key: cord-0903440-2t4bpm6e authors: Elzeki, Omar M.; Shams, Mahmoud; Sarhan, Shahenda; Abd Elfattah, Mohamed; Hassanien, Aboul Ella title: COVID-19: a new deep learning computer-aided model for classification date: 2021-02-18 journal: PeerJ Comput Sci DOI: 10.7717/peerj-cs.358 sha: 6be0c63d0cf34deae3237265a65507e1966172a4 doc_id: 903440 cord_uid: 2t4bpm6e Chest X-ray (CXR) imaging is one of the most feasible diagnosis modalities for early detection of the infection of COVID-19 viruses, which is classified as a pandemic according to the World Health Organization (WHO) report in December 2019. COVID-19 is a rapid natural mutual virus that belongs to the coronavirus family. CXR scans are one of the vital tools to early detect COVID-19 to monitor further and control its virus spread. Classification of COVID-19 aims to detect whether a subject is infected or not. In this article, a model is proposed for analyzing and evaluating grayscale CXR images called Chest X-Ray COVID Network (CXRVN) based on three different COVID-19 X-Ray datasets. The proposed CXRVN model is a lightweight architecture that depends on a single fully connected layer representing the essential features and thus reducing the total memory usage and processing time verse pre-trained models and others. The CXRVN adopts two optimizers: mini-batch gradient descent and Adam optimizer, and the model has almost the same performance. Besides, CXRVN accepts CXR images in grayscale that are a perfect image representation for CXR and consume less memory storage and processing time. Hence, CXRVN can analyze the CXR image with high accuracy in a few milliseconds. The consequences of the learning process focus on decision making using a scoring function called SoftMax that leads to high rate true-positive classification. The CXRVN model is trained using three different datasets and compared to the pre-trained models: GoogleNet, ResNet and AlexNet, using the fine-tuning and transfer learning technologies for the evaluation process. To verify the effectiveness of the CXRVN model, it was evaluated in terms of the well-known performance measures such as precision, sensitivity, F1-score and accuracy. The evaluation results based on sensitivity, precision, recall, accuracy, and F1 score demonstrated that, after GAN augmentation, the accuracy reached 96.7% in experiment 2 (Dataset-2) for two classes and 93.07% in experiment-3 (Dataset-3) for three classes, while the average accuracy of the proposed CXRVN model is 94.5%. On 31 December 2019, pneumonia of unknown cause found in Wuhan, China, was first confirmed to China's WHO Country Office, and the disease was named COVID-19 by WHO (World Health Organization, 2020) . The WHO declared the Chinese outbreak of COVID-19 on 30 January 2020 to be a public health emergency of international concern posing a high risk to countries with weak healthcare systems. The emergency committee reported that COVID-19 could be stopped by early detection, isolation, timely care, and the implementation of a reliable communication monitoring system (World Health Organization, 2020; Sohrabi et al., 2020) . An essential step in combating COVID-19 is the successful monitoring of infected patients, enabling those infected to seek prompt diagnosis and care, as well as being isolated to reduce the spread of the virus. Reverse transcriptase-polymerase chain reaction (RT-PCR) is the principal screening tool used to identify COVID19 cases (Wang, Ng & Brook, 2020) . Smart healthcare systems can assist in improving healthcare worldwide via employing artificial intelligence (AI) and machine learning techniques in different ways, for example, detection, identification, and monitoring of the disease. AI allows doctors to diagnose, discover, and monitor diseases in early stages. In turn, it becomes easier to overcome obstacles and issues in traditional methods such as time consumption and extra effort wasting. From cancer screening and disease tracking to tailored treatment, recommendations are a wide variety of topics and applications in healthcare. These applications depend on different and various sources of today-radiological imaging data (X-ray, CT and MRI scans), pathology imaging, and, more recently, genomic sequences for being used during service(s) implementation Razzak, Naz & Zaib, 2018; Xu et al., 2014) . Due to the recent pandemic, the opportunity of smart healthcare expansion is exponentially increasing and attracting many researchers to find a cure or medication to benefit billions of people around the world. Therefore, COVID-19 detection and classification is a critical application in smart healthcare systems (Ting et al., 2020; Ienca & Vayena, 2020; . In this article, we are motivated to propose an approach that is based on deep learning (DL) technology as a potential tool to assist healthcare workers to be timely to detect the presence of COVID-19 from CXR images. The main contributions of this article are as follows: CXRVN: A novel Chest, X-ray COVID-19 Network architecture, is designed, implemented, trained, optimized, and evaluated to detect infected cases easily, accurately, and rapidly. We crawled a novel dataset from different resources, which include COVID-19, Pneumonia, and Normal cases. Fine-tuned and transferred learning pre-trained models for feature extraction and image classification. Augmentation of the COVID-19 dataset is performed using a designed GANs architecture. In the rest of this article, we recall the recent scientific researches in literature in "Related Work". "Materials and Methods" discusses the design principles, learning criteria, and optimization algorithms for our CXRVN model. Validation and verification of the CXRVN model are illustrated using different experimental studies in "Evaluation of Experimental Results". "Discussion" discusses the results and insights of the experimental studies and compares the performance of CXRVN with recent literature. Finally, "Conclusions" concludes the proposed method and research impacts and highlights additional research questions in the hotspot research point. COVID-19 has been affecting more than 190 countries and regions since a few months ago. Recently, many attempts by researchers in the field of computer science were introduced and proposed to identify, classify, and diagnose cases, relying on the presence of a limited number of particular databases (Oh, Park & Ye, 2020; Khan, Shah & Bhat, 2020) . Prediction models used to address the pandemic COVID-19 are affected by many different sources, such as the demographics, and issues of vulnerability that can be associated with lung or heart disease, settings/hospital capacity, and the rate of testing, social and spacing, and income in exchange for goods (Santosh, 2020a) . Truncated Inception Network is presented by Das, Santosh & Pal (2020) in order to classify positive CXR images from normal cases, further, they used six different datasets with resulting 99.96% accuracy. The major limitation of this work is there is nonclinical implications performed. They just designed the network to check whether the Truncated Inception Net could be used in detecting COVID-19 positive cases using CXRs. Therefore, recent approaches attempts to use clinical implications for example, nine pregnant women with chest CT-images as limited laboratory-confirmed COVID-19 pneumonia scans were retrospectively reviewed by Chen et al. (2020) . Further, The efforts to diagnose and classify each patient and determine whether they had SARS-Co-V-2 infection or not depending upon RT-PCR was presented by Struyf et al. (2020) . One more, the study of COVID-19 pneumonia in Wuhan, China, consists of 81 patients who were presented by Shi et al. (2020) depends up on classifying the COVID-19 cases from normal cases. Different approaches were proposed to address the problem of COVID-19, as well as the variability and concurrent permanent update of corona cases in the databases. Given the potential future epidemics of COVID-19, AI scientists do not always wait to train complete data sets. Therefore the decision-making process depending not only one data type, but also many data types are used (multimodal data) to ensure the reliability of the AI model to detect the variability of COVID-19 pandemic Santosh (2020b) . In Pereira et al. (2020) proposed a classification scheme based on a multi-class classification and a hierarchical classification where pneumonia can be structured as a hierarchy. Besides, they used resampling algorithms to solve the data imbalance problem during feature extraction by texture descriptors and a pre-trained CNN model from CXR images. They fused the features of two methods to improve the power of several texture descriptors and base classifiers at once. Their hierarchical classifier was tested in RYDLS-20 achieved an F1-Score of 0.65 using a multi-class approach and an F1-Score of 0.89 for the COVID-19 identification. Ozturk et al. (2020) presented a new architecture for rapid recognition of COVID-19 using CXR images to provide reliable diagnostic tests for binary classifications (COVID vs. No-Findings) and multi-class classifications (COVID vs. No-Findings vs. Pneumonia) . Their model achieved a classification accuracy of 98.08% and 87.02% for binary and multi-class, respectively. In Ucar & Korkmaz (2020) , a new model for the rapid diagnosis of COVID-19 based on deep Bayes-Squeeze Net to overcome the public database imbalance problem, a multi-scale offline increase was performed, and finally an easy-to-install deep learning network for embedded and mobile systems that could assist health experts in establishing a stable system for COVID -19 diagnosis. Their model achieved 98.3% and 100% for multi-class and binary classification, respectively. Another approach based on deep learning was developed for COVID-19 using the CXR dataset consisting of three classes, namely: normal, COVID-19, and pneumonia was presented by Toğaçar, Ergen & Cömert (2020) . Their model starts with a preprocessing step, including restructuring images using the fuzzy color technique. In the next step, the stacked dataset was trained with deep learning models (MobileNetV2 and SqueezeNet), and the feature sets obtained by the models were processed using the Social Mimic optimization method. They trained an SVM using significant features and achieved 99.27% for multi-class classification. Furthermore, in Apostolopoulos, Aznaouridis & Tzani (2020), MobileNet v2 was used and trained from scratch to investigate the importance of the extracted features of COVID-19. They have been trained CNNs from scratch and improved the other transition learning methods, especially in separating the X-rays using a large-scale dataset of 3905 X-ray images, related to 6 diseases. Their classification model achieved 87.66%, 99.18%, 97.36% and 99.42% for precision, accuracy, sensitivity, and specificity, respectively. Using statistical analysis of texture feature extraction, Haralick features proposed by Perumal, Narayanan & Rajasekar (2020) are applied to emphasis the region of interest for detecting COVID-19 cases. They used three modalities bacterial pneumonia, viral pneumonia, and normal lung diseases based on transfer learning using VGG16, Resnet50 and Inception V3 and the resulting accuracies are 93.8%, 89.2% and 82.4% respectively. Fractional-order and marine predators algorithm (FO-MPA) with inception CNN presented by Sahlol et al. (2020) are used to extract the features and classify the COVID-19 chest X-ray (CXR) images respectively. The results obtained are 98.7%, 98.2% and 99.6%, 99% of classification accuracy and F-Score for the applied Dataset-1 and Dataset-2, from Kaggle website respectively. Abdulmunem, Abutiheen & Aleqabie (2021) presents a methodology to recognize COVID-19 cases using Resnet-50 with 5 and 10 folds cross validation and the resulting accuracy reached to 97.28%. Ismael & Şengür (2021) proposes a pre-trained CNN model to extract and classify CXR images to detect COVID-19 cases further, they used Resnet-50 and SVM with linear kernel function and they obtain a satisfied accuracy reached to 94.7%. They used limited number of CXR images and therefore a suggestion of performing augmentation based on limited nimber of imbalanced data is required. A new self-contained dataset for COVID-19 classification is presented by Misztal et al. (2020) by which they used number of CT and radiograph images from a diverse set of classes. Dense-Net is applied to CT with radiograph and the resulting accuracies are 87% and 92% for multiclass and data stock binary, respectively. They suggested to use 3D CT images with radiograph to analysis and learn other patients on clinical. Santosh (2021), summarizes artificial intelligence for COVID-19 issues ranging from forecasting to decision making to support healthcare in human life. Moreover, in Joshi, Dey & Santosh (2020) presented intelligent systems and methods to combat Covid-19. We could conclude from the literature as mentioned earlier, the following points The importance of the deep learning models and the pre-trained-models for the early diagnoses of COVID-19. Regards to the limited available resources and COVID-19 X-ray images, we have employed the role of the data augmentation methods effectively in generating a lot of required images. Different types of clinical data (balanced and imbalanced) with different features range and values should be used to test any proposed model related to COVID-19 to assure reliability and validity of the system. Generally, deep neural network (DNN) inspired by the human brain consists of neurons, synapses, and much more, the formulation of DNN seems like hierarchical neural networks to improve the process of classifying supervised patterns (Hinton & Salakhutdinov, 2006; Ciregan, Meier & Schmidhuber, 2012) . DL is a methodology of stacking multi-hidden layers that can significantly learn objects. DL can classify, extract the features, and make a decision ineffective and precise fashion after an efficient training process. The training process includes "fine-tuning" where DNN slightly adjusts the weights found in pre-training during backpropagation Yosinski et al., 2014) . Hence, we need optimizers during parameters update and cost minimization. Mini-batch gradient decent (MBGD) and Adam optimizers are the most common optimizers to speed up the learning process and further enhance the value of the objective function. However, recently transfer learning plays a useful and powerful tool to enable the training of large-scale datasets without overfitting problem results from the target dataset that is much smaller than the raw dataset (Lu et al., 2015; Ahmed, Jones & Marks, 2015) . The presence of redundancy of data is beneficial to use the MBGD as an optimizer algorithm. Since the learning rate changes from relatively large to the relatively small that is called schedule. Therefore, it is requiring to estimate the parameters to be convergence by futzing the parameters, ultimately (Le et al., 2011) . The stochastic gradient descent (SGD) is used to minimize the objective function for extensive training sets. The traditional gradient descent becomes a costly procedure (Ruder, 2016) . Assume that the hypothesis h u x ð Þ for x input features is given by Eq. (1) (Dean et al., 2012; Maas, Hannun & Ng, 2013) . where u is the current initial case for the input x for the n training set, then the training set of hypothesis h called J train u ð Þ is given by half number of the m training examples multiplied by the average square error, as given in Eq. (2). where the difference, h u ðx i ð Þ Þ À y i ð Þ À Á 2 , is the square error of the ith training instances such that the parameters of theta u in the inner loop of the gradient descent are updated repeatedly as in Eq. (3), and that is commonly called Batch Gradient Descent (BGD). where a is the learning rate for j = 0, 1, 2, …, n, the updated theta u is the difference between the old theta h and the partial derivative @ @u J train u ð Þ. The parameters are firstly initialized, then different iteration of the batch gradient descent will likely result in local minimum through the data trajectory. For a large scale, data BGD accumulates the sums, and it will consume much time, and the system complexity will be very high. Therefore, both SGD and MBGD is more reliable than BGD in large scale optimization approaches, and with the systems requires different parameters. Moreover, there is no need, to sum up, all the training sets. Mini-batch Gradient Descent looks at the mini-batch instances. Also, SGD is more likely to escape from local optima than BGD, not guaranteed global optima. As the MBGD takes the batch reasonability straight-line trajectory to get the local minimum. The cost of SGD is given by Eq. (4) such that for random shuffle dataset the trained J train u ð Þ is the sum of the cost function to the number of the trained examples m, as shown in Eq. (5). Hence, the updated u does not depend on the accumulated summation, as shown in Eq. (6). During the learning process, it is preferred to use the largest number of iterations for optimizing the accuracy of the model. Starting from the first iteration may take the parameter in the direction and move the parameters in the direction of the local minima (Abadi et al., 2016; Lee et al., 2011) . While BGD used all m examples in each iteration, and SGD used a single example in each iteration, the MBGD uses b examples in each iteration such that b is the mini-batch size as shown in Eq. (7) (Hinton, Srivastava & Swersky, 2012; Goyal et al., 2017; Jain et al., 2017) . Moreover, Adam optimizer presented by Kingma & Ba (2014) depends on optimizing lower-order moments with a little memory requirement is applied in this work to boost the cost function as well as to get reliable results after MBGD. A mathematical proof of the convergence Adam optimizer is stated in Tran (2019). Generative adversarial networks (GANs) Generative Adversarial Networks (GANs) are recently used for the generation of images, video, and voice. GANs are algorithmic architectures that use two DNN architectures, to build new simulated instances of data that can be transferred to real data (Goodfellow et al., 2014) . GAN is one of the most common architecture algorithms for image data augmentation by which the samples can be stacked with random cropping to further in-rate the data collection (Samangouei, Kabkab & Chellappa, 2018; Frid-Adar et al., 2018) . In Waheed et al. (2020) the authors presented GAN architecture for a limited number of COVID-19 CXR dataset that consists of 192 images and their architecture achieved accuracies 85% and 95% before and after GAN augmentation, respectively. The taxonomy of image data augmentation that shows the different types recently used in image augmentation is shown in Fig. 1 (Shorten & Khoshgoftaar, 2019) . In image data augmentation, there are two types; the first type is image manipulation, while the second is DL approaches. In image manipulation, there are two types in general, which are geometry transformation and mixing images. In contrast, the DL approaches are classified into GANs and neural transfer. In this work, we present GAN architecture, which belongs to DL approaches to produce meta-learning data augmentation of the enrolled CXR images. In this article, we build a novel architecture to classify the input COVID-19 CXR images into normal and abnormal categories. The proposed network is called Chest X-Ray COVID-19 Network (CXRVN) is considered as the first specialized deep neural network for analyzing chest X-ray images against the pandemic COVID-19. Our network architecture is summarized in Fig. 2 . Generally, CXRVN consists of four convolution layers, three pooling layers, and one fully connected layer. Next, we describe the main features of our architecture and their importance for diagnosis COVID19 patients. Since the saturating nonlinearities are much slower than the non-saturating nonlinearity during the training time with gradient descent, we use the rectified linear unit (ReLU) as the activation function. Besides, we concern about preventing overfitting when using ReLU, so the observed effect is different from the accelerated ability to fit the training set. Besides, using ReLU during the training procedure leads to relatively rapid learning of the network. The ReLU is the activation function used in the hidden layer so that for the input convoluted feature x, the ReLU allows faster learning, which significantly affects the output of large models trained on large datasets, and does not require normalization of inputs to avoid saturation of the learning. Although some training examples produce a positive input to a ReLU of a neuron, causing the learning process to happen in that neuron, we still find the importance of local normalization scheme in generalization aids. The batch normalization that determines the mean and variance for the input feature x is determined as in Calik et al. (2019) by which the mean of the expected value of x is determined. Moreover, the variance is the expected value the determined as the square of each enrolled features x subtracted from the mean of the whole features l. Then the normalized value of x is calculated by Eq. (8) as follows: where 2 is a very small number which protects zero division for batch normalization via deep learning platform codes. For the score vectors of an input COVID-19 X-Ray input images that denoted by S V x , the probability of the scored values are given as in Eq. (9) Typically, we find that models with concurrent pooling are much more challenging to overfit during the training models. Because of the pooling layers in our CNNs, the architecture summarizes the outputs in the same kernel map of neighboring groups of neurons. A pooling layer can, therefore, be viewed as a grid of pooling units spaced between pixels, each of which summarizes a neighborhood of size z × z centered at the pooling unit position. The use of overlapping pooling layers decreases error levels compared to the non-overlapping system, which generates equal dimensional outputs. In the proposed architecture, we use four convolutional layers. Each layer contains a batch normalization and ReLU activation function. The batch normalization is applied for the mini-batch set of the learned parameters of the convoluted features so that it brings the mini-batch data to zero means and normalizes variance. For the abnormal cases that required the percentage of the existence of the COVID-19 virus inside the image, the proposed system determines the abnormal probability infection using the SoftMax activation function. The algorithm steps of the proposed CXRVN is shown in Algorithm 1. We train our models using MBGD with a mini-batch size b=32 and a weight decay of 0.0003. This small amount of weight decay is essential for practical training as it is not only a regularization strategy but also it reduces the model's training error. Furthermore, we apply Adam optimizer based on the same hyper-parameters to boost and ensure the system's reliability in speed computation time and minimum memory. On the other hand, we adopt GANs to construct artificial instances for further data augmentation. In Algorithm 2, we summarize the steps of the proposed trained GAN augmentation model. The excellent success of GANs has led to an increased focus on how they can be applied to the data increment mission. In this article, we take the real images in the dataset, and the discriminator compares it with the generated images represented by the applied noise that represents the difference of the enrolled real images to predict the labels. Algorithm 1 Build a deep learning model using CXRVN-proposed architecture. Image_COVID-19_Set imds The generator is applied as input to a given vector of random values (latent inputs), and the network generates data with the same structure as the training data. Discriminator, given batches of data containing both the training data and the generated data from the generator, is trying to classify the observations as "real" or "generated." Training to produce data that "fools" the discriminator. Train the discriminator to differentiate between real and produced data (Wang, Wang & Wang, 2018; Salehinejad et al., 2018) . Due to the limited and variable number of the collected database from different sources, in this work, we collected a database and made GAN augmentation available on the Mendeley website (Shams et al., 2020a) . As we present a CXR COVID-19 Network CXRVN that is build from scratch to identify, recognize and classify chest X-ray images in a simple and very fast manner. Moreover, the proposed methodology used GAN network to augment the limited number of imabalanced dataset from different sources and handled it in an efficient and reliable manner. The comparison of the proposed method compared with the state of the art approaches stated the reliability of the proposed system in terms of accuracy and loss function before and after GAN augmentation. This section is dedicated to exploring the effectiveness of the proposed approach. Due to the variability of the updated standard datasets versions COVID-19 X-ray images, two different experimental studies are carried out, discussed, and analyzed in detail. All experiments were carried out using the MATLAB 2019b software package running on Microsoft machine with Core i7 processor, 16-RAM, and NVIDIA 4G-GT 740m GPU environment. There are three datasets we are used in this article; the first one is called Dataset-1 from (Faizan, 2020) which contains 25 normal cases (negative cases) and 25 COVID-19 (positive cases). Smfai presents 50 images and he claims that COVID-19 cases reached to 100% recognized at a time and 80% for negative cases or normal cases. The second one named Dataset-2 from (Mooney, 2020; Bachir, 2020) . It is noticed that Dataset-2 collected from two different independent sources, the first one Paul moony (Mooney, 2020) presented 5,863 chest x-ray images with two class labels pneumonia and normal cases. The collected chest-x-ray images also known as (posterior-anterior) were selected from retrospective cohorts of pediatric patients of one to five years old from Guangzhou Women and Children's Medical Center, Guangzhou. All chest X-ray imaging was performed as part of patients' routine clinical care. We used only 234 normal cases selected from 1,341 image with percentage (17.44%) and 148 pneumonia cases out of 3,875 trained cases. The second one is which has 221 COVID-19 cases selected from 314 images with percentage (70.38 %). The dataset is collected from 205 male and female patients with ages in between 120 and 88 years old. The third dataset called Dataset-3 was uploaded in Menedely (Shams et al., 2020a) . This collected data contains 603 chest-x-ray images with three class labels normal, COVID-19, and pneumonia cases which are 234, 221 and 148 respectively. We further augment the dataset using GANs, which produce 6,030 images; 2,340, 2,210, 1,480 for normal, COVID-19, and pneumonia images, respectively. The details of all datasets are summarized in Table 1 . We used the dataset collected by Toğaçar, Ergen & Cömert (2020) for comparison study. In this part, we attempt to optimize the proposed CXRVN architecture using the Bayesian algorithm to minimize the scalar objective function. We need to update the Gaussian process model to find a new point that is required for maximizing the acquisition function by sampling thousands of pints with the variable bounds. Therefore, in this work, we propose to use MBGD to find the local minima that satisfy constraints. Moreover, the proposed CXRVN architecture is fitted to overcome the additive noise with minimum loss after GAN augmentation using both MBGD and Adam optimizers. All experiments were done based on the following parameters. The hyper-parameter values of the proposed DCNN architecture, as shown in Table 2 . To evaluate the performance of the proposed DCNN architecture, the well-known performance measures for the evaluation are used, in terms of, the sensitivity, specificity, precision, accuracy and F1score from the confusion matrix based on the following Equations: Precision ¼ TP=ðTP þ FPÞ where TP, TN, FP, and FN are true positive, true negative, false positive, and false negative, respectively. The evaluation of the proposed CXRVN was performed to get the final decision of the trained model. Initially, the datasets, which contain the normal, COVID-19, and pneumonia cases, are collected and enrolled. Afterward, the datasets are splitted into training and testing sets. The trained images are then applied to the GAN augmentation process, which takes the trained sets of the enrolled image and generates the synthesized image datasets to produce an augmented COVID-19 dataset. We used the k-fold cross-validation strategy with k = 10 cross validation. Specifically, we train on k−1 folds and validate on the remaining 1-fold. Then we calculate the average from n iterations as shown in detail in Fig. 3 . We able to control the number of iteration of the trained COVID-19 chest X-ray images to be compared with tested images to obtain the final evaluation. The collected datasets consist of normal cases and COVID-19 ones. These datasets are splitted into two sets, and they are the training and testing sets. To overcome the Figure 3 The steps of getting the final evaluation results of the trained/tested augmented COVID-19 chest X-ray images. The CXR images were downloaded from Kaggle under a CC0 1.0 license. Full-size  DOI: 10.7717/peerj-cs.358/ fig-3 overfitting problem, We split the datasets into 80% for the trained images, and the remaining 20% is for the testing ones. Subsequently, the training sets are augmented via the use of GAN. Therefore, the hyper-parameters values of the training sets have learned and proceeded with the evaluation to produce the validation set. Every iteration of the shuffled fold is split by generating an independent number of the trained/tested image. The first experiment was conducted using Dataset-1. This experiment is performed using the same parameters mentioned in Table 2 . Subsequently, we used the proposed architecture shown in Fig. 2 by enrolling all 50 grayscale images to the system. The enrolled images are with size 128 × 128 × 1. Furthermore, we used the mini-batch gradient descent optimizer for the trained convoluted input features. Afterward, the maximum pooling of the convoluted images to produce the fully connected layer that contains 1 × 1 × 1,024. Finally, the CXRVN classify the results either to normal or COVID-19 case. A sample of the dataset is shown in Fig. 4 . This experiment is considered as an initial experiment to prove the ability of the proposed architecture to handle and solve the classification problem based on the small collected dataset. The accuracy and loss function of the proposed CXRVN architecture for a given hyper-parameter value is shown in Fig. 5 . In this experiment we used k-fold cross-validation (k = 10) for all stacked 50 X-ray images. The confusion matrices of the achieved results are shown in Fig. 6 , which show that the proposed system accuracy achieved for testing, training, and cross-validation are 90.0%, 92.5% and 88%, respectively. The confusion matrix measurements, including sensitivity, specificity, accuracy, precision and F1 score in both cross validation, training, and testing phases are summarized in Table 3 . We notice that, the average results of the proposed CXRVN architecture is 92.85% in the testing phase. Intuitively, only 50 X-Ray images are not sufficient to prove the reliability and robustness of the proposed system. Therefore, we have to expand the data of the X-ray COVID-19 images. Furthermore, enhancement of the augmentation process by applying GAN augmentation for the input images is urgently required. In this experiment, we utilize Dataset-2 based on the same hyper-parameter values mentioned in Table 2 for normal and COVID-19 X-ray images. Furthermore, for image data augmentation, GAN is used in the preprocessing stage to ensure the reliability of the proposed system and to enhance the results in a large-scale standard dataset with the same hyper-parameter values. The validation is processed every two iterations; also, every ten cycles, the data is shuffled (10-fold cross validation). In this experiment, afterward, the data shuffled and using MBGD, the regulator rate is 0.0001 given that the number of the trained images is 364, and the number of validated images 91, and we used the evaluation results based on 80% training and the remaining 20% for testing. Figures 7 and 8 show the samples of the dataset used (Mooney, 2020, at https://www.kaggle.com) and (Bachir, 2020 , at https://www.kaggle.com) respectively. We perform this experiment in two scenarios. The first scenario is using Dataset-2 without augmentation, that is, using only 455 images. The second scenario is after GAN augmentation, which generates 4,550 images based on the hyper-parameter values listed in Table 2 . The results of the two scenarios are summarized in Table 4 , which prove the system reliability. The CXRVN-architecture has critical advantages, including the reliability and stability of the running process. During changing the datasets, the CXRVN shows the solidity of architecture against a source of dataset and size. The accuracy and loss function of the proposed system architecture for phase 1 without data image augmentation is shown in Fig. 9 . In this experiment the final result that represents the accuracy of the tested 91-X-ray images is 96.70% after 160 iteration. It is very clear that, the loss function is slightly high after 20-40 iteration and it becomes more stable with minimum value after 160 iteration. In this experiment we used MBGD optimizer before augmentation with b = 32. Therefore, we need to enhance the loss and accuracy at the same time. To boost the results obtained and produce enhancement accuracy with a minimum loss, Adam optimizer with MBGD is applied in the X-ray image augmentation based on GAN architecture. In this scenario, we use the same 455 X-ray images that is, Dataset-2 and the data are enlarged 10 times to generate 4,550 X-ray images using GAN augmentation architecture. In this experiment, same hyper-parameter values in Table 2 are used but with MBGD instead of Adam optimizer, and the maximum number of iteration was 220. Figure 10 shows the accuracy and loss function of the proposed CXRVN architecture on the 4,550 X-ray images after GAN augmentation using Adam optimizer. It is noteworthy that, high accuracy of 97.58% is obtained after GAN augmentation with a minimum and stable loss after 220 iterations. Further, we prove the ability of the proposed CXRVN in the presence of big datasets of normal and COVID-19 X-Ray images. The confusion matrices of the two scenarios with and without data augmentation are shown in Fig. 11 for 91 and 910 tested X-ray images out of 455 and 4,550, respectively. In this experiment, the proposed CXRVN is evaluated based on three class labels as mentioned in details in Table 5 . The data are collected from Dataset-2 except we modify 148 pneumonia datasets. The source of our collect dataset is uploaded on Mendeley website (Shams et al., 2020a) . In this experiment the number of trained datasets are 482 and the remaining 121 are used for testing. The augmentation based on the proposed GAN architecture is performed to produce 6,030 augmented images 4,820 (80%) for training and 1210 (20%) for testing. The confusion matrixes of the three class labels are shown in Fig. 12A that shows the accuracy of our model which reaches 91.7% before augmentation. Table 4 The collected datasets of the normal, COVID-19 and pneumonia X-ray images before and after the augmentation process. On the other hand, the accuracy of the proposed CXRVN based GAN augmentation achieved improved accuracy of 93.06% on the tested 1210 augmented X-ray images for three classes as shown in Fig. 12B . It is obvious that, there is slight decrease in accuracy of the three class labels compared with the two classes. This is because the presence of three classes that collected from different sources that is, imbalance dataset. On the contrary, there is an improvement of the loss function as shown in Fig. 13 . To improve the loss and classification accuracy we utilize GAN architecture for augmentation. Figure 12 shows the evaluation results related to experiment (III) of the three classes; COVID-19, normal, and pneumonia. It can be noticed that, a great enhancement of results after GAN augmentation is achieved by using Adam optimizer based on MBGD. The accuracy and loss of the proposed CXRVN architecture based on GAN X-ray image augmentation are shown in Fig. 13 . We notice that, the final result is 93.06% after 600 iteration based on Adam optimizer with mini-batch size 20. Moreover, enhancement and stability of the loss function during the experiment reach 600 iterations. We used the same parameter values listed in Table 2. Table 6 summarizes the recall, precision and accuracy of the proposed CXRVN architecture before and after GAN augmentation. To compare the proposed CXRVN architecture with the recent approaches, we need a normalized standard dataset. Moreover, that is not possible because of the variability and updated standard datasets for COVID-19 X-Ray images. Therefore, the proposed approach is firstly compared with the state-of-the-art deep learning models. Namely, the GoogLeNet, VGG-16, Resnet-18 and AlexNet. Although, these models are basically proposed for computer vision tasks, we made some modifications to be adaptive with the enrolled classes as a transfer learning models. The accuracy of the proposed method against these models on Datasets 2 and 3 are given in Table 7 . This comparison is performed based on the same hyper-parameter values listed in Table 2 for databset-2. Moreover, we also perform a comparison on Dataset-3 that consists of three classes which are normal, COVID-19, and pneumonia. The comparison is performed based on the same hyper-parameter values in Table 2 except we used 40 epochs and the maximum number of iteration was 600. Table 7 summarizes the comparison evaluation in the testing phase for Dataset-3 based on three classes. We further compare our method the dataset collected by Toğaçar, Ergen & Cömert (2020) which consists of 458 chest X-ray images for three class labels; normal (65), COVID-19 (295) and pneumonia (98) shown in Table 8 . For fair comparison with (Toğaçar, Ergen & Cömert, 2020) , we used 70% and 30% for training and testing, respectively, as reported by the authors. The confusion matrix of our proposed CXRVN on (Toğaçar, Ergen & Cömert, 2020) dataset is shown in Fig. 14 . Table 9 investigate the detailed comparison between (Toğaçar, Ergen & Cömert, 2020 ) and our CXRVN architecture. In addition to comparisons with shared computer vision deep models, we also roughly compare our proposed CXRVN architecture with the state-of-the-art methods of COVID-19 detection and classification, as illustrated in Fig. 15 and Table 10 . In this comparison, we show the class label, modality used, that is, X-ray and CT, number of cases, and the methodology used. Further, in Table 11 the running time for each scenario and dataset used are determined. The proposed approach is evaluated based two types of datasets, the first is Dataset-1 which is a balanced dataset, while the second is Dataset-2 which is an imbalanced one. For Dataset-1, we used only 50 cases; 50% normal and 50% are COVID-19 infected cases X-ray images. The results indicated that the accuracy of the proposed CXRVN is 92.85%. Furthermore, due to the variability and updated version of COVID-19 datasets, we collect a large-scale dataset from two sources for both normal and COVID-19. The GANs are used for image data augmentation to enlarge the collected datasets, and the experiment is performed in two phases. Furthermore, two scenarios are presented, in the first one, which is done without augmentation, the accuracy reached to 96.70%, while the second one is based on the GANs augmentation, the accuracy reached to 97.58%. We not only used two class labels to validate the proposed method, but also we used three classes, including normal, COVID-19, and pneumonia. In experiment three applied in the collected Dataset-3 (Shams et al., 2020a) , the accuracies are 91.07, and 93.06 before and after GAN augmentation, respectively. The comparisons between the proposed CXRVN and the most recent deep learning models are performed on our collected dataset, and the results indicate the superiority of our architecture. Moreover, we compare our method on the dataset collected by Toğaçar, Ergen & Cömert (2020) with the same parameter settings, and the results attain better performance, especially after GAN augmentation. Finally, rough comparisons between CXRVN and the state-of-the-art deep learning methods are performed and investigated in Table 10 . In Fig. 15 the statistical average values of the accuracy of the compared approaches with the proposed CXRVN average value. We clearly found that the average accuracy of the proposed approaches is not the top value that is because we used different imbalanced dataset than others. Moreover, we augmented the CXR images using GAN which increase the stability and accuracy of the proposed system (Shams et al., 2020b) . The technical motivation of the proposed CXRVN architecture can be summarized as follows: CXRVN classification architecture using the presence of chest X-ray images available allows diagnosis patients. The elapsed time to diagnosis the patients are decreased, and it will take a few seconds to classify the patient's cases. The adaptability of the proposed CXRVN architecture in classification multi-class not only binary classes. In the proposed work, the model capable of handling large scale datasets by using GAN for augmentation. Mini-batch gradient descent and Adam optimizers are applied for GAN optimization. The available balanced and imbalanced of chest X-ray images are used as the input datasets. We present a novel architecture that is trained from scratch with some modifications and improvements as follows: The network architecture is adaptive in its procedure parameter for the enrolled X-ray chest images. The architecture uses two optimizers for the augmented images, which are MBGD and Adam. The architecture can classify noisy X-ray images and produce promising layers as five convoluted layers with batch, and RelU activation functions are applied. The architecture deals with balanced, imbalanced, and augmented GAN datasets. The architecture can classify three classes normal, COVID, and pneumonia. From the results mentioned above, it could be concluded the following points; Deep learning plays an essential role in detecting COVID-19 cases, smoothly. The role of GANs to produce different numbers of images helped to improve the overall accuracy of the proposed approach. The proposed approach would be used as transfer learning. Although the proposed method achieved superior performance to the state-of-the-art methods, it still has some limitations. The first one is that radiologists tested the accuracy of the proposed approach for clinical usage. The second limitation is the limited COVID-19 dataset, which is considered one of the most critical issues for training deep models. Using a big X-ray dataset for the training phase can potentially improve the performance of the proposed method. More extracted features of the X-ray images are required in order to test the X-ray images for more details that may be helpful for the updated cases in COVID-19 patients. Since CT scanners are not always available, usually have a high cost, and come after long acquisition time, X-ray remains the standard imaging modality for chest, particularly in isolated areas and developing countries. There are different challenges related to the medical sector. They could be summarized in the following points. During the COVID-19 pandemic. Lots of challenges are faced Medical datasets are very limited, which is more difficult for any researcher to reach to these data. In the face of the epidemic Covid-19, the lack of images of the chest of various kinds. Researchers can use methods to enlarge the number of images, which contributes to a fair test of the different methods presented by researchers and research centers robustness and reliability of the proposed architecture against the contemporary architectures. For future direction, we plan to use CT-images and study different updated cases of the COVID-19 X-Ray image. Furthermore, for the promising obtained results, the proposed architecture can be utilized in other medical images classification and diagnosis issues. The authors received no funding for this work. Tensorflow: large-scale machine learning on heterogeneous distributed systems Recognition of corona virus disease (COVID-19) using deep learning network An improved deep learning architecture for person re-identification Extracting possibly representative COVID-19 Biomarkers from X-Ray images with deep learning approach and image data related to pulmonary diseases COVID-19 X-ray images Large-scale offline signature recognition via deep neural networks and feature embedding Clinical characteristics and intrauterine vertical transmission potential of COVID-19 infection in nine pregnant women: a retrospective review of medical records Multi-column deep neural networks for image classification Truncated inception net: COVID-19 outbreak screening using chest X-rays Large scale distributed deep networks COVID-19 in X-Ray Images GAN-based synthetic medical image augmentation for increased CNN performance in liver lesion classification Generative adversarial nets Accurate, large minibatch sgd: training imagenet in 1 hour Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups Reducing the dimensionality of data with neural networks Neural networks for machine learning lecture 6a overview of mini-batch gradient descent On the responsible use of digital data to tackle the COVID-19 pandemic Deep learning approaches for COVID-19 detection based on chest X-ray images Parallelizing stochastic gradient descent for least squares regression: mini-batching, averaging, and model misspecification Intelligent systems and methods to combat covid-19, SpringerBriefs in computational intelligence Coronet: a deep neural network for detection and diagnosis of COVID-19 from chest x-ray images Adam: a method for stochastic optimization On optimization methods for deep learning Unsupervised learning of hierarchical representations with convolutional deep belief networks Using artificial intelligence to detect COVID-19 and community-acquired pneumonia based on pulmonary CT: evaluation of the diagnostic accuracy Transfer learning using computational intelligence: a survey. Knowledge-Based Systems Rectifier nonlinearities improve neural network acoustic models The importance of standardisation-COVID-19 CT & radiograph image data stock for deep learning purpose Chest X-Ray Images (Pneumonia) Deep learning covid-19 features on cxr using limited training data sets Automated detection of COVID-19 cases using deep neural networks with X-ray images COVID-19 identification in chest X-ray images on flat and hierarchical classification scenarios Detection of COVID-19 using CXR and CT images using transfer learning and Haralick features Deep learning for medical image processing: overview, challenges and the future An overview of gradient descent optimization algorithms COVID-19 image classification using deep features and fractional-order marine predators algorithm Generalization of deep neural networks for chest pathology classification in x-rays using generative adversarial networks Defense-gan: protecting classifiers against adversarial attacks using generative models COVID-19 prediction models and unexploited data AI-driven tools for coronavirus outbreak: need of active learning and cross-population train/test models on multitudinal/multimodal data COVID-19: prediction, decision-making, and its impacts Chest x-ray images with three classes: covid-19, normal, and pneumonia, Mendeley Data v3 Why are generative adversarial networks vital for deep neural networks? A case study on COVID-19 chest X-ray images Radiological findings from 81 patients with COVID-19 pneumonia in Wuhan, China: a descriptive study A survey on image data augmentation for deep learning World Health Organization declares global emergency: a review of the 2019 novel coronavirus (COVID-19) Van den Bruel A. 2020. Signs and symptoms to determine if a patient presenting in primary care or hospital outpatient settings has COVID-19 disease Digital technology and COVID-19 COVID-19 detection using deep learning models to exploit social mimic optimization and structured chest X-ray images using fuzzy color and stacking approaches On the convergence proof of amsgrad and a new version COVIDiagnosis-net: deep bayes-squeezeNet based diagnostic of the coronavirus disease 2019 (COVID-19) from X-ray images Covidgan: data augmentation using auxiliary classifier gan for improved covid-19 detection Response to COVID-19 in Taiwan: big data analytics, new technology, and proactive testing An intelligent diagnosis scheme based on generative adversarial learning deep neural networks and its application to planetary gearbox fault pattern recognition Detection of SARS-CoV-2 in different types of clinical specimens WHO director-general's remarks at the media briefing on 2019-nCoV on 11 Deep learning of feature representation with multiple instance learning for medical image analysis How transferable are features in deep neural networks? In: Advances in Neural Information Processing Systems Supplemental information for this article can be found online at http://dx.doi.org/10.7717/ peerj-cs.358#supplemental-information. The diagnosis chest scan suffers the lack of ready programs for detecting the injury cases. Deep learning will play and still play an essential and vital role in contributing to the diagnosis of COVID-19 and others. Machine learning techniques, especially classification and regression, are considered as one of the essential tools to fight the spread COVID-19. In this article, a DCNN architecture to classify the input X-Ray COVID-19 images called CXRVN is proposed. The architecture can handle the extracted feature from each convoluted layer, and the results indicate the robustness and superiority of the proposed system compared with the state-of-the-art methods. We performed many different experiments based on availability and the applied dataset. The first experiment used a balanced dataset of 50 X-ray images for two classes (Dataset-1), normal and COVID-19, and the accuracy was 92.85% in the testing phase, while the second experiment was performed using an imbalanced dataset (Dataset-2) that consists of 455 X-ray images for two classes, and the accuracy was 96.70%. In the third experiment, we used 603 X-ray images for three class labels; COVID-19, normal, and pneumonia (Dataset-3), and the accuracy reached 91.70% in the testing phase. To prove the ability of the proposed CXRVN architecture on a large scale, we present image data augmentation based on GANs that leads to a significant enhancement of the proposed architecture. The evaluation results based on sensitivity, precision, recall, accuracy, and F1 score demonstrated that, after GAN augmentation, the accuracy reached 96.7% in experiment 2 (Dataset-2) for two classes and 93.07% in experiment-3 (Dataset-3) for three classes. Comparisons were performed to prove the The following information was supplied regarding data availability: Data is available at GitHub: https://github.com/smfai200/Detecting-COVID-19-in-X-ray-images/tree/master/ dataset?fbclid=IwAR3UzNPQI9yfyETfbFVgCQHKWa5mvew5mJQxNhJk6tTYmLZsDz JZaDQ3bQ0.https://github.com/ieee8023/covid-chestxray-dataset/blob/master/README.md? fbclid=IwAR1AwKzp4dIY2WW_n1AQqTV0H9CDJ4GJQq6idffPmGBaFaKR6SW dwUBp78M.COVID-19 X-ray images are available at Kaggle: https://www.kaggle.com/bachrr/covid-chest-xray?fbclid=IwAR0KBoFoXsrv6LShMod EDI1mcmVN0OEoLAg_7KKzcnHxiTH5huMBQApUMbc.Chest X-Ray (Pneumonia) images are also available at Kaggle: https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia?fbclid=Iw AR25LVOs7Wiu64v6bh_-SUZTEZKq1O3dM7xoZw5V1mqAk_Hx6gXjQfUv_GQ.