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
. 2025 Apr 22:8:1560523.
doi: 10.3389/frai.2025.1560523. eCollection 2025.

Deep learning for accurate B-line detection and localization in lung ultrasound imaging

Affiliations

Deep learning for accurate B-line detection and localization in lung ultrasound imaging

Nixson Okila et al. Front Artif Intell. .

Abstract

Introduction: Lung ultrasound (LUS) has become an essential imaging modality for assessing various pulmonary conditions, including the presence of B-line artifacts. These artifacts are commonly associated with conditions such as increased extravascular lung water, decompensated heart failure, dialysis-related chronic kidney disease, interstitial lung disease, and COVID-19 pneumonia. Accurate detection of the B-line in LUS images is crucial for effective diagnosis and treatment. However, interpreting LUS is often subject to observer variability, requiring significant expertise and posing challenges in resource-limited settings with few trained professionals.

Methods: To address these limitations, deep learning models have been developed for automated B-line detection and localization. This study introduces YOLOv5-PBB and YOLOv8-PBB, two modified models based on YOLOv5 and YOLOv8, respectively, designed for precise and interpretable B-line localization using polygonal bounding boxes (PBBs). YOLOv5-PBB was enhanced by modifying the detection head, loss function, non-maximum suppression, and data loader to enable PBB localization. YOLOv8-PBB was customized to convert segmentation masks into polygonal representations, displaying only boundaries while removing the masks. Additionally, an image preprocessing technique was incorporated into the models to enhance LUS image quality. The models were trained on a diverse dataset from a publicly available repository and Ugandan health facilities.

Results: Experimental results showed that YOLOv8-PBB achieved the highest precision (0.947), recall (0.926), and mean average precision (0.957). YOLOv5-PBB, while slightly lower in performance (precision: 0.931, recall: 0.918, mAP: 0.936), had advantages in model size (14 MB vs. 21 MB) and average inference time (33.1 ms vs. 47.7 ms), making it more suitable for real-time applications in low-resource settings.

Discussion: The integration of these models into a mobile LUS screening tool provides a promising solution for B-line localization in resource-limited settings, where accessibility to trained professionals may be scarce. The YOLOv5-PBB and YOLOv8-PBB models offer high performance while addressing challenges related to inference speed and model size, making them ideal candidates for mobile deployment in such environments.

Keywords: B-line artifact; YOLO; deep learning; localization; lung ultrasound.

PubMed Disclaimer

Conflict of interest statement

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Figures

Figure 1
Figure 1
Examples of LUS images captured during data collection, illustrating A-line and B-line LUS imaging artifacts. (a) In a healthy lung, ultrasound waves are reflected at the pleura, resulting in horizontal reverberation artifacts known as A-lines. (b) As fluid volume increases, vertical artifacts (B-lines) become common, characterized by bright lines that originate from the pleural line. (c) In severe cases, B-lines may merge together and become confluent, spanning the entire intercostal space.
Figure 2
Figure 2
A representation of preprocessed LUS image frames from public and M-K LUS datasets. (a) Public dataset. Examples of image frames containing B-lines, extracted from LUS video data using a Python program. (b) M-K LUS dataset. Left: image frame with noise (ultrasound measure scales and text labels) before cropping. Right: corresponding image frame after cropping and the noise removed.
Figure 3
Figure 3
Sample image frame illustrating B-line artifacts and their corresponding annotations. (a) Original LUS image frame showing B-line artifacts. (b) RBB annotation highlighting the B-line region. (c) PBB annotation providing a precise contour of the B-lines.
Figure 4
Figure 4
Comparison of detection head outputs of YOLOv5 and YOLOv5-PBB. (a) The RBB output of YOLOv5 includes cx and cy, which represent the center coordinates of the RBB, while w and h indicate its width and height. (b) The PBB output of YOLOv5-PBB consists of x1, y1, x2, y2, x3, y3, and x4, y4, which represent the coordinates of the corners.
Figure 5
Figure 5
Training curves for YOLOv5, YOLOv5-PBB, YOLOv8, YOLOv8-OBB YOLOv8-SEG, and YOLOv8-PBB models when trained on the mixed dataset. The top row shows the mean average precision curves, while the bottom row depicts the box loss curves of the corresponding model.
Figure 6
Figure 6
Comparison of B-line localization by YOLOv5, YOLOv5-PBB, YOLOv8, YOLOv8-OBB, YOLOv8-SEG, and YOLOv8-PBB models on two sample inference images from the held-out test set.
Figure 7
Figure 7
Mobile LUS screening tool comprising a Clarius scanner, a smartphone running the Clarius app, and a laptop equipped with both the CC API the model.

References

    1. Choy G., Khalilzadeh O., Michalski M., Do S., Samir A. E., Pianykh O. S., et al. . (2018). Current applications and future impact of machine learning in radiology. Radiology 288, 318–328. 10.1148/radiol.2018171820 - DOI - PMC - PubMed
    1. Cristiana B., Grzegorz T., Seungsoo K., Katelyn M., Rachel L., Melissa M., et al. . (2020). Automated lung ultrasound B-line assessment using a deep learning algorithm. IEEE Trans. Ultrason. Ferroelectr. Frequency Control 67, 2312–2320. 10.1109/TUFFC.2020.3002249 - DOI - PubMed
    1. Demi L., Wolfram F., Klersy C., De Silvestri A., Ferretti V. V., Muller M., et al. . (2023). New international guidelines and consensus on the use of lung ultrasound. J. Ultrasound Med. 42, 309–344. 10.1002/jum.16088 - DOI - PMC - PubMed
    1. Demi M., Prediletto R., Soldati G., Demi L. (2020). Physical mechanisms providing clinical information from ultrasound lung images: hypotheses and early confirmations. IEEE Trans. Ultrason. Ferroelectr. Frequency Control 67, 612–623. 10.1109/TUFFC.2019.2949597 - DOI - PubMed
    1. Duggan N. M., Shokoohi H., Liteplo A. S., Huang C., Goldsmith A. J. (2020). Best practice recommendations for point-of-care lung ultrasound in patients with suspected COVID-19. J. Emerg. Med. 59, 515–520. 10.1016/j.jemermed.2020.06.033 - DOI - PMC - PubMed

LinkOut - more resources