Fast COVID-19 and Pneumonia Classification Using Chest X-ray Images
Abstract
:1. Introduction
2. Materials and Methods
2.1. Convolutional Neural Networks and Chest Diseases
2.2. Convolutional Neural Networks, Pneumonia, and COVID-19
3. Materials and Methods
3.1. Pneumonia Dataset
3.2. COVID-19 Dataset
3.3. Class Imbalance
3.4. Convolutional Network
3.5. Screening and Localization
3.6. Performance Measures
- true positives (tp)
- true negatives (tn)
- false positives (fp), and
- false negatives (fn).
4. Proposed Method
4.1. Image Preprocessing
- If some black band appears at the edges, they are removed.
- The size of the image is transformed until the smallest border measures 299 pixels.
- Extract the central region of 299 × 299 pixels.
4.2. Cost Sensitive Learning
4.3. Data Augmentation and Hyperparameter Tuning
- Random rotation of ±10 degrees.
- Zoom on a range of ±10%.
- Horizontal flipping.
4.4. Dataset Partition
5. Results
5.1. Experimental Framework
- Resizing and cropping of all images with the proposed method.
- Hold-out as validation method to obtain training, validation, and test sets.
- Normalization of the images.
- Model selection by Xception training and validation.
- Performance evaluation of the model on the test set.
- Grad-CAM generation for test examples.
5.2. Validation Set Results
5.3. Test Set Classification Results
5.4. Disease Screening
6. Discussion
7. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- World Health Organization Coronavirus Disease 2019. Available online: https://www.who.int/emergencies/diseases/novel-coronavirus-2019 (accessed on 30 June 2020).
- World Health Organization Coronavirus. Available online: https://www.who.int/health-topics/coronavirus#tab=tab_1 (accessed on 30 June 2020).
- Kooraki, S.; Hosseiny, M.; Myers, L.; Gholamrezanezhad, A. Coronavirus (COVID-19) outbreak: What the department of radiology should know. J. Am. Coll. Radiol. 2020, 17, 447–451. [Google Scholar] [CrossRef] [PubMed]
- Simpson, S.; Kay, F.U.; Abbara, S.; Bhalla, S.; Chung, J.H.; Chung, M.; Henry, T.S.; Kanne, J.P.; Kligerman, S.; Ko, J.P.; et al. Radiological society of North America expert consensus statement on reporting chest ct findings related to COVID-19. Endorsed by the society of thoracic radiology, the American college of radiology, and RSNA. Radiol. Cardiothorac. Imaging 2020, 2, e200152. [Google Scholar] [CrossRef] [Green Version]
- Wong, H.Y.F.; Lam, H.Y.S.; Fong, A.H.-T.; Leung, S.T.; Chin, T.W.-Y.; Lo, C.S.Y.; Lui, M.M.-S.; Lee, J.C.Y.; Chiu, K.W.-H.; Chung, T.; et al. Frequency and Distribution of Chest Radiographic Findings in COVID-19 Positive Patients. Radiology 2020, 201160. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Sutton, D. Textbook of Radiology and Imaging, 7th ed.; Chirchill Livingstone: London, UK, 2003. [Google Scholar]
- Suzuki, K. Overview of deep learning in medical imaging. Radiol. Phys. Technol. 2017, 10, 257–273. [Google Scholar] [CrossRef] [PubMed]
- Wang, G.; Li, W.; Zuluaga, M.A.; Pratt, R.; Patel, P.A.; Aertsen, M.; Doel, T.; David, A.L.; Deprest, J.; Ourselin, S.; et al. Interactive Medical Image Segmentation Using Deep Learning With Image-Specific Fine Tuning. IEEE Trans. Med. Imaging 2018, 37, 1562–1573. [Google Scholar] [CrossRef]
- Chen, S.; Ding, C.; Liu, M. Dual-force convolutional neural networks for accurate brain tumor segmentation. Pattern Recognit. 2019, 88, 90–100. [Google Scholar] [CrossRef]
- Li, H.; Li, A.; Wang, M. A novel end-to-end brain tumor segmentation method using improved fully convolutional networks. Comput. Biol. Med. 2019, 108, 150–160. [Google Scholar] [CrossRef]
- Li, Z.; Hou, Z.; Chen, C.; Hao, Z.; An, Y.; Liang, S.; Lu, B. Automatic cardiothoracic ratio calculation with deep learning. IEEE Access 2019, 7, 37749–37756. [Google Scholar] [CrossRef]
- Wang, X.; Peng, Y.; Lu, L.; Lu, Z.; Bagheri, M.; Summers, R.M. ChestX-ray: Hospital-Scale chest X-ray database and benchmarks on weakly supervised classification and localization of common thorax diseases. In Advances in Computer Vision and Pattern Recognition; Springer: Berlin, Germany, 2019; pp. 369–392. [Google Scholar]
- Allaouzi, I.; Ben Ahmed, M. A Novel approach for multi-label chest X-Ray classification of common thorax diseases. IEEE Access 2019, 7, 64279–64288. [Google Scholar] [CrossRef]
- Irvin, J.; Rajpurkar, P.; Ko, M.; Yu, Y.; Ciurea-Ilcus, S.; Chute, C.; Marklund, H.; Haghgoo, B.; Ball, R.; Shpanskaya, K.; et al. CheXpert: A large chest radiograph dataset with uncertainty labels and expert comparison. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolului, HI, USA, 27 January–1 February 2019. [Google Scholar]
- Chen, B.; Li, J.; Guo, X.; Lu, G. DualCheXNet: Dual asymmetric feature learning for thoracic disease classification in chest X-rays. Biomed. Signal Process. Control 2019, 53, 101554. [Google Scholar] [CrossRef]
- Chollet, F. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016. [Google Scholar]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems; Curran Associates, Inc.: New York, NY, USA, 2012; pp. 1097–1105. [Google Scholar]
- Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. In Proceedings of the International Conference on Learning Representations, Banff, AB, Canada, 14–16 April 2014. [Google Scholar]
- Szegedy, C.; Vanhoucke, V.; Ioffe, S.; Shlens, J.; Wojna, Z. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016; pp. 770–778. [Google Scholar]
- Huang, G.; Liu, Z.; Van Der Maaten, L.; Weinberger, K.Q. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition 2017, Honolulu, HI, USA, 21–26 July 2017; pp. 2261–2269. [Google Scholar]
- Bakator, M.; Radosav, D. Deep learning and medical diagnosis: A review of literature. Multimodal Technol. Interact. 2018, 2, 47. [Google Scholar] [CrossRef] [Green Version]
- Baltruschat, I.M.; Nickisch, H.; Grass, M.; Knopp, T.; Saalbach, A. Comparison of deep learning approaches for multi-label chest X-Ray classification. Sci. Rep. 2019, 9, 6381. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Xu, S.; Wu, H.; Bie, R. CXNet-m1: Anomaly detection on chest X-Rays with image-based deep learning. IEEE Access 2019, 7, 4466–4477. [Google Scholar] [CrossRef]
- Blumenfeld, A.; Greenspan, H.; Konen, E. Pneumothorax detection in chest radiographs using convolutional neural networks. In Medical Imaging 2018: Computer-Aided Diagnosis; Mori, K., Petrick, N., Eds.; SPIE: Bellingham, WC, USA, 2018; Volume 10575, p. 3. [Google Scholar]
- Que, Q.; Tang, Z.; Wang, R.; Zeng, Z.; Wang, J.; Chua, M.; Gee, T.S.; Yang, X.; Veeravalli, B. CardioXNet: Automated detection for cardiomegaly based on deep learning. In Proceedings of the 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Honolulu, HI, USA, 17–21 July 2018; pp. 612–615. [Google Scholar]
- Salehinejad, H.; Colak, E.; Dowdell, T.; Barfett, J.; Valaee, S. Synthesizing chest X-Ray pathology for training deep convolutional neural networks. IEEE Trans. Med. Imaging 2019, 38, 1197–1206. [Google Scholar] [CrossRef]
- Liang, G.; Zheng, L. A transfer learning method with deep residual network for pediatric pneumonia diagnosis. Comput. Methods Programs Biomed. 2020, 187, 104964. [Google Scholar] [CrossRef] [PubMed]
- Kermany, D.S.; Goldbaum, M.; Cai, W.; Valentim, C.C.S.; Liang, H.; Baxter, S.L.; McKeown, A.; Yang, G.; Wu, X.; Yan, F.; et al. Identifying medical diagnoses and treatable diseases by image-based deep learning. Cell 2018, 172, 1122–1131. [Google Scholar] [CrossRef] [PubMed]
- Luján-García, J.E.; Yáñez-Márquez, C.; Villuendas-Rey, Y.; Camacho-Nieto, O. A transfer learning method for pneumonia classification and visualization. Appl. Sci. 2020, 10, 2908. [Google Scholar] [CrossRef] [Green Version]
- Chouhan, V.; Singh, S.K.; Khamparia, A.; Gupta, D.; Tiwari, P.; Moreira, C.; Damaševičius, R.; de Albuquerque, V.H.C. A novel transfer learning based approach for pneumonia detection in chest X-ray images. Appl. Sci. 2020, 10, 559. [Google Scholar] [CrossRef] [Green Version]
- Radiological Society of North America RSNA Pneumonia Detection Challenge. Available online: https://www.kaggle.com/c/rsna-pneumonia-detection-challenge/ (accessed on 31 May 2019).
- Sirazitdinov, I.; Kholiavchenko, M.; Mustafaev, T.; Yixuan, Y.; Kuleev, R.; Ibragimov, B. Deep neural network ensemble for pneumonia localization from a large-scale chest X-ray database. Comput. Electr. Eng. 2019, 78, 388–399. [Google Scholar] [CrossRef]
- Ardakani, A.A.; Kanafi, A.R.; Acharya, U.R.; Khadem, N.; Mohammadi, A. Application of deep learning technique to manage COVID-19 in routine clinical practice using CT images: Results of 10 convolutional neural networks. Comput. Biol. Med. 2020, 121, 103795. [Google Scholar] [CrossRef]
- Hemdan, E.E.-D.; Shouman, M.A.; Karar, M.E. COVIDX-Net: A framework of deep learning classifiers to diagnose COVID-19 in X-Ray images. arXiv 2020, arXiv:2003.11055. Available online: https://arxiv.org/abs/2003.11055 (accessed on 5 August 2020).
- Butt, C.; Gill, J.; Chun, D.; Babu, B.A. Deep learning system to screen coronavirus disease 2019 pneumonia. Appl. Intell. 2020. [Google Scholar] [CrossRef]
- Ozturk, T.; Talo, M.; Yildirim, E.A.; Baloglu, U.B.; Yildirim, O.; Rajendra Acharya, U. Automated detection of COVID-19 cases using deep neural networks with X-ray images. Comput. Biol. Med. 2020, 121, 103792. [Google Scholar] [CrossRef] [PubMed]
- Redmon, J.; Farhadi, A. YOLOv3: An incremental improvement. arXiv 2018, arXiv:1804.02767. Available online: https://arxiv.org/abs/1804.02767 (accessed on 6 July 2020).
- Zhang, J.; Xie, Y.; Liao, Z.; Pang, G.; Verjans, J.; Li, W.; Sun, Z.; He, J.; Li, Y.; Shen, C.; et al. Viral pneumonia screening on chest X-Ray images using confidence-aware anomaly detection. arXiv 2020, arXiv:2003.12338. Available online: https://arxiv.org/abs/2003.12338 (accessed on 5 August 2020).
- Cohen, J.P.; Dao, L.; Morrison, P.; Roth, K.; Bengio, Y.; Shen, B.; Abbasi, A.; Hoshmand-Kochi, M.; Ghassemi, M.; Li, H.; et al. Predicting COVID-19 pneumonia severity on chest X-ray with deep learning. arXiv 2020, arXiv:2005.11856. Available online: https://arxiv.org/abs/2005.11856 (accessed on 5 August 2020). [CrossRef]
- Cohen, J.P.; Morrison, P.; Dao, L. COVID-19 image data collection. arXiv 2020, arXiv:2003.11597. Available online: https://arxiv.org/abs/2003.11597 (accessed on 1 June 2020).
- Fernández, A.; García, S.; del Jesus, M.J.; Herrera, F. A study of the behaviour of linguistic fuzzy rule based classification systems in the framework of imbalanced data-sets. Fuzzy Sets Syst. 2008, 159, 2378–2398. [Google Scholar] [CrossRef]
- Goodfellow, I.; Bengio, Y.; Courville, A. Deep Learning; MIT Press: Cambridge, MA, USA, 2016. [Google Scholar]
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization. arXiv 2016, arXiv:1610.02391. Available online: https://arxiv.org/abs/1610.02391 (accessed on 1 June 2020).
- Sokolova, M.; Lapalme, G. A systematic analysis of performance measures for classification tasks. Inf. Process. Manag. 2009, 45, 427–437. [Google Scholar] [CrossRef]
- Pasa, F.; Golkov, V.; Pfeiffer, F.; Cremers, D.; Pfeiffer, D. Efficient deep network architectures for fast chest X-Ray tuberculosis screening and visualization. Sci. Rep. 2019, 9, 6268. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- López, V.; Fernández, A.; Moreno-Torres, J.G.; Herrera, F. Analysis of preprocessing vs. cost-sensitive learning for imbalanced classification. Open problems on intrinsic data characteristics. Expert Syst. Appl. 2012, 39, 6585–6608. [Google Scholar] [CrossRef]
- Murphy, K.P. Machine Learning: A Probabilistic Perspective, 1st ed.; MIT Press: Cambridge, MA, USA, 2012. [Google Scholar]
- Pedregosa, F.; Michel, V.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Vanderplas, J.; Cournapeau, D.; Pedregosa, F.; Varoquaux, G.; et al. Scikit-learn: Machine learning in python Gaël Varoquaux bertrand thirion vincent dubourg alexandre passos PEDREGOSA, VAROQUAUX, GRAMFORT ET AL. Matthieu Perrot. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
- Hernández-Castañeda, Á.; Calvo, H.; Gelbukh, A.; Flores, J. Cross-domain deception detection using support vector networks. Soft Comput. 2017, 21, 585–595. [Google Scholar] [CrossRef]
- Kermany, D.; Zhang, K.; Goldbaum, M. Labeled Optical Coherence Tomography (OCT) and Chest X-Ray Images for Classification. Available online: https://data.mendeley.com/datasets/rscbjbr9sj/2 (accessed on 7 October 2019).
- Bradski, G. The OpenCV library. Dr. Dobb’s J. Softw. Tools 2000, 120, 122–125. [Google Scholar]
- Van Der Maaten, L.; Hinton, G. Visualizing Data using t-SNE. J. Mach. Learn. Res. 2008, 9, 2579–2605. [Google Scholar]
Class | Weight |
---|---|
COVID-19 | 6.42 |
HEALTHY | 1.36 |
PNEUMONIA | 0.47 |
Cost Function | Learning Rate (LR) | Optimizer | Epochs | Batch Size | LR Decay |
---|---|---|---|---|---|
Categorical cross entropy | Adam | 100 | 32 | 10 times after a plateau |
Partition | COVID-19 | HEALTHY | PNEUMONIA |
---|---|---|---|
Training | 229 | 1079 | 3106 |
Validation | 58 | 270 | 777 |
Test | 32 1 | 234 | 390 |
Model | Best Epoch | Validation Loss | Average Training Time (Epoch) | Average Training Time (Example) | Convergence Time (Best Model) | Training Total Time |
---|---|---|---|---|---|---|
VGG16 | 34 | 0.79751 | 80 s | 0.0181 s | 2720 s | 3520 s |
ResNet50 | 7 | 0.19316 | 78 s | 0.0177 s | 546 s | 1248 s |
DenseNet121 | 8 | 0.08312 | 74 s | 0.0168 s | 592 s | 1258 s |
Proposed method | 6 | 0.05619 | 100 s | 0.0226 s | 700 s | 1600 s |
Class | Accuracy | Precision | Recall | F1-Score | ROC Curve AUC |
---|---|---|---|---|---|
COVID-19 | 1.00 | 0.94 | 1.00 | 0.97 | 1.00 |
HEALTHY | 0.86 | 0.99 | 0.62 | 0.76 | 0.97 |
PNEUMONIA | 0.86 | 0.82 | 1.00 | 0.90 | 0.97 |
Macro-averaged | 0.91 1 | 0.92 | 0.87 | 0.88 | 0.98 |
Model | Average Accuracy | MA Precision | MA Recall | MA F1-Score | MA ROC Curve AUC |
---|---|---|---|---|---|
VGG16 | 0.46 | 0.60 | 0.53 | 0.30 | 0.81 |
ResNet50 | 0.88 | 0.77 | 0.85 | 0.79 | 0.95 |
DenseNet121 | 0.88 | 0.83 | 0.85 | 0.80 | 0.97 |
Proposed method | 0.91 | 0.92 | 0.87 | 0.88 | 0.98 |
© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Luján-García, J.E.; Moreno-Ibarra, M.A.; Villuendas-Rey, Y.; Yáñez-Márquez, C. Fast COVID-19 and Pneumonia Classification Using Chest X-ray Images. Mathematics 2020, 8, 1423. https://doi.org/10.3390/math8091423
Luján-García JE, Moreno-Ibarra MA, Villuendas-Rey Y, Yáñez-Márquez C. Fast COVID-19 and Pneumonia Classification Using Chest X-ray Images. Mathematics. 2020; 8(9):1423. https://doi.org/10.3390/math8091423
Chicago/Turabian StyleLuján-García, Juan Eduardo, Marco Antonio Moreno-Ibarra, Yenny Villuendas-Rey, and Cornelio Yáñez-Márquez. 2020. "Fast COVID-19 and Pneumonia Classification Using Chest X-ray Images" Mathematics 8, no. 9: 1423. https://doi.org/10.3390/math8091423
APA StyleLuján-García, J. E., Moreno-Ibarra, M. A., Villuendas-Rey, Y., & Yáñez-Márquez, C. (2020). Fast COVID-19 and Pneumonia Classification Using Chest X-ray Images. Mathematics, 8(9), 1423. https://doi.org/10.3390/math8091423