Skip to content
/ csc-app Public

App for segmentation of Lung Lobes and Lesions for severity classification of COVID-19 CT Scans

License

Notifications You must be signed in to change notification settings

hds-69/csc-app

Repository files navigation

Segmentation of Lung Lobes and Lesions in Chest CT for the Classification of COVID-19 Severity

Publication: https://doi.org/10.1038/s41598-023-47743-z

About

To precisely determine the severity of COVID-19-related pneumonia, computed tomography (CT) is an imaging modality beneficial for patient monitoring and therapy planning. Thus, we aimed to develop a deep learning-based image segmentation model to automatically assess lung lesions related to COVID-19 infection and calculate the total severity score (TSS). The entire dataset consists of 124 COVID-19 patients acquired from Chulabhorn Hospital, divided into 28 cases without lung lesions and 96 cases with lung lesions categorized severity by radiologists regarding TSS. The model combines a 3D-UNet with pre-trained DenseNet and ResNet models for lung lobe segmentation and calculation of the percentage of lung involvement related to COVID-19 infection as well as TSS measured by the Dice similarity coefficient (DSC). Our final model, consisting of 3D-UNet integrated with DenseNet169, achieved segmentation of lung lobes and lesions with Dice similarity coefficients of 0.9152 and 0.7689, respectively. The calculated TSSs are similar to those evaluated by radiologists, with an R2 of 0.842. The correlation between the ground-truth TSS and model prediction was greater than that of the radiologist, which was 0.890 and 0.709, respectively.

App demo: please use in local computer.

Requirements

  1. You need install Python >= 3.9.13

  2. Library requirement

     streamlit
     numpy
     pandas
     patchify==0.2.3
     segmentation-models-3D==1.0.3
     keras==2.8.0
     Keras-Applications==1.0.8
     tensorflow==2.8.0
     regex
     scikit-image==0.18.3
     pandas==1.3.5
     matplotlib
     numba
     zipp
     opencv-python==4.5.5.64
     Pillow==8.3.2
     fpdf
    

Installation

  1. clone this project followed by Github CLI command:

    gh repo clone hds-69/csc-app
    

    or download project zip file

  2. Open a command prompt or terminal for CD command to change the directory to project location.

  3. Installation with pip allows the usage of the install command:

     pip install -r requirements.txt
    
  4. Run the App

     streamlit run app.py
    

Use steps

Installation handbook: https://docs.google.com/presentation/d/1DoHhD1M588GQGURy2NagAL8hC8nkRoxNFfkGxB3L2vs/edit?usp=sharing

  1. Input Lung CT-scan image .jpg (Min/Max range 80-256 images per patient)

  1. Click Predict button.

  1. Click Save button.

Development process

  1. Dataset: Train 32 cases (3,752 images), Test1 20 cases (2,584 images), Test2 72 cases (8,720 images)

    CT-scans image range: 92-208 images

    Case Type: No lesion, Mild, Moderate, Severe

  2. Image Annotation by labelme for using label mask for Model Training. (for Train set and Test1 set)

  3. Traning Model: 3D-Unet + Backbone (DenseNet, ResNet) using API: https://github.com/ZFTurbo/segmentation_models_3D

  4. Model Evaluation with Test1 dataset.

  5. User Interface (UI) Development using Streamlit.

  6. Develop the Percentage of Infection (PI%) and TSS calculation.

  7. TSS Evaluation with Test2 dataset.

Results

The model was evaluated on a dataset of 20 infected patients, and the results demonstrated that 3D-UNet + DenseNet169 achieved the best performance, yielding Dice Similarity Coefficient (DSC) of 91.52% and 76.88% for lung lobe and lesion segmentation, respectively. The proposed model can reliably segment lesions on CT scans of severe cases, but the model performed less accurately in segmenting lung lesions of mild and moderate cases. However, the TSS calculated by the proposed model were comparable to those assigned by radiologists. Using CT scans of 72 COVID-19 patients for evaluation, the correlation coefficient (r) was 0.9176, indicating a very strong correlation.

Model Testing Result Table Test with Test set 1

Objective Model Backbone IoU DSC Accuracy Precision Sensitivity Specificity
Lung lobe segmentation 3D-Unet DenseNet 169 88.59% 91.52% 98.25% 93.33% 94.46% 98.28%
Lesion segmentation 3D-Unet DenseNet 169 72.22% 76.88% 99.06% 81.89% 83.47% 99.20%

TSS calculation Testing Result Table Test with Test set 2

Regression Statistics Value
Correlation Coefficient 0.9176
R Square 0.8419
Observations 72
p-value <0.0001

Citation

For more information, kindly acknowledge our project by citing it when using the code. The article is currently under review.

Khomduean, P., Phuaudomcharoen, P., Boonchu, T. et al.
Segmentation of lung lobes and lesions in chest CT for the classification of COVID-19 severity.
Sci Rep 13, 20899 (2023).
https://doi.org/10.1038/s41598-023-47743-z

About

App for segmentation of Lung Lobes and Lesions for severity classification of COVID-19 CT Scans

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published