Description:
<jats:title>Abstract</jats:title><jats:p>Automatic lung segmentation in the chest x‐ray is important for computer aided diagnosis. It helps in the surgical planning and diagnosis of pulmonary diseases. Lung shape, size, overlapped area, and opacities make lung segmentation arduous. In this article, we have proposed a UNet‐based model for lung segmentation. We have evaluated the model on difficult datasets that have chest radiographs of patients affected by tuberculosis and other severe abnormalities. Three chest radiography datasets and a CT‐scan dataset are used to prove the model generalization. The proposed model efficiently uses the residual learning and attention mechanisms to improve the segmentation results against the original UNet for the dice coefficient index (DCI) and Jaccard index. We have also performed an ablation study to highlight the impact of the attention mechanism in the proposed model. The model obtained a 97.62% DCI, 95.43% Jaccard index, and a 4.00 Hausdorff distance on the Montgomery County dataset. While on the Shenzhen and NIH datasets, it achieved a 95.71% and 95.75% DCI, 91.90% and 91.95% Jaccard index, and a 5.23 and 5.20 Hausdorff distance, respectively. The proposed model has achieved better or comparable performance against other state‐of‐the‐art models.</jats:p>