key: cord-0685122-o4qvou7s authors: Panahi, Amirhossein; Askari Moghadam, Reza; Akrami, Mohammadreza; Madani, Kurosh title: Deep Residual Neural Network for COVID-19 Detection from Chest X-ray Images date: 2022-02-21 journal: SN Comput Sci DOI: 10.1007/s42979-022-01067-3 sha: d6c334ba54c4e7537ed684b4d254efef43ceac19 doc_id: 685122 cord_uid: o4qvou7s The COVID-19 diffused quickly throughout the world and converted as a pandemic. It has caused a destructive effect on both regular lives, common health and global business. It is crucial to identify positive patients as shortly as desirable to limit this epidemic’s further diffusion and to manage immediately affected cases. The demand for quick assistant distinguishing devices has developed. Recent findings achieved utilizing radiology imaging systems propose that such images include salient data about the COVID-19. The utilization of progressive artificial intelligence (AI) methods linked by radiological imaging can help the reliable diagnosis of COVID-19. As radiography images can recognize pneumonia infections, this research brings an accurate and automatic technique based on a deep residual network to analyze chest X-ray images to monitor COVID-19 and diagnose verified patients. The physician states that it is significantly challenging to separate COVID-19 from common viral and bacterial pneumonia, while COVID-19 is additionally a variety of viruses. The proposed network is expanded to perform detailed diagnostics for two multi-class classification (COVID-19, Normal, Viral Pneumonia) and (COVID-19, Normal, Viral Pneumonia, Bacterial Pneumonia) and binary classification. By comparing the proposed network with the popular methods on public databases, the results show that the proposed algorithm can provide an accuracy of 92.1% in classifying multi-classes of COVID-19, normal, viral pneumonia, and bacterial pneumonia cases. It can be applied to support radiologists in verifying their first viewpoint. COVID-19, a recent kind of Coronavirus, has formed a powerful crucial chaotic circumstance, negatively affecting a high number of deaths and people's lives universal. It initially seemed in Wuhan, China, in December 2019. It has expanded to most of the other countries. In several countries, managers and governments have utilized new measures and planned new lifestyles to oppose COVID-19. Today's medicine and technology have created a precious contribution to implementing nations' new strategies in this new and unpredictable manner [1, 2] . The death rate is rising alarmingly everywhere globally, needing an immediate response to distinguish and limit this disease's fast spread. Because of having no particular medications and ways, the circumstance has grown scary to billions of people [3] . While researchers in the medical area promote vaccines to stop the virus, several doctors and medical applications are being improved to treat infected cases and limit them from moving on to others [4] . Reverse transcription-polymerase chain reaction (RT-PCR), the common generally applied the specific test of COVID-19, suffers from low sensation in initial steps with an extended test period supporting further transportation [5] . Moreover, the severe inadequacy of this valuable test kit exacerbating the condition. Therefore, X-rays and Computer Tomography (CT) scans are ordered for all patients with possible pneumonia symptoms for quicker investigation and separation of the infected patients. The signs of COVID-19, which being like the viral disease, can sometimes lead to an incorrect examination in the current state while clinics are overloaded. In the nowadays modern era, several biomedical health tasks and complexities, such as the detection of a tumor, breast cancer diagnosis and pneumonia detection using Chest X-ray, are applying Artificial Intelligence [6] [7] [8] . Deep learning methods can report image features that are not visible in the initial images. Especially, Convolutional Neural Network (CNN) has been established notably profitable in feature learning and extraction and, accordingly, generally utilized by the analysis center [9] . CNN was utilized to recognize the type of pulmonary nodules, automatic labeling, pediatric pneumonia analysis, and medical image analysis from videos [10] [11] [12] . Deep learning methods on chest X-Rays are becoming popular among the accessibility of deep CNNs and the encouraging results in many uses. Furthermore, there is plenty of data possible for training various CNN's models. The transfer learning method has remarkably helped the process by immediately retraining deep CNN networks, including an approximately low number of images. The COVID-19 epidemic's fast increase has required the need for expertise in this field. This has heightened attention in promoting automatic diagnosis methods based on AI devices. It is challenging to implement specialist clinicians in each hospital due to the inadequate number of radiologists. Hence, an easy, reliable, and quick AI technique should help overcome this difficulty and give patients suitable support. In addition, radiologists perform an essential task due to their wide knowledge in this domain; the AI systems in radiology can help achieve correct investigation [12] . Also, AI programs can help eliminate disadvantages such as costs and deficient number of possible RT-PCR test kits [13] . Most of the researches in the literature is classified into two types (COVID-19 vs. normal cases). But, few papers discussed multi-classes. Furthermore, the current researches in the state-of-the-art discuss the classification of three classes. This paper not only proposed classification of two and three classes but also classified four classes (COVID-19, Normal, Viral and Bacterial Pneumonia). Additionally, each class compare and analyze with other classes, which is also dropping in most of the researches. In this study, an intelligence detection COVID-19 virus detection architecture based on the CNNs and machine learning methods was suggested. The suggested architecture makes certain an end-to-end learning plan which can straightly acquire a knowledge of discriminative features from the chest X-ray images. Therefore, the contributions of the authors are summed up as follows. -the use of a deep residual network to recognize COVID-19 causes, viral pneumonia, bacterial pneumonia, and normal classes using a CXR image was suggested. -the proposed network has been trained independently to specify between: • COVID-19 vs normal cases. • Normal, COVID-19, and viral pneumonia classes. • COVID-19, viral and bacterial pneumonia classes. • COVID-19, viral and bacterial pneumonia and normal classes. -the performances of the proposed network have been evaluated due to the accuracy, sensitivity, and specificity. The rest of the paper is designed as follows. In the next section, the authors have explained more about some recent related works. In the subsequent section, the materials and methods of the current research have been presented, such as the detail of the dataset and model. Then the final results and related discussion have been presented. In the last section, the conclusion of this research have been presented. Newly, some research groups have announced deep learning methods using X-ray images for recognizing COVID-19 virus. A fine-tuned SqueezeNet pre-trained network with Bayesian optimization was proposed by Ucar et al. to classify COVID-19 images cases that showed assuring results on a small dataset [14] . Khan et al. utilized the transfer learning model on normal, bacterial pneumonia, viral pneumonia, and COVID-19 pneumonia images [15] . Ioannis et al. published a transfer learning strategy for classifying 1427 X-ray images containing Bacterial Pneumonia, COVID-19, and Normal X-ray images with specificity, accuracy, and sensitivity of 96.46%, 96.78%, and 98.66%, respectively [16] . Ashfar et al. suggested a Capsule Networks named COVID-CAPS trained with a smaller dataset [17] . COVID-CAPS was presented to obtain 95.7% accuracy, a 90% sensitivity, and 95.8% specificity. Abbas et al. have worked on a minimal database of COVID-19, Normal, and SARS X-ray images to identify COVID-19 X-ray images using a modified pre-trained CNN model to calculate the high-dimension feature range toward a lower one [18] . This could assist in creating more homogenous classes, decrease the memory demands, and attain accuracy, sensitivity, and specificity of 95.12%, 97.91%, and 91.87%. Wang and Wong proposed a deep CNN named COVID-Net to diagnosing of COVID-19 virus from about 14k chest X-ray images. But, the obtained accuracy was 83.5% [19] . To extract visual features from volumetric chest CT exams for detect COVID-19, Li et al. developed COVID-19 detection neural network (COVNet) and used datasets that collected from 6 hospital between August 2016 and February 2020 [20] . They achieved 90% sensitivity and 96% specificity and AUC of 0.96. Sethy and Behera used deep learning architecture ResNet50 and support vector machine to detect infected people and achieved 95.38% accuracy [21] . To detect coronavirus pneumonia-infected patient, Narin et al. used five pre-trained models (ResNet50, ResNet101, ResNet152, InceptionV3 and Inception-ResNetV2) and three different binary classifications with four classes (COVID-19, normal (healthy), viral pneumonia and bacterial pneumonia) using fivefold cross validation [22] . ResNet50 model achieved 96.1% accuracy among other models. Mahmud et al. proposed a deep convolution neural network based architecture (CovXNet) for automated COVID-19 and other pneumonia detection systems provide detection performance with accuracy of 90.2% for multi classification [23] . Chakraborty et al. classified COVID-19, Pneumonia, and Healthy cases from the chest X-ray images by applying the transfer learning approach on the pre-trained VGG-19 architecture [24] .They use a public dataset of 3797 X-ray images, among them COVID-19 affected (1184 images), Pneumonia affected (1294 images), and Healthy (1319 images) and achieved an accuracy of 97.11%, average precision of 97%, and average Recall of 97% on the test images. Verma et al. has classified the X-rays images into COVID-19 and normal using multi-model classification incorporates Support Vector Machine (SVM) in the last layer of VGG16 Convolution network [25] . For synchronization among VGG16 and SVM they have added one more layer of convolution, pool, and dense between VGG16 and SVM and compared their model with five existing models using different parameters and metrics. The result shows that this model reached accuracy up to 95%. Nikolaou et al. used a pre-trained baseline CNN (EfficientNetB0) which added a dense layer on top of it. They trained, validated, and tested the model on 15,153 X-ray images and their model differentiated COVID-19 from normal lungs with 95% accuracy, 90% sensitivity, and 97% specificity; it differentiated COVID-19 from other viral pneumonia and normal lungs with 93% accuracy, 94% sensitivity, and 95% specificity. A two-stage deep CNN-based scheme is proposed by Rashid et al. to detect COVID-19 from chest X-ray images [26] . In the first stage, an encoder-decoder-based autoencoder network is proposed, trained on chest X-ray images in an unsupervised manner, and the network learns to reconstruct the X-ray images. Finally, the encoder-merging network is trained for feature extraction of the X-ray images in a supervised manner and resulting features are used in the classification layers of the proposed architecture. Considering the final classification task, an EfficientNet-B4 network is utilized in both stages. An end to end training is performed for datasets containing classes: COVID-19, Normal, Bacterial Pneumonia, Viral Pneumonia. The proposed method achieves an accuracy of 90.13% on the 4-class, 96.45% on a 3-class, and 99.39% on 2-class classification. Goyal et al. propose a framework for the lung disease predictions like pneumonia and COVID-19 from the chest X-ray images of patients [27] . The framework consists of dataset acquisition, image quality enhancement, adaptive and accurate Region Of Interest (ROI) estimation, features extraction, and disease anticipation.For accurate detection of lung disease, deep learning architecture has been proposed using recurrent neural network (RNN) with long short-term memory (LSTM) and their framework achieves an accuracy of 95%. Three different procedures, described below, are studied in this study. We evaluate the proposed neural networks against the state-of-the-art network which have been used to solve the problem of classification of COVID-19. There are different datasets for the classification of X-ray images. In this paper, a well-known dataset have been used that contains three classes; COVID-19, Normal and Viral Pneumonia [28] . 1 The dataset consists of 1345 viral pneumonia cases, 10,200 normal cases and 3616 COVID-19 cases. Bacterial pneumonia images are obtained from the other online resource. 2 In this study, 1310 images have used for each class of binary classification. For the classification of three classes, 700 images were considered. For four classes, 450 images were considered for training and testing the proposed network. The distribution of the images existing in the dataset for dour classification part is reported in Table 1 . The four example images from the prepared dataset are presented in Fig. 1 . From each category, two images have chosen and joined them to these figures. Figure 1 gives the posteroanterior (P-A) P-A view of a COVID patient displaying hyperlucent lung areas that show lungs hyperinflation for the difficulty of tiny airways. Some piecemeal opalescences Page 4 of 10 SN Computer Science are observed in both lung sides, expressing strengthening created by bacterial infection. Image normalization with changing the images into an array and sorting them by 255 is prepared. It supports defining the scale of the image on a range of 0.0-1.0. It benefits in eliminating deformities produced by shadows and lighting in each image. Data augmentation is applied to handling unstable dataset issues [29] . By applying data augmentation, the training data is heightened to promote the training of the network. The following technique does the data augmentation in this work; a rotation range of 15 is utilized. Images are formed by rotating them on a given scale. 80% of the prepared dataset have been considered for training and 20% for testing phases. Skip-connections in CNN have several benefits in many tasks, especially in visual models, and can hold gain of the multi-level features [30, 31] . Here, we briefly use the notion of residual connectivity [32] . A residual connection block attaches a shortcut via specification mapping, making the model determine the residual function to return the initial non-linear conversion. As described in [31] , Residual block with identity mapping can be calculated by the following formula: where x i and x i+1 are input and output of the ith unit in the network, the function F(x, W i ) represents the residual mapping to be learned and W i are parameters of the block. The operation F + x is accomplished by element-wise addition and a shortcut connection. The dimensions of x and F must be equal in Eq. (1), Otherwise, to match the dimensions, a linear projection W s by the shortcut connections perform as follow: (1) Fig. 2 , residual connections can efficiently improve the stream of data among the network's head and base and ease the over-fitting difficulty. Also, the different mapping formation approximately does not prosper the network's parameter consumption, and the residual models are more comfortable with optimizing [31] . It is worrying that the original drawback associated with deep residual networks is the feature reuse issue in which some feature alterations or blocks may provide very little to learning features [33] . Deep residual networks is addressed for this issue [34] . They proposed that the chief learning ability of deep residual networks is due to the residual units, whereas depth has a supplementary effect. Deep ResNet utilized the residual blocks' capability by composing ResNet deeper rather than deeper network [31] . Deep ResNet developed the width by including an extra factor k, that manages the network's width scale. Widening of the layers in Deep ResNet illustrated that this network might implement a more significant efficiency enhancement system than by deepening the residual networks. This paper develops a deep Residual Network based on deep learning algorithm for the classification of chest X-ray images. In this proposed network, sixteen convolutional layers are applied. At the end, the Average-Pooling2D and fully connected dense layers have been used. The process flow of the proposed architecture is presented in Fig. 3 . As shown in Fig. 3 , Max-pooling and Batch-normalization layers are used. Also, the Softmax optimizer is utilized, which produces the prediction of each class of X-ray images in case of probabilities. Sparse-categorical-crossentropy is utilized in this research and applied as the purpose loss function for the training phase. This loss function is also applied here as a metric for evaluating the performance of the proposed method. Adam's optimization algorithm is applied for training the model [35] . 100 epochs, 28 batch sizes, and 0.001 for the learning rate have been applied for training and testing the proposed network. With weight decay in cases of initial learning rate/total number of epochs to train the network, Adam optimization is used. Weight decay benefits in quicker convergence and enhancing performance. The network is performed in Python2 using Keras framework 2.2.4 by Tensorflow 1.14.0 as the backend. Also, the device configuration is free-Google service. 3 To investigate each model's performance, different metrics have been presented, among which a confusion matrix have used. This matrix has four expected parameters; TP, TN, FP, FN, which mention the true positive, true negative, false positive, and false negative samples for any class, respectively. In addition, the other performance metrics defined as In this study, three different modes (two-class, three-class, and four-classes) using X-ray images have examined and categorized. In the case of two-class, the authors have divided the X-ray images of lung into two parts, COVID-19 and normal. Adding viral pneumonia to previous twoclass, we used proposed network to categorize these three states. The last case that we consider in this section is adding bacterial pneumonia and categorizing 4 different classes. In the following, the performance of the proposed network for three different categories will be examined. A comparison of performance between the network used, the well-known convolution networks,and the networks presented in other studies is shown in Table 2 . According to the data in Table 2 , the proposed network has shown significant performance compared to the networks introduced in some references. Figure 4a shows the configuration matrix for this state. Fortunately, the network has not detected any case of COVID-19 as normal, which is very desirable, and only one case of normal has been detected as COVID-19. For two-class classification, network accuracy has been reached 99.9% , which shows the high capability of network. In addition to COVID-19, viral pneumonia also affects human lung. To diagnose what kind of disease the patient has, in this section, three classes (Normal, COVID-19, and viral pneumonia) have been categorized. Table 3 compares the proposed network and other networks. Based on these data, the proposed network for the three class classification performed better than the state-of-art networks. Figure 4b shows the confusion matrix for this part. In addition to the mentioned classification, the three-class (COVID-19, viral and bacterial pneumonia) classification has also been The most challenging mode possible is to distinguish between COVID-19, normal, viral, and bacteria pneumonia. The comparison in Table 4 shows that the network used has higher accuracy and performance than the networks presented so far. According to the confusion matrix shown in Fig. 4d only 2 normal photos are not categorized correctly, which is acceptable. What matters in this picture is that viral pneumonia categorized as normal. The reason is images in the dataset has been difficult to identify even for radiologist in first glance. ROC curves in all mentioned classification problem are showing comparable performance as shown in Figs. 6 and 7. Fig. 5 , the proposed output on some example cases from the test set are shown. As can be seen, the proposed network accurately detects COVID-19 pneumonia. Due to the need for rapid diagnosis of COVID-19 pneumonia to prevent its spread, in our opinion, the proposed network can be used to help radiologists. COVID-19 disease now has a profound effect on the health systems and economies of many countries, causing thousands of deaths worldwide. Diagnosis of COVID-19 disease in the early stages of the disease is very important to treat it and prevent its spread. This study introduce a deep learning-based model which called deep RESNET to identify and classify COVID-19 and other type of pneumonia from X-ray images. The principal aim is to explain the following research issues: RQ1). Is there any Deep Learning system that precisely outperforms other Deep Learning methods? Q2). Can Deep Learning apply to detect COVID-19 from X-ray images? Q3). What is the characteristic accuracy that Deep Learning can be achieved based on X-ray images? RQ4). Can Deep Learning support in the efforts to precisely recognize and follow the progress of the COVID-19? For this purpose, the evaluations were handled using chest X-ray dataset. Furthermore, the results of these analyses were assessed using different performance metrics. Moreover, the obtained outcomes confirm that the proposed model presents more reliable outcomes than other structures and algorithms. Due to the tremendous achievement of this algorithm, it can be concluded that these results assist physicians in making decisions. The proposed model is completely automated with an end-to-end architecture without the requirement for hand-operated feature extraction. The classification accuracy of two-class classification, three-class classification, and four-class classification problem were 99.9%, 96.38%, and 92%, respectively, which has a higher accuracy than the mentioned state-of-the-art studies. The advanced network's achievement is evaluated by proficient radiologists and is available to experiment via a larger database. Estimation of covid-19 prevalence in Italy, Spain, and France Epidemiological and clinical characteristics of 99 cases of 2019 novel coronavirus pneumonia in Wuhan, china: a descriptive study The epidemiology and pathogenesis of coronavirus disease (covid-19) outbreak Death and contagious infectious diseases: Impact of the covid-19 virus on stock market returns Imaging of pulmonary viral pneumonia How far have we come? Artificial intelligence for chest radiograph interpretation Transfer learning with deep convolutional neural network (cnn) for pneumonia detection using chest x-ray A systematic approach to the design and characterization of a smart insole for detecting vertical ground reaction force (vgrf) in gait analysis Imagenet classification with deep convolutional neural networks Deep learning-based image conversion of CT reconstruction kernels improves radiomics reproducibility for pulmonary nodules or masses Identifying medical diagnoses and treatable diseases by image-based deep learning Application of artificial neural networks for automated analysis of cystoscopic images: a review of the current status and future prospects Chest CT for typical Corona virus disease 2019 (Covid-19) pneumonia: relationship to negative RT-PCR testing Covidiagnosis-net: Deep Bayes-squeezenet based diagnostic of the coronavirus disease 2019 (covid-19) from x-ray images Coronet: a deep neural network for detection and diagnosis of covid-19 from chest x-ray images Covid-19: automatic detection from x-ray images utilizing transfer learning with convolutional neural networks Covid-caps: a capsule network-based framework for identification of covid-19 cases from x-ray images Classification of covid-19 in chest x-ray images using detrac deep convolutional neural network Covid-net: a tailored deep convolutional neural network design for detection of covid-19 cases from chest x-ray images Artificial intelligence distinguishes Covid-19 from community acquired pneumonia on chest CT Detection of coronavirus disease (covid-19) based on deep features Automatic detection of coronavirus disease (covid-19) using x-ray images and deep convolutional neural networks Covxnet: a multi-dilation convolutional neural network for automatic covid-19 and other pneumonia detection from chest x-ray images with transferable multi-receptive feature optimization A transfer learning-based approach with deep cnn for covid-19-and pneumonia-affected chest x-ray image classification Covxmlc: high performance covid-19 detection on x-ray images using multi-model classification Autocovnet: unsupervised feature learning using autoencoder and feature merging for detection of covid-19 from chest x-ray images Detection and classification of lung diseases for pneumonia and covid-19 using machine and deep learning techniques Can AI help in screening viral and covid-19 pneumonia? Covid-19 imaging tools: how big data is big? Spectral-spatial residual network for hyperspectral image classification: a 3-d deep learning framework Deep residual learning for image recognition Delving deep into rectifiers: surpassing human-level performance on imagenet classification Training very deep networks. Advances in neural information processing systems Ldsinspired residual networks Adam: a method for stochastic optimization Automated detection of covid-19 cases using deep neural networks with x-ray images The authors declare that they have no conflict of interest.