key: cord-0829675-y66ec4is authors: Ahamed, Khabir Uddin; Islam, Manowarul; Uddin, Ashraf; Akhter, Arnisha; Paul, Bikash Kumar; Yousuf, Mohammad Abu; Uddin, Shahadat; Quinn, Julian M.W.; Moni, Mohammad Ali title: A deep learning approach using effective preprocessing techniques to detect COVID-19 from chest CT-scan and X-ray images date: 2021-11-04 journal: Comput Biol Med DOI: 10.1016/j.compbiomed.2021.105014 sha: 53d8bd3995d51b9c2ff5e2e47a7548e967b69b9c doc_id: 829675 cord_uid: y66ec4is Coronavirus disease-19 (COVID-19) is a severe respiratory viral disease first reported in late 2019 that has spread worldwide. Although some wealthy countries have made significant progress in detecting and containing this disease, most underdeveloped countries are still struggling to identify COVID-19 cases in large populations. With the rising number of COVID-19 cases, there are often insufficient COVID-19 diagnostic kits and related resources in such countries. However, other basic diagnostic resources often do exist, which motivated us to develop Deep Learning models to assist clinicians and radiologists to provide prompt diagnostic support to the patients. In this study, we have developed a deep learning-based COVID-19 case detection model trained with a dataset consisting of chest CT scans and X-ray images. A modified ResNet50V2 architecture was employed as deep learning architecture in the proposed model. The dataset utilized to train the model was collected from various publicly available sources and included four class labels: confirmed COVID-19, normal controls and confirmed viral and bacterial pneumonia cases. The aggregated dataset was preprocessed through a sharpening filter before feeding the dataset into the proposed model. This model attained an accuracy of 96.452% for four-class cases (COVID-19/Normal/Bacterial pneumonia/Viral pneumonia), 97.242% for three-class cases (COVID-19/Normal/Bacterial pneumonia) and 98.954% for two-class cases (COVID-19/Viral pneumonia) using chest X-ray images. The model acquired a comprehensive accuracy of 99.012% for three-class cases (COVID-19/Normal/Community-acquired pneumonia) and 99.99% for two-class cases (Normal/COVID-19) using CT-scan images of the chest. This high accuracy presents a new and potentially important resource to enable radiologists to identify and rapidly diagnose COVID-19 cases with only basic but widely available equipment. In 2019, the COVID-19 pandemic appeared as a dangerous infectious disease caused by the SARS-CoV-2 virus that can result in severe respiratory distress. The disease has caused millions of fatalities around the world since it was reported in Wuhan, China [1, 2] . COVID-19 has spread rapidly through human-to-human transmission since transmission of the virus can occur well before symptoms are evident. Over 130 million people worldwide have been infected at the time of writing [3] , representing an enormous healthcare burden. Infections by SARS-CoV cause symptoms broadly similar to those caused by the related severe acute respiratory syndrome coronavirus(SARS-CoV) and Middle East respiratory syndrome coronavirus (MERS-CoV), and range in severity from mild upper respiratory tract symptoms similar resembling a common cold to severe acute lifethreatening illness [4] . Among the latter symptoms include fever, headache, dry coughing and sore throat, severe pneumonia and acute respiratory distress syndrome(ARDS) that can often include severe hypoxia, and serious exacerbation of existing chronic pulmonary and respiratory conditions are often seen [5] . This virus has caused major public health and economic problems and is particularly dangerous to people with certain comorbidities such as diabetes, cardiovascular disease and asthma [6, 7, 8, 9, 10, 11, 12, 13] . Many early symptoms of COVID-19 are similar to those of the common cold and influenza making detection of early stage COVID-19 cases problematic. Vaccines specific for SARS-CoV-2 have been developed and have been widely employed, reducing infection rates and greatly improving patient survival, although many poorer countries have only recently begun to vaccinate in significant numbers, so waves or surges of infections are still being experienced. No other medication with high efficacy against COVID-19 has been developed, although a number of anti-inflammatory drugs and other re-purposed drugs have proved useful in reducing disease severity. Newly approved antivirals such as Merck's Molnupiravir are showing promise but currently are very expensive. These factors mean that spread of SARS-CoV-2 is hard to monitor, detect and overcome in less developed countries, particularly with the emergence of newer more infectious strains. Reverse transcription-polymerase chain reaction(RT-PCR) is currently the most commonly used for diagnosing COVID-19 patients, and is the only fully reliable method for detecting early stage (pre-symptom) SARS-CoV-2 infections. Cheaper antibody-based rapid tests are not reliable for early stage infections or those in immunosuppressed people. SARS-CoV-2 RT-PCR-based tests respiratory swabs from nasopharyngeal or oropharyngeal. although these may fail to identify COVID-19 cases in the early phases when viral load is low in the sampled tissues [14] . However, a more significant issue is that RT-PCR is expensive, requires highly developed facilities and technical expertise that in many countries there is limited accessibility outside of large towns. 2 J o u r n a l P r e -p r o o f Several researchers have previously shown that deep learning models trained on standard chest radiography images yield good accuracy in COVID- 19 predictions, an approach that may be able to complement RT-PCR tests and would be highly accessible. It may also be possible to detect early mild symptomatic cases that give false negative RT-PCR results due to low viral particle numbers in the upper respiratory tract. Two kinds of chest radiographic images have been used for this approach: X-ray & computed tomography (CT) [15, 16] . CT scans provide very fine detail but require substantially more radiation exposure than X-ray images and require high cost equipment [17] . X-ray images are more accessible to a wider population through widely available X-ray imaging facilities at low cost. CT scans can, however, provide finer image features in 3 dimensions and can feasibly be used to train a deep learning model to identify COVID-19 as they give very rich datasets. Therefore, we investigated deep learning models trained with datasets consisting of chest CT-scan and X-ray to determine whether this would be a viable alternative to RT-PCR in detecting or confirming COVID-19 cases. In this study, we review the literature related to chest image classifications. We have also investigated how effective deep learning approaches that employ chest X-ray and CT-scan images can classify potential COVID-19 cases. The proposed architecture was able to distinguish cases of COVID-19 from pneumonia cases and normal controls with a high level of accuracy. We propose that such deep CNN-based models trained on CT-scan and X-ray images could assist radiologists to make rapid, low cost and accessible diagnosis usefully early detection of infected patients at an early stage in the disease progression. The following is a summary of the main contributions: 1. We employed a preprocessing technique on the image dataset to enable the dataset to be accurately and efficiently analysed by our deep learning model. We developing an extended ResNet50V2-based deep learning model where fine-tuning was performed to facilitate rapid detection and diagnosis of COVID-19 cases with high accuracy. 3. Classifying COVID-19 patient images from normal and typical pneumonia cases by considering two, three and four class categories respectively. 4. We conducted a comparative performance analysis of our proposed methodology with other state-of-the-art approaches and showed that our model can identify COVID-19 cases with high accuracy using chest CT-scan and X-ray image datasets. The rest of this article is arranged as follows: Section 2 provides a comprehensive overview of the studies in the field. The methodology of the proposed work is presented in Section 3. Experimental results with discussion and dataset description are presented in Section 4. In Section 5, we present our conclusions and proposals for future development work. COVID-19 testing kits give a significant number of FN (false negative) so ideally need supplementing with an alternative rapid method to detect lower respiratory tract issues. This can be based on chest x-ray and CT scan imaging. In addition, in locations where RT-PCR testing is not available due to cost and lack of expertise availability, chest x-ray imaging often is available [18] . This makes it appropriate to use in COVID-19 diagnosis if 3 J o u r n a l P r e -p r o o f the patient has begun to progress with the disease and a differential diagnosis is needed to exclude other respiratory ailments. AI has proved effective for classifying a range of human activities [19] and AI use in the healthcare sector has risen dramatically in recent years, particularly in medical imaging technology. In imaging AI has particularly been used in the detection of cardiovascular diseases [20] and brain tumours [21] . In addition to these applications, there is now a move to use it in the diagnosis of COVID-19 cases, with CT scans and chest X-rays a common focus. There have been a number of suggestions that COVID-19 testing should be performed using RT-PCR methods and a machine learning analysis of chest imaging to accurately confirm COVID-19 cases, although the latter approach is unlikely to be suitable for rapid mass screening [22, 23, 24, 25, 26, 27] . Studies have identified key changes that can be seen in patient chest X-ray and CT-scan images after COVID-19 has developed [28] . Yoon et al. [29] stated that one in every three patients had a single nodular opacity on the left side of the lower lung. Kong et al. [30] reported that opacities of infrahilar airways were detected in the right side in a COVID patient. However, most studies have found that ground glass opacity (GGO) is the most frequent finding in COVID-19 case lung images. Widespread inflammation, thrombi and vascular ischaemic lesions and other intrusive lung illnesses are associated with GGO [31] . GGO and blended GGO were discovered in the majority of patients, as well as vascular dilatation with consolidation in the affected area, according to Zhao et al. [22] . Kanne et al. [32] observed that 50-75% patients had multifocal GGO as well as peripheral focal impacts on both lungs. Figure 1 shows an example image of a GGO case. Researchers in this area have suggested a number of deep learning architectures that can be trained with radiographic images to extract COVID-19 status since radiography images are readily available. This is similar to recent work on skin cancer identification from images [34] , pneumonia detection utilizing chest X-ray images t [35] , brain disorder classification [36] , lung segmentation [37] , detection of myocardial infarction [38] . These are just a few of the areas where Deep Learning methods have already been developed. Chen et al. [39] designed a VGG-16 deep transfer learning approach for identifying COVID-19 in chest Xray images, which took into account two classes: COVID-19 and Non-COVID-19. Gupta et al. [40] proposed InstaCovNet-19 that is an integrated stacking model. They used a variety of transfer learning frameworks, such as Nasnet, InceptionV3, Xception, Resnet101 and MobilenetV2. These models are integrated to form a stack-like 4 J o u r n a l P r e -p r o o f architecture. Furthermore, they used three separate classes for image classification and attained a higher accuracy. Jain et al. [41] employed an unbalanced database of three groups of 1345 normal cases, 3632 pneumonia cases, and 490 COVID-19 cases. They tested three architectures, including Xception net, ResNeXt and Inception net V3, and found that the Xception model had the highest accuracy of 97.97%. In [42] , an AlexNet with a combination of SVM framework was provided, with fine-tuning on the proposed design to distinguish COVID-19 instances from pneumonia and normal cases. Ouchicha et al. [43] presented a deep CNN model called CVDNet to distinguish COVID-19 infections from pneumonia and normal cases. To validate their system, they utilized a 5-fold crossvalidation technique. Ozturk et al. [33] presented an automated identification technique (DarkCovidNet) that worked on 2-class classification categories (COVID-19 cases vs. Normal) and a multi-class classification category (COVID-19 cases, Normal and Pneumonia cases) with a binary class accuracy of 98.08%. However, pre-processing actions on X-ray images were not considered in their study. For the detection of COVID-19, a framework based on the CNN technique was applied in [44] . Ghavami et al. [45] suggested a comprehensible artificial intelligent approach for identifying COVID-19 patients by considering COVID-19 patients, healthy patients, and non-COVID-19 lung infections utilizing chest CT scan data. A combined deep transfer learning architecture was presented [46] where they used 15 pre-trained convolutional neural networks (CNNs) models using chest CT-scan images. Li et al. [47] proposed a stacked auto-encoder based framework to classify covid-19 positive cases from the negative cases but they used a low amount of image data to train their model. Heidarian et al. [48] proposed a framework called COVID-fact that was trained with an unbalanced data set with three class categories, including covid-19, pneumonia cases and normal cases. Using CT-scan images, Xu et al. [49] proposed an architecture called "ResNet18 + Location attention" for identifying COVID-19 cases. Despite their efficient architecture, their overall accuracy level was only 86.7%, which was insufficient. Some studies have used a combination of chest CT scans and X-ray images to identify and treat COVID-19. Using a balanced dataset of chest CT-scan and X-ray images, Mukherjee et al. [50] suggested a CNN-based customized deep neural network (DNN) with extensive accuracy of 96.13 percent for X-ray and 95.83 percent for CT-scan. For identifying and diagnosing COVID-19, a standard tuned VGG-19 model was reported in [51] utilizing chest CT-scan & X-ray images. Ahsan et al. [52] proposed a pre-trained method to distinguish COVID-19 cases from non-COVID-19 cases obtaining an accuracy of 82.94 percent for CT-scan sample data and 93.94 for chest x-ray sample data. To distinguish COVID-19 from streptococcus and SARS virus infections, Dansana et al. [53] used an unbalanced dataset of x-ray and CT-scan images. They employed a tuned pre-trained VGG19 model, a pre-trained InceptionV3, and a decision tree classifier with the tuned VGG19 model. The model showed the highest accuracy (91%). Sedik et al. [54] combined machine learning and deep learning algorithms to identify and diagnose covid-19 cases from chest x-ray and ct-scan images. The authors applied two methods of data-augmentation that improve the learnability of the Convolutional Long Short-Term Memory and Convolutional Neural Networks based deep learning models. However, using machine learning (ML) methods has several limitations, including complexity, overfitting and poor performance while training with unbalanced datasets. The majority of the studies reviewed above used imbalanced datasets as well as a small database of COVID-5 J o u r n a l P r e -p r o o f 19 cases to train various machine learning models. Datasets of small size are likely to result in a CNN-based framework overfitting. As a result, the model would not report genuine and reliable classification performance outside the training datasets. Furthermore, many existing methods are trained and tested with raw images without any type of pre-processing, and augmentation. Thus, the network's generalization error is increased, and the training advantages are minimized. Moreover, the majority of the studies have used pre-trained approaches and trained their architectures using three or two classes. To overcome these issues, we constructed a balanced dataset and performed pre-processing and augmentation operations on the collected images instead of using raw images. Furthermore, in our study, a traditional deep learning model was modified and developed by fine-tuning effectively and optimizing the hyper-parameters to improve model robustness. In addition, multi-class comparisons among the image classes, such as four-class, three-class, and two-class categories made the suggested study more effective. This section describes data preprocessing, the CNN model and the proposed architecture which was implemented before conducting experiments to assess performance. The overview of the proposed methodology is illustrated in Figure 2 . In this block diagram, chest CT-scan and X-ray images are used as input for the suggested COVID-19 case detection method. Next, the collected images are preprocessed by considering resizing, cropping and filtering techniques. After that, augmentation of the image data is performed. Finally, the model was trained and tested with the clinical datasets. The proposed model was built from the base deep learning model named ResNet50V2. In this study, this model was developed by adding extra layers to its base network. The added layers were modified by applying regularization and effective fine-tuning processes to make the experiment more robust and efficient. Moreover, this model can classify the images based on binary class, three class and four class categories. The original size of the collected images had different pixels for different images. The inputs for the pre-trained models on ImageNet will be smaller or equal to 224*224. In the case of transfer learning, the inputs must be suited to the pre-trained model. Thus, for rigorous investigation purposes, all images were scaled down to 224*224 pixels to make the training model faster. In this study, cropping and sharpening filters of image processing techniques were applied to the collected datasets to enhance the images before feeding those images into the CNN model. However, cropping methods were only applied on the CT scan images in order to extract the main part of the lung image, i.e., removing the unwanted irrelevant parts of the images. The CT scan images were cropped by considering the proper height and width ratio. Figure 4 shows the original and cropped image of the CT scan. A sharpening filter was then used to filter all of our collected images for enhancement. The concept of this filter comes from Laplacian filters picture or image highlights the regions of rapid intensity change and is an illustration of a 2 nd order or 2 nd a derivative system of enhancement [55] . This can be traditionally derived according to equation Figure 2 : Block Diagram of Proposed methodology. Here, Now, from equation 1 we get the following output presented in equation 2. From the equation 2, a mask can be generated. Hence, the desired mask is represented in Figure 3 (a). Besides that mask, other types of Laplacian mask/filter also exist [56] . In this study, one of the variants of the Laplacian filter is used. The filter used in this study is shown in Figure 3 (b). From the given Laplacian filter, the intensity value is measured as the sum of center point of the mask along with the rest of the point that is computed as follows: Here, the intensity value "0" is found from the mask by adding the centre value and the other corresponding values. Again, when an original image is filtered through this mask, this produces a dark image where only the edge of the image is found for the 0-intensity value. Figure 4 shows the changes of the original image after applying the Laplacian mask. The original image can then be generated using the following rules given in equations 3 and 4. Here, g (x, y) represents the output filter after performing the expected operation. Therefore, if the center value of the Laplacian filter is less than zero then it follows the equation 3 Now from the equation 5, the generated mask or filter is presented in Figure 3 (c). The generated filter is also called the sharpening filter. This filter is used to sharpen as well as highlight the edges of the images. Besides this, it makes a transition between features, more recognizable and obvious compared to smooth noisy and blurry images. Instead of gathering new data, practitioners can use data augmentation to significantly boost the diversity of the data samples for the training models. Image augmentation approaches may help to reduce network generalization errors, improve training amenities, and address data overfitting concerns. In this article, augmentation methods [57] on image data were used to create the diversity of images based on rescaling, zooming, horizontal flipping and shearing operations. These procedures were carried out using the functionality of the ImageDataGenerator from TensorFlow, Keras framework. In the image data augmentation settings, the values of the above mentioned criteria following rescaling = 1./255, zoom_range = 0.2, shear_range = 0.2 and horizontal_flip = True. Some samples of augmented images are presented in Figure 5 . The suggested model methodology is based on a deep transfer learning architecture. Researchers have recently become interested in using transfer learning-based CNN models to handle a variety of computer vision problems. Over the previous few decades, these models have been widely employed in medical disease diagnostics [58] , J o u r n a l P r e -p r o o f and agriculture [59, 60] . A CNN-based transfer learning architecture was developed and applied for chest CT-scan and X-ray image classifications in this research. The convolution layer is the main building block of a CNN (convolutional neural network). Rather than basic matrix multiplication, it performs a convolution operation, denoted by a*. Its parameters are constructed using a collection of learnable filters, often known as kernels. The purpose of this layer is to find features in the native regions of input samples (here, the images) and produce a feature map that diminishes the presence of the observed features in the input data. The basic convolution operation can be written according to equation 6. Here, I refers to an input matrix (such as an image), m x n represents dimension, and K represents a 2D filter. The kernel is another name for K. The outcome of the 2D characteristic map is F. F is generated by convolving input I with K. Therefore, I * K specifies the convolution action. Where * indicates a discrete convolution process. The matrix k scans over the input matrix while taking the stride parameter into account. Furthermore, for the construction of non-linearity, the results of each layer of the convolution are compiled utilizing a function called the activation function. Various types of activation functions have lately been used more commonly, with ReLU (rectified linear unit) being one of the most well-known in the deep learning field. The activation function is usually calculated by normalizing the input to zero in ReLU. ReLU also produces 0 output if the input is less than 0 and the raw output if the input is more than 0. Equation 7 can be used to represent it mathematically. So, if the input value of the x is less than zero, then the function f(x) returns 0; if the input value of the x is larger than or equal to zero, the function f(x) returns 1. Pooling layers are an important part of the convolution layer sequences in a CNN. These layers reduce spatial dimensions of the input data by collecting the outputs of the neuron bunches at one layer and turning them into a single neuron at the next layer. Pooling layers entail sliding a 2-D(dimensional) filter over each channel of the feature map and summarizing the features within the filter field of coverage. The dimensions of a feature map can be written as n h xn w xn c , and the output dimensions after a pooling layer operation can be derived using the given formula. ( Here, n h signifies the feature map height, n w indicates the feature map width, and n c specifies the number of channels utilized in the feature map, where f is filter size and s is stride length. Max pooling, L2-norm pooling, global pooling layers and average pooling are some of the pooling layers utilized in convolutional neural networks. Compared to other pooling techniques, max pooling delivers the maximum value while being employed in the input zone. The fully connected layer is a fundamental part of CNN where the entire neuron from the former layer is connected to the entire neuron in the following layer and then conveys to the vaticination of how nearly every value matches with every particular class. The final FC (fully connected) layer output is then coupled with a function called "activation function", which provides output class scores. CNN employs a variety of classifiers, including Sigmoid, SVM (support vector machine), SoftMax etc. SoftMax, as indicated in equation 9, may calculate the probability distribution of n number of output categories. Here, the input vector is marked as x, n denotes the number of classification classes while the output vector is labelled as Z, here, k = 1,. . . ,n. The sum of all outputs (Z) is equivalent to one. The Softmax classifier is used in this model to classify the input chest CT-scan and X-ray images. A CNN-based transfer learning architecture was developed and used in this study. Transfer learning defines as a machine learning technique that takes previously learned knowledge (a pre-trained model) and applies it to a new problem that is related [61] . Using a traditional CNN model has some shortcomings, such as not working effectively with insufficient data, as well as being time-consuming and costly in data labelling and learning. Transfer learning methods can readily deal with insufficient data in these circumstances and alleviate model completion time. The proposed model of this study is created by extending and tuning the ResNet50V2 CNN architecture. ResNet50V2 [62] is an improved version of ResNet-50 that outperforms than ResNet50 and ResNet101 on the ImageNet datasets. An adjustment or modification was conducted to the extended formulation of the links within blocks in ResNet50V2. Again, deeper models are better at extracting features in general. However, due to the characteristics or diversity of feed-forward (passing inputs to the architecture to obtain a forecasting result from complicated computations in the framework) and the back-propagation (weights of the parameter upgrade on the grounds of the prediction outcome), which is also the particle of testing deep learning models, heavily deep models are hard to train due to vanishing or exploding gradients. ResNets overcome this shortcoming by forming a residual link, which reduces the influence of vanishing or exploding gradients and hence improves the performance of very deep models. ResNet50V2 has eliminated the very last non-linearity, resulting in an input-to-output path that resembles the identity connection depicted in Figure 6 . The suggested basic model ResNet50V2 has fifty deeper layers and 25,613,800 parameters, according to [63] . The Batch Normalization is usually referred to as bn_norm ("Batch Norm"). Recently this has been utilized in the deep learning field broadly. Batch normalization (BN/bn_norm) is a method that transforms the inter-layer outputs of the neural networks into conventional ordination, and it's called normalizing. This approach effectively 'resets' the output distributions of the previous layer, allowing the current layer to be processed more efficiently. Batch normalization increases Neural Network performance during training, avoids overfitting, and provides regularization. The term "padding" is associated with convolutional neural networks since it represents the number of pixel values that are added to a photo or image whenever it is created by the segment of a CNN. Padding works by expanding the measurement range of convolutional neural networks. "Kernel" is the general name for the neural networks filter. It scans over each pixel in the target image and transforms the data samples or values into a larger or smaller format. To facilitate the kernel in managing the photo or image, padding is assembled to the picture frame to give the kernel enough room to cover the image. Incorporating padding to a CNN-processed image allows for more obvious image analysis. In order to make the proposed model more feasible, effective and robust, we further developed the fundamental architecture of the pre-trained ResNet50V2 by adding extra four layers. Firstly, we modify the top layer of the original ResNet50V2 to set the custom input of the images. Secondly, several layers are concatenated with the pre-trained ResNet50V2 network. Finally, regularization and effective fine-tuning operations were performed on the additional layers. As illustrated in Figure 7 , one flatten layer, then one dropout, and after that two fc (Fully Connected) dense layers were assembled with the base architecture of ResNet50V2. The flatten layer receives data from the previous layer and converts the data into a 1-D (one-dimensional) array, which was fed to the next layer as input. The output of the preceding convolutional layer was flattened to produce a single feature vector. The proposed model was flattened to allow for rapid feedforward execution. Figure 8 shows an example of a flattening procedure. and ImageNet weights with the Adam optimizer [64] , batch size with 32, learning rate with 1e-5, dropout ratio 0.5. In addition, the model utilized an activation function named SoftMax to classify the images into both two-class and multiclass categories. There were a total of 49, 256, 196 parameters in the suggested model, including 49,210,756 trainable and 45,440 non-trainable parameters. Table 1 shows the output shape of the developed architecture along with a concise model summary. repository "Chest X-Ray Images (Pneumonia)" offered by Paul Mooney [66] . Figure 10 The proposed framework was implemented in Keras with the Tensor flow GPU support. The entire experiment, training, as well as testing, was carried out in the Google Colaboratory environment, which includes a Tesla T4 cases, normal controls and CAP cases considering three and two class categories respectively. Four metrics were utilized in this study to evaluate the performance of the proposed architecture. The evaluation was performed with respect to the accuracy, sensitivity(recall), precision and f1-score. The mathematical formulae for these metrics are presented in the equations below 10,11,12 and 13 respectively. P recision = T P (T P + F P ) (11) where TN, FN, TP, FP and represent true-negative, false-negative, true-positive and false-positive respectively. Furthermore, the loss function was applied in this study to assess the effectiveness of the predicted model. The model was trained using a categorical cross-entropy loss. The loss function was also utilized to reduce the cost of the model parameters. The loss function will be reduced by increasing the number of epochs. Equation 14 expresses the mathematical interpretation of the loss function. Here, Y = True label,Ŷ = Predicted Labels & L(Y,Ŷ ) = Loss function. A five-fold cross-validation technique was applied on four, three and binary class classifications. For each of the cases, 80 percent of the data is allotted for training and 20 percent for validation. As shown in Figure 11 , the operations are repeated five times. Figure 11 : Schematic illustration of five -fold cross validation approach. The performance results on the chest x-ray image dataset were evaluated for four, three and two class categories using a five-fold cross-validation approach based on the given performance metrics in 4.3. As demonstrated in Table 2 , the overall performance was obtained by averaging the values of each fold. The classification performance results of fold-3 using 4-class and 3-class classification are presented in Figure 12 and 13. Again, the performance results of fold-2 using 2-class classification are presented in Figure 14 . The fivefold cross-validation approach was not applied on some sub-class categories. The sub-classes are experimented with just once, where we classify 2-class COVID-19 vs pneumonia with bacterial infection cases and COVID-19 vs normal control cases) and 3-class (COVID-19 vs pneumonia with viral infection vs normal control cases). The class-wise performance results are presented in Table 3 . The performance analysis presented in the Figure 15 where the red bar represents precision, green and blue represent recall or sensitivity and f1-score respectively. The cross-validation approach is applied for some classes including 4-class, 3-class (COVID19 vs pneumonia with bacterial infection vs normal control cases) and 2-class (COVID19 vs pneumonia with viral infection cases). The accuracy of each fold for the mentioned classes is presented in Figure 16 (a) where the blue line represents the 4-class, orange line and green line represent the 3-class and 2-class respectively. The average accuracy of these classes is plotted in Figure 16 (b). Using a five-fold cross-validation approach based on the stated performance metrics in 4.3, the performance results on the chest CT-scan image dataset were evaluated on three class categories. As demonstrated in Table 4 , the overall performance was obtained by averaging the values of each fold. The classification performance results of fold-1 using 3-class classification are presented in Figure 17 . The fivefold cross-validation approach was not applied on some sub-class categories. The sub-classes are experimented with just once, where we classify 2-class classifications including COVID-19 vs CAP and COVID-19 vs normal control cases. The class-wise performance results are presented in Table 5 . The classification performance analysis reported in Table 4 shows that the proposed model achieved an overall average accuracy of 99.012% on 3-class with high levels of average precision, recall and f1-score of 99.066%, 99.066% and 99.00% on 3-class respectively, while categorizing COVID-19, cases with CAP and normal images. Again from and f1-score value for both classifications. Figure 18 (b) depicts the average precision, recall, and f1-score of all category classes, where the red bar represents precision, the green and blue bars represent recall or sensitivity, and the f1-score, respectively. As the cross-validation approach is applied on the 3-class, so in this case, the accuracy of each fold on that class is presented in Figure 18 In this study, the results of the proposed model were compared with other pre-trained models and some recent state-of-the-art studies from this field. The proposed model was first compared with other pre-trained models that included VGG19, ResNet50 and InceptionV3. In these cases, comparisons were performed by considering both the two datasets of chest CT-scan and X-ray images with four class and three class classifications. In four class classifications, the classifications were performed on images of COVID-19, viral pneumonia, bacterial pneumonia and uninfected (normal) control cases. Three-class classifications compared COVID-19, pneumonia and normal cases, while another 3three-class classification category compared COVID-19, community-acquired pneumonia and normal control cases. The comparisons between the proposed model and the other pre-trained models are demonstrated in Table 6 . Thus, it is shown from Table 6 that, when the models are trained without using preprocessed data they produce low accuracy as well as low precision, recall and f1-score value, compared to models trained with preprocessed data. On the other hand, the proposed model achieved comprehensively high accuracy, specifically 96.452% for four class categories, 97.242% for three class categories using chest x-ray images and 99.012% for three class categories using chest CT-scan images. Moreover, the precision, recall and f1-score values achieved using the proposed model were also very high, as shown in Table 6 . Thus, it is evident that effective preprocessing on image data and development of the pre-trained "ResNet50V2" model can result in the proposed architecture being far more effective and robust. CT-scan images. J o u r n a l P r e -p r o o f data containing viral pneumonia but our proposed model did (Table 7 ) not only considering data that included viral pneumonia but also comparing data from other different categories and achieved superior accuracy when compared to their work on the three classes. Ozturk et al. [33] proposed DarkCovidNet, an automated COVID-19 identification system using x-ray images of the chest that attained 98.08% for binary classes considering normal cases and COVID-19 cases and 87.02% accuracy for three classes combining pneumonia cases with the other cases. For their raw data, they did not use any augmentation procedures. As data augmentation improves the robustness of the deep learning model, the proposed model in this study applied augmentation techniques on the raw images and obtained better results as demonstrated in Table 7 better results from their model as shown in Table 7 . Our proposed study obtained 99.012% accuracy for three classes comprising COVID-19, CAP cases, normal cases, 99.99% for two classes considering normal cases and COVID-19 cases using chest CT-scan images as presented in Table 7 . Besides this, our model achieved an accuracy of 99.99% for two classes considering COVID-19 cases and CAP cases using CT-scan images as presented in 4.4.2, Table 5 . Heidarian et al. [48] proposed a model named COVID-FACT to identify COVID-19 using CT-scan images where they achieved an accuracy of 90.82% for three-class classification. A combined architecture ResNet + Location attention was built by Xu et al. [49] to identify COVID-19 patients using chest CT-images. They worked on three-class classifications and obtained a lower accuracy of 86.7% due to using the old architecture of ResNet. Shalbaf et al. [46] worked on 15 pre-trained models to identify COVID-19 cases from non-COVID-19 cases and achieved a lower accuracy of 85.0% using CTscan images. Mukherjee et al. [50] proposed CNNs-tailored deep neural networks to identify COVID-19 cases from non-COVID cases by using both the ct and x-ray images of the chest. The aforementioned studies did not deal with more patient data. Moreover, using pre-trained models did not make their model more robust. Therefore, our proposed model employed more patient data with a balanced dataset of CT-scan images for the experiment and developed a pre-trained model to make the model more robust and obtain better accuracy compared to these studies, as demonstrated in Table 7 . In sum, the encouraging and promising results of our proposed model in the identification of COVID-19 cases from CT-scan and X-ray images suggest that deep learning could play an important role in combating the current pandemic in the near future. Although we collected a large number of X-ray and CT-scan images to train our model, the model needs to be evaluated with a large number of patient images from different countries to ensure its robustness. To enhance the collected images, we sharped the images through a sharpening filter. To improve the accuracy and robustness of the model, advanced image processing techniques such as hybrid filtering (combination of several filters) need to be incorporated. We used ResNet50V2 as our base model and also added some extra layers to it. Generally, ResNet50V2 is a deeper model, and by adding some new layers to the existing layers, the proposed architecture 28 J o u r n a l P r e -p r o o f becomes more deep and complex. Although deeper models perform well in feature extraction, training the model with a large dataset is time-consuming. Hence, in future, we intend to build a deep learning model that might have low complexity and be more feasible and robust. SARS-CoV-2 is a serious continuing threat to human health, but the shortage of testing resources in many countries limits patient testing. Thus, alternative strategies may be needed to aid the rapid diagnosis of COVID-19 patients. Hence, we examined a deep learning framework based on the ResNet50V2 architecture and effective preprocessing techniques identification and classification of COVID-19 cases using CT-scan and X-ray images. The architecture was examined using a balanced and updated dataset collected from different open sources. The model was capable of working with both the binary class and the multiclass classifications. Performance analysis shows that this model performed well on the prepared datasets. This raises the possibility that this or a similar image analysis approach can assist radiologists and clinicians in the diagnosis of COVID-19, and provide timely services to patients and thereby help to limit community transmission. Future research will focus on federated learning and Blockchain technology to establish a distributed trust-less COVID-19 detection protocol. Author correction: A new coronavirus associated with human respiratory disease in china Tclustvid: a novel machine learning classification model to investigate topics and sentiment in covid-19 tweets Covid-19 coronavirus cases A review of covid-19 (coronavirus disease-2019) diagnosis, treatments and prevention Severe acute respiratory syndrome coronavirus 2 (sars-cov-2) and coronavirus disease-2019 (covid-19): The epidemic and the challenges Transcriptomic studies revealed pathophysiological impact of covid-19 to predominant health conditions Bioinformatics and system biology approach to identify the influences of covid-19 on cardiovascular and hypertensive comorbidities Bioinformatics and system biology approaches to identify the diseasome and comorbidities complexities of sars-cov-2 infection with the digestive tract disorders Bioinformatics and system biology approach to identify the influences of sars-cov-2 infections to idiopathic pulmonary fibrosis and chronic obstructive pulmonary disease patients Covid-19 patient transcriptomic and genomic profiling reveals comorbidity interactions with psychiatric disorders Covid-hero: Machine learning based covid-19 awareness enhancement mobile game for children Diseasome and comorbidities complexities of sars-cov-2 infection with common malignant diseases Short-term prediction of covid-19 cases using machine learning models Imaging of pulmonary viral pneumonia Convolutional neural network model to detect covid-19 patients utilizing chest x-ray images Vulnerability in deep transfer learning models to adversarial fast gradient sign attack for covid-19 prediction from chest radiography images Artificial intelligence distinguishes covid-19 from community acquired pneumonia on chest ct Ct imaging features of 2019 novel coronavirus (2019-ncov) View-invariant deep architecture for human action recognition using twostream motion and shape temporal dynamics Detecting cardiovascular disease from mammograms with deep learning Brain tumor classification using deep cnn features via transfer learning Relation between chest ct findings and clinical conditions of coronavirus disease (covid-19) pneumonia: a multicenter study Coronavirus disease 2019 (covid-19): role of chest ct in diagnosis and management A machine learning model to identify early stage symptoms of sars-cov-2 infected patients Predicting patient covid-19 disease severity by means of statistical and machine learning analysis of clinical blood testing data Machine learning approaches to identify patient comorbidities and symptoms that increased risk of mortality in covid-19 Machine learning approach to predicting covid-19 disease severity based on clinical blood test data: Statistical analysis and model development A familial cluster of pneumonia associated with the 2019 novel coronavirus indicating person-to-person transmission: a study of a family cluster Chest radiographic and ct findings of the 2019 novel coronavirus disease (covid-19): analysis of nine patients treated in korea Chest imaging appearance of covid-19 infection Differential diagnosis and management of focal ground-glass opacities Essentials for radiologists on covid-19: an update-radiology scientific expert panel Automated detection of covid-19 cases using deep neural networks with x-ray images Dermatologist-level classification of skin cancer with deep neural networks Chexnet: Radiologist-level pneumonia detection on chest x-rays with deep learning Convolutional neural networks for multi-class brain disease detection using mri images Lung segmentation on high-resolution computerized tomography images using deep learning: A preliminary step for radiomics studies Myocardial infarction detection based on deep neural network on imbalanced data, Multimedia Systems Detecting covid-19 in chest x-rays using transfer learning with vgg16 Instacovnet-19: A deep learning classification model for the detection of covid-19 patients using chest x-ray Deep learning based detection and analysis of covid-19 on chest x-ray images Covidetectionet: Covid-19 diagnosis system based on x-ray images using features selected from pre-learned deep features ensemble Cvdnet: A novel deep learning architecture for detection of coronavirus (covid-19) from chest x-ray images Mapping the landscape of artificial intelligence applications against covid-19 Accurate and rapid diagnosis of covid-19 pneumonia with batch effect removal of chest ct-scans and interpretable artificial intelligence Automated detection of covid-19 using ensemble of transfer learning with deep convolutional neural network based on ct scans Stacked-autoencoder-based model for covid-19 diagnosis on ct images Covid-fact: A fully-automated capsule network-based framework for identification of covid-19 cases from chest ct scans A deep learning system to screen novel coronavirus disease 2019 pneumonia Deep neural network to detect covid-19: one architecture for both ct scans and chest x-rays A deep learning framework to detect covid-19 disease via chest x-ray and ct scan images Study of different deep learning approach with explainable ai for screening patients with covid-19 symptoms: Using ct scan and chest x-ray image dataset Early diagnosis of covid-19-affected patients based on x-ray and computed tomography images using deep learning algorithm Deploying machine and deep learning models for efficient data-augmented detection of covid-19 infections Chapter 4 -efficient medical image enhancement technique using transform hsv space and adaptive histogram equalization Multidimensional Signal, Image, and Video Processing and Coding A survey on image data augmentation for deep learning Comprehensive electrocardiographic diagnosis based on deep learning Deep learning for big data applications in cad and plm-research review, opportunities and case study Detecting and counting pistachios based on deep learning A study on cnn transfer learning for image classification Identity mappings in deep residual networks Adam: A method for stochastic optimization Covid-19 radiographydatabase Chestx-rayimages(pneumonia) Large covid-19 ct scan slice dataset Coronet: A deep neural network for detection and diagnosis of covid-19 from chest x-ray images 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 Detection of covid-19 cases by utilizing deep learning algorithms on x-ray images Detection of coronavirus disease (covid-19) based on deep features J o u r n a l P r e -p r o o f Highlights:The following is a summary of the main contributions: Performing an effective preprocessing technique on collected images to make the dataset of images fit for the proposed deep learning model properly. Developing an extended ResNet50V2 based deep learning model where finetuning has been performed to rapidly detect and diagnose COVID-19 infected cases with higher accuracy. Classifying COVID-19 images from normal and typical pneumonia cases by considering two, three and four class categories respectively. Conducting comparative performance analysis of the suggested work with other preceding state-of-the-art efforts by identifying the COVID-19 cases with the most flawless classification findings using chest CT-scan and X-ray image datasets.