Literature DB >> 34723208

A Transfer Learning-Based Approach with Deep CNN for COVID-19- and Pneumonia-Affected Chest X-ray Image Classification.

Soarov Chakraborty1, Shourav Paul1, K M Azharul Hasan1.   

Abstract

The COVID-19 pandemic creates a significant impact on everyone's life. One of the fundamental movements to cope with this challenge is identifying the COVID-19-affected patients as early as possible. In this paper, we classified COVID-19, Pneumonia, and Healthy cases from the chest X-ray images by applying the transfer learning approach on the pre-trained VGG-19 architecture. We use MongoDB as a database to store the original image and corresponding category. The analysis is performed on a public dataset of 3797 X-ray images, among them COVID-19 affected (1184 images), Pneumonia affected (1294 images), and Healthy (1319 images) (https://www.kaggle.com/tawsifurrahman/covid19-radiography-database/version/3). This research gained an accuracy of 97.11%, average precision of 97%, and average Recall of 97% on the test dataset.
© The Author(s), under exclusive licence to Springer Nature Singapore Pte Ltd 2021.

Entities:  

Keywords:  COVID-19; Deep learning; MongoDB; Pneumonia; Transfer learning

Year:  2021        PMID: 34723208      PMCID: PMC8547126          DOI: 10.1007/s42979-021-00881-5

Source DB:  PubMed          Journal:  SN Comput Sci        ISSN: 2661-8907


Introduction

Medical Imaging plays a significant role in the modern healthcare system. Advancements of medical imaging devices, like Computed Tomography (CT), Magnetic Resonance Imaging (MRI), and X-Ray Imaging have become extremely necessary for disease diagnosis. Deep learning plays an essential factor in the medical industry as it can achieve human-level accuracy for image classification and segmentation tasks [1]. Deep learning can perform great on tasks in the fields like computer-aided diagnostics [2], recognition of lesions and tumors [3], and brain–computer interface [4]. Deep learning can easily execute time-consuming tasks, like detect symptoms of COVID-19 and Pneumonia from the chest X-ray images as the lungs of affected patients carry some visual marks of that distinct disease. Newly identified coronavirus causes an infectious disease namely COVID-19 [5]. Many patients who are suffering from COVID-19 can have minor to moderate effects and recover without additional care. An infected person’s cough and sneeze primarily spread COVID-19. Pneumonia is usually caused by viruses, fungi, and bacteria and creates infection in the lungs [6]. Both COVID-19 and pneumonia become life-threatening for those who have chronic diseases. These diseases decrease the body’s oxygen level and create complications for a person to breathe. Patients with serious conditions have to be hospitalized and need to be on ventilator support. DBMS plays an important role in the medical field to save data for further analysis. Traditional Database Management Systems are inadequate in semi-structured and unstructured data because of not maintaining Big data features, namely velocity, value, variety, validity, veracity, volume, and volatility [7, 8]. Several high-tech companies like LinkedIn, Google, Facebook, and Amazon have customized storage systems to operate with huge data volumes. Not Only SQL (NoSQL) is a distributed database management system, and its demand is increasing to handle big data efficiently. As working with vast amounts of data, big companies develop their NoSQL databases, i.e., Ebay’s MongoDB [9], Google’s Bigtable [10], Facebook’s Cassandra [7]. In this paper, we developed a system using the transfer learning method to classify chest X-ray images into COVID-19, Pneumonia, and Healthy. At first, we applied several image processing techniques on the chest X-ray images, and used pre-trained VGG-19 architecture, and transferred weights for classification purposes. Finally, MongoDB [9] is used as a database to store the original image and corresponding category images as MongoDB needs less data load time and query time than traditional RDMS in the case of BLOB files. Here, our goal is to make a flexible system that can modify in the future. Our system has achieved a higher accuracy using a pre-trained model’s most of the features. Moreover, this work describes the background database and the advantage of using this kind of database to store classified data for further study. By connecting the deep learning model with the database makes this research complete and formulates a new dimension. The rest of the paper is arranged as follows: “Related Works” describes some related and important recent works. “X‑ray Image Classification” outlines the methodology of this work. The experimental outcome is analyzed in “Performance Analysis”. Finally, a summary of our findings is described in the “Conclusions” section.

Related Works

In recent times, several good works are done utilizing Convolutional Neural Network to solve medical-related problems such as detecting brain tumors from MRI images, breast cancer recognization, classification of diseases using X-ray images [11]. Fukushima originally introduced CNN with the help of the model developed by Wiesel and Hubel [12]. By utilizing CNN, segmentation of neuron membranes was proposed by Ciresan et al. [13]. Wang et al. [14] developed a unique dataset with 108,948 X-ray images of 32,717 patients, which accomplished excellent outcomes utilizing a deep CNN. Rajpurkar et al. [15] developed a deep CNN architecture to identify 14 distinct pathologies from chest X-ray images, and the model contains 121 layers. Zhou et al. [16] applied the transfer learning approach for distinguishing between malignant and benign tumors by utilizing InceptionV3 architecture. Deniz et al. [17] introduced a classifier by utilizing a pre-trained VGG-16 architecture for breast cancer. During the feature extracting procedure, the proposed system used AlexNet architecture. Furthermore, transfer learning was applied to smaller datasets of MRI images, and the time of feature extraction portion utilize pre-trained networks [18]. Yang et al. [19] utilized GoogLeNet and AlexNet for their experiment on glioma grading, and GoogLeNet displayed excellent results for the analysis compare to AlexNet. Here, we successfully applied the transfer learning approach on the pre-trained VGG-19 architecture. We measured the system’s performance for the classification of COVID-19-affected, Pneumonia-affected, and Healthy people from the chest X-ray images. Furthermore, MongoDB is used as a storage for the original images and classified labels. Overview of the whole system

X-ray Image Classification

This section includes the following steps: image pre-processing, classification of X-ray images using transfer learning, and finally, description of data storing process in MongoDB database. The entire working process of the system is shown in Fig. 1.
Fig. 1

Overview of the whole system

Image Pre-processing

Image pre-processing result for the system Histogram of various pre-processing level outcomes We applied several image processing steps to make the image ready for the experiment. The primary image was 5123 sized. We resize the images into 2563 size. Furthermore, apply a Gaussian filter on the resized image and produce a filtered image. Transfer parameters from VGG-19 for the classification task Architecture of the classification model Equation 1 represents the 2D Gaussian function with a kernel of size 55 is applied. Here, X and Y indicate the length between origin and the horizontal axis and the length between origin and the vertical axis, respectively, and indicates the standard deviation. It removes noise from a resized image. The histogram equalization is applied on every filtered image. This technique enhances the contrast of an image and also spread out values that appear most frequently. These X-ray images are multichannel, and each image has three different (RGB) channels. To utilize the full power of VGG and achieve higher accuracy multi-channel X-Ray images are used, as the VGG-19 [20] model is trained using three channels images. Therefore, we have to separate each channel and apply histogram equalization individually. After that, we merge back every histogram equalized channel and get an equalized image. Figure 2b shows the resized image of Fig. 2a. Figure 2c represents the filtered image as it helps to reduce noise and make the image smoother. Also, it enhances the probability for detecting features. Furthermore, Fig. 2d shows the histogram equalized image. Histogram equalization is applied for balancing the contrast of an image by adjusting the intensity distribution. The goal of this method is to provide a linear relationship to the cumulative likelihood function. Figure 3 represents histogram on various pre-processing level outcomes. Figure 3a–c represents the histogram of primary, resized and filtered image, respectively, for an X-ray image. Figure 3d represents the histogram of an equalized image where all the contents are balanced.
Fig. 2

Image pre-processing result for the system

Fig. 3

Histogram of various pre-processing level outcomes

Transfer Learning for X-ray Image Classification

Transfer learning is a process to reuse parameters that have been trained before. It implies transferring the pre-trained parameters to a different model. Moreover, pre-trained layers can be applied as a feature extractor. VGG-19 is a 19-layer deep architecture [20]. It is a CNN model trained on the ImageNet dataset that includes millions of images of 1000 categories. The input layer’s size of VGG-19 is 2243, followed by several filters, each with a kernel size of 33. Therefore, originally it takes three-channel images. It contains multiple convolutional layers. The convolution layer applies several convolution kernels for the extraction of various features.

Transfer Parameters from VGG-19

Figure 4 shows the transfer parameters from VGG-19 for the classification task. From the 19 layers of the VGG-19 architecture, we used the first 16 layers. The architecture of the first 16 layers of VGG-19 is not the same as VGG-16 [20]. VGG-16 has fewer convolutional layers than VGG-19. All of these convolutional layers of VGG-19 are also sequentially organized in five blocks. These parameters are considered frozen or non-trainable.
Fig. 4

Transfer parameters from VGG-19 for the classification task

Parameters for the classification model

The Classification Model

We replace the original input layer of the VGG-19 model with a layer that can take 2563 sized images as input. Instead of the last three layers, added a dense layer with three neurons and used softmax as an activation function. This layer is trainable. Figure 5 represents the entire architecture of the classification model. The overview of the trainable and non-trainable parameters is shown in Table 1.
Fig. 5

Architecture of the classification model

Table 1

Parameters for the classification model

LayersParameters
Block1 (Non-trainable)38,720
Block2 (Non-trainable)221,440
Block3 (Non-trainable)2,065,408
Block4 (Non-trainable)8,259,584
Block5 (Non-trainable)9,439,232
Dense (Trainable)98,307
Total20,122,691
Total trainable98,307
Total non-trainable20,024,384

Mongodb as a Data Storage

In the medical domain, it is essential to store data in a database for further analysis. Figure 6 illustrates the workflow of data storage in the medical domain.
Fig. 6

Workflow of data storage in the medical field

Workflow of data storage in the medical field Store images in the MongoDB server BLOB file is a collection of binary data. Images, audios, and other types of records are saved as blob files. If an image is converted into a BLOB file, that image becomes compressed and uses less space. Further, we can do several operations as it already been converted into a binary file. Moreover, at the moment of movement of the database not have to bother with the distributing files. For saving an X-ray image in the database, we have to convert it into a BLOB file. The relational database management systems are popular technology in the case of data storage. However, it is difficult to work with BLOB files in the traditional SQL database. Storing BLOB files into an SQL database requires a huge data query process. If the size of an image is small, it can easily store as a BLOB in the SQL DBMS. However, for a large file storing or retrieving BLOB on RDBMS is a costly process and needs large memory. Furthermore, the SQL databases face challenges in the situation like the scalability of the system, and fast data access during complicated operations [21]. It is easy to work with a BLOB file in the MongoDB database as it stores a BLOB file by splitting it into several numbers of chunks. At the time of data retrieval, all the chunks merge into one single file and produce the result. For this reason, MongoDB needs lesser data load time and query time than traditional RDMS. Therefore, we used MongoDB with GridFS interface as a data storage for the system. After the classification step, the original images and the corresponding label have to store in the MongoDB database. However, MongoDB cannot retain a document file that crosses 16 MB in size. To tackle this problem, the GridFS file storage system is introduced. A combination of MongoDB and GridFS can store image files that are massive in size. Data are separated into two collections in the MongoDB server. These are fs.files and fs.chunks. In fs.files, there are different fields like id, file name, encoding type, MD5, chunk size, length, and upload time. The id field contains a unique key for a file. For this experiment, all the labels are stored in the file name field. The chunk size field determines the volume of a chunk in bytes. The upload time field stands for the time of uploading the file. The server automatically generates MD5, and it represents a check value. In the case of fs.chunks collection, there are several fields like id, chunk number, file id, and data package. Here id field contains a unique key for a chunk. File id is the same as id in the fs.files for a particular file, and it’s fixed for all the chunks of the same file. The chunk number field represents the chunk’s position, and the data package contains a binary representation of the chunk for an image. Figure 7 represents the data storage for an X-ray image using MongoDB and GridFS interface.
Fig. 7

Store images in the MongoDB server

Performance Analysis

The experimental outcomes are illustrated in this Section. We analyze system performance using different performance metrics.

Dataset

The chest X-ray images obtained from different publicly available sources [22, 23]. We used 3797 images, among these COVID-19 (1,184 images), Pneumonia (1294 images), and Healthy (1319 images). We separated them into three sets from the original dataset and 2733 images, 72% of the dataset, were used for training purposes. 304 images, 8% of the dataset, were used for validation purposes, and the rest of the 760 images, 20% of the dataset, were used for testing purposes. Table 2 represents the summary of the used dataset.
Table 2

Description of dataset

LabelTrain setValidation setTest setTotal
COVID-19852942381184
Pneumonia9321082541294
Healthy9491022681319
Description of dataset

Performance Metric

The performance of the classification model is tested using precision, recall, and F1-score. We also use the confusion matrix and ROC curve. We average all the metrics of different classes for validation purposes and give priority base on precision, recall, and F1 score, respectively. During measuring, the following equations are used.

Experimental Setup

We executed all the image pre-processing steps analysis on a computer having an operating system of Windows 10, with NVIDIA GeForce GPU and 8 GB RAM CPU. The rest of the operations, including training and testing of the classification model, were executed on Colab. Adam optimizer [24] is applied to compile the classification model. Adam optimizer is a powerful optimization algorithm. Moreover, it combines different optimization techniques, including Root Mean Square Propagation, and sparse categorical cross-entropy is used as a loss function. Here, learning rate = 0.001 and momentum parameters = 0.9 & = 0.999. A batch size of 32 and 30 epochs were applied while fitting the training data on the model. Performance measure indices

Experimental Results

Figures 8 and 9 represent the accuracy and the loss of the training and validation set, respectively. We got an accuracy of 97.11% while testing the model on the test dataset.
Fig. 8

Accuracy curve for the classification process

Fig. 9

Loss curve for the classification process

Accuracy curve for the classification process Loss curve for the classification process Confusion matrix. Class 0 (COVID-19), Class 1 (Healthy), and Class 2 (Pneumonia) ROC curve of the classification task Comparison of recently used approaches for COVID-19 detection Figure 10 shows the confusion matrix for the X-ray image classification model. For testing purposes, 238 COVID-19-affected chest X-ray images as Class 0, 268 images of healthy chest X-ray as Class 1, and 254 images of pneumonia-affected chest X-ray as Class 2 were used. Table 3 represents performance measure indices. The model achieved a precision of 99%, 95%, 97% for Class 0 (COVID-19), Class 1 (Healthy), and Class 2 (Pneumonia), respectively. The average precision is 97%. Figure 11 represents the ROC curve. The overall accuracy grows higher as the curve moves nearer to the top left corner.
Fig. 10

Confusion matrix. Class 0 (COVID-19), Class 1 (Healthy), and Class 2 (Pneumonia)

Table 3

Performance measure indices

ClassPrecisionRecallF1-scoreSupport
Class 0 (COVID)0.990.970.98238
Class 1 (Healthy)0.950.980.96268
Class 2 (Pneumonia)0.970.960.96254
Avg./Total0.970.970.97760
Fig. 11

ROC curve of the classification task

Moreover, the recommended system performance is analyzed in Table 4 with related works. This table also describes the methodology behind all the tasks. The proposed method has gained 97.11% accuracy, which is best in all the referenced studies.
Table 4

Comparison of recently used approaches for COVID-19 detection

ReferencesDatasetMethodologyAccuracy (%)
This workX-ray imageTransfer learning97.11
Sethy et al. [25]X-ray imageDeep learning and SVM95.33
Heidari et al. [26]X-ray image (Same dataset)Transfer learning94.50
Pathak et al. [27]X-ray image (Same dataset)Transfer learning93.02
Oh et al. [28]X-ray imageStatistical approach88.90
Wang et al. [29]CT scanTransfer learning85.20
Azemin et al. [30]X-ray imageDeep learning71.90

Conclusions

In this paper, our purpose is to develop a deep learning-based method to classify COVID-19- and Pneumonia-affected chest X-ray images by applying transfer learning. Here, we use the pre-trained VGG-19 architecture and transfer its weights and get an excellent accuracy. Moreover, we use MongoDB as a database to store the original image and corresponding category. Our findings confirm that deep learning can make the diagnostic process more comfortable as it can achieve human-level accuracy for image classification tasks. Deep learning can efficiently execute time-consuming tasks, like detect symptoms of COVID-19 and Pneumonia from the chest X-ray images, and it will be an excellent asset for doctors. Therefore, Deep learning will play an impactful role in saving valuable lives.
  15 in total

Review 1.  A survey on deep learning in medical image analysis.

Authors:  Geert Litjens; Thijs Kooi; Babak Ehteshami Bejnordi; Arnaud Arindra Adiyoso Setio; Francesco Ciompi; Mohsen Ghafoorian; Jeroen A W M van der Laak; Bram van Ginneken; Clara I Sánchez
Journal:  Med Image Anal       Date:  2017-07-26       Impact factor: 8.545

Review 2.  Deep learning based computer-aided diagnosis systems for diabetic retinopathy: A survey.

Authors:  Norah Asiri; Muhammad Hussain; Fadwa Al Adel; Nazih Alzaidi
Journal:  Artif Intell Med       Date:  2019-08-07       Impact factor: 5.326

3.  Deep Transfer Learning Based Classification Model for COVID-19 Disease.

Authors:  Y Pathak; P K Shukla; A Tiwari; S Stalin; S Singh; P K Shukla
Journal:  Ing Rech Biomed       Date:  2020-05-20

4.  Transfer learning based histopathologic image classification for breast cancer detection.

Authors:  Erkan Deniz; Abdulkadir Şengür; Zehra Kadiroğlu; Yanhui Guo; Varun Bajaj; Ümit Budak
Journal:  Health Inf Sci Syst       Date:  2018-09-28

Review 5.  A literature review and survey of childhood pneumonia etiology studies: 2000-2010.

Authors:  Zunera Gilani; Yuenting D Kwong; Orin S Levine; Maria Deloria-Knoll; J Anthony G Scott; Katherine L O'Brien; Daniel R Feikin
Journal:  Clin Infect Dis       Date:  2012-04       Impact factor: 9.079

6.  Glioma Grading on Conventional MR Images: A Deep Learning Study With Transfer Learning.

Authors:  Yang Yang; Lin-Feng Yan; Xin Zhang; Yu Han; Hai-Yan Nan; Yu-Chuan Hu; Bo Hu; Song-Lin Yan; Jin Zhang; Dong-Liang Cheng; Xiang-Wei Ge; Guang-Bin Cui; Di Zhao; Wen Wang
Journal:  Front Neurosci       Date:  2018-11-15       Impact factor: 4.677

7.  The COVID-19 epidemic.

Authors:  Thirumalaisamy P Velavan; Christian G Meyer
Journal:  Trop Med Int Health       Date:  2020-02-16       Impact factor: 2.622

8.  A Deep Learning-Based Radiomics Model for Differentiating Benign and Malignant Renal Tumors.

Authors:  Leilei Zhou; Zuoheng Zhang; Yu-Chen Chen; Zhen-Yu Zhao; Xin-Dao Yin; Hong-Bing Jiang
Journal:  Transl Oncol       Date:  2018-12-17       Impact factor: 4.243

9.  Deep learning for chest radiograph diagnosis: A retrospective comparison of the CheXNeXt algorithm to practicing radiologists.

Authors:  Pranav Rajpurkar; Jeremy Irvin; Robyn L Ball; Kaylie Zhu; Brandon Yang; Hershel Mehta; Tony Duan; Daisy Ding; Aarti Bagul; Curtis P Langlotz; Bhavik N Patel; Kristen W Yeom; Katie Shpanskaya; Francis G Blankenberg; Jayne Seekins; Timothy J Amrhein; David A Mong; Safwan S Halabi; Evan J Zucker; Andrew Y Ng; Matthew P Lungren
Journal:  PLoS Med       Date:  2018-11-20       Impact factor: 11.069

10.  A deep learning algorithm using CT images to screen for Corona virus disease (COVID-19).

Authors:  Shuai Wang; Bo Kang; Jinlu Ma; Xianjun Zeng; Mingming Xiao; Jia Guo; Mengjiao Cai; Jingyi Yang; Yaodong Li; Xiangfei Meng; Bo Xu
Journal:  Eur Radiol       Date:  2021-02-24       Impact factor: 5.315

View more
  3 in total

1.  Detection and Prevention of Virus Infection.

Authors:  Ying Wang; Bairong Shen
Journal:  Adv Exp Med Biol       Date:  2022       Impact factor: 2.622

2.  Machine Learning-Based Research for COVID-19 Detection, Diagnosis, and Prediction: A Survey.

Authors:  Yassine Meraihi; Asma Benmessaoud Gabis; Seyedali Mirjalili; Amar Ramdane-Cherif; Fawaz E Alsaadi
Journal:  SN Comput Sci       Date:  2022-05-12

3.  Deep Residual Neural Network for COVID-19 Detection from Chest X-ray Images.

Authors:  Amirhossein Panahi; Reza Askari Moghadam; Mohammadreza Akrami; Kurosh Madani
Journal:  SN Comput Sci       Date:  2022-02-21
  3 in total

北京卡尤迪生物科技股份有限公司 © 2022-2023.