Published October 8, 2023 | Version 1.0
Model Open

Deep Learning Models for Lung Segmentation in Chest X-ray Radiographs

  • 1. Politecnico di Milano
  • 2. Universitat Pompeu Fabra

Description

Introduction: We present a collection of lung segmentation models designed for accurate analysis of chest X-ray (CXR) images. These models have undergone rigorous training, validation, hyperparameter tuning, and testing on a diverse dataset consisting of CXRs from three publicly available sources: the Darwin, Montgomery, and Shenzhen datasets.

Dataset Description: The dataset includes CXRs from patients diagnosed with various respiratory diseases, including COVID-19, pneumonia, and tuberculosis. While these conditions differ in nature and disease patterns, we intentionally included them in the training data to improve the ability of the models to generalize across a range of pathologies. The dataset is summarized in Table 1 and publicly available at https://data.mendeley.com/datasets/8gf9vpkhgy/2.

Model Selection: In our model selection process for lung segmentation, we rigorously evaluated several state-of-the-art models, including U-netU-net++DeepLabV3DeepLabV3+FPNLinknetPSPNetPAN, and MA-Net. These models were trained and tested on a Linux machine equipped with an NVIDIA GeForce RTX 3090 boasting 24 GB of memory. The training procedure closely followed the methodology described in the paper "Automatic scoring of COVID-19 severity in X-ray imaging based on a novel deep learning workflow", specifically as outlined in the Model Training section.

Model Comparison: After a thorough evaluation, DeepLabV3+ emerged as our top choice. It exhibited exceptional performance with a DSCtest score of 0.963, while maintaining computational efficiency with a total of 7.4 million parameters and 2.2 billion MACs. This combination of high performance and computational efficiency solidified its position as the optimal model for our lung segmentation task.

In Table 2, we provide a comprehensive overview of the performance metrics for each model, including batch size, memory usage, parameters, and MACs. Additionally, we present the DSC values, enabling a detailed comparison of each model's performance across the training, validation, and testing phases.

Requirements: The models were originally trained and tested using PyTorch v1.8.1 and timm v0.3.2. Subsequently, we conducted additional tests on PyTorch v1.13.1 and timm v0.6.12, and all models performed well. However, it's worth noting that Linknet and PSPNet encountered errors on the latter version and are not compatible with it.

Access to the Study: Further information about this study, including curated source code, dataset details, and trained models, can be accessed through the following repositories:

 

Table 1. Description of the datasets used for lung segmentation

Dataset Training Validation Testing Total
Darwin 4884 611 611 6106 / 90%
Montgomery 110 14 14 138 / 2%
Shenzhen 452 57 57 566 / 8%
Total 5446 / 80% 682 / 10% 682 / 10% 6810 / 100%

 

Table 2. Results of the fully trained lung segmentation networks

Model Batch size Memory, Gb Parameters, M MAC, G DSCtrain DSCval DSCtest
U-net 24 21 55.9 35.6 0.960 0.960 0.962
U-net++ 32 24 9.1 11.5 0.956 0.959 0.960
DeepLabV3 16 24 7.3 13.4 0.960 0.960 0.961
DeepLabV3+ 20 22 7.4 2.2 0.962 0.960 0.963
FPN 32 23 5.8 9.1 0.962 0.960 0.962
Linknet 24 24 29.3 39.9 0.965 0.959 0.961
PSPNet 40 23 29.7 14.4 0.959 0.959 0.960
PAN 32 24 4.1 0.3 0.961 0.960 0.962
MA-Net 24 24 13.4 9.9 0.956 0.959 0.961

 

 

Files

Segmentation example - Shenzhen.png

Files (606.7 MB)

Name Size Download all
md5:a4cbed03b0eb0ca92dd2a42c505065b2
27.8 MB Preview Download
md5:cc3f4cce83c4bf55d1dd83673931f72a
27.3 MB Preview Download
md5:467682e5d9a08de5e1edcc3e7515ae59
21.5 MB Preview Download
md5:45553b1a3995a9494aab4af863f01f8d
109.2 MB Preview Download
md5:115cf4c742aa053c9b491fb7f162c0ad
50.1 MB Preview Download
md5:78b9be090f7fa3533a6cf7fa52f2640a
15.4 MB Preview Download
md5:58d0aca4c702b7ede505b8cde7962515
110.9 MB Preview Download
md5:e71c400ca9a1adf99beeb4aa8f857250
876.9 kB Preview Download
md5:d7d9335826c1077751e299d256fdfd8c
569.6 kB Preview Download
md5:5538042b52f1e7c38d69df3f4dd4b42b
637.6 kB Preview Download
md5:f91e7fd2ba9259a9b01f05541d4f648a
34.0 MB Preview Download
md5:9ddfcf1d5cf1927dd095b7ca333c6350
208.4 MB Preview Download

Additional details

Related works

Is part of
Journal article: 10.1093/radadv/umae003 (DOI)

Software

Repository URL
https://github.com/ViacheslavDanilov/covid_scoring
Programming language
Python
Development Status
Active