Enhancing lung segmentation in chest X-rays via SAM with anatomical priors and boundary-aware loss

Read full text
Authors: Lingajan Senthinathan, Kajaraj Arunthavarajah, Logathas Tharshikan, Ravikkumar Rajeethan, Princiha JacobSelvakumar, Kithusshand Raveendran, Kanagasabai Thiruthanigesan
Cited by: 1
References: 25

Abstract

Accurate lung segmentation in chest X-rays is a foundational step for computer-aided diagnosis of respiratory diseases such as pneumonia, tuberculosis, and lung cancer. While the Segment Anything Model (SAM) has demonstrated remarkable zero-shot segmentation capabilities on natural images, its direct application to medical imaging remains limited due to domain shift, low contrast, and ambiguous anatomical boundaries. To address these challenges, we propose a lightweight yet effective adaptation of SAM that integrates (i) a Mask Autoencoder (MAE) as an anatomical prior to enforce global shape consistency, and (ii) a composite loss function combining Binary Cross-Entropy (BCE), Dice, and Boundary losses to jointly optimize pixel-level accuracy, region overlap, and edge fidelity. Our parameter-efficient fine-tuning strategy trains only 0.3% of SAM's parameters, specifically the mask decoder, while freezing the image and prompt encoders. Evaluated on the MedSeg Chest X-ray Lung Dataset, our method achieves a Dice score of 87.3%, outperforming both full fine-tuning (MedSAM: 81.2%) and recent parameter-efficient variants (S-SAM: 84.6%, SAM-PARSER: 85.1%). Moreover, our model demonstrates exceptional robustness across the test set, with median Dice and Specificity exceeding 0.90, and runs at 78 ms per image, the fastest among compared methods. Qualitative results confirm precise delineation of lung fields even under challenging conditions such as rib overlap and cardiac silhouette interference. By combining anatomical constraints with boundary-aware supervision, our framework improves prompt-conditioned lung segmentation performance and provides a lightweight segmentation component that can be integrated into larger clinical decision-support pipelines.

Fields of Study & Subjects

COVID-19 diagnosis using AI Advanced Neural Network Applications Lung Cancer Diagnosis and Treatment

Publication details

Journal / source
Scientific Reports
Publisher
Springer Science and Business Media LLC
Volume
16
Issue
1
Publication date
29 June 2026
Language
EN