1 Introduction

Novel coronavirus pandemic starts spreading from the city Wuhan of China in mid-November 2019. This pandemic affects millions of people within a few weeks. Initially, the virus is named the Wuhan virus but after its widespread, it is named as CoronaVirus(COVID-19) by the world health organization(WHO). Initially, coronavirus detects by the symptoms of fever, cough, and sore throat but after a few months of studies, scientists claimed that it can be in any form of symptoms. According to research (Chen et al. 2020), the initial patients from the Wuhan city are detected with fever and cough symptoms in the ratio of \(50\%\) and \(38\%\). Soon afterward the patients having a headache, rhinorrhea, and dyspnea are also detected with this virus (Di Gennaro et al. 2020). Further investigation reveals that the patients can be asymptomatic showing no signs in the initial days and still carry the disease.

According to WHO report (WHO 2020) referenced in Table 1, from March 2020 to November 2020 the total number of confirmed cases is 2,810,325, and the death toll reaches 193,825 by affecting around 213 countries. The same report (WHO 2020) also reveals the 4th November confirmed cases and death cases statistics in Fig. 1. Multiple approaches are utilized to get accurate results in detecting and predicting the coronavirus-infected patient. The chest computed tomography (CT) technique is considered best at the initial stages. The accuracy rate of predicting COVID-19 patients is observed around 85–90% (Kanne 2020; Kim 2020). Other research works (Huang et al. 2020; Wang et al. 2020a; Pan et al. 2020) performed on the prediction of COVID-19 infected patients make use of radiological features. They claimed that the patient infected with COVID-19 showed bilateral patchy shadowing, GGO lesions, and local patchy shadowing when their CT was performed. AI-based CT image analysis tool is designed for the detection and quantification of COVID-19 by Gozes et al. (2020). Their work system automatically extracted opacities from lung images and provided a 3D view of lung opacities and their quantitative measures as output. They achieved 92% specificity and 98% sensitivity.

Table 1 COVID-19 growth rate according WHO
Fig. 1
figure 1

Growth of COVID-19 of last 24 h from 4-Nov-2020

Two radiologists quantitatively evaluated the segmentation technique and presented 90% dice similarity. Xu et al. (2020) performed a classification task to discriminate pneumonia from viral pneumonia influenza-A using CNN based deep learning model and achieved 86.7% maximum accuracy. Zhao et al. (2020) employed a deep learning model for training CT images to predict COVID-19. They used 183 positives, 146 negative CT images for training purposes, and 35 positive and 34 negative CT images for testing purposes to detect COVID-19. They achieved 85% training accuracy and a 0.85 F1 score. They also published a dataset of 275 CT images of COVID-19 infected patients. To avoid overfitting using deep learning models they also applied transfer learning on chest X-rays. Authors in Narin et al. (2020) introduced three different models, i.e., ResNet50, InceptionV3, and Inception- ResNetV2 to classify COVID-19 patients from X-ray images. The models are trained on chest X-ray images of 50 COVID-19 patients and 50 normal people. The achieved accuracy is 98.0%, 97.0% and 87% for ResNet50, InceptionV3 and Inception-ResNetV2, respectively. A similar ResNet approach is presented in Zhang et al. (2020), whereby the trained model is used to classify the patients and detect the anomaly. Anomaly detection is used to improve COVID-19 classification. Classification is performed to separate COVID-19 patients from pneumonia patients. Results show the sensitivity of 96.0%, the specificity of 70.07%, and the AUC of 0.952.

A novel coronavirus is an infectious acute disease and can cause respiratory failure due to immense alveoli damage and that severe condition may lead to death. This disease was first recognized as a pneumonia outbreak for an unknown reason in Wuhan, China in December 2019. Initially, the virus was named the Wuhan virus. Later it was confirmed as an infection caused by a novel coronavirus called 2019-nCoV. The disease was named by World Health Organization (WHO) as COVID-19 on February 11, 2020, and the virus was named by the International Committee on Taxonomy of Viruses (ICTV) as Severe Acute Respiratory Syndrome Coronavirus 2 (SARS-COV-2). In this research work, we will use chest X-rays images for the detection and prediction of the COVID-19 virus using CODISC-CNN model. As a pre-processing phase, CODISC-CNN makes use of multiple filters to extract the required portion from the images for an accurate prediction of COVID-19 infected patients. Max-pooling, Global Max-pooling, and dense layers are used as supportive layers in CODISC-CNN model. ImageDataGenerator class is used to extend the size of the dataset for better training of the proposed model. For a better analysis of CODISC-CNN, this research work also performs experiments on 2-class, 3-class, and 4-class datasets.

The major aim of this study is the identification of the infected patient and if the patient is found infected then needs to identify the type of infection. The raising of the COVID-19 is severely dangerous for human life and in this situation, other infections are also expanding. The symptoms of the COVID-19 are mostly similar to the Virus bacteria and Virus pneumonia. The COVID-19 spreads in the body very furiously and reaches the lungs within 3–5 days and the doctor has to identify it by X-ray scans. The CODISC-CNN helps clinically by identifying the infected patient and classifying the type of the infection. The doctor also needs years of practice and experience to classify the infected patient by looking at X-ray images but the CODISC-CNN classifies the infected patient and helps the doctor to treat the patient for the exact infection type. The reason for choosing an X-ray-based dataset is that CT scans and MRIs are rarely available in every hospital or clinic. But the X-ray technology is easily available to tackle the coronavirus. The main objectives of this research work are as follows:

  • The CODISC-CNN is proposed that can efficiently separate the COVID-19 lung images from viral bacteria, viral pneumonia, and normal lung images based on the chest X-rays of the patients.

  • Image preprocessing steps such as image resizing, image re-scaling and image flipping help in improving the training of the deep learning model and thus increase the accuracy of the proposed simple and less complex CNN-based model.

  • The scarcity of training images has been mitigated with images generated by the augmented ImageDataGenerator of Keras. Total images are 10,000 for training and testing the proposed approach.

  • An open dataset of COVID-19 patients containing chest X-rays utilized to evaluate the performance of the CODISC-CNN and found it more effective as compared to state-of-the-art deep learning-based approaches including VGG16 and AlexNet.

The rest of the paper is organized as follows. Section 2 discusses a few pieces of research related to the current study. Section 3 presents an overview of the methodology adopted for the CODISC-CNN as well as a detailed description of each neural network layer used for the experiment. Results are presented in Sect. 4. Section 5 discusses conclusion and future work.

2 Related work

The coronavirus is an infectious deadly disease affecting the whole world. The researchers and scientists made their efforts in the field of artificial intelligence (AI), machine learning and the methods of Deep Learning to identify and predict the infection named Coronavirus in the initial stages to prevent the infection from spreading and to protect human lives. The coronavirus structure and protein visualization are shown in Fig. 2 (Gibbens 2020), it belongs to a family coronaviridae and binds to the receptor by membrane fusion with the help of spike(s) proteins. The situation of the COVID-19 remains to have a disastrous impact on the health and affects the population of the entire world (Siddiqui et al. 2020). Researchers applied deep learning to detect coronavirus (Castiglione et al. 2021).

Necessary actions are significant to take against the COVID-19 outbreak. For that purpose regular screening of the infected patients with the most significant screening techniques such as using radiological methods of imaging (X-ray imaging) is necessary. It automatically recognizes infected patients from COVID-19 using X-ray images of the chest by gaining good results in terms of accuracy in the process of detection by applying deep convolutional neural networks (DCNN).

Fig. 2
figure 2

Coronavirus structure (Gibbens 2020)

While the current global requirement, analysts, clinicians and healthcare specialists throughout the world keep on exploring new methods to assist in handling the COVID-19. While the current global requirement, analysts, clinicians, and healthcare specialists throughout the world keep on exploring new methods to assist in handling the COVID-19. To comprehensively evaluate the purpose of machine learning based techniques as one important process in the field of screening, forecasting, and development of the medicine for the SARS-CoV-2 during the epidemic. The active and crucial analysis has been performed to compare the model’s probabilities for handling the SARS-CoV-2 epidemic by discusses modern researches that employ AI and machine learning methods. It also discusses several challenges while practicing these algorithms in problems of the real world. Continuous development in the field of AI and machine learning has significantly enhanced the treatment and disease detection process of the COVID-19 by reducing the intervention of the human in clinical practices. However, most deep learning or AI models are contributing well to the treatment of infectious diseases, but they are still battling with the SARS-CoV-2 epidemic.

2.1 Artificial intelligence technology in SARS-CoV-2 screening and treatment

Identification of the infection in early stages that it was contagious or non-contagious, is significantly a critical assignment for initial treatment to protect more lives. Quick screening and diagnostic system support to restrict the scope of pandemic infections such as SARS-CoV-2, cost-effective, and expedite up the relevant diagnosis. AI and machine learning are adopted to expand the diagnosis and screening method for the identification of the contagious patient in the early stages using different radiological-based imaging methods like CT scan, magnetic resonance imaging (MRI), X-ray scan and data of the blood samples. The medical specialists can utilize radiology images like CT scans and X-rays as a convenient tool to expand the traditional examination and screening. Unluckily, the performance of these medical methods is considered during the tremendous eruption of the SARS-CoV-2 pandemic. In that respect, different studies and researches explicate the tendencies and potential of the AI methods by recommending deep learning models for the identification of SARS-CoV-2 diagnosis applying deep convolutional network.

The research explains the diagnosis phase using a system that is expert in applying deep learning methods on CT scan 1020 images of the 108 patients infected with COVID-19 with the 86 victims of viral pneumonia (Tang et al. 2020). The extraordinary performance recommends the employment of the convolutional neural network (CNN) based on Resnet-101 as a diagnosis apparatus for the radiologist after gaining the highest results 86.27% of accuracy and highest specificity achieved with 83.33% respectively. Recent researches purpose an assistant tool to enhance the efficiency of COVID-19 examination that is Automatic identification of COVID-19 that was based on the deep learning models. The raw X-ray images of the chest of 127 affected victims with 500 number of no findings class and 500 records from the pneumonia case. With exceptional illustration of results, the highest accuracy gain with the binary class is 98.08% and 87.02% with the multi-class. Multi-classes demonstrated the applicability and compatibility of the deep learning-based auto-identification of the COVID-19 system to help radiology annulling in screening method quickly and accurately. Moreover, researchers have discovered of the combination of the four significant medical characteristics of laboratory, clinical features and demographic knowledge utilising CD3, GHS rate, the total number of protein and age of the patient applying SVM model as the central feature for the classification model. The proposed machine learning model is efficient and strong in predicting victims are in critical situations. The experimental outcomes illustrate that a unification of the four features gives the highest results in the form of AUROC that achieved highest such as 0.9996% in the training and in the testing case the highest 0.9757% is achieved. The analyses of the survival rate and the analyses of the cox-multivariate regression showed the model’s importance towards the supporting tools for the medical specialist.

Numerous investigations are carried out based on both laboratory (Lowen and Mubareka 2007), mathematical modeling (Zuk et al. 2009), analyses of the ambient temperature based survival, epidemiological analysis (Barreca and Shimshack 2012) and viruses transmission. An enormous amount of analyses related to different studies support humidity and ambient temperature in the participation of the procedure of delivering and spreading of COVID-19 prompted this related research to analyze the significance of environmental circumstances. The major aim of this related work is to identify that the climate is the factor of the COVID-19 spread or not. The period of pandemic lockdown until today, the researchers made their efforts to participate in the battle against COVID-19 and the notably large number of researchers made their core contributions that were published in different journals are presented in Table 2.

2.2 Lack of medical facilities

The outbreak of COVID-19 has influenced the whole world. However, the situation is worse in developing countries with weak healthcare facilities. Pakistan is a developing country with a poor healthcare system and is more susceptible to a contagious disease. It is located at the borders of China and Iran which are the epicenter of the disease, so there is a need for strong policies against disease spread. According to WHO et al. (2020), all countries should limit the spread of the COVID-19 by taking proper preventive measures such as early detection, quarantine, surveillance, and awareness campaigns. During the starting phase of the disease, there was the unavailability of medical facilities, and samples were tested in China (Khan 2020). There were few quarantine centers and a dearth of diagnostic facilities and medicines until testing kits and other facilities were received from other countries. WHO established test centers and quarantine centers in many hospitals in Pakistan (Saqlain et al. 2020). Still, rooms are not sufficient according to the number of patients. As the infection rate is increasing, facemasks have become costly and insufficient. Drugs that were being used during pandemics become unavailable in pharmacies due to overdemand and stock business. Hospitals were not able to provide medical assistance to hundreds of patients (Latif 2020). New quarantine centers in Balochistan were in the deficit of proper screening and patient care (Khan 2020). The Government relaxed the lockdown and instructions of medical professionals were disregarded (Hashim 2020). Health professionals were getting infected speedily and became stressed and intensive care units were overflowed and the cost of patient care increased (Hashim 2020). Then the government took action and the situation is normal and under control now (Khanain 2020).

Malfunctioned equipment and untrained medical staff were a major challenge in fighting against a global pandemic condition. Attendants of patients were smashing hospital equipment and beating doctors in grief and anger due to the death of their loved ones as it was due to mistakes of doctors. The general public was also protesting against the administration of quarantine centers to take back infected patients. The State became a deficit of medical personnel due to a large number of deaths of doctors and equipment. Primary researches recommended plasma of individuals recovered from COVID-19 as helpful for fast recovery of newly diagnosed patients (Duan et al. 2020). But instead of donating plasma freely, recovered patients started making business. Even plasma transfusion is not declared as a proper cure but the public is experimenting without any assistance and approval of medical doctors (Epstein and Burnouf 2020). Even Though much more effort is required to deal with the situation.

3 CODISC-CNN architecture

The CODISC-CNN is developed to identify the coronavirus patients by using the chest X-ray scan images based on the deep learning methods. Furthermore, to attenuate the shortage of labeled datasets of COVID-19 images, Keras ImageDataGenerator class is utilized to generate 10,000 expanded images. Extensive experiments have been performed to classify X-ray images into two classes (Normal and COVID), three classes (Normal, COVID, and Virus Bacteria), and four classes (Normal, COVID, and Virus Bacteria, and Virus Pneumonia). The material and methods are discussed in this section that consists of deep learning CODISC-CNN and its layered architecture. CODISC-CNN is a simple having 5 convolution layers, 2 max pooling layer and 1 average pooling layer. Main aim of this study is to introduce a less complex and fast deep learning model with improved image classification results. Image augmentation with image resizing, image re-scaling and image flipping showed efficiently trained the proposed model. The complete proposed methodology of CODISC-CNN is shown in Fig. 3.

3.1 Data description

This study uses the X-ray datasets from two sources. Dataset-1 is available at Dataset (2020) and contains 79 images each for virus and bacterial pneumonia. Dataset 2 is available at Kaggle (2020) and it contains 78 X-ray images of COVID-19 patients and 28 images for normal people. The X-ray images of the chest are used to identify the infected areas by shadowing the X-ray images because during the worsen conditions of the coronavirus some scientific studies presented the 69% sensitivity rate in April 2020. The biggest advantage in using the X-rays images is that it can identify the symptoms slightly within 3–4 days and perfectly within 10–12 days (Wong et al. 2020).

3.2 Convolutional neural network (CNN)

The CNN (Lee and Song 2019; Mishra et al. 2020) is specifically used for the purpose of image classification. The CNN consists of convolutional layers that can handle the 2D or 3D data more efficiently. CNN model is used to analyze the visual images based data and CNN also called by another namespace invariant artificial neural network (SIANN) (Nam and Han 2016; Gallego et al. 2019). This name contains the feature of translational invariance and shared weighted architecture. CNN is the regularization version of the multi-layer perceptron. The multi-layer perceptron consists of the neurons and layers architecture that is fully connected through weighted connections known as links. One neuron is connected to the all neurons of the next layer and so on all the neurons are connected to each other layer by layer. The layers and neurons are fully connected with weighted links and when one layer passes its output weights that were learned from the previous layer then the chances of overfitting drastically increases.

CNN model adopts typical ways to regularize the based on the functional hyper-parameters. The magnitudes measurements of the loss functions are also added as a regularization method.

Table 2 Comparative analyse of the of the existing systems from recent years
Fig. 3
figure 3

CODISC-CNN architecture

CNN used many regularization methods that take advantage in extracting complex and hierarchical patterns and knowledge from the patterns that are small in scale and simpler in structure. That is why the CNNs are performing better in analyzing the visual domains and predicting perfect results. The CNN application is in image and video mining, image recognition, natural language processing based on extracting text from the image, analyses of medical images, image classification, image segmentation, and financial analyses through time series.

Convolutional neural networks are inspired by the biological structures that are based on the connectivity of the neurons. This concept resembles the fully connectedness of the neurons of the animal visual cortex that respond directly to the stimuli for only in the restricted area of the visual field is known as the receptive field. To cover the whole visual field, the receptive fields of each neuron are partially connected to each other and share the learning weights that transmits the information to the brain for the classification purpose.

3.2.1 Max pooling layer

One of the discretization processes used in deep learning is the max pooling (Gallego et al. 2019; Christlein et al. 2019) that is based on the sampling method. The major aim of the max-pooling is the down-sampling of the input features such as the image or output feature map of the hidden layers. Downsampling reduces the dimensionality of the input feature map that produces the optimized form of the output feature. It provides the abstracted representation that tackles the overfitting process. The computational complexity gets reduced by reducing the number of learnable parameters.

3.2.2 Global average pooling layer

The expert enhances the pooling by introducing the global average pooling layer. The reduction of the parameter in the global average pooling layer on the basis of dimensional reduction that is based on the spatial dimensions of the three-dimensional tenor. The global average pooling layer is designed to reduce the parameter to its lowest forms that would also be considered as a replacement of the fully connected layer. The global average pooling layer is designed to produce one feature map for the classification purpose that reduces the number of feature maps and computational complexity.

3.2.3 Dense layer

The neural network dense layer consists of the deeply connected neural network like other layers. Each neuron receives the output values from the neurons of the previous layers. The dense layer performs the vector-matrix multiplication operation on the input feature maps. The values used in the dense layer are the parameters that can be trained by using back-propagation methods. Basically, the dense layer is used to change the shape of the vector according to dimensions. Operation of dense layer is presented in Eq. 1.

$$\begin{aligned} Output = activation\left( dot\left( input, kernel\right) + bias \right) \end{aligned}$$
(1)

where bias represents a biased value used in machine learning to optimize the model, the weighted data form presented by the kernel and the dot presents the dot product of the input values and their corresponding weighted values.

3.2.4 Dropout rate

One of the regularization techniques mostly used in this study was dropout that is utilized to decrease the model complexity and also preventing the overfitting problem. Applying “dropout” by randomly deactivating a specific number of neurons associated with the layer using satisfied “P” probability by using the algorithmic equation from the Bernoulli distribution. So, if you transform 50% of the activation’s of the layers into zero. During training the pass of feed-forward the neural network would not be able to rely on the performance of the specific activation’s. As a result, the neural network will train on diverse, irrelevant features. The network cannot rely on the appropriate neurons and the sequence of these neurons presented.

3.3 VGG16 model

An annual competition under the name of ImageNet Large Scale Visual Recognition Challenge (ILSVRC) is held every year in which multiple teams participate. The challenges of this competition consist of two tasks. First, it belongs to object detection from the dataset of 200 classes and the second is image classification from the image dataset that consists of 1000 classes. The dataset consists of 1.2 million training images, 150,000 testing images and 50,000 validation images. VGG16 (Simonyan and Zisserman 2014) proposed in this competition by Simonyan and Zisserman were competed as a group from Oxford University and won 1st and 2nd place. VGG16 is a convolutional neural network and the architecture depends on the deep convolutional layers that were named after the Visual Geometry Group (VGG) from the Oxford University. VGG16 architecture consists of 16 convolutional layers and 3 fully connected layers. the minimum number of channels starting from the 64 number of channels and increasing with the factor of 2 until it reaches 512 channels. VGG16 depends on a smaller kernel size than the AlexNet and as well outperforms the AlexNet in the case of image classification.

3.4 AlexNet

The AlexNet (Krizhevsky et al. 2012) is one of the convolutional neural networks that is based on the architecture that was designed by Alex Krizhevsky with the contribution of IIya Sutskever and Geoffrey Hinton. He competed in the ILSVRC competition in 2012. This model architecture consists of the eight learnable layers from which convolutional layers are five and fully connected layers are 3. It consists of 96 kernels with size 11 \(\times \) 11 \(\times \) 3 using the strides of four pixels in the start with 1st convolutional-2D layer. The second layer consists of 256 kernels that extract features from the output of the first layer. Th size of the kernel is 5 \(\times \) 5 \(\times \) 48 in the second layer. The remaining 3rd, 4th, and 5th layers are connected completely with each other by connecting the number of neurons of each layer without any interference of the pooling and normalization layers.

3.5 Evaluation parameters

The deep learning approach convolutional neural network with image augmentation method is proposed in this study to perform classification operation on chest X-ray image to identify that the patient has a which type infection. There are four types of bacterial infection as Normal, COVID-19, Virus bacteria and Virus Pneumonia. The CODISC-CNN needs to be evaluated through several scientific methods to measure the scope and worthiness. The evaluation measures are used such as accuracy, precision, recall, F1-score, specificity, and F1-score.

3.6 Accuracy

Accuracy is the evaluation method used in classification problems to measure the correctly classified results or predictions. The fraction of the correctly predicted result with a number of a total prediction consists of two things. First, the correctly predicted and second the false prediction. For example, if the total number of records in the test data is 100 chest X-ray images then the total number of predictions is also 100. From which, it is not necessary that all the predictions that were made by the CNN model are correct. Most of them are false predictions and most of them are correct predictions. Accuracy measures the correctness of the trained model. If 10 images are false predictions then it means the 90 images are correctly predicted. So this shows that the model accuracy is 90%. The term of accuracy is explained in the form of Eq. 2.

$$\begin{aligned} Accuracy = \frac{(no.\;of\;CP )}{(CP + FP)} \end{aligned}$$
(2)

where CP is correct prediction and FP is false prediction. (CP+FP) is the total number of predictions that consists of correct and false predictions.

$$\begin{aligned} Accuracy = \frac{(TP + TN)}{(TN + FP + FN + TP)} \end{aligned}$$
(3)

where,

  • TP presents the true positive rate. The TP is the truly predicted values from all the prediction that means there are four classes and how many predictions are from which class and in actual what is the class of the data. In actual the patient has no infection, it belongs to the normal class and the deep learning model is also predicted as normal then it is called a true positive prediction of normal class.

  • FP shows the false positive rate. Same like above if the actual class is normal and the model predicts it as infected of a different class then it is known as false predicted values.

  • FN presents the false negative rate. The model presents the prediction that the patient is normal but if the actual patient is infected that is the false-negative case.

  • TN shows a true negative rate. The model presents the prediction and illustrates that the patient is infected or having a virus bacteria infection or covid19 or virus pneumonia and in actuality the patient is really infected with the same class as predicted by the model then it is known as a true negative case.

In performance evaluation metric accuracy as shown in Eq. 3 (TP + TN) is the truly predicted rate consists of true positive cases plus true negative cases which is a total number of true predicted values and fractionated with a total number of predictions such as TP + TN + FN + FP.

3.7 Precision

Precision is the measurement of the effectiveness of the model. The precision evaluates the truly positive prediction from the total number of true predictions as shown in Eq. 4. The precision helps to improve the CNN model because these infections that we are dealing with in this study are dangerous for the life of human beings. As discussed in Table 1. The whole world is in the effect of COVID19 infection. It is necessary for the deep learning model to predict the infected patient perfectly which helps the doctor to treat the patient in the best manner and save the life.

$$\begin{aligned} Precision = \frac{(TP)}{(TP + FP)} \end{aligned}$$
(4)

where TP is the true prediction rate, FP is the false prediction rate and (TP + FP) is the total number of true predictions.

3.8 Recall

The recall is also known as sensitivity. It presents the total number of actual positive predictions. There is a concept that is being used in this study that how many actual positive cases are predicted positive as well out of all positive and negative cases as shown in Eq. 5.

$$\begin{aligned} Recall = \frac{(TP)}{(TP + FN)} \end{aligned}$$
(5)

where, (TP + FN) is the total number of positive and negative prediction.

3.9 Specificity

Specificity is the opposite of recall. The recall identifies the number of actual positive predictions from the total positive and negative prediction as shown in Eq. 6. But the specificity measures the total predicted negative cases from the (TN + FP).

$$\begin{aligned} Specificity = \frac{(TN)}{(TN + FP)} \end{aligned}$$
(6)

4 Results and discussion

The classification of the Normal, COVID-19, Virus Bacteria, and Virus Pneumonia from chest X-ray images based on Convolutional network is proposed in this study. In the previous 7 to 8 months the COVID-19 spread very furiously and took so many lives. In this emergency situation, doctors need to identify the infection type in the patient. The virus bacteria and virus pneumonia are mostly similar in symptoms like in both cases the patient is infected with flu and coughing. But the X-ray images showing different results. The proposed study is evaluated in this section on how effectively the classification can be performed for the multiple classes.

4.1 Experimental result

The experiments are carried out in three different ways. First, the experiments are performed with only two classes Normal And COVID-19. In the second phase, the experiments are carried out with three classes Normal, COVID-19, and Virus Bacteria. In the third phase, the experiments are carried out by using three classes Normal, COVID-19, Virus Bacteria, and Virus Pneumonia. These experiments are carried out by using deep learning convolutional Neural networks such as the Proposed approach, AlexNet, and VGG16.

4.2 Results with the proposed approach

The CODISC-CNN consists of 8 weighted layers and 2 fully connected layers, from which the 5 convolutional layers with two max-pooling layers and 1 average pooling layer are used to design the proposed model. Table 3 presents the results of the proposed convolutional model according to the 2 classes, 3 classes, and 4 classes by using evaluation parameters accuracy, precision, recall, and F1 score. The results illustrate that the proposed model achieves the highest results with two classes with the accuracy rate of 0.97210%, the precision is 0.98214%, the recall is 0.98761% and 0.97986% of F1 score. The CODISC-CNN model consists of 5 convolutional layers that consist of 130,830 parameters. The first convolutional layer extracts the features from the image input that is based on the RelU activation function layer with 16 channels, 3 \(\times \) 3 kernel, and strides of \(2 \times 2\). Then this output map is passed to the next convolutional layer. The second convolutional layer depends on the 32 channels with a kernel size of \(4 \times 4\) and strides of 1 \(\times \) 1 that extracts the number of features from the first output map. Then to reduce the number of features and extracts the useful feature we use max-pooling layer that helps in the classification process. The max-pooling layer is dependent on the pool size of \(2 \times 2\) with the dropout layer that is dropping the number of neurons with the rate of 0.4 which reduces the number of features from 130830 to 77675. These features are reduced again by the use of 3 and 4 convolutional layers that are implemented with a kernel size of \(3 \times 3\) and stride \(2 \times 2\) and \(1 \times 1\) and ReLU used as an activation function. These two convolutional layers and another max pooling layer with the pooling size of \(2\times 2\). That reduces the number of features from 77,675 to 19,067. After this to get the least number of features that are useful in the fully connected layer, another convolutional layer is used with the global average pooling layer. The global average pooling layer is used to extract a single from the one feature map and convert the number of feature maps into a collection of linear features that are easily passed to the next fully connected layer that is a dense layer. The dense layer consists of a sigmoid activation function that extracts the further features from the previous output map and classifies the class of the input image and identifies it that the chest X-ray scan of the patient has an infection or not and what is the type of infection.

Table 3 Statistics for the performance of the proposed approach

The results are also illustrated in the visualized form in Fig. 4 that presents the variations in the results. In the case of accuracy, the highest accuracy is obtained with two classes that present with blue color. In the overall graph, the highest results are illustrating that the highest results are achieved with 2 classes that outperform other classes. When the experiments are carried out by the two classes of the chest X-ray image dataset. The CODISC-CNN has to only classify in between the binary classes that are the patient is normal or infected with COVID-19. The learning performance of the CODISC-CNN enhances in this case because the computational complexity reduces. As discussed in Sect. 3.5, the accuracy score is the number of true predictions over all the number of predictions. The highest accuracy percentage achieved is 0.97210% with two classes, 0.89855% is achieved with three classes and 0.84762% is achieved with four classes. This shows that with two classes the proposed model achieved 0.97210% true prediction. This prediction rate consists of Normal and COVID-19 classes that mean the model predicts the 0.9721.0% prediction similar to the actual cases. The actual patient is infected with COVID-19 and the model also predicts it is infected with COVID-19. In the precision case, the model predicts with the precision of 0.98214% with two classes, 0.91410% with three classes, and 0.89293% of four classes. The precision is the true positive rate that means the total number of Truly predicted values over the total number of positive predictions. This presents how accurately the model predicts the true values from the COVID-19 classes over the true or false prediction of the same class. In the same way, the sensitivity or recall is the true negative rate means that how much prediction belongs to the Normal class over the total number of true or false predictions. The recall is 0.98761% with two classes, 0.97320% with three classes, and 0.98994% with four classes. The F1 score is the harmonic mean of the precision and recall which means it describes the balance between the classes of the dataset. The highest F1 scores achieved with two classes is 0.97986%, three classes are 0.95512%, and 0.93893% with four classes.

Fig. 4
figure 4

Comparative analyses of proposed model in terms of accuracy, precision, recall and F1-score

Further, the results are presented in the form of sensitivity, specificity, and AUC. In these experiments, the results of 2 classes also achieved the highest place as shown in Table 4 and Fig. 5.

Table 4 Sensitivity, specificity and AUC of the proposed approach

In the comparison of 2 classes, 3 classes, and 4 classes, the proposed CODISC-CNN performs better with 2 classes. The CODISC-CNN model can identify the COVID-19 patients much better than the others. The main aim of the CODISC-CNN is to classify the infected patients in this age of coronavirus that will help the doctor or clinical staff to prevent the severeness and save the patient’s life. The infected patients contain some anomalies in the chest X-ray images that is identified by the CODISC-CNN more efficiently without noisy data that means if the proposed study classifies the infected patient from only two classes then it increases the prediction rate by almost 5%. The CODISC-CNN is also performing well with multiple classes three and four classes. With three classes the results are 0.89855% in accuracy and with four classes the accuracy is achieved 0.84762%.

The analysis was also carried out and evaluated by using Sensitivity, specificity, and AUC rates as well. Table 4 presents the results with two, three and four classes. The overall results according to this table are more efficient with two classes that are 0.98761% sensitivity, 0.96221% specificity, and 0.9817% AUC.

Fig. 5
figure 5

Comparative analyses of proposed, VGG16 and AlexNet models

But in the case of three or four classes, there is no big difference. The proposed approach achieves 0.97320% sensitivity with three classes and 0.98994% with four classes that show the effectiveness of the proposed model that it can identify all four cases such as normal, virus bacteria, virus pneumonia, and COVID-19 with best prediction results.

4.3 Results analyses in comprehensive manners

The two most significant convolutional neural networks are also used in this study for comparison purposes. The results are extracted and evaluated on the basis of comparative analyses of the proposed approach, AlexNet, and VGG16 with two, three and four classes. The analysis of the overall results illustrates in Table 5 and Fig. 6 that the CODISC-CNN outperforms the AlexNet and VGG16 by the smallest variation of prediction results. The proposed design of the CODISC-CNN with a specified number of layer and image augmentation achieved the highest results in two, three, and four classes as compared to AlexNet and VGG16 models.

Table 5 Statistics for the performance of the proposed approach

AlexNet and VGG16 are predefined models as discussed in Sects. 3.3 and 3.4. These models are most popular in the field of image classification that consists of numerous convolutional layers than the proposed CODISC-CNN. The proposed architecture of the CNN model with the image augmentation techniques makes it more efficient in speed, accuracy and reduces the complexity of the model. As discussed in Table 5, the comparative analysis is presented in the terms of two classes, three classes, and four classes. In the comparative analyses of the proposed CNN model that outperform the AlexNet and VGG16 in the multi-class classification of the chest X-ray images. The results comparison of these transfer learning models with the proposed approach is visualized in Fig. 6.

Fig. 6
figure 6

Comparative analyses of proposed, VGG16 and AlexNet models

4.3.1 Significance of COSISC-CNN

In order to prove effectiveness of the proposed approach, there is need to compare it with other approaches. If we compare the result of our proposed model with state-of-the-art approaches from the literature as presented in Table 6. We can see that most of the models that performed good for the detection of COVID-19 were mostly trained on CT-Scan images (Zheng et al. 2020; Ardakani et al. 2020b). Another problem with the previous approaches is that if they achieved accuracy greater than 97% then they were more complex than other models, thus they were computationally costly and and have a large number of parameters that need to be tuned. Hussain et al. (2021) achieved 99% accuracy on chest X-rays and it is a 22-layer model and very complex.

Table 6 Sensitivity, specificity and AUC of the proposed approach

We have obtained superior performance as compared to many other studies in the literature with more number of classes and less complex model. However, in our work, we compared our proposed approach with state-of-the-art best performing models VGG16 and AlexNet on same dataset. Our proposed model is simple and less complex and outperformed the state-of-the-art approaches. We prefer X-ray images on the basis of implementation point of view as most of the hospital has X-ray facility but not CT scan facility.

However, the proposed CODISC-C outperforms other models when it is trained on the large number of X-ray images generated by the process of data augmentation. The limitation of this study is that the proposed approach could not train well on the small-sized datasets.

5 Conclusion

The CODISC-CNN model is used to classify the chest X-ray images in between the infected patient and in a normal patient. The reason for using X-ray images in this study is that it shows the contaminated parts of the lungs and is almost available in every hospital. Another problem faced by doctors to diagnose the type of infection because in the cold weather other bacteria got strong such as pneumonia and flu. Another aim of this study is to classify in between multiple diseases. The chest X-ray images dataset consists of 4 classes Normal, Virus bacteria, Virus pneumonia and COVID-19. The proposed approach consists of deep learning methods such as Convolutional Neural Network (CNN). The CODISC-CNN is effective with a large dataset. The image augmentation methods are used to rescale and increase the number of images from 700 to 10000. The images in the dataset are random in height and width then preprocessing is applied to the image and resize all the images into a fixed size: 120 \(\times \) 120 \(\times \) 3. Different experiments are carried out to evaluate the proposed model. Experiments are carried out for COVID-19 X-ray image classification with two classes (Normal and COVID-19), three classes (Normal, COVID-19 and Virus bacteria) and Four classes (Normal, COVID-19, Virus bacteria and Virus Pneumonia). The CODISC-CNN is evaluated on different evaluation parameters such as Accuracy, Precision, Recall, Specificity, and F1-score. The highest results achieved with two classes. The comparative analysis is performed with advanced convolutional neural network models such as AlexNet and VGG16. The CODISC-CNN outperforms the AlexNet and VGG16 approximately in all class results. For the researchers to do future work, the directions are considered as the image segmentation can be applied with different color saturation techniques.