Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
Comparative Study
. 2025 Aug;38(4):2367-2380.
doi: 10.1007/s10278-024-01315-3. Epub 2024 Nov 25.

A Performance Comparison of Different YOLOv7 Networks for High-Accuracy Cell Classification in Bronchoalveolar Lavage Fluid Utilising the Adam Optimiser and Label Smoothing

Affiliations
Comparative Study

A Performance Comparison of Different YOLOv7 Networks for High-Accuracy Cell Classification in Bronchoalveolar Lavage Fluid Utilising the Adam Optimiser and Label Smoothing

Sebastian Rumpf et al. J Imaging Inform Med. 2025 Aug.

Abstract

Accurate classification of cells in bronchoalveolar lavage (BAL) fluid is essential for the assessment of lung disease in pneumology and critical care medicine. However, the effectiveness of BAL fluid analysis is highly dependent on individual expertise. Our research is focused on improving the accuracy and efficiency of BAL cell classification using the "You Only Look Once" (YOLO) algorithm to reduce variability and increase the accuracy of cell detection in BALF analysis. We assess various YOLOv7 iterations, including YOLOv7, YOLOv7 with Adam and label smoothing, YOLOv7-E6E, and YOLOv7-E6E with Adam and label smoothing focusing on the detection of four key cell types of diagnostic importance in BAL fluid: macrophages, lymphocytes, neutrophils, and eosinophils. This study utilised cytospin preparations of BAL fluid, employing May-Grunwald-Giemsa staining, and analysed a dataset comprising 2032 images with 42,221 annotations. Classification performance was evaluated using recall, precision, F1 score, mAP@.5, and mAP@.5;.95 along with a confusion matrix. The comparison of four algorithmic approaches revealed minor distinctions in mean results, falling short of statistical significance (p < 0.01; p < 0.05). YOLOv7, with an inference time of 13.5 ms for 640 × 640 px images, achieved commendable performance across all cell types, boasting an average F1 metric of 0.922, precision of 0.916, recall of 0.928, and mAP@.5 of 0.966. Remarkably, all four cell types were classified consistently with high-performance metrics. Notably, YOLOv7 demonstrated marginally superior class value dispersion when compared to YOLOv7-adam-label-smoothing, YOLOv7-E6E, and YOLOv7-E6E-adam-label-smoothing, albeit without statistical significance. Consequently, there is limited justification for deploying the more computationally intensive YOLOv7-E6E and YOLOv7-E6E-adam-label-smoothing models. This investigation indicates that the default YOLOv7 variant is the preferred choice for differential cytology due to its accessibility, lower computational demands, and overall more consistent results than more complex models.

Keywords: Artificial intelligence; Bronchoalveolar lavage; Deep learning; Medical imaging; Pathology; Tile-based.

PubMed Disclaimer

Conflict of interest statement

Declarations. Ethics Approval: This study was approved by the Ethics Committee of the Julius Maximilian University of Würzburg (20230623 01). Competing Interests: The authors declare the following financial interests/personal relationships which may be considered as potential competing interests: Sebastian Rumpf reports a relationship with Smart In Media AG that includes consulting or advisory. All other authors have no relevant financial or non-financial interests to disclose.

Figures

Fig. 1
Fig. 1
Schematic overview of the methodology. Cytospin preparations were selected from archived results from the years 2019–2021
Fig. 2
Fig. 2
Average position value of annotations for all tiles in the dataset. Images generated using Roboflow. A Heatmap before resizing to 640 × 640 px. B Heatmap after resizing to 640 × 640 px
Fig. 3
Fig. 3
A Overview image of a BAL cytospin sample. B One tile with annotated cells using bounding boxes. C Classification of each cell by the network on the same tile
Fig. 4
Fig. 4
A Differential routine manual enumeration analysis generated the relative distribution of cell populations among all tiles. B Distribution of cell populations in annotated tiles
Fig. 5
Fig. 5
Training progression of the YOLOv7 algorithm version in our dataset. “val” represents results in the validation dataset. Precision, recall, mAP@0.5, and mAP@0.5:0.95 were also conducted during validation. X-axis reflects the number of trained epochs, while Y-axis shows the amounts of loss in Box, Classification, val Box, and val Classification
Fig. 6
Fig. 6
Comparison of performance metrics for different YOLOv7 network models, including YOLOv7, YOLOv7 with Adam and label smoothing, YOLOv7-E6E, and YOLOv7-E6E with Adam and label smoothing, based on results from the test dataset. X-axis representing the different models and Y-axis the performance. Each cell type is shown individually in addition to the average value. A F1. B Recall. C Precision. D mAP@0.5. E mAP@0.5:0.95
Fig. 7
Fig. 7
Confusion matrix of the test dataset of YOLOv7 for each cell type and background noise as the probability between the predicted values and expert annotations

Similar articles

Cited by

References

    1. James, S.L., et al.: Global, regional, and national incidence, prevalence, and years lived with disability for 354 diseases and injuries for 195 countries and territories, 1990–2017: a systematic analysis for the Global Burden of Disease Study 2017. The Lancet 392 (10159): p. 1789-1858, 2018. - PMC - PubMed
    1. Labaki, W.W. and M.K. Han: Chronic respiratory diseases: a global view. The Lancet Respiratory Medicine 8 (6): p. 531-533, 2020. - PMC - PubMed
    1. Driscoll, T., et al.: The global burden of non‐malignant respiratory disease due to occupational airborne exposures. American journal of industrial medicine 48 (6): p. 432-445, 2005. - PubMed
    1. Poletti, V., M. Chilosi, and D. Olivieri: Diagnostic invasive procedures in diffuse infiltrative lung diseases. Respiration 71 (2): p. 107-119, 2004. - PubMed
    1. Fang, X., et al.: Diagnostic value of metagenomic next-generation sequencing for the detection of pathogens in bronchoalveolar lavage fluid in ventilator-associated pneumonia patients. Frontiers in microbiology 11: p. 599756, 2020. - PMC - PubMed

Publication types

LinkOut - more resources