Next Article in Journal
A Context Awareness Hierarchical Attention Network for Next POI Recommendation in IoT Environment
Next Article in Special Issue
Deep Feature Extraction for Detection of COVID-19 Using Deep Learning
Previous Article in Journal
Detection of Diseases in Pandemic: A Predictive Approach Using Stack Ensembling on Multi-Modal Imaging Data
Previous Article in Special Issue
Deep-COVID: Detection and Analysis of COVID-19 Outcomes Using Deep Learning
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Convolutional Neural Network for COVID-19 Diagnosis: An Analysis of Coronavirus Infections through Chest X-rays

1
Research Fellow, McMaster University, Hamilton, ON L8S 4L8, Canada
2
Department of Electrical and Electronics Engineering, Birla Institute of Technology & Science, Pilani, Dubai Campus, Dubai P.O. Box 345055, United Arab Emirates
3
Faculty of EEE, Sathyabama Institute of Science and Technology, Chennai 600119, Tamil Nadu, India
4
Vel Tech Rangarajan Dr. Sagunthala, R&D Institute of Science and Technology, Chennai 600062, Tamil Nadu, India
*
Authors to whom correspondence should be addressed.
Electronics 2022, 11(23), 3975; https://doi.org/10.3390/electronics11233975
Submission received: 9 November 2022 / Revised: 24 November 2022 / Accepted: 25 November 2022 / Published: 30 November 2022

Abstract

:
Coronavirus (COVID-19) disease has not only become a pandemic but also an overwhelming strain on the healthcare industry. The conventional diagnostic methods include Antigen Rapid Kits and Reverse Transcription–Polymerase Chain Reaction (RT-PCR) tests. However, they entail several drawbacks such as low precision in diagnosis, increased time in obtaining test results, increased human–patient interaction, and high inaccuracy in the diagnosis of asymptomatic individuals, thus posing a significant challenge in today’s medical practice in curbing an extremely infectious disease such as COVID-19. To overcome these shortcomings, a machine learning (ML) approach was proposed to aid clinicians in more accurate and precise infection diagnoses. A Convolutional Neural Network was built using a sample size of 1920 chest X-rays (CXR) of healthy individuals and COVID-19-infected patients. The developed CNN’s performance was further cross-checked using the clinical results of the validation dataset comprising 300 CXRs. By converting the final output to binary, an intuitive classification of whether a specific CXR is of a healthy or a COVID-infected patient was accomplished. The statistical analysis of the CNN was: Accuracy: 95%; Precision: 96%; Specificity: 95%; Recall: 95%, and F1 score: 95%, thus, proving it to be a promising diagnostic tool in comparison to the other existing ML-based models. The datasets were obtained from Kaggle, GitHub, and European Institute for Biomedical Imaging Research repositories. The prospects of the proposed CNN lie in its flexibility to be altered and extrapolated in diagnosing other lung infections, such as pneumonia and bacterial infections, with relevant training algorithms and inputs. Additionally, the usage of other bio-imaging modalities as input datasets such as CT scans, Lung Ultrasounds and Heat Maps gives the CNN immense potential to assess for better insights on the severity of infection in both infected and asymptomatic patients as well as other related medical diagnoses.

1. Introduction

The coronavirus (COVID-19) disease has affected humanity in all spheres. The first case was reported in China in December 2019. Initially, the disease only affected a few people and exhibited mild flu-like symptoms [1]. However, due to the highly contagious nature of the infection, it impacted a worldwide population in less than three months. The World Health Organization (WHO) declared this disease a pandemic in March 2020, causing countries to undergo nationwide lockdowns and issue stringent quarantine laws [2]. The pandemic caused worldwide panic and immensely burdened the healthcare industry. Due to the novel nature of the virus, it gained immediate attention from researchers and medical experts worldwide.
Patients with the coronavirus infection exhibit symptoms such as that of a viral infection, such as fever, shortness of breath, fatigue, and cough; to name a few [3]. However, research and biomedical data state that coronavirus infection has more profound and fatal consequences on the human body, especially the lungs. Even after a lengthy period of COVID-19 recovery, long-lasting effects can cause medical conditions such as Ageusia, Anosmia, Myalgic Encephalomyelitis, and Pulmonary Fibrosis. Neurological problems such as insomnia, brain fog, inflamed heart muscle, and mental health issues such as increased anxiety significantly affect patients’ overall quality of life [4]. The conventional methods to diagnose COVID-19 infection include tests such as Antigen Rapids Kits and RT-PCR that require taking swab samples from the sputum or nasopharynx of the patients [5].
However, there are several drawbacks to these diagnostic procedures, such as [6,7]:
  • Human intervention is needed to conduct the procedure successfully, thus increasing the risk of a highly contagious infection such as COVID-19;
  • Taking nasal swabs may cause discomfort to the patients;
  • The diagnostic test results can take up to 6 h to determine the presence or absence of viral infection;
  • Zero to low precision in the diagnosis obtained, thus giving no insights into the severity of the infection;
  • Highly inaccurate results were obtained, especially in the initial stages of the infection, where an individual may appear ‘asymptomatic’ and can continue to spread the disease.
Research indicates that the COVID-19 infection causes irregularities in human lungs that can be detected through various medical imaging modalities such as chest X-rays (CXR), Computed Tomography (CT) scans, and Lung Ultrasonography [8]. The malformation can appear in the form of ground-glass or nodular opacities as detected in CXRs and CT scans, or in the form of dense-shaped pleural lines with the presence of focal, varifocal, and confluent vertical B-lines as observed in lung ultrasonography [8,9].
With the breakthrough advancements in engineering, the goal is to achieve computer vision through machine learning models that can make independent decisions and produce more precise and accurate results in the shortest time possible. Such models would significantly assist medical experts and clinicians in diagnosing an overly contagious disease such as COVID-19. The following research article is organized into five sections. The following section (Section 2) discusses the methods and datasets used for training, testing, and validating the proposed Convolution Neural Network (CNN). Section 3 outlines the model’s results obtained during and after training, cross-validation statistics, and performance evaluation metrics. Section 4 discusses the feasibility of deploying CNN as a diagnostic tool for COVID-19 and potential imaging modalities that can be used as inputs to the CNN as part of future work. Section 5 concludes the research work.

2. Materials and Methods

2.1. Data Gathering and Processing

Chest X-rays are excellent biomarkers of COVID-19 infection in human lungs as they can distinctly highlight the deformities caused as well as the severity of the infection. Hence, they were selected as inputs in the proposed CNN. The input dataset comprises a total of 1920 samples of CXR images obtained from multiple online data communities such as Kaggle, GitHub, and the European Institute for Biomedical Imaging Research (EIBIR).
The CXRs can help identify and diagnose the level of infection and severity through various indications such as [10,11]:
  • Ground glass opacities and consolidation;
  • Parenchymal abnormalities;
  • Interstitial changes;
  • Peripheral ground glass opacities;
  • Vascular congestion signs;
  • Pleural effusion.
X-rays use electromagnetic waves, exposing the radiant X-ray photons to the body’s organs. There is a variance in the number of photons passed through the body tissue based on its type and the degree of infection, eventually leading to the generation of 2D images. In a normal human chest X-ray, the heart, spinal cord, and diaphragm consume maximum radiation and thus appear as ‘white’ scans. The rib cage appears ‘gray’ whereas the lungs consuming the least amount of photon radiation, appear ‘dark or black’ in the CXR, as seen in Figure 1. These are also part of the samples of healthy human CXRs used in the training of the proposed CNN.
In a COVID-19-infected individual, the CXR shows consolidation, several irregulars, and widespread opacities [11,15,16]. Additionally, these images appear cloudy and white-washed compared to the clarity observed in healthy human CXRs in Figure 1. The patchy opacities, as seen in Figure 2, help to understand the extent of the infection spread and the severity level of the disease in patients. This information can further help clinicians and medical experts to deduce correct treatment procedures promptly. The opacities are also observed for asymptomatic patients, thus assisting in the quicker diagnosis of these individuals and preventing further infection spread. The samples of COVID-19-infected patients in Figure 2 are also used in the training of the CNN model.
As seen in Table 1, the CXR input images used in training the model were split into training and testing datasets using the Pareto Principle. Training and testing datasets were further classified into two classes of CXR images: Abnormal Class (CXR of COVID-19 infected patients) and Normal Class (CXR of healthy individuals).
The model uses binary classification and assigns class 0 if the CXR exhibited any symptoms of COVID-19 infection (Abnormal Class) and 1 if the CXR did not exhibit any symptoms and was of a healthy individual (Normal Class). The mathematical modeling was primarily carried out using Python coding in the Google Colaboratory software. Several libraries, such as TensorFlow Keras, Computer Vision 2 and Seaborn were imported and used to provide better functionality and support for the multi-dimensional input datasets.
Multiple data augmentation techniques as listed below were used to increase the sample size and enhance the learning of the model:
  • Searing: CXR inputs were tilted by 40% from their standard orientation;
  • Horizontal flip: CXR inputs were horizontally flipped by 180;
  • Zoom: CXR inputs were zoomed in by 40%.

2.2. Proposed CNN Model Architecture

Deep learning (DL) is a subset of Machine Learning (ML) and is of vital interest to many researchers worldwide. Deep learning methods aim to achieve computer vision, i.e., create intelligent systems that can make independent and quick decisions by training with existing and historical data. This concept can be applied to an infinite number of industrial, medical and manufacturing applications [17,18]. One such deep learning algorithm- Convolutional Neural Network, is proposed as part of the research work to aid in the early diagnosis of COVID-19 infection in humans.
Several reasons went behind the selection of the CNN algorithm to address the classification problem such as COVID-19 diagnosis. As seen in Figure 3, many layers such as convolution, pooling, and Artificial Neural Network (ANN) form the architecture of the CNN. The pooling layers filter out the noise and prevent the ‘over-learning’ of the model during training. ANN uses the back-propagation algorithm, assigns random weight values, and processes the inputs with the help of an activation function until the lowest error is achieved; hence providing overall enhanced training. The input data is primarily RGB CXR 3D arrays, and the CNN proves to be a great algorithm to process this type of multi-dimensional input [19,20].
In the proposed CNN architecture, as seen in Figure 4, the first step is convolution. This step involves creating multiple convolution feature maps that eventually make up the convolution layers. Mathematically, a convolution feature map is obtained by multiplying the input 3D array with a Feature Detector of kernel size [3×3]. A feature detector is an image filter that helps identify various aspects of the input images such as bends, angles, and vertical/horizontal lines. Thirty-two feature detectors were incorporated into the proposed CNN to yield thirty-two [3×3] convolution feature maps.
To the convolution feature maps, the Rectified Linear Unit (ReLU) (Equation (1), Figure 5) activation function is applied to eventually obtain the convolutional layers.
F(x) = max (0, x); F(x) ∈ [0–∞]
The data created in the form of feature maps and convolution layers in the first step undergoes the next step: pooling. The spatial size of the input images is now progressively reduced to enhance the computation speed of the network by reducing the number of parameters. Each convolution feature map is worked upon individually to generate pooled layers. Mathematically, the pooled layers here are generated by applying the max-pooling operation to produce Pooled Feature Maps. The kernel size of the max-pooling array is [2×2]. The next step is flattening, where the pooled feature maps are further converted to 1D arrays to create a single long feature vector. The feature vector is the input to the ANN, thus forming a fully connected layer. The sigmoid (Equation (2), Figure 6) activation function is applied at the end of the ANN to obtain the desired binary outputs 0 or 1 depending on input processing.
F ( x ) = 1 1 + e x   ;   x     [ ]

2.3. Training and Calibrating the CNN Model

As seen in Figure 7, the proposed network has twelve hidden layers; five in the convolution, five in the pooling process (a total of ten in CNN), and two in the ANN. Dropouts are applied throughout CNN to reduce overfitting. The model is trained to provide binary outputs: 0 indicating COVID-positive and 1 indicating COVID-negative results for the patients. Adam Gradient Descent is chosen as the model optimizer to optimize the proposed CNN’s learning rate. To reduce the loss obtained through various training cycles or epochs, binary cross entropy is applied to the network.
The 3D input images were resized to (224,224) pixels for faster processing. A batch of thirty-two samples for testing and training datasets was used. The CNN is trained for a total of forty epochs or cycles. The steps per epoch for the training data were forty-eight, while the steps per epoch for the testing data were twelve.
A number of calibration techniques were experimented with and integrated into the proposed CNN architecture to yield optimized results:
  • Number of Epochs: The CNN architecture experimented with several epochs. An optimum number was determined by the trial-and-error method by observing the model accuracy and loss trends at the end of the training. The optimum number of epochs for the proposed architecture is forty.
  • Variance in the number of layers in the CNN and ANN: To increase the neural network’s learning and enhance backpropagation, the model experimented with a variable number of hidden layers in the CNN and ANN. The proposed model currently uses twelve hidden layers: ten in the CNN structure and two in the ANN.
  • Regularization: One of the most significant issues in AI models is overfitting. Several trials were run using varying dropout rates for each hidden layer to overcome overfitting in the proposed model. The current model uses dropout rates between 0.25 and 0.5 for various CNN and ANN layers.
  • Loss Function: Since the architecture is based on solving a classification problem and uses a sigmoid activation function at the output, the binary cross entropy loss function was used to reduce the overall loss and increase the learning rate of the neural network.

2.4. Validation of the CNN Model

A different dataset, called the validation dataset, was created to evaluate the proposed CNN for its accuracy and performance in diagnosing COVID-19 infection in patients. The dataset comprised CXR images of three hundred patients whose clinical diagnosis results for the COVID-19 infection were known. These were obtained from data repositories in Kaggle, EIBIR, and GitHub. The 300 CXR samples were then run through the proposed CNN and cross-checked against their clinical results. This process led to further classification of the cross-checked samples into the following parameters [9,21,22,23,24,25]:
  • True Positive TP: Number of correctly predicted COVID-19 positive cases;
  • False Positive FP: Number of incorrectly predicted COVID-19 positive cases;
  • True Negative TN: Number of correctly predicted standard cases;
  • False Negative FN: Number of incorrectly predicted standard cases.
These parameters were significant in calculating various statistical performance metrics such as accuracy, precision, recall, specificity, and F1 score for the proposed architecture.
Accuracy (Equation (3)) is the competency of the proposed CNN to detect COVID-19 positive and COVID-19 negative results in patients correctly. This also gives an insight into how efficiently the proposed CNN has learned the diagnosis through various epochs of training and testing.
Accuracy = T P + T N T P + F P + T N + F N
Recall (Equation (4)) is the sensitivity of the model in diagnosing COVID-19 infection in the patients.
Recall = T P T P + F N
Precision (Equation (5)) is the model’s ability to understand various levels of variations for COVID-19-positive cases. It is the ratio of the correctly predicted COVID-19 positive cases to the total number of model-diagnosed COVID-19 positive cases.
Precision = T P T P + F P
Specificity (Equation (6)) is the ratio of correctly predicted COVID-19 negative cases to the total number of COVID-19 negative cases. This performance metric helps to understand the true COVID-19 negatives in the sample size of the validation dataset.
Specificity = T N T N + F P
F1 score (Equation (7)) is the weighted average of two competing metrics: precision and recall. It takes both positives and negatives into consideration to determine the quality of the diagnosis of COVID-19 infection in the sample size.
F 1 - Score = 2   P r e c i s i o n R e c a l l P r e c i s i o n + R e c a l l

3. Results

3.1. Training and Learning of the CNN

The model is trained using the input train and test datasets and is evaluated for loss and accuracy for the running epochs. Table 2 lists the obtained results after the training was completed for the first and the last five epochs.
Figure 8 and Figure 9 depict the training characteristics of the proposed CNN. As seen in Figure 8, the model accuracy for the training samples increases with the number of epochs and shows an increasing linear trend. This implies the correct number of layers used in the CNN model. A linear decreasing trend for the training loss is seen in Figure 9. A significant error is observed in the first epoch. Since it is the first time the model is exposed to the input sample, the model calculates a high loss, as expected with any model working with unsupervised learning. This loss reduces as the model reiterates its learning through back propagation to obtain the lowest error.
Figure 10 and Figure 11 depict the testing characteristics of the proposed CNN. As seen in Figure 10, the model accuracy for the testing samples also increases with the number of epochs and shows an increasing linear trend. A linear decreasing trend for the testing loss is seen in Figure 11.
Figure 12 summarizes the average accuracies and losses for the training and testing samples as calculated by the model after completing the training for forty epochs. The accuracy for the training and testing samples is 95%, while the losses are 14% and 16%, respectively. This could result from the difference in the number of layers in the output layer and the ANN.

3.2. Statistical Performance Evaluation of the CNN

As described in Section 2.4, 300 CXR samples in the validation dataset were tested in the proposed CNN and cross-checked against their clinical results as part of the validation process. While testing the validation samples in the model, it was vital to keep a few points in mind to obtain optimum results:
  • Resizing the input 3D RGB image to (224,224,3);
  • Importing the computer vision 2.0 library;
  • Rounding off the decimal results to either 0 or 1, the problem statement was depicted as binary classification (0 implying COVID-19 positive, 1 implying COVID-19 negative).
After testing the validation dataset, the results were further classified into various parameters previously defined in Section 2.4. These parameters were True Positive, False Positive, True Negative, and False Negative.
As seen in Figure 13, the model correctly predicted:
  • 155 out of 163 new samples of COVID-19-positive cases;
  • 130 out of 138 new samples of COVID-19-negative/normal cases;
And the model incorrectly predicted:
  • 7 out of 163 new samples of COVID-19-positive cases;
  • 8 out of 138 new samples of COVID-19-negative/normal cases.
Figure 13. Evaluation metric characteristics for CXR input samples.
Figure 13. Evaluation metric characteristics for CXR input samples.
Electronics 11 03975 g013
Various statistical performance metrics were calculated for the proposed CNN using Equations (3)–(7) and the parameters as discussed in Section 2.4. As seen in Figure 14, the proposed CNN has an overall accuracy of 95%, precision of 96%, specificity, recall, and F1 score of 95% each, in diagnosing the COVID-19 infection in patients through CXR samples.

4. Discussion

4.1. Proposed CNN in Comparison with Existing DL Algorithms

As seen in Figure 14, the proposed CNN has an overall accuracy of 95% and a precision of 96% in diagnosing COVID-19 infection in patients. The time taken to generate these results was real-time. The model also has a specificity, recall, and F1 score of 95% each, thus depicting a high caliber detection quality among varying CXR samples. Upon comparing existing models and deep learning algorithms that used CXR as input samples for diagnosing COVID-19 infection in humans, the proposed CNN shows quite promising performance, as seen in Table 3.
Several DL-based models were proposed in this field where researchers have used either CXRs or CT as a primary bio-imaging modality to diagnose COVID-19 infection in patients. A majority of those models attained an accuracy of more than 80%. However, most of these models were trained with a small number of train/test datasets limiting the model’s scope and ability to segregate complex (severe) infection cases. Additionally, researchers used approaches such as transfer learning, data augmentation using GANs, and image processing techniques such as image rotation and lightning transformations to compensate for the lack of big and good-quality data. This trend is observed for various models such as ResNet18, XceptioNet, 3-class CoroNet, ResNet50, ResNet101, DenseNet201, MobileNet V2, and InstaCovNet-19, as seen in Table 3. Some researchers combined both CXRs and CTs as input datasets (training and testing) to try to optimize the performance statistics of the DL models. One such model is the AlexNet, which used a total of 531 input images (CXR: 170; CT: 361). Out of these input images, CXR: 85 and CT: 203 were of the COVID-19-infected patients. The accuracy obtained for this model was 98%; however, the input size of the infected patients was relatively very small.
As seen in Table 3, CNN models such as MobileNet V2, Inceptionresnetv2 and InstaCovNet-19 have higher accuracy and precision as compared to the proposed model. Additionally, the InstaCovNet-19 is by far from the most accurate model developed, with an accuracy of 99.08% in detecting COVID-19 infection using CXR input samples of patients. The size of the dataset used for models such as MobileNet V2 and InstaCovNet-19 is approximately three times lower (726 samples), and for Inceptionresnetv2 is approximately nineteen times lower as compared to the dataset used in the proposed CNN model (1920). Moreover, various data augmentation techniques such as searing, flipping and zooming were applied to the dataset to increase the sample size and enhance the network’s learning. The relatively larger data and data augmentation techniques cause a more realistic training of the model, thus yielding a slightly lower accuracy and precision in comparison to InstaCovNet-19 and MobileNet V2.
In addition, the proposed model was tested and validated for 300 new samples that were a random mix of both COVID-infection and normal (healthy) subjects yielding high accuracy and efficiency in detecting the infection in the validation subjects. This makes the proposed CNN a highly reliable, fast, and accurate tool in clinical practice for diagnosing and predicting COVID-19 infection in patients and asymptomatic individuals as well as for inputs with large variances.

4.2. CXR in Comparison to Other Medical Imaging Modalities

Research indicates that CT scans provide promising results in diagnosing COVID-19 infection in the lungs, especially in its initial stages [26,27,28,29,30]. However, some significant drawbacks entail its viability:
  • Extended exposure of patients to X-rays, especially children, can be very harmful;
  • Limitations in the available CT scans, quality, and accuracy of data—which can be a big hindrance in developing ML-based models that solely rely on the quality and quantity of the inputs;
  • Health and safety concerns for the asymptomatic and early-stage patients getting exposed to extended X-ray photons seem to be a rational medical debate.
Another widely used imaging modality, Lung Ultrasound, on the other hand, is radiation-free and cheaper [27]. However, these are not widely used in the DL/CNN models due to the extensive lack of accurate data [31,32,33]. Additionally, a few more focal drawbacks entail the viability of this modality:
  • Prolonged exposure and interaction between the operator and the patient, thus increasing the spread of a highly contagious infection;
  • Lower sensitivity and accuracy as compared to CXR/CT inputs.
Various other imaging modalities that show potential to be used for diagnosing COVID-19 infection in humans are discussed in Table 4 [9,18,19,20,21,32]. These can also be interpreted as future directions to the proposed research work.

4.3. Feasibility Study of the Proposed CNN and Future Prospective

The proposed CNN has proved to be a viable DL algorithm to help solve the COVID-19 diagnosis classification problem using CXR as inputs. By converting the final output to binary, we could easily classify whether a specific CXR is of a healthy or of a COVID-infected patient. In light of a highly contagious infection, the biggest strength of the proposed CNN is the non-requirement of human intervention in the diagnosis process. This, as mentioned earlier, is not the case for the existing RT-PCR and Antigen tests where a medical operator or nurse is required to perform the tests. Human interaction significantly increases the risk of infection in symptomatic and asymptomatic individuals.
The software to develop the CNN algorithm is readily available and no expensive equipment is involved as opposed to various testing apparatuses required in the case of conventional methods of diagnosis. Once the training is complete, the CNN models are fast, quick, and accurate in determining the diagnosis results, thus alleviating an immense strain on the hospitals. Moreover, corrective and preventive action can be taken immediately upon receiving results in case of positive infection—thus helping to limit the spread of the infection. The proposed CNN can be altered and extrapolated for its use in diagnosing other lung infections, such as pneumonia and bacterial infections, with relevant training algorithms and inputs.
The COVID-19 infection is a novel viral infection, and an absence of historical data is a given. For ML-based CNN models that rely entirely on the input data, the lack of quality big data is a severe impediment as it prevents proper training of the model, thereby increasing the inaccuracy of the results. However, using various data augmentation techniques such as zooming, searing, tilting, flips (horizontal/vertical), and Gaussian filters, the lack of data can be compensated up to a certain degree during data modeling. This was attempted in the proposed model to enhance its learning. Moreover, data companies such as GitHub and Kaggle have started initiatives to create online global datasets inviting everyone to add to their libraries and to use.
The use of other bio-imaging modalities as input datasets such as CT scans, Lung Ultrasounds and Heat Maps gives the immense potential for CNN to assess for better insights on the severity of the infection and other relevant medical diagnoses.
The proposed CNN uses a sigmoid activation function at the ANN that rounds off the values and gives the binary output as 0 or 1. This can be remodeled in the CNN to give decimal outputs to understand the severity of the infection. A concept of Corona Severity Score can be introduced [9,18] and the network can be trained to help determine the correct course of medical action depending on the infection severity. Once a large, good-quality dataset was set up, enhanced use of transfer learning to overcome data standardization issues seems like the next low-hanging fruit in the prospects of diagnosis of COVID-19 through ML-based models.

5. Conclusions

An automated diagnostic tool using the CNN algorithm to help with a faster, more accurate, and precise diagnosis of COVID-19 infection in patients and asymptomatic individuals was proposed in the research work. Identifying and issuing the correct course of medical action is a crucial measure, especially in the case of asymptomatic individuals. This is key in breaking the chain in highly contagious COVID-19 infection—and the proposed diagnostic tool provides a promising solution. The CNN uses a dataset of 1920 CXR samples for testing and training and 300 CXR samples for validation and cross-checking its performance. Several statistical performance metrics for the proposed model were calculated and observed as Accuracy 95%, Precision 96%, Specificity 95%, Recall 95%, and F1 score 95%, which are incredibly reliable results compared to other published literature models for the considered input sample size. The research work also entails critical discussions on the architecture of the proposed model and its performance for new samples and provides a detailed feasibility analysis of deploying CNN in detecting novel viral infections such as COVID-19 infection, the potential of using other bio-imaging modalities as inputs, as well as discusses the prospects of the proposed CNN.

Author Contributions

Conceptualization, R.S. and A.K.M.; methodology, A.K.M. and R.S.; software, A.K.M.; validation, R.S., A.K.M. and M.S.; formal analysis, A.K.M. and R.S.; investigation, A.K.M.; resources, R.S. and A.K.M.; data curation, A.K.M.; writing—original draft preparation, A.K.M.; writing—review and editing, A.K.M., R.S., M.S. and S.S.; visualization, A.K.M. and S.S.; supervision, R.S.; project administration, R.S., S.S., M.S. and S.S.; funding acquisition, R.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable, as no ethical approvals were required for this research work.

Informed Consent Statement

Not applicable, as no humans or patients participated in this study. The CXRs used in the research are available on free data hub websites such as Kaggle, GitHub which are also referenced at relevant areas of the manuscript.

Data Availability Statement

1. https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia (accessed on 21 February 2022); 2. https://www.kaggle.com/prashant268/chest-xray-covid19-pneumonia/ (accessed on 18 February 2022); 3. Available online: https://github.com/ieee8023/covid-chestxray-dataset (accessed on 21 January 2022).

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

References

  1. COVID ‘Long Haulers’: Long-Term Effects of COVID-19. Available online: https://www.hopkinsmedicine.org/health/conditions-and-diseases/coronavirus/covid-long-haulers-long-term-effects-of-covid19#:~:text=A%20bad%20case%20of%20COVID,is%20possible%2C%20but%20takes%20time (accessed on 3 March 2022).
  2. Nabavi, S.; Ejmalian, A.; Moghaddam, M.E.; Abin, A.A.; Frangi, A.F.; Mohammadi, M.; Rad, H.S. Medical Imaging and Computational Image Analysis in COVID-19 Diagnosis: A Review. Comput. Biol. Med. 2021, 135, 104605. [Google Scholar] [CrossRef]
  3. How Are Diseases Transmitted? Available online: https://www.healthline.com/health/disease-transmission#direct-contact (accessed on 3 March 2022).
  4. Use and Care of Masks. Available online: https://www.cdc.gov/coronavirus/2019-ncov/prevent-getting-sick/about-face-coverings.html (accessed on 3 March 2022).
  5. Stewart, E.H.; Davis, B.; Clemans-Taylor, B.L.; Littenberg, B.; Estrada, C.A.; Centor, R.M. Rapid Antigen Group A Streptococcus Test to Diagnose Pharyngitis: A Systematic Review and Meta-Analysis. PLoS ONE 2014, 9, e111727. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  6. Pascarella, G.; Strumia, A.; Piliego, C.; Bruno, F.; Del Buono, R.; Costa, F.; Scarlata, S.; Agrò, F.E. COVID-19 diagnosis and management: A comprehensive review. J. Intern. Med. 2020, 288, 192–206. [Google Scholar] [CrossRef] [PubMed]
  7. Wiersinga, W.J.; Rhodes, A.; Cheng, A.C.; Peacock, S.J.; Prescott, H.C. Pathophysiology, Transmission, Diagnosis, and Treatment of Coronavirus Disease 2019 (COVID-19): A Review. JAMA 2020, 324, 782–793. [Google Scholar] [CrossRef] [PubMed]
  8. Afshar, P.; Heidarian, S.; Naderkhani, F.; Oikonomou, A.; Plataniotis, K.N.; Mohammadi, A. COVID-CAPS: A capsule network-based framework for identification of COVID-19 cases from X-ray images. Pattern Recognit. Lett. 2020, 138, 638–643. [Google Scholar] [CrossRef]
  9. Abumalloh, R.A.; Nilashi, M.; Ismail, M.Y.; Alhargan, A.; Alghamdi, A.; Alzahrani, A.O.; Saraireh, L.; Osman, R.; Asadi, S. Medical image processing and COVID-19: A literature review and bibliometric analysis. J. Infect. Public Health 2022, 15, 75–93. [Google Scholar] [CrossRef]
  10. Chest MRI of Patients with COVID-19. Available online: https://pubmed.ncbi.nlm.nih.gov/33727149/ (accessed on 10 March 2022).
  11. Data Visualization in Python with Matplotlib, Seaborn and Bokeh. Available online: https://machinelearningmastery.com/data-visualization-in-python-with-matplotlib-seaborn-and-bokeh/ (accessed on 10 March 2022).
  12. Mooney, P. Chest X-ray Images (Pneumonia). Kaggle. 2018. Available online: https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia (accessed on 21 February 2022).
  13. Patel, P. Chest X-ray (COVID-19 & Pneumonia). Kaggle. 2020. Available online: https://www.kaggle.com/prashant268/chest-xray-covid19-pneumonia/ (accessed on 18 February 2022).
  14. Cohen, J.P. IEEE8023/COVID-Chestxray-Dataset: We are Building an Open Database of COVID-19 Cases with Chest X-ray or CT Images. GitHub. 2020. Available online: https://github.com/ieee8023/covid-chestxray-dataset (accessed on 21 January 2022).
  15. Huang, Y.; Cheng, W.; Zhao, N.; Qu, H.; Tian, J. CT screening for early diagnosis of SARS-CoV-2 infection. Lancet Infect. Dis. 2020, 20, 1010–1011. [Google Scholar] [CrossRef] [Green Version]
  16. Mondal, M.; Bharati, S.; Podder, P. Diagnosis of COVID-19 Using Machine Learning and Deep Learning: A Review. Curr. Med. Imaging Former. Curr. Med. Imaging Rev. 2021, 17, 1403–1418. [Google Scholar] [CrossRef]
  17. Majidi, H.; Niksolat, F. Chest CT in patients suspected of COVID-19 infection: A reliable alternative for RT-PCR. Am. J. Emerg. Med. 2020, 38, 2730–2732. [Google Scholar] [CrossRef]
  18. Borghesi, A.; Zigliani, A.; Golemi, S.; Carapella, N.; Maculotti, P.; Farina, D.; Maroldi, R. Chest X-ray severity index as a predictor of in-hospital mortality in coronavirus disease 2019: A study of 302 patients from Italy. Int. J. Infect. Dis. 2020, 96, 291–293. [Google Scholar] [CrossRef]
  19. Chua, F.; Armstrong-James, D.; Desai, S.R.; Barnett, J.; Kouranos, V.; Kon, O.M.; Jose, R.; Vancheeswaran, R.; Loebinger, M.R.; Wong, J.; et al. The role of CT in case ascertainment and management of COVID-19 pneumonia in the UK: Insights from high-incidence regions. Lancet Respir. Med. 2020, 8, 438–440. [Google Scholar] [CrossRef] [Green Version]
  20. Clinical Utility of Perfusion (Q)-Single-Photon Emission Computed Tomography (SPECT)/CT for Diagnosing Pulmonary Embolus (PE) in COVID-19 Patients with a Moderate to High Pre-Test Probability of PE. Available online: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7505736/ (accessed on 10 March 2022).
  21. WHO. WHO Coronavirus Disease COVID-19 Dashboard. Available online: https://covid19.who.int (accessed on 15 March 2022).
  22. Revel, M.-P.; Parkar, A.P.; Prosch, H.; Silva, M.; Sverzellati, N.; Gleeson, F.; Brady, A. COVID-19 patients and the radiology de-partment–advice from the European society of radiology (ESR) and the European society of thoracic imaging (ESTI). Eur. Radiol. 2020, 30, 4903–4909. [Google Scholar] [CrossRef] [Green Version]
  23. Rodrigues, J.; Hare, S.; Edey, A.; Devaraj, A.; Jacob, J.; Johnstone, A.; McStay, R.; Nair, A.; Robinson, G. An update on COVID-19 for the radiologist-A British society of Thoracic Imaging statement. Clin. Radiol. 2020, 75, 323–325. [Google Scholar] [CrossRef] [Green Version]
  24. Nair, A.; Rodrigues, J.; Hare, S.; Edey, A.; Devaraj, A.; Jacob, J.; Johnstone, A.; McStay, R.; Denton, E.; Robinson, G. A British Society of Thoracic Imaging statement: Considerations in designing local imaging diagnostic algorithms for the COVID-19 pandemic. Clin. Radiol. 2020, 75, 329–334. [Google Scholar] [CrossRef]
  25. Raptis, C.A.; Hammer, M.; Short, R.G.; Shah, A.; Bhalla, S.; Bierhals, A.J.; Filev, P.D.; Hope, M.D.; Jeudy, J.; Kligerman, S.J.; et al. Chest CT and Coronavirus Disease (COVID-19): A Critical Review of the Literature to Date. Am. J. Roentgenol. 2020, 215, 839–842. [Google Scholar] [CrossRef]
  26. Duan, Y.-N.; Zhu, Y.-Q.; Tang, L.-L.; Qin, J. CT features of novel coronavirus pneumonia (COVID-19) in children. Eur. Radiol. 2020, 30, 4427–4433. [Google Scholar] [CrossRef] [Green Version]
  27. Nasir, M.U.; Roberts, J.; Muller, N.L.; Macri, F.; Mohammed, M.F.; Akhlaghpoor, S.; Parker, W.; Eftekhari, A.; Rezaei, S.; Mayo, J.; et al. The role of emergency radiology in COVID-19: From preparedness to diagnosis. Can. Assoc. Radiol. J. 2020, 71, 293–300. [Google Scholar] [CrossRef] [Green Version]
  28. Li, B.; Li, X.; Wang, Y.; Han, Y.; Wang, Y.; Wang, C.; Zhang, G.; Jin, J.; Jia, H.; Fan, F.; et al. Diagnostic value and key features of computed tomography in Coronavirus Disease 2019. Emerg. Microbes Infect. 2020, 9, 787–793. [Google Scholar] [CrossRef] [Green Version]
  29. Bao, C.; Liu, X.; Zhang, H.; Li, Y.; Liu, J. Coronavirus Disease 2019 (COVID-19) CT Findings: A Systematic Review and Meta-analysis. J. Am. Coll. Radiol. 2020, 17, 701–709. [Google Scholar] [CrossRef]
  30. Salehi, S.; Abedi, A.; Balakrishnan, S.; Gholamrezanezhad, A. Coronavirus Disease 2019 (COVID-19): A Systematic Review of Imaging Findings in 919 Patients. Am. J. Roentgenol. 2020, 215, 87–93. [Google Scholar] [CrossRef]
  31. Fan, L.; Li, D.; Xue, H.; Zhang, L.; Liu, Z.; Zhang, B.; Zhang, L.; Yang, W.; Xie, B.; Duan, X.; et al. Progress and prospect on imaging diagnosis of COVID-19. Chin. J. Acad. Radiol. 2020, 3, 4–13. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  32. Liu, H.; Liu, F.; Li, J.; Zhang, T.; Wang, D.; Lan, W. Clinical and CT imaging features of the COVID-19 pneumonia: Focus on pregnant women and children. J. Infect. 2020, 80, e7–e13. [Google Scholar] [CrossRef] [PubMed]
  33. Yang, R.; Li, X.; Liu, H.; Zhen, Y.; Zhang, X.; Xiong, Q.; Luo, Y.; Gao, C.; Zeng, W. Chest CT Severity Score: An Imaging Tool for Assessing Severe COVID-19. Radiol. Cardiothorac. Imaging 2020, 2, e200047. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Healthy human CXRs used in the training of the CNN model [12,13,14].
Figure 1. Healthy human CXRs used in the training of the CNN model [12,13,14].
Electronics 11 03975 g001
Figure 2. COVID-19-infected CXR samples used in the training of the CNN model [12,13,14].
Figure 2. COVID-19-infected CXR samples used in the training of the CNN model [12,13,14].
Electronics 11 03975 g002
Figure 3. Block Diagram of CNN model.
Figure 3. Block Diagram of CNN model.
Electronics 11 03975 g003
Figure 4. Proposed CNN architecture.
Figure 4. Proposed CNN architecture.
Electronics 11 03975 g004
Figure 5. Graphical representation of the ReLU activation function.
Figure 5. Graphical representation of the ReLU activation function.
Electronics 11 03975 g005
Figure 6. Graphical representation of the sigmoid activation function.
Figure 6. Graphical representation of the sigmoid activation function.
Electronics 11 03975 g006
Figure 7. Proposed network model.
Figure 7. Proposed network model.
Electronics 11 03975 g007
Figure 8. Graph showing train accuracy vs. epoch characteristics.
Figure 8. Graph showing train accuracy vs. epoch characteristics.
Electronics 11 03975 g008
Figure 9. Graph showing train loss vs. epoch characteristics.
Figure 9. Graph showing train loss vs. epoch characteristics.
Electronics 11 03975 g009
Figure 10. Graph showing test accuracy vs. epoch characteristics.
Figure 10. Graph showing test accuracy vs. epoch characteristics.
Electronics 11 03975 g010
Figure 11. Graph showing test loss vs. epoch characteristics.
Figure 11. Graph showing test loss vs. epoch characteristics.
Electronics 11 03975 g011
Figure 12. Trained model characteristics.
Figure 12. Trained model characteristics.
Electronics 11 03975 g012
Figure 14. Evaluation metrics for the proposed model.
Figure 14. Evaluation metrics for the proposed model.
Electronics 11 03975 g014
Table 1. Input Data Split and Classification.
Table 1. Input Data Split and Classification.
Input DatasetAbnormal (COVID +ve)Normal (COVID −ve)
Training (80%)768 samples768 samples
Testing (20%)192 samples192 samples
Table 2. Results obtained after training was complete.
Table 2. Results obtained after training was complete.
EpochTime (s)Train LossTrain AccuracyTest LossTest Accuracy
1820.69610.53840.69290.5
2700.45710.78520.22670.9427
3700.2660.90430.18290.9479
4690.21470.92710.15320.9531
5690.20280.93030.15090.9583
36680.05790.97920.13270.9479
37680.04820.98440.19210.9349
38680.05330.98110.09370.9688
39680.06990.97270.19090.9193
40680.05410.98240.140.9427
Table 3. Performance comparison for the proposed architecture with existing models.
Table 3. Performance comparison for the proposed architecture with existing models.
Sr. No.Proposed ModelNumber of CXR InputsAccuracy (%)Precision (%)
1VGG-19N: 8066, C:3588383.1
2ResNet18N:50, C:5087.2895.91
3ResNet101N:200, C:18087.37-
4XceptionNetN: 50, C:5088.7489.18
53-class CoroNetN:500, C:50090.2192
6ResNet50 (Fine Tuning)N: 200, C:18092.63-
7InceptionV3N:127, C:25490.26-
8DenseNet201N:50, C:5090.5697.85
9Proposed CNN ModelN: 960, C:9609596
10Inceptionresnetv2N:50, C:5097.1898.64
11MobileNet V2N:365, C:3619897.6
12InstaCovNet-19N:365, C:36199.0899
Table 4. Potential bio-imaging modality inputs for CNN models.
Table 4. Potential bio-imaging modality inputs for CNN models.
Sr. No.Imaging ModalityResearcher Comments
1IRT (Infrared Thermography)
  • Detects asymptomatic carriers and internal body temperature; however, it does not provide any information about vital physiological characteristics such as tissue deformities, respiratory functions, and cardiovascular abnormalities, which can be essential in understanding the extent and severity of COVID-19 infection.
2SPECT (Single Photon Emission Computerized Tomography)
  • The symptoms indicated are bilateral parenchymal ground glass opacities, pleural effusions, and pneumomediastinum.
  • This modality has a high clinical utility for a smaller sample size of patients with COVID-19 diagnosing pulmonary embolus.
3F-FDG PET (Positron Emission Tomography)
  • This entails considerable restrictions in testing in a broader group population due to equipment limitations, time taken to perform, and increased interaction between the patient and the operator.
  • However, this modality shows high potential in testing complex cases and providing deeper insights into the nature, behavior, and consequences of COVID-19 infection in patients.
4MRI (Magnetic Resonance Imaging)
  • A viable alternative if a CXR/CT scan is not available.
  • Instead of appearing as consolidated opacities, the infection appears cloudy in these scans. MRI generates additional data, such as thoracic spine MRI and cardiac MRI that can help detect signs of viral pneumonia and COVID-19 infection in asymptomatic individuals.
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Mehta, A.K.; Swarnalatha, R.; Subramoniam, M.; Salunkhe, S. A Convolutional Neural Network for COVID-19 Diagnosis: An Analysis of Coronavirus Infections through Chest X-rays. Electronics 2022, 11, 3975. https://doi.org/10.3390/electronics11233975

AMA Style

Mehta AK, Swarnalatha R, Subramoniam M, Salunkhe S. A Convolutional Neural Network for COVID-19 Diagnosis: An Analysis of Coronavirus Infections through Chest X-rays. Electronics. 2022; 11(23):3975. https://doi.org/10.3390/electronics11233975

Chicago/Turabian Style

Mehta, Avani Kirit, R. Swarnalatha, M. Subramoniam, and Sachin Salunkhe. 2022. "A Convolutional Neural Network for COVID-19 Diagnosis: An Analysis of Coronavirus Infections through Chest X-rays" Electronics 11, no. 23: 3975. https://doi.org/10.3390/electronics11233975

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop