Skip to content

Explainable AI for accurate COVID-19 diagnosis with XCT-COVID

License

Notifications You must be signed in to change notification settings

nhattruongpham/XCT-COVID

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XCT-COVID

Standalone program for the XCT-COVID paper

stars forks license DOI

IntroductionInstallationGetting StartedCitationAcknowledgements

Introduction

This repository provides the standalone program for XCT-COVID framework. The virtual environment, refined datasets, and final models are available via Zenodo at DOI

Installation

Software requirements

  • Ubuntu 20.04.6 LTS (This source code has been already tested on Ubuntu 20.04.6 LTS with NVIDIA RTX A5000)
  • CUDA 11.7 (with GPU suport)
  • cuDNN 8.6.0.163 (with GPU support)
  • Python 3.10.14

Cloning this repository

git clone https://github.com/nhattruongpham/XCT-COVID.git
cd XCT-COVID

Creating virtual environment

  • Please download the virtual environment (xct_covid.tar.gz) via Zenodo at DOI
  • Please extract it into the xct_covid folder as below:
tar -xzf xct_covid.tar.gz -C xct_covid 
  • Activate the virtual environment as below:
source xct_covid/bin/activate

Getting started

Downloading all refined independent datasets

  • Please download all refined independent datasets via Zenodo at DOI
  • For the refined COVIDx-CT-3 independent dataset, please extract COVIDx_CT_3.zip file downloaded via Zenodo and put COVID and non-COVID folders into the examples/COVIDx_CT_3 folder.
  • For the refined COVID-CT independent dataset, please extract COVID_CT.zip file downloaded via Zenodo and put COVID and non-COVID folders into the examples/COVID_CT folder.
  • For the refined SARS-CoV-2-CT independent dataset, please extract SARS_CoV_2_CT.zip file downloaded via Zenodo and put COVID and non-COVID folders into the examples/SARS_CoV_2_CT folder.

Downloading all final models

  • Please download all final models via Zenodo at DOI
  • For the XCT-COVID-L models, please extract XCT_COVID_L.zip file downloaded via Zenodo and put all *.pth files into the models/XCT_COVID_L folder.
  • For the XCT-COVID-S1 models, please extract XCT_COVID_S1.zip file downloaded via Zenodo and put all *.pth files into the models/XCT_COVID_S1 folder.
  • For the XCT-COVID-S2 models, please extract XCT_COVID_S2.zip file downloaded via Zenodo and put all *.pth files into the models/XCT_COVID_S2 folder.

Running prediction

Usage

CUDA_VISIBLE_DEVICES=<GPU_NUMBER> python predictor.py 

Example

CUDA_VISIBLE_DEVICES=0 python predictor.py

Note

  • Please modify dataset_dir, model_name, and model_path in the Configs.py file for the target model and its corresponding dataset.
  • For the COVIDx-CT-3 independent dataset:
self.dataset_dir = r'examples/COVIDx_CT_3/'
self.model_name = 'vgg16'
self.model_path = r'models/XCT_COVID_L/'
  • For the COVID-CT independent dataset:
self.dataset_dir = r'examples/COVID_CT/'
self.model_name = 'mobilenet_v2'
self.model_path = r'models/XCT_COVID_S1/'
  • For the SARS-CoV-2-CT independent dataset:
self.dataset_dir = r'examples/SARS_CoV_2_CT/'
self.model_name = 'mobilenet_v2'
self.model_path = r'models/XCT_COVID_S2/'

Citation

If you use this code or any part of it, as well as the refined datasets, please cite the following papers:

Main

@article{pham2024leveraging,
  title={Leveraging deep transfer learning and explainable AI for accurate COVID-19 diagnosis: Insights from a multi-national chest CT scan study},
  author={Pham, Nhat Truong and Ko, Jinsol and Shah, Masaud and Woo, Hyun Goo and Manavalan, Balachandran},
  journal={},
  volume={},
  number={},
  pages={},
  year={2024},
  publisher={}
}

References

[1] Gunraj, H., Sabri, A., Koff, D., Wong, A., 2022a. Covid-net ct-2: Enhanced deep neural networks for detection of covid-19 from chest ct images through bigger, more diverse learning. Frontiers in Medicine 8, 3126. DOI
[2] Gunraj, H., Tuinstra, T., Wong, A., 2022b. Covidx ct-3: A large-scale, multinational, open-source benchmark dataset for computer-aided Covid-19 screening from chest CT images. arXiv preprint arXiv:2206.03043. DOI
[3] Gunraj, H., Wang, L., Wong, A., 2020. Covidnet-ct: A tailored deep convolutional neural network design for detection of covid-19 cases from chest ct images. Frontiers in medicine 7, 608525. DOI
[4] Zhang, K., Liu, X.H., Shen, J., Li, Z.H., Sang, Y., Wu, X.W., Zha, Y.F., Liang, W.H., Wang, C.D., Wang, K., Ye, L.S., Gao, M., Zhou, Z.G., Li, L., Wang, J., Yang, Z.H., Cai, H.M., Xu, J., Yang, L., Cai, W.J., Xu, W.Q., Wu, S.X., Zhang, W., Jiang, S.P., Zheng, L.H., Zhang, X., Wang, L., Lu, L., Li, J.M., Yin, H.P., Wang, W., Li, O., Zhang, C., Liang, L., Wu, T., Deng, R.Y., Wei, K., Zhou, Y., Chen, T., Lau, J.Y.N., Fok, M., He, J.X., Lin, T.X., Li, W.M., Wang, G.Y., 2020. Clinically Applicable AI System for Accurate Diagnosis, Quantitative Measurements, and Prognosis of COVID-19 Pneumonia Using Computed Tomography (vol 181, pg 1423, 2020). Cell 182, 1360-1360. DOI
[5] Revel, M.P., Boussouar, S., de Margerie-Mellon, C., Saab, I., Lapotre, T., Mompoint, D., Chassagnon, G., Milon, A., Lederlin, M., Bennani, S., Molière, S., Debray, M.P., Bompard, F., Dangeard, S., Hani, C., Ohana, M., Bommart, S., Jalaber, C., El Hajjam, M., Petit, I., Fournier, L., Khalil, A., Brillet, P.Y., Bellin, M.F., Redheuil, A., Rocher, L., Bousson, V., Rousset, P., Grégory, J., Deux, J.F., Dion, E., Valeyre, D., Porcher, R., Jilet, L., Abdoul, H., 2021. Study of Thoracic CT in COVID-19: The STOIC Project. Radiology 301, E361-E370. DOI
[6] Boulogne, L.H., Lorenz, J., Kienzle, D., Schön, R., Ludwig, K., Lienhart, R., Jegou, S., Li, G., Chen, C., Wang, Q., Shi, D., Maniparambil, M., Müller, D., Mertes, S., Schröter, N., Hellmann, F., Elia, M., Dirks, I., Bossa, M.N., Berenguer, A.D., Mukherjee, T., Vandemeulebroucke, J., Sahli, H., Deligiannis, N., Gonidakis, P., Huynh, N.D., Razzak, I., Bouadjenek, R., Verdicchio, M., Borrelli, P., Aiello, M., Meakin, J.A., Lemm, A., Russ, C., Ionasec, R., Paragios, N., van Ginneken, B., Revel, M.P., 2024. The STOIC2021 COVID-19 AI challenge: Applying reusable training methodologies to private data. Med Image Anal 97. DOI
[7] An, P., Xu, S., Harmon, S.A., Turkbey, E.B., Sanford, T.H., Amalou, A., Kassin, M., Varble, N., Blain, M., Anderson, V., Patella, F., Carrafiello, G., Turkbey, B.T., Wood, B.J., 2020. CT Images in COVID-19 [Data set]. The Cancer Imaging Archive. DOI
[8] Clark, K., Vendt, B., Smith, K., Freymann, J., Kirby, J., Koppel, P., Moore, S., Phillips, S., Maffitt, D., Pringle, M., Tarbox, L., Prior, F., 2013. The Cancer Imaging Archive (TCIA): Maintaining and Operating a Public Information Repository. J Digit Imaging 26, 1045-1057. DOI
[9] Harmon, S.A., Sanford, T.H., Xu, S., Turkbey, E.B., Roth, H., Xu, Z.Y., Yang, D., Myronenko, A., Anderson, V., Amalou, A., Blain, M., Kassin, M., Long, D., Varble, N., Walker, S.M., Bagci, U., Ierardi, A.M., Stellato, E., Plensich, G.G., Franceschelli, G., Girlando, C., Irmici, G., Labella, D., Hammoud, D., Malayeri, A., Jones, E., Summers, R.M., Choyke, P.L., Xu, D.G., Flores, M., Tamura, K., Obinata, H., Mori, H., Patella, F., Cariati, M., Carrafiello, G., An, P., Wood, B.J., Turkbey, B., 2020. Artificial intelligence for the detection of COVID-19 pneumonia on chest CT using multinational datasets. Nat Commun 11. DOI
[10] Kassin, M.T., Varble, N., Blain, M., Xu, S., Turkbey, E.B., Harmon, S., Yang, D., Xu, Z.Y., Roth, H., Xu, D.G., Flores, M., Amalou, A., Sun, K.Y., Kadri, S., Patella, F., Cariati, M., Scarabelli, A., Stellato, E., Ierardi, A.M., Carrafiello, G., An, P., Turkbey, B., Wood, B.J., 2021. Generalized chest CT and lab curves throughout the course of COVID-19. Sci Rep-Uk 11. DOI
[11] Jun, M., Cheng, G., Yixin, W., Xingle, A., Jiantao, G., Ziqi, Y., Minqing, Z., Xin, L., Xueyuan, D., Shucheng, C., Hao, W., Sen, M., Xiaoyu, Y., Ziwei, N., Chen, L., Lu, T., Yuntao, Z., Qiongjie, Z., Guoqiang, D., & Jian, H., 2020. COVID-19 CT Lung and Infection Segmentation Dataset (Verson 1.0) [Data set]. Zenodo. DOI
[12] Armato III, S.G., McLennan, G., Bidaut, L., McNitt-Gray, M.F., Meyer, C.R., Reeves, A.P., Zhao, B., Aberle, D.R., Henschke, C.I., Hoffman, E.A., Kazerooni, E.A., MacMahon, H., Van Beek, E.J.R., Yankelevitz, D., Biancardi, A.M., Bland, P.H., Brown, M.S., Engelmann, R.M., Laderach, G.E., Max, D., Pais, R.C., Qing, D.P.Y., Roberts, R.Y., Smith, A.R., Starkey, A., Batra, P., Caligiuri, P., Farooqi, A., Gladish, G.W., Jude, C.M., Munden, R.F., Petkovska, I., Quint, L.E., Schwartz, L.H., Sundaram, B., Dodd, L.E., Fenimore, C., Gur, D., Petrick, N., Freymann, J., Kirby, J., Hughes, B., Casteele, A.V., Gupte, S., Sallam, M., Heath, M.D., Kuhn, M.H., Dharaiya, E., Burns, R., Fryd, D.S., Salganicoff, M., Anand, V., Shreter, U., Vastagh, S., Croft, B.Y., Clarke, L.P., 2015. Data From LIDC-IDRI [Data set]. The Cancer Imaging Archive. DOI
[13] Armato, S.G., McLennan, G., Bidaut, L., McNitt-Gray, M.F., Meyer, C.R., Reeves, A.P., Zhao, B.S., Aberle, D.R., Henschke, C.I., Hoffman, E.A., Kazerooni, E.A., MacMahon, H., van Beek, E.J.R., Yankelevitz, D., Biancardi, A.M., Bland, P.H., Brown, M.S., Engelmann, R.M., Laderach, G.E., Max, D., Pais, R.C., Qing, D.P.Y., Roberts, R.Y., Smith, A.R., Starkey, A., Batra, P., Caligiuri, P., Farooqi, A., Gladish, G.W., Jude, C.M., Munden, R.F., Petkovska, I., Quint, L.E., Schwartz, L.H., Sundaram, B., Dodd, L.E., Fenimore, C., Gur, D., Petrick, N., Freymann, J., Kirby, J., Hughes, B., Casteele, A.V., Gupte, S., Sallam, M., Heath, M.D., Kuhn, M.H., Dharaiya, E., Burns, R., Fryd, D.S., Salganicoff, M., Anand, V., Shreter, U., Vastagh, S., Croft, B.Y., Clarke, L.P., 2011. The Lung Image Database Consortium, (LIDC) and Image Database Resource Initiative (IDRI): A Completed Reference Database of Lung Nodules on CT Scans. Med Phys 38, 915-931. DOI
[14] Bell, D., Campos, A., Sharma, R., 2020. COVID-19. Radiopaedia.org.
[15] Rahimzadeh, M., Attar, A., Sakhaei, S.M., 2021. A fully automated deep learning-based network for detecting COVID-19 from a new and large lung CT scan dataset. Biomed Signal Proces 68. DOI
[16] Saltz, J., Saltz, M., Prasanna, P., Moffitt, R., Hajagos, J., Bremer, E., Balsamo, J., Kurc, T., 2021. Stony Brook University COVID-19 Positive Cases [Data set]. The Cancer Imaging Archive. DOI
[17] Ning, W.S., Lei, S.J., Yang, J.J., Cao, Y.K., Jiang, P.R., Yang, Q.Q., Zhang, J., Wang, X.B., Chen, F.H., Geng, Z., Xiong, L., Zhou, H.M., Guo, Y.P., Zeng, Y.L., Shi, H.S., Wang, L., Xue, Y., Wang, Z., 2020. Open resource of clinical data from patients with pneumonia for the prediction of COVID-19 outcomes via deep learning. Nat Biomed Eng 4, 1197-1207. DOI
[18] Morozov, S.P., Andreychenko, A.E., Blokhin, I.A., Gelezhe, P.B., Gonchar, A.P., Nikolaev, A.E., Pavlov, N.A., Chernina, V.Y., Gombolevskiy, V.A., 2020. MosMedData: data set of 1110 chest CT scans performed during the COVID-19 epidemic. Digital Diagnostics 1, 49-59. DOI
[19] Afshar, P., Heidarian, S., Enshaei, N., Naderkhani, F., Rafiee, M.J., Oikonomou, A., Fard, F.B., Samimi, K., Plataniotis, K.N., Mohammadi, A., 2021. COVID-CT-MD, COVID-19 computed tomography scan dataset applicable in machine learning and deep learning. Sci Data 8. DOI
[20] Lundberg, S. M., & Lee, S. I. (2017). A unified approach to interpreting model predictions. Advances in neural information processing systems, 30.
[21] Chattopadhay, A., Sarkar, A., Howlader, P., & Balasubramanian, V. N. (2018, March). Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks. In 2018 IEEE winter conference on applications of computer vision (WACV) (pp. 839-847). IEEE. DOI

Acknowledgements

The authors also would like to thank the Multi-national NIH Consortium for CT AI in COVID-19. The authors acknowledge the National Cancer Institute and the Foundation for the National Institutes of Health, and their critical role in the creation of the free publicly available LIDC/IDRI Database used in this study. This work was supported by the Korea Bio Data Station (K-BDS) with computing resources including technical support.

About

Explainable AI for accurate COVID-19 diagnosis with XCT-COVID

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published