Intelligent System for COVID-19 Diagnosis from Chest X-Ray Images

DOI : 10.17577/IJERTV12IS010099

Download Full-Text PDF Cite this Publication

Text Only Version

Intelligent System for COVID-19 Diagnosis from Chest X-Ray Images

Anas Y. Saleh

Electrical and Computer Engineering Department King Abdulaziz University

Jeddah 21589, Saudi Arabia.

Abstract The diverse impacts of the COVID-19 outbreak has encouraged the researchers to try to find out simple, accurate, and fast testing methods to control and overcome the spreading of this infectious disease. The Polymerase Chain Reaction (PCR) is the most dominant test that is used for COVID-19 detection. However, the PCR testing method is time- consuming test and requires sophisticated laboratories in addition to the special testing kits which is prone to shortage especially in the peak periods. On the other hand, the chest X- ray (CXR) is widely available, fast, and low-cost imaging modality. This paper proposed a machine learning (ML) model which utilized first and second order statistical features to discriminate COVID-19 CXR images. In addition to ML model, this work also proposed a deep learning (DL) model which was developed by using transfer learning approach. Six thousand of normal and COVID-19 CXR images were used to train and test these two models. The developed models show a robust performance, where ML and DL systems achieved accuracy of 100% and 99.20% respectively .

Keywords COVID-19, Chest X-ray (CXR), Polymerase Chain Reaction (PCR) test, Machine Learning (ML), Transfer Learning, and Deep Learning (DL).

  1. INTRODUCTION

    Sever Acute Respiratory Syndrome Coronavirus 2 (SARS- CoV-2), virus that causes Coronavirus (COVID-19) infectious disease. COVID-19 was firstly detected in Wuhan, China in December 2019 and its main symptoms include fatigue, cough, fever, and shortness of breath [1]. The World Health Organization (WHO) has considered the wide spread of COVID-19 a global pandemic on 11th of March 2020. The new WHO statistics show that there are more than 600 million of accumulative confirmed COVID-19 cases, including more than 6 million deaths[2].

    The dominant test that is used for COVID-19 diagnosis is the Polymerase Chain Reaction (PCR). However, this method is time consuming, and has a false negative possibility that cannot be neglected [3]. In addition to that it requires special testing kits and sophisticated laboratories that are not available in many of rural areas. Even if the kits are available in these areas, delivering of the collected samples to the equipped laboratories will expose the specimens to the external factors for a long time which could diversely affect them and the results[4]. On the other hand, the X-ray imaging is fast and affordable imaging modality that is widely used around the world to diagnose many of illnesses such as respiratory diseases and fractured bones. During COVID-19 pandemic,

    Chest X-ray (CXR) and Computed Tomography (CT) scan are widely used to assess the effects of COVID-19 on the respiratory system of the infected patients. Compared with CT, CXR imaging is faster and has lower radiation dose and cost [5][6].

    This paper proposes robust automated Machine Learning (ML) and Deep Learning (DL) models to diagnose COVID- 19 patients using CXR images. Each one of these two models was trained and tested separately by using 6000 CXR images, where 75% (4500 images) of them were used for training and 25% (1500 images) for testing. The proposed models show high classification accuracy. Where, the ML model classified all the CXR images correctly and the developed DL model misclassified only 12 out of 1500 cases.

  2. LITERATURE REVIEW

    Guefrechi S. et al. [7], proposed a deep learning system for COVID-19 detection using CXR images. They used 3000 of normal images and 623 of COVID-19 CXR images. The COVID-19 images were augmented to be equal to 2000, by applying horizontal flips, random noise, and random rotations (-10 to 10 degrees). The researchers preprocessed the dataset by resizing the images to be in uniform dimensions that compatible with the used pretrained networks. Where the inputs dimensions of the used networks are 224×224 pixels. The developed system used transfer learning for tuning and updating the networks parameters. The pretrained architectures that were used are InceptionV3, ResNet-50, and VGG-16. The system achieved 98.10%, 97.20%, and 98.30% accuracy for InceptionV3, Resnet-50, and VGG-16 respectively.

    Kusakunniran W. et al. [8], used ResNet-101 as a backbone architecture to develop a binary deep learning system that classify CXR images into normal and COVID-19. They used CXR images witp500×1500 pixels, and these images were augmented before importing into the network. The training and validation processes in the proposed system will continue until reaching of max number of epochs or the validating result is converged. Else, the system goes back to augmentation step and perform the next epoch. The final model was concluded after finishing training and validating processes. The proposed model achieved accuracy, sensitivity, and specificity of 98%, 97%, and 98% respectively.

    Chaddad A. et al. [9], tested the using of transfer learning with chest Computed Tomography (CT) scans, CXR images, and CT in addition to CXR images. The researchers used a

    total of 846 CT scans and 657 CXR images of non-COVID-

    19 and COVID-19 cases. They employed DenseNet, GoogLeNet, NASNet-Mobile, AlexNet, DarkNet, and ResNet-18 to build their model. The highest accuracy was achieved by combining CXR and CT images, and then importing these images into DarkNet model. Where the models accuracy and Area Under the Curve (AUC) of COVID-19 and normal classification are 99.09% and 99.89% respectively.

    Manokaran J. et al. [10], proposed a model using DenseNet-201, where the last classification layer was replaced with averaging, batch normalization, and dense layers. They tested the performance of their model by using of 1729 CXR images which consist of 800 normal, 129 COVID-19, and 800 pneumonia images. The researchers had considered the COVID-19 group as the positive class, while normal and pneumonia groups were considered as the negative class. The developed system was able to detect COVID-19 images with an accuracy of 94%.

    Rao K. et al. [11], fine-tuned ResNet-50, InceptionV3, Xception, and VGG-16 models to classify COVID-19 CXR images. Then the researchers developed two new models SVRNet and SVDNet on the basis of VGG-16 with some modifications. The used dataset (which consists of 1560 CXR images) was preprocessed by applying Contrast-Limited Adaptive Histogram Equalization (CLAHE) algorithm to improve -unsatisfactory- contrast of the used images. The proposed models i.e., SVRNet and SVDNet have showed better performance comparing with other four models. Where the accuracy of SVDNet and SVRNet are 99.37% and 99.13% respectively.

    Wang W. et al. [12], proposed a new Convolution Neural Network (CNN) structure called MCFF-Net66 based on Parallel Channel Attention Feature Fusion (PCAF). The used dataset comprises 4 classes normal, viral pneumonia, bacterial pneumonia, and COVID-19. The proposed model was able to detect the all 142 COVID-19 images. However, the developed system achieved an overall accuracy of 94.66%.

    Guarrasi V. et al. [13], designed a fusion approach that uses multiple of different CNNs to collaborate for COVID-19 detection in CXR images. The system aimed to enhance the generalizability of the existed CNNs. The average accuracy of the proposed ensemble CNNs system is 95.18%.

    Yadav A. et al. [14], developed DeepAttentiveNet to detect COVID-19 infected patients using CXR images. The proposed model uses DenseNet-121 as a backbone architecture for spatia features extraction. After that the researchers used the attention mechanism, which facilitates extraction of the most important regions on the images to have more focus than others, which leads to enhanced overall detection process. The DeepAttentiveNet model diagnosed the COVID-19 CXR images with an accuracy of 97.5%.

    Brunese L. et al. [15], proposed a supervised ML model for discriminating between COVID-19 and non-COVID-19 (other pathologies) CXR images. To extract features, they used Cosine discreate transformation and grid-based color selection, where the image was divided into 64 blocks and the color feature was computed for each block. Then, K-nearest neighbors (KNN) classifier was trained with K=4. Then the

    system was examined, where the results show that out of 85 CXR images were tested, only 3 of them were wrongly classified.

    Kassani S. et al. [16], developed a hybrid system that uses deep learning networks to extract features and then employed machine learning classifiers to discriminate COVID-19 CXR and CT images from normal images. The researchers used VGGNet, DenseNet, ResNet, Xception, InceptionV3, InceptionResNetV2, MobileNet, and NASNet deep neural networks with different classifiers such as Decision Tree, Bagging, Adaboost, and LightGBM. The best two models were the DenseNet-121 with Bagging Tree classifier, and ResNet50 with LightGBM classifier, where the accuracies were 99% and 98% respectively.

  3. MATERIALS AND METHODS

    1. Dataset Description

      To train and evaluate the performance of the proposed systems, 3000 of normal and 3000 of COVID-19 CXR images were used (Fig.1 shows samples of the used images). These images were selected and retrieved from publicly available dataset that is proposed by a team of researchers from Qatar University in cooperation with a number of national and international academic and medical collaborators (can be downloaded using the following link: https://www.kaggle.com/datasets/tawsifurrahman/covid19- radiography-database) [17][18]. The dataset includes three categories: Normal, COVID-19, and non-COVID-19- Pneumonia CXR images with 299×299 dimensions and PNG format. These images were collected from different countries, which boosts the generalization ability of the proposed systems due to the expected differences between the used X- ray machines and external circumstances.

      Figure 1: Examples of the used CXR images, where (a) COVID-19, and (b) Normal.

    2. Preprocessing

      Each network of the pretrained CNNs has its own images dimensions that must be matched in order to update its weights and outputs in the transfer learning process. Because of the original size of the used dataset is 299×299; the images were resized to 224×224, 227×227, and 256×256. Where the input size of ShuffleNet, GoogLeNet, ResNet-50, and DenseNet-201 is 224×224. While AlexNet, and SqueezeNet have input layers with 227×227 pixels. The images also resized to 256×256 in order to be used with DarkNet-19. The

      resizing process for the used images was needed to develop the DL model, however, to develop the ML model, no preprocessing standard was employed, and the images were used with the original size i.e., 299×299.

    3. Conventional Machine Learning Model

      The developed ML model is belonging to the supervised machine learning approach, and it consists of three phases: Extracting features, learning (i.e., training the model), and testing phase where the performance is evaluated. This paper used first order and second order statistical features to extract useful features that can be used to train the ML system in order to discriminate between COVID-19 and normal CXR images.

      Texture features contain important characteristics that can be used to process and study the images specifically medical images. One of the oldest methods that is employed to extract texture features is Gray Level Co-occurrence Matrix (GLCM), which shows how many times a pair of pixels with specific value and offset is co-occurring in an image [19]. In this paper, each element of the GLCM matrix was considered as a feature, in addition to that, the contrast, uniformity(energy), homogeneity, and correlation features are computed from the extracted GLCM matrices. The proposed system also used the following first order statistical features: mean, median, max, min, mode, (30, 40, 50, 60, 70, & 80) percentiles, and (0.25, 0.50, & 0.75) quantiles. Then t-test was used to select the useful features that have significant differences between COVID-19 and normal CXR images. Where, all the selected features have p-value less than 0.05. After that these features were used to train the classifiers. Fig. 2 shows the flowchart of the proposed ML system. This work trained and tested a group of different classifiers to find a Machine Learning (ML) model that has a robust performance. K-Nearest Neighbor (KNN), Support Vector Machine(SVM), Decision Tree, and Ensemble classifiers with different training options and kernels were tested. Section V shows the performances of the best classifiers in detail.

      Figure 2: Flowchart of the proposed ML model.

    4. Deep Learning Model

    Using of DL models to perform classification tasks was rapidly increased and show a good performance in many applications in various fields. Building a DL model can be done by one of the following: (1) train the model from scratch, (2) fine-tuning, and (3) transfer learning. However, to train a deep neural network from scratch, the researcher needs a large dataset in addition to high processing and computing resources. Also, training the deep neural network from scratch requires days or weeks based on many factors such as the dataset size and the network depth. Due to the lack of sufficient medical images that can be used to train the neural networks; many of researchers use transfer learning to build their models for medical diagnosis purposes. Transfer learning enables the user to transfer acquired and learned knowledge that performs a specific task in an original model (called source model), to be used in a second model (called target model) to perform another task with smaller dataset as shown in Fig.3 [20][21].

    This section used transfer learning to retrain a group of CNNs to discriminate between Normal and Covid-19 CXR images. Where AlexNet, ShuffleNet, SqueezeNet, GoogLeNet, ResNet-50, DarkNet, and DenseNet-201 were modified and their parameters were updated. To train these networks, Root Mean Square Propagation (RMSprop) optimizer was used with initial learning rate equals to 0.0001. The number of epochs was 10 for all of the networks and the reshuffling was done after each epoch.

    Figure 3: Transfer Learning.

  4. PERFORMANCE MEASURES

    This section defines the measures that were used to evaluate the proposed models. The used measures include the Accuracy, Sensitivity, Specificity, Positive Predictive Value (PPV), and Negative Predictive Value (NPV). Where the diagnostic accuracy measures show the ability of the system to discriminate between healthy and infected images [22][23].

    To calculate these measures, the four values in the confusion matrix must be found for each model (see Fig. 4):

    1. True Positive (TP); represents number of infected patients who are correctly diagnosed.

    2. True Negative (TN); represents number of healthy cases who are correctly diagnosed.

    3. False Positive (FP); Number of healthy people who are wrongly diagnosed as positive.

    4. False Negative (FN); Number of infected patients who are wrongly diagnosed as negative.

      These numbers were used in the following equations to calculate the performance measures. The first measure that commonly used to assess the models performance is the accuracy and it is resulted from the division of the correctly classified cases number over the total cases number as following :

      The second measure is the sensitivity, and it is defined as the ability of the system to distinguish the presece of the disease and it is given as:

      Specificity shows the ability of the system to recognize the absence of the disease and it is defined as:

      The probability of having the disease can be measured by using PPV indicator, and to measure the probability of not having the disease, NPV was computed. Equations (4) and

    5. show the expressions of PPV and NPV respectively:

      Figure 4: The Confusion Matrix, where 0 represents negative (healthy) and 1 represents positive (infected).

  5. RESULTS AND DISCUSION

      1. Machine Learning Model

        This section shows in detail the performance of the best trained classifiers and their confusion matrices. Where the most accurate ML models were achieved using KNN and Ensemble classifiers. The proposed KNN classifier with K=1 was able to correctly predict all testing images. Also, Ensemble classifier with KNN learners was achieved an accuracy of 100%. The Decision Tree classifier achieved and accuracy of 85.13%, while SVM (linear kernel) showed the worst performance with an accuracy equals to 51%. Table.1 shows the performance measures of these developed classifiers and Fig.5 shows the confusion matrices of them.

        TABLE I. PERFORMANCE MEASURES OF THE TRAINED CLASSIFIERS.

        Classifier

        Notes

        Accuracy (%)

        Sensitivity (%)

        Specificity (%)

        PPV (%)

        NPV (%)

        KNN

        Num. of neighbors 1

        100

        100

        100

        100

        100

        KNN

        Num. of neighbors 3

        93.27

        93.60

        92.93

        92.98

        93.56

        KNN

        Num. of neighbors 5

        92.40

        92.00

        92.80

        92.74

        92.06

        SVM

        Linear kernel

        51

        40.93

        61.07

        51.25

        50.83

        Tree

        100 max splits

        85.13

        82.53

        87.73

        87.06

        83.40

        Ensemble

        (KNN learners)

        100

        100

        100

        100

        100

        Figure 5: the confusion matrices for (a) KNN (K=1), (b) KNN (K=3), (c) KNN (K=5), (d) SVM (Linear), (e) Tree (100 splits), and (f) Ensemble (KNN learners).

      2. Deep Learning Model

    In this section, the performance details of the developed DL models are illustrated. The measures as accuracy, sensitivity, specificity, PPV, and NPV were computed for each network. In addition to that, learning curves and confusion matrices for the best performances are attached in this section. As mentioned in section III, the used training options such as solver, number of epochs, and learning rate for all networks are the same.

    The best performance was obtained by using ShuffleNet architecture, where the achieved accuracy, sensitivity, specificity, PPV, and NPV were 99.20%, 98.00%, 99.87%,

    99.86, and 98.04% respectively. Which means, only 12 images were misclassified out of 1500 testing images. Models based on DarkNet-19 and DenseNet-201 networks have the same accuracy which is equal to 98.93%. Table 2 shows the performance measures of the developed DL models, which are arranged in ascending order based on the achieved accuracy. Figure 6 shows the confusion matrices of each network. While Fig.7 shows the learning curves of the best three developed DL models which are based on ShuffleNet, DenseNet-201, and DarkNet-19.

    Figure 6: shows the confusion matrices for (a) SqueezeNet, (b) AlexNet, (c) GoogLeNet, (d) ResNet-50, (e) DarkNet-19, (f) DenseNet-201, and (g) ShuffleNet.

    TABLE II: SHOWS THE PERFORMANCE MEASURES OF THE DEEP NEURAL NETWORKS.

    Network

    Accuracy (%)

    Sensitivity (%)

    Specificity (%)

    PPV (%)

    NPV (%)

    SqueezeNet

    94.47

    89.07

    99.87

    99.85

    90.13

    AlexNet

    97.73

    95.87

    99.60

    99.58

    96.02

    GoogLeNet

    98.47

    96.93

    100

    100

    97.02

    ResNet-50

    98.80

    99.47

    98.13

    98.16

    99.46

    DarkNet-19

    98.93

    98.40

    99.47

    99.46

    98.42

    DenseNet-201

    98.93

    98.00

    99.87

    99.86

    98.04

    ShuffleNet

    99.20

    99.07

    99.33

    99.33

    99.07

    Figure 7: shows the learning curves for (a) DarkNet-19, (b) DenseNet-201, and (c) ShuffleNet.

    Comparing with [7-16], this paper proposed AI-models (ML and DL) with higher accuracy and reliability. Where each of the proposed AI-systems were tested using 1500 CXR images which increases the generalizability and reliability of the system. And the proposed models showed accurate classification reached to 99.20% using DL and 100% using ML.

  6. CONCLUSION AND FUTURE WORK

In this paper we proposed accurate and robust AI-based models using ML and DL approaches. Where, this paper

developed ML model which utilized first order and second order statistical features to train KNN and Ensemble classifiers that achieved an accuracy of 100%. On the other hand, a transfer learning approach was used to develop an effective DL model. Where, this paper proposed an accurate DL model by using ShuffleNet network as a backbone architecture with an accuracy of 99.20%. These two models offer fast, accurate, and low-cost testing methods that can be efficient alternatives of PCR testing method. In this work, we used 6000 images without preprocessing, which boosts the generalizability of these proposed models. In future, this

system can be improved to classify CXR images into different levels of infectious severity.

REFERENCES

[1] Alimohamadi, Y., Sepandi, M., Taghdir, M., & Hosamirudsari, H. (2020). Determine the most common clinical symptoms in COVID-19 patients: a systematic review and meta-analysis. Journal of preventive medicine and hygiene, 61(3), E304E312. https://doi.org/10.15167/2421-4248/jpmp020.61.3.1530

[2] WHO Coronavirus (COVID-19) Dashboard, Geneva: World Health Organization. Available online: https://covid19.who.int/data/ (retrieved: September ,2022).

[3] Axell-House, D., Lavingia, R., Rafferty, M., Clark, E., Amirian, E., & Chiao, E. (2020). The estimation of diagnostic accuracy of tests for COVID-19: A scoping review. Journal Of Infection, 81(5), 681-697. doi: 10.1016/j.jinf.2020.08.043

[4] Yilmaz Gulec, E., Cesur, N. P., Yesilyurt Fazliolu, G., & Kazezolu,

C. (2021). Effect of different storage conditions on COVID-19 RT- PCR results. Journal of medical virology, 93(12), 65756581. https://doi.org/10.1002/jmv.27204

[5] Bushong, Stewart C. (1993). Radiologic Science for Technologists : Pysics, Biology, and Protection. St. Louis :Mosby, 570.

[6] Benmalek, E., Elmhamdi, J., & Jilbab, A. (2021). Comparing CT scan and chest X-ray imaging for COVID-19 diagnosis. Biomedical Engineering Advances, 1, 100003. doi: 10.1016/j.bea.2021.100003

[7] Guefrechi, S., Jabra, M., Ammar, A., Koubaa, A., & Hamam, H. (2021). Deep learning based detection of COVID-19 from chest X-ray images. Multimedia Tools and Applications, 80(21-23), 31803-31820. doi: 10.1007/s11042-021-11192-5

[8] Kusakunniran, W., Borwarnginn, P., Sutassananon, K., Tongdee, T., Saiviroonporn, P., Karnjanapreechakorn, S., & Siriapisith, T. (2021). COVID-19 detection and heatmap generation in chest x-ray images.

Journal Of Medical Imaging, 8(S1). doi: 10.1117/1.jmi.8.s1.014001

[9] Chaddad, A., Hassan, L., & Desrosiers, C. (2021). Deep CNN models for predicting COVID-19 in CT and x-ray images. Journal Of Medical Imaging, 8(S1). doi: 10.1117/1.jmi.8.s1.014502

[10] Manokaran, J., Zabihollahy, F., Hamilton-Wright, A., & Ukwatta, E. (2021). Detection of COVID-19 from chest x-ray images using transfer learning. Journal Of Medical Imaging, 8(S1). doi: 10.1117/1.jmi.8.s1.017503

[11] Rao, K., Hu, Z., Wen, C., Xie, K., Guo, X., & He, J. (2021). COVID-

19 detection method based on SVRNet and SVDNet in lung x-rays.

Journal Of Medical Imaging, 8(S1). doi: 10.1117/1.jmi.8.s1.017504 [12] Wang, W., Li, Y., Li, J., Zhang, P., & Wang, X. (2021). Detecting

COVID-19 in Chest X-Ray Images via MCFF-Net. Computational Intelligence and Neuroscience, 2021, 1-8. doi: 10.1155/2021/3604900

[13] Guarrasi V., D'Amico N., Sicilia R., Cordelli E., & Soda P. (2021). A Multi-Expert System to Detect COVID-19 Cases in X-ray Images. IEEE 34th International Symposium on Computer-Based Medical Systems (CBMS), 2021, 395-400, doi: 10.1109/CBMS52027.2021.00090.

[14] Yadav A., & Mukhopadhyay D. (2022). DeepAttentiveNet: An automated deep based method for COVID-19 diagnosis based on chest x-rays, IEEE Fourth International Conference on Advances in Electronics, Computers and Communications (ICAECC), 2022, pp. 1- 6, doi: 10.1109/ICAECC54045.2022.9716640

[15] Brunese, L., Martinelli, F., Mercaldo, F., & Santone, A. (2020). Machine learning for coronavirus covid-19 detection from chest x-rays. Procedia Computer Science, 176, 2212-2221. doi: 10.1016/j.procs.2020.09.258

[16] Kassania, S., Kassanib, P., Wesolowskic, M., Schneidera, K., & Detersa, R. (2021). Automatic Detection of Coronavirus Disease (COVID-19) in X-ray and CT Images: A Machine Learning Based Approach. Biocybernetics And Biomedical Engineering, 41(3), 867- 879. doi: 10.1016/j.bbe.2021.05.013

[17] Chowdhury, M., Rahman, T., Khandakar, A., Mazhar, R., Kadir, M., & Mahbub, Z. et al. (2020). Can AI Help in Screening Viral and COVID-

19 Pneumonia?. IEEE Access, 8, 132665-132676. doi: 10.1109/access.2020.3010287.

[18] Rahman, T., Khandakar, A., Qiblawey, Y., Tahir, A., Kiranyaz, S., & Abul Kashem, S. et al. (2021). Exploring the effect of image enhancement techniques on COVID-19 detection using chest X-ray images. Computers In Biology and Medicine, 132, 104319. doi: 10.1016/j.compbiomed.2021.104319.

[19] Nanni, L., Brahnam, S., Ghidoni, S., Menegatti, E., & Barrier, T. (2013). Different approaches for extracting information from the co- occurrence matrix. PloS one, 8(12), e83554. https://doi.org/10.1371/journal.pone.0083554

[20] Chandola, Y., Virmani, J., Bhadauria, H. S., & Kumar, P. (2021). Deep learning for chest radiographs, ELSEVIER ACADEMIC PRESS, 118-119.

[21] Apostolopoulos, I. D., & Mpesiana, T. A. (2020). COVID-19: Automatic detection from X-ray images utilizing transfer learning with Convolutional Neural Networks. Physical and Engineering Sciences in Medicine, 43(2), 635640. https://doi.org/10.1007/s13246-020-00865-4

[22] imundi A. M. (2009). Measures of Diagnostic Accuracy: Basic Definitions. EJIFCC, 19(4), 203211.

[23] Eusebi P. (2013). Diagnostic accuracy measures. Cerebrovascular diseases (Basel, Switzerland), 36(4), 267272.

https://doi.org/10.1159/000353863