COVID-19 DIAGNOSIS USING TRANSFER LEARNING ON X-RAY IMAGES

: Deadly corona virus disease has an effect on people's everyday lives condition and the economy of a country. Diagnose of COVID-19 in the patient in most of the laboratories used real-time reverse transcription polymerase chain reaction (RT-PCR) technique. Initially disease, performance of RT-PCR is not up to the mark due to time required for the diagnosis and high false positives and false negatives outcomes. The diagnosis of this particular disease from radiography imageries is the fastest method. The imaging technique is thought to be a quick diagnosis mechanism to rapidly identify suspicious patients in an epidemic area. We have suggested and developed an automatic system for the detection of COVID-19 samples from normal and pneumonia cases by chest x-ray. We have combined 5 publicly available datasets which include COVID-19 from Kaggle, Medley, SIRM and NIH images comprising Healthy, Pneumonia and infected patients. Numerous pre-trained transfer learning models namely Resnet50, VGG19, VGG16, MobileNetV2, InceptionResNetV2, EfficientNetB0 and ResNet Mobile have been used for disease diagnosis by utilizing the chest x-rays. A total of 3000 images with class balanced dataset are used to determine the performance suggested method. We have also compared the performance of seven pre-trained transfer learning algorithms to help identify COVID-19 detection efficiency of transfer learning methods for diagnosis using chest x-ray. Resnet50 shows highest classification accuracy of 97%.


INTRODUCTION
COVID-19 is a pandemic instigated from Wuhan China in late 2019 and blowout all around the globe in few months, posing a serious public health hazard.SARS-CoV-2 was COVID-19 the virus that created the epidemic (severe acute respiratory syndrome coronavirus [1].It's a novel virus that never been seen in humans before [1].Large number of people got affected by this virus having symptom similar to Pneumonia.Common symptoms includes fever, loss of taste or smell, cough and tiredness but less serious symptoms are aches and pains, rashes on skin, headache, red eyes, diarrhea, sore throat and soiling on fingers.COVID-19 and earlier beta-coronaviruses have extremely similar signs.According to Chinese government guidelines, blood sample ,DNA sequencing for lungs or trials must be validated as primary pointer for (RT-PCR) [1].RT-PCR method takes 4 or may be 6 hours to finish, it takes an extensive period for the considering of COVID-19.In addition to being ineffective, RT-PCR test kits are in low supply [2].The shortage of antibody test kits as well as the time it takes to get test results in many countries, providing a significant barrier in developing or rural areas.Similarly, CT scan is not a feasible technique for identifying 1  coronavirus because it's very dangerous for human health, it has high cost as well as provides high ionizing radiations and the inadequate availability of medical equipment in less developed regions [1] [25].In locations where viral or antibody testing is not accessible the use of radio graphical images as first screening might be critical.To overcome the shortcomings of previous methods for detecting automated and reliable technique is required to meet the daily need for a huge volume of new positive trial cases, especially as the pandemic enters its fifth wave [3].X-ray imaging equipment is commonly accessible in every hospital, public health clinics and even less developing areas, it can be utilized to identify virus or other disease in a patient and it is very cost effective and low ionizing radiations.Because new COVID-19 waves outbreak is likely in many nations, pandemic preparations will involve increased use of transportable chest X-ray scanners, which are more readily available and pose less patient safety concerns than CT equipment [1].Presented a new technique to detect the coronavirus as a positive patient by employing chest X-ray images.Classes like positive, Pneumonia and Healthy disease are segregated to identify the patient's conditions.Moreover, the proposed method will identify and mark exact part of the chest X-ray that is affected by disease.The accuracy of RT-PCR falls short due to extended diagnosis times and the prevalence of both high false positives and false negatives there is a need to develop a robust model that performs accurate diagnosis of the positive cases on multiple types of radiograph scans.The imaging conduct is considered as a fast diagnostic tool for quickly detecting possibly problematic individuals within a pandemic region.

II. RELATED WORK
In this research an automated systems to identify positive cases with the help of X-rays and CT-images.In the recent past CNN which is popular enough with Alex-Net architecture on Transfer Leaning.Datasets from 5 countries that consists of CT and chest X-ray samples.They achieved accuracy of CNN model is 98% however Alex-Net pertains 94.1% [5].COVID-19 can be detected with the help of pneumonia.The author collected three classifications using model integration and transfer learning.Two public available datasets are deployed to represent the efficiency of the model.The data augmentation technique are further applied to enhance the quantity of data.Author's proposed two pre-trained model based on transfer learning called ResNet-101 and ResNet-152 both models receive input and weight updating functions with the higher precision model weight is used.They achieved 96.1% accuracy [6].The author used CXR images technique to detect infection on Kaggle datasets.They examined 150 COVID-19 images for their model.The outcome obtained from their model was 93% [7].Created a model COVIDX-Net for identifying COVID-19 patients with the use of CXR samples that achieved 0.90% accuracy containing 25 samples of COVID-19 and 25 samples without COVID-19 as healthy images [8].In order to analyses CXR in a quick time, deep learning techniques were used.De-Trac model which was built on CNN network for classifying COVID-19 CXR samples.They used publically available datasets which consists of 5,856 samples.They have also proposed a comparative study of eight pre-trained models which was established on "Transfer Learning".These algorithm was learned on 5,856 CXR samples and achieved 96% accuracy on these two distinct models namely MobileNetV2 and InceptionV3 [9].Dark-Net Model for identifying infected people using CXR samples.Author's collected datasets with two different open source databases.By using Dark-Net model multi-class problems in COVID-19 were classified.Mode is designed to provide accurate diagnostics for both binary and three class classification.Binary classes has achieved 0.98% accuracy while for multiclass cases can accurately diagnose with 87% [10].Presents a Deep learning model on CXR samples.Three Deep CNNs networks were employed in the suggested study.They utilized a dataset that included 50 COVID-19 samples and 50 healthy sample, all of which were re-scaled to 224 x 224 pixels.Transfer learning techniques are applied to address the challenge of a limited number of samples or images.Furthermore, samples were separated into two portion, majority of the dataset simulated through training and remaining 20% was considered for testing purpose.DCNN was deployed on pre-trained models e.g., Inception-ResNetV2, ResNet-50 and Inception -V3 that were able to classify patients from CXR samples.Findings indicated that the pre-trained model ResNet50 performed well and obtained 98% accuracy overall [11].Using the Keras library and the Tensor Flow training framework, the author designed a DL model for identifying COVID19 infection.They have built trained, and validated their model using total 50 CXR samples and divided the samples into two classes which was COVID-19 and healthy images.Due to limited data, their recommended model was able to diagnose positive patients with an accuracy, sensitivity and specificity respectively (90%, 100% and 80%) respectively [12].CXR samples can be used in this investigation instead of other modalities since they are quick to obtain and accessible.For the categorization of COVID-19, healthy, viral/bacterial pneumonia from CXR samples that was collected by several public sources.The author utilized a pre-trained Alex-Net model that already trained on related problem.They achieved the results with the help of multi-class and obtained accuracy, recall and sensitivity 94.00%, 91.30% and 84.78% and the accuracy, recall and sensitivity 93.42%, 89.18%, and 98.92% [13].Early identification of coronavirus might aid in the development of a treatment strategy and virus control choices.They have adopted 04 pertained models called VGG series, ResNet50, Xception and Inception for categorization.There are 115 samples of coronavirus patients, 322 photos of pneumonia and 6,361 photos of healthy patient used by the system.They achieved roughly recall and precision 80% for VGG series algorithms [14].Author used the approach of VGG architecture for the X-ray images classification.They utilized three publicly accessible COVID-19 CXR samples.Dataset one comprises three categories COVID-19, Healthy and Pneumonia.Dataset two comprises of 4 classes termed as COVID-19, Bacterial/Viral Pneumonia and Normal.Dataset three comprises of five classes termed as COVID-19, Bacterial/Viral Pneumonia, No-findings, Healthy and the results which they draw by using VGG is 87.49% [15][26].Table 1 displays the compassion of relevant literature in this context.The significance of the Internet of Things (IoT) is growing across various aspects of life, with a particularly noteworthy impact on enhancing the efficiency of healthcare systems.This importance was further underscored during the COVID-19 pandemic, where the demand for IoT solutions surged to enable remote monitoring and care for patients within the safety of their homes.The traditional practice of physically visiting doctors for minor complications during the pandemic posed risks of virus transmission and increased costs for patients.Moreover, critical patients faced challenges in promptly accessing emergency services, contributing to a higher mortality rate.To address these issues, the IoT has played a crucial role in healthcare services, employing interconnected networks to monitor COVID-19 patients effectively.This approach not only ensures the well-being of patients without the risk of virus transmission but also contributes to a reduction in the mortality rate during the COVID-19 crisis [4].The rapid global spread of the Coronavirus disease (COVID-19) has had a profound impact on the education sector, particularly due to widespread partial or complete lockdowns implemented worldwide between 2019 and 2022.Developing countries like Pakistan have been significantly affected by this pandemic, leading educational institutions to transition to online learning.However, this shift presented numerous challenges as these countries faced a shortage of teaching and digital experts, as well as insufficient resources and infrastructure, including limited access to the Internet of Things (IoT).The move from traditional to online education posed considerable hurdles for developing nations during the COVID-19 pandemic [5].Stigma encompasses adverse attitudes, beliefs, and stereotypes directed towards individuals or groups due to particular characteristics, behaviors, or conditions.This study seeks to explore social stigma attitudes, focusing on fear and discrimination, prevalent among healthcare workers in Pakistan amid the COVID-19 pandemic.Data was gathered from healthcare employees in both public and private hospitals within the Pakistan, utilizing a convenient sampling technique.A total of 280 responses were collected and subjected to analysis.The study employed constructs derived from prior research to evaluate data reliability, employing Cronbach's alpha for this purpose [6].Brain magnetic resonance (MR) images represent a highly effective means of detecting chronic neurological conditions such as brain tumors, strokes, dementia, and multiple sclerosis.They are particularly adept at assessing diseases affecting the pituitary gland, brain vessels, eyes, and inner ear organs.Numerous deep learning-based methods have been proposed for medical image analysis, with a focus on brain MRI images, to aid in health monitoring and diagnosis.Convolutional Neural Networks (CNNs), a subset of deep learning, are widely utilized for visual information analysis, including tasks like image and video recognition, image classification, medical image analysis, and natural language processing.This study introduces a novel modular deep learning model designed to leverage the strengths of established transfer learning methods (DenseNet, VGG16, and basic CNN architectures) for the classification of MR images while mitigating their limitations.Utilizing open-source brain tumor images from the Kaggle database, the model was trained using two approaches: an 80-20 split for training and testing phases, and 10-fold cross-validation.The evaluation demonstrated improved classification performance compared to known transfer learning methods, albeit with an associated increase in processing time [7].Vital difference of this study over rest of the techniques is Grad-CAM (Gradient-weighted Class Activation Mapping) distinguishes itself among visualization techniques due to its capacity to offer nuanced insights into the decision-making mechanisms of convolutional neural networks (CNNs).In contrast to alternative methods that may generate rudimentary or abstract visual representations, Grad-CAM produces heat maps pinpointing precise regions in an input image that significantly influence the model's prediction.Through the utilization of gradient information extracted from the final convolutional layer, Grad-CAM effectively captures the hierarchical features learned by the model, providing transparency and interpretability.The resulting detailed attention map facilitates an intuitive comprehension of the model's focus, thereby bolstering trust and aiding in model debugging.Grad-CAM's emphasis on high-resolution visualizations, along with its straightforwardness and applicability to various models, positions it as a valuable tool for researchers, practitioners, and stakeholders aiming to understand and validate the decision-making processes of deep neural networks across diverse applications.

III. MATERIAL AND METHOD
Medical diagnosis could be revolutionized by transfer learning, a subfield of machine learning.In order to rapidly understand the complex processes involved in diagnosis, transfer learning can use data from other sources.Predictive models and algorithms are created using existing data sets in order to identify patterns and make predictions about a patient's health.Improved patient outcomes can be achieved by reducing costs and time spent on diagnosis [27].Additionally, transfer learning can help to reduce bias in medical diagnosis by using different data sets and allowing medical professionals to focus on the patient rather than being limited by the data available.CNN architecture is mentioned in Figure 1.

. Process of GRAD-CAM technique used in this research
This Pandemic not only influenced and affected 30.8 million people around the world but also affected economic systems of most countries in the world [23].In this research, we comparatively tested seven (7) common state of the art pre-trained CNNs namely VGG-16, VGG-19, Resnet-50, Inception-ResNet-V2, EfficientB0, Mobile-NetV2 and Nas-Net Mobile to determine which CNN implementation is the most effective within the limitations of the publicly available COVID-19 database.The key goals of our experiments with these models is to point out the most suitable transfer learning model applicable for the available limited data for COVID-19 detection from x-ray samples.As we already know, in order to train DL models, huge data is required, which is not commonly accessible in this domain.(Figure 1) depicts the recommended methodology.This paper contribution in the following manners.

A. Dataset
The dataset used in this research was related to stroke disease.In this step, to generate the dataset, we combined and modified five diverse publicly available data repositories named as COVID-19 (Cohen), Kaggle, Mendeley, SIRM and NIH, a master dataset comprising of COVID-19, Healthy and Pneumonia images see (Figure 2).Training, validation and test sets of 3000 images of three classes were split into 60:20:20 respectively.We used same number of images of three classes to avoid the over fitting.The number of samples of COVID-19, pneumonia, and healthy are 600, 600, and 600, respectively.There are 600 total samples, with 200 of COVID positive cases, 200 pneumonia and 200 of healthy X-ray samples used as a training, validation and testing respectively, see Table 2.

B. Data Preprocessing
The following step involves by applying several pre-processing methods to the input data (See Figure 3).The objective of image pre-processing is to boost the visual information contained in each input image by eliminating or reducing the noise from the source image it helps network model to improve image quality by increasing contrast, eliminate low or high-frequency components, etc.

Pakistan Journal of Engineering Technology and Science (PJETS)
Volume 11.Issue.

C. Resizing And Image Augmentation
Considering the restricted size of our dataset, we used data augmentation to artificially expand the size of our training dataset.In this research, different data augmentation approaches are imposed on training samples help to resolve over-fitting issues.The zoom refers to zoom-in/magnify or zoom-out/reduce the picture built on arbitrarily value between 1 to ±0.1.The rotation termed as to spin angle in degrees like 10 degree used to generate randomly pictures between -10 to +10.

D. Pre-Trained Transfer Learning Models
Key objectives of the current research are to achieve state-of-the-art classification outcomes using widely or publically accessible data through "Transfer learning".We have implemented numerous deep learning models VGG-16, VGG-19, Resnet-50, Inception-ResNet-V2, Efficient-B0, Mobile-NetV2 and NasNet-Mobile for classification of COVID positive, pneumonia and healthy.These models need large volume of training data, which is yet to be available in this field [22].Considering the fact that transfer learning models utilized minimum amount of resources with least complexity.

E. Training and Classification of the Models
Data pre-processing, data augmentation and splitting techniques are applied to training dataset as soon as the data set volume enhanced it proceeds to the feature extraction stage.To build a vectorized features map, features from every model are flattened and composed all together.Resulting vector feature is processed by MLP (multi-layer perceptron) which classifies each image into the appropriate class.

A. Experimental Setup
Python programming language is considered as an implementation tool for current experiment.All research were implemented on Google Colab, Linux server 16.03 OS (operating-system) with the help of online cloud provider by using free GPU, TPU and CPU.Testing is performed with the help of Keras Application Programming Interface with a Tensor Flow.

B. Hyper-parameters Description
Both machine learning and deep learning algorithms have a key role on hyper-parameters.They are the parts of the model that have been learned from previous training data.It is critical to learn how to optimize them in order to obtain maximum performance.As a result, hyper-parameter tuning is a critical job, particularly when it emanates to deep learning in medical image processing.Table 3 exhibits all the models have different hyperparameters and feature extraction.

B.1 Analysis
We describe the multi-classification conclusions in this subsection, followed by a brief explanation of the findings presented by each model (See Figure 4).Resnet50:

B.2 Analysis
To understand these results, it is useful to consider the learning curves for all experiments as shown in (Figure 10).

C. The Grad-CAM Method
The "Grad-CAM" also called activation mapping is a technique that can truly highlight main areas in pictures to identify prediction in image classification.We utilize the Grad-CAM approach to focus on a specific area where our model could make predictions see (Figure 12).This method is applied through adjusting the layers and extracted relevant features of the model.In this research, jet color scheme is used.The yellow and aqua color represents the medium points, and red or dark red represents the maximum points.Features in the scan region defines a particular class [19].There are certain limits of the current model that can be overcome in the future.We have inadequate patient dataset available that ultimately affects the learning capability of the proposed models.In near future, supplementary patient data can be added explicitly COVID-19 patients that can ultimately increase the feature extraction abilities of the current model.Deeper analysis is necessary for distinguishing the COVID-19, pneumonia and normal patients.Current model can further be enhanced by addition of risk and survival prediction of positive patients that ultimately can be useful in healthcare development and management.

Pakistan 18 Figure 1
Figure 1.Process of GRAD-CAM technique used in this research

Figure 4 :
Figure 4: Confusion Matrix Models' training and validation accuracy.The end-to-end training procedure of proposed pre-trained models shown in Figure 11 depicts the model's training and validation accuracy during each epoch.It quite evident that both training and validation follows the same trend for Resnet50, VGG16, MobileNetV2, EfficientNetB0 models.On the other hand, models like VGG19, inception-ResNet-V2, and NAS-NetMobile also showed promising results even though models performance fluctuates.Figure 11 (a) that obtained highest training accuracy with the ResNet-50.Considering the overall performance, it's quite evident that accuracy on train and validation set, Resnet50, VGG16, MobileNetV2 and EfficientNetB0 showed more stability and better accuracy than the other three pre-trained models.Model's training and validation loss.Training and validation values of ResNet50, VGG16, MobileNetV2, EfficientNetB0 and NASNetMobile are shown in Figure 11 follow a similar pattern.Contrary to VGG19 inception-ResNet-V2 demonstrates different patterns.When it comes to the analysis of loss figures, it can be seen a phenomenal reduction of the loss values in all models while proceeding through the training stage.ResNet-50 model reduces loss values more quickly and reduces to zero.