Classification of COVID-19 in chest X-ray images using DeTraC deep convolutional neural network
Asmaa Abbas Mohammed M. Abdelsamea Mohamed Medhat Gaber
eess.IV cs.CV cs.LG stat.ML





Classification of COVID-19 in chest X-ray images using DeTraC        





Asmma Abbas Mathematics Department, Faculty of Science, Assiut University, Assiut, Egypt 

              asmaa.abbas@science.aun.edu.eg           

           Mohammed M. Abdelsamea School of Computing and Digital Technology, Birmingham City University, Birmingham, UK and Mathematics Department, Faculty of Science, Assiut University, Assiut, Egypt 

              mohammed.abdelsamea@bcu.ac.uk           

           Mohamed Medhat Gaber School of Computing and Digital Technology, Birmingham City University, Birmingham, UK

              mohamed.gaber@bcu.ac.uk           

           







Classification of COVID-19 in chest X-ray images using DeTraC deep convolutional neural network



    Asmaa Abbas         Mohammed M. Abdelsamea Mohamed Medhat Gaber

    Received: date / Accepted: date
==================================================================================================




Chest X-ray is the first imaging technique that plays an important role in the diagnosis of COVID-19 disease. Due to the high availability of large-scale annotated image datasets, great success has been achieved using convolutional neural networks (CNNs) for image recognition and classification. However, due to the limited availability of annotated medical images, the classification of medical images remains the biggest challenge in medical diagnosis. Thanks to transfer learning, an effective mechanism that can provide a promising solution by transferring knowledge from generic object recognition tasks to domain-specific tasks. In this paper, we validate and adapt a deep CNN, called Decompose, Transfer, and Compose (DeTraC), for the classification of COVID-19 chest X-ray images. DeTraC can deal with any irregularities in the image dataset by investigating its class boundaries using a class decomposition mechanism. The experimental results showed the capability of DeTraC in the detection of COVID-19 cases from a comprehensive image dataset collected from several hospitals around the world. High accuracy of 95.12% (with a sensitivity of 97.91%, and a specificity of 91.87%) was achieved by DeTraC in the detection of COVID-19 X-ray images from normal, and severe acute respiratory syndrome cases.








§ INTRODUCTION

Diagnosis of COVID-19 is typically associated with both the symptoms of pneumonia and Chest X-ray tests <cit.>. Chest X-ray is the first imaging technique that plays an important role in the diagnosis of COVID-19 disease. Fig. <ref> shows a negative example of a normal chest x-ray, a positive one with COVID-19, and a positive one with the severe acute respiratory syndrome (SARS). 

    

Several classical machine learning approaches have been previously used for automatic classification of digitised chest images <cit.>. For instance, in <cit.>, three statistical features were calculated from lung texture to discriminate between malignant and benign lung nodules using a Support Vector Machine SVM classifier. A grey-level co-occurrence matrix method was used with Backpropagation Network <cit.> to classify images from being normal or cancerous. With the availability of enough annotated images, deep learning approaches <cit.> have demonstrated their superiority over the classical machine learning approaches. CNN architecture is one of the most popular deep learning approaches with superior achievements in the medical imaging domain <cit.>. The primary success of CNN is due to its ability to learn features automatically from domain-specific images, unlike the classical machine learning methods. The popular strategy for training CNN architecture is to transfer learned knowledge from a pre-trained network that fulfilled one task into a new task <cit.>. This method is faster and easy to apply without the need for a huge annotated dataset for training; therefore many researchers tend to apply this strategy especially with medical imaging. Transfer learning can be accomplished with three major scenarios <cit.>: a) “shallow tuning”, which adapts only the last classification layer to cope with the new task, and freezes the parameters of the remaining layers without training; b) “deep tuning” which aims to retrain all the parameters of the pre-trained network from end-to-end manner; and (c) “fine-tuning” that aims to gradually train more layers by tuning the learning parameters until a significant performance boost is achieved. Transfer knowledge via fine-tuning mechanism showed outstanding performance in X-ray image classification <cit.>.

Class decomposition <cit.> has been proposed with the aim of enhancing low variance classifiers facilitating more flexibility to their decision boundaries. It aims to the simplification of the local structure of a dataset in a way to cope with any irregularities in the data distribution. Class decomposition has been previously used in various automatic learning workbooks as a preprocessing step to improve the performance of different classification models. In the medical diagnostic domain, class decomposition has been applied to significantly enhance the classification performance of models such as Random Forests, Naive Bayes, C4.5, and SVM <cit.>. 

In this paper, we adapt our previously proposed convolutional neural network architecture based on class decomposition, which we term  Decompose, Transfer, and Compose (DeTraC) model, to improve the performance of pre-trained models on the detection of COVID-19 cases from chest X-ray images [The developed code is available at https://github.com/asmaa4may/DeTraC_COVId19.]. This is by adding a class decomposition layer to the pre-trained models. The class decomposition layer aims to partition each class within the image dataset into several sub-classes and then assign new labels to the new set, where each subset is treated as an independent class, then those subsets are assembled back to produce the final predictions. For the classification performance evaluation, we used images of chest x-ray collected from several hospitals and institutions. The dataset provides complicated computer vision challenging problems due to the intensity inhomogeneity in the images and irregularities in the data distribution.  

The paper is organised as follow.In Section <ref>, we review the state-of-the-art methods for COVID-19 detection. Section <ref> discusses the main components of DeTraC and its adaptation to the detection of COVID-19 cases. Section <ref> describes our experiments on several chest X-ray images collected from different hospitals. In Section <ref>, we discuss our findings. Finally, Section <ref> concludes the work.



§ RELATED WORK



In the last few months, World Health Organization (WHO) has declared that a new virus called COVID-19 has been spread aggressively in several countries around the world <cit.>. Diagnosis of COVID-19 is typically associated with the symptoms of pneumonia, which can be revealed by genetic and imaging tests. Fast detection of the COVID-19 can be contributed to control the spread of the disease. 

Image tests can provide a fast detection of COVID-19, and consequently contribute to control the spread of the disease. Chest X-ray (CXR) and Computed Tomography (CT) are the imaging techniques that play an important role in the diagnosis of COVID-19 disease. The historical conception of image diagnostic systems has been comprehensively explored through several approaches ranging from feature engineering to feature learning. 

Convolutional neural network (CNN) is one of the most popular and effective approaches in the diagnosis of COVD-19 from digitised images. Several reviews have been carried out to highlight recent contributions to COVID-19 detection <cit.>. For example, in <cit.>, a CNN was applied based on Inception network to detect COVID-19 disease within computed tomography (CT). In <cit.>, a modified version of ResNet-50 pre-trained network has been provided to classify CT images into three classes: healthy, COVID-19 and bacterial pneumonia. Chest X-ray images (CXR) were used in <cit.> by a CNN constructed based on various ImageNet pre-trained models to extract the high level features. Those features were fed into SVM as a machine learning classifier in order to detect the COVID-19 cases. Moreover, in <cit.>, a CNN architecture called COVID-Net based on transfer learning was applied to classify the CXR images into four classes: normal, bacterial infection, non-COVID and COVID-19 viral infection. In <cit.>, a dataset of X-ray images from patients with pneumonia, confirmed Covid-19 disease, and normal incidents, was used to evaluate the performance of state-of-the-art convolutional neural network architectures proposed previously for medical image classification. The study suggested that transfer learning can extract significant biomarkers related to the Covid-19 disease.

Having reviewed the related work, it is evident that despite the success of deep learning in the detection of Covid-19 from CXR and CT images, data irregularities have not been explored. It is common in medical imaging in particular that datasets exhibit different types of irregularities (e.g. overlapping classes) that affect the resulting accuracy of machine learning models. Thus, this work focuses on dealing with data irregularities, as presented in the following section.




§ DETRAC METHOD



This section describes in sufficient details the proposed method for detecting Covid-19 from chest X-ray images. Starting with an overview of the architecture through to the different components of the method, the section discusses the workflow and formalises the method.



 §.§ DeTraC architecture overview


DeTraC model consists of three phases. In the first phase, we train the backbone pre-trained CNN model of DeTraC to extract deep local features from each image. Then we apply the class-decomposition layer of DeTraC to simplify the local structure of the data distribution. In the second phase, the training is accomplished using a sophisticated gradient descent optimisation method. Finally, we use the class-composition layer of DeTraC to refine the final classification of the images. As illustrated in Fig. <ref>, class decomposition and composition components are added respectively before and after knowledge transformation from an ImageNet pre-trained CNN model. The class decomposition component aiming at partitioning each class within the image dataset into k sub-classes, where each subclass is treated independently. Then those sub-classes are assembled back using the class-composition component to produce the final classification of the original image dataset.

    
    







 §.§ Deep feature extraction



A shallow-tuning mode was used during the adaptation and training of an ImageNet pre-trained CNN model using the collected chest X-ray image dataset. We used the off-the-shelf CNN features of pre-trained models on ImageNet (where the training is accomplished only on the final classification layer) to construct the image feature space. However, due to the high dimensionality associated with the images, we applied PCA to project the high-dimension feature space into a lower-dimension, where highly correlated features were ignored. This step is important for the class decomposition to produce more homogeneous classes, reduce the memory requirements, and improve the efficiency of the framework. 
	
		


 §.§ Class decomposition








		Now assume that our feature space (PCA's output) is represented by a 2-D matrix (denoted as dataset A), and 𝐋  is a class category. A and 𝐋 can be rewritten as

	
    A= [ 
            a_11     a_11   …      a_1m
    
            a_21     a_22   …       a_2m
    ⋮   ⋮   ⋮           ⋮
    
            a_n1     a_n2   …    a_nm
    ]  ,   𝐋= { l_1, l_2, … ,l_k},

	
	


where n is the number of images,  m is the number of features, and k  is the number of classes. For class decomposition, we used k-means clustering <cit.> to further divide each class into homogeneous sub-classes (or clusters), where each pattern in the original class  𝐋  is assigned to a class label associated with the nearest centroid based on the squared euclidean distance (SED):


	
    SED= ∑ _j=1^k∑ _i=1^n∥ a_i^( j ) -c_j∥,

	
where centroids are denoted as  c_j.

Once the clustering is accomplished, each class in  𝐋 will further divided into k subclasses, resulting in a new dataset (denoted as dataset B). 





Accordingly, the relationship between dataset A and B can be mathematically described as:











	
    A = ( A | 𝐋 )  ↦  B= (B | 𝐂 )

	

where the number of instances in  A  is equal to B while 𝐂 encodes the new labels of the subclasses (e.g. 𝐂 ={l_11, l_12, …, l_1k, l_21, l_22, …, l_2k, … l_ck}). Consequently A and B can be rewritten as:

	
    A= [ 
            a_11     a_11   …      a_1m      l_1
    
            a_21     a_22   …       a_2m     l_1
    ⋮   ⋮   ⋮           ⋮   ⋮
    ⋮   ⋮   ⋮          ⋮
         l_2
    
            a_n1     a_n2   …    a_nm     l_2 
    ], 
      
            B= [ 
            b_11     b_11   …      b_1m     l_11
    
            b_21     b_22   …       b_2m     l_1c
    ⋮   ⋮   ⋮           ⋮   ⋮
    ⋮   ⋮   ⋮          ⋮
         l_21
    
            b_n1     b_n2   …    b_nm     l_2c
    ].

	
	
	
   

   

	
	



 §.§ Transfer learning




With the high availability of large-scale annotated image datasets, the chance for the different classes to be well-represented is high. Therefore, the learned in-between class-boundaries are most likely to be generic enough to new samples. On the other hand, with the limited availability of annotated medical image data, especially when some classes are suffering more compared to others in terms of the size and representation, the generalisation error might increase. This is because there might be a miscalibration between the minority and majority classes. Large-scale annotated image datasets (such as ImageNet) provide effective solutions to such a challenge via transfer learning where tens of millions parameters (of CNN architectures) are required to be trained. 

For transfer learning, we used the ImageNet pre-trained ResNet <cit.> model, which showed excellent performance on ImageNet with only 18 layers. Here we consider freezing the weights of low-level layers and update weighs of high-level layers. 

For fine-tuning the parameters, the learning rate for all the CNN layers was fixed to 0.0001 except for the last fully connected layer (was 0.01), the min batch size was 64 with minimum 256 epochs, 0.001 was set for the weight decay to prevent the overfitting through training the model, and the momentum value was 0.9. With the limited availability of training data, stochastic gradient descent (SGD) can heavily be fluctuating the objective/loss function and hence overfitting can occur. To improve convergence and overcome overfitting, the mini-batch of stochastic gradient descent (mSGD) was used to minimise the objective function, E(·), with cross-entropy loss 
  
  
  

    E ( y^j,z(x^j)  )     =     -1/n∑_j=0^n [ y^jlnz(x^j )
            
    +  ( 1-y^j )ln ( 1-z( x^j )  ) ],

    
    
where x^j is the set of input images in the training, y^j is the ground truth labels while  z (·) is the predicted output from a softmax function.    



 §.§ Evaluation and composition









In the class decomposition layer of DeTraC, we divide each class within the image dataset into several sub-classes, where each subclass is treated as a new independent class. In the composition phase, those sub-classes are assembled back to produce the final prediction based on the original image dataset. For performance evaluation, we adopted Accuracy (ACC), Specificity (SP) and Sensitivity (SN) metrics.They are defined as:

	
    Accuracy (ACC)     =    TP+TN/n , 
     Sensitivity  (SN)     =    TP/TP+FN , 
    	
     Specificity  (SP)     =    TN/TN + FP ,
 	


where TP is the true positive in case of COVID-19 case and  TN is the true negative in case of normal or other disease, while FP and FN are the incorrect model predictions for COVID-19 and other cases.

More precisely, in this work we are coping with a multi-classification problem. Consequently, our model has been evaluated using a multi-class confusion matrix of <cit.>. Before error correction, the input image can be classified into one of (c) non-overlapping classes. As a consequence, the confusion matrix would be a (N_c× N_c) matrix, and TP, TN, FP and FN for a specific class i are defined as:


    TP_i=∑_i=1^nx_ii
    
        TN_i=∑_j=1^c∑_k=1^c x_jk ,j≠ i ,k≠ i
    
        FP_i=∑_j=1^c x_ji   , j≠ i
    
        FN_i=∑_j=1^c x_ij   , j≠ i,


where x_ii is an element in the diagonal of the matrix. 
Having discussed and formalised the DeTraC method in this section in details, the following section validates the method experimentally. The method establishes the effectiveness of class decomposition in detecting Covid-19 from chset X-ray images. 


	




§ EXPERIMENTAL STUDY


This section presents the dataset used in evaluating the proposed method, and discusses the experimental results. 




 






 §.§ Dataset

In this work we used a combination of two datasets:

    
  * 80 samples of normal CXRs (with 4020 × 4892 pixels) from the Japanese Society of Radiological Technology (JSRT) <cit.>.
    
  * Chest X-ray images of <cit.>, which contains 105 and 11 samples of COVID-19 and SARS (with 4248 × 3480 pixels).


We applied different data augmentation techniques to generate more samples such as: flipping up/down and right/left, translation and rotation using random five different angles. This process resulted in a total of 1764 samples. Also, a histogram modification technique was applied to enhance the contrast of each image.



 §.§ Class decomposition based on deep features

We used AlexNet <cit.> pre-trained network based on shallow learning mode to extract discriminative features of the three original classes. AlexNet is composed of 5 convolutional layers to represent learned features, 3 fully connected layers for the classification task. AlexNet uses 3 × 3 max-pooling layers with ReLU activation functions and three different kernel filters. We adopted the last fully connected layer into three classes and initialised the weight parameters for our specific classification task. For class decomposition process, we used k-means clustering <cit.>. In this step, as pointed out in <cit.>, we selected k  = 2 and hence each class in  𝐋  is further divided into two clusters (or subclasses), resulting in a new dataset (denoted as dataset B) with six classes (norm_1, norm_2, COVID19_1,COVID19_2, SARS_1, and SARS_2), see Table <ref>.
 





 §.§ Parameter settings and accuracy


All the experiments in our work have been carried out in MATLAB 2019a on a PC with the following configuration: 3.70 GHz Intel(R) Core(TM) i3-6100 Duo, NVIDIA Corporation with the donation of the Quadra P5000GPU, and 8.00 GB RAM.


The dataset was divided into two groups; 70% for training the model and 30% for evaluation of the classification performance. We used ResNet18 as an ImageNet pre-trained network in the transfer learning component of DeTraC. ResNet18 <cit.> consist of 18 layers with input image size of 224 × 224 and achieved an effective performance with 95.12% of accuracy. The last fully-connected layer was changed into the new task to classify six classes.  The learning rate for all the CNN layers was fixed to 0.0001 except for the last fully connected layer (was 0.01) to accelerate the learning. The min batch size was 64 with a minimum 100 epochs, 0.0001 was set for the weight decay to prevent the overfitting through training the model, and the momentum value was 0.95. The schedule of drop learning rate was set to 0.95 every 5 epochs. DeTraC-ResNet18 was trained based on deep learning mode. For performance evaluation, we adopted some metrics from the confusion matrix such as accuracy, sensitivity, specificity, and precision. The results were reported and summarised in table <ref>.




We plot the learning curve accuracy and loss between training and test as shown in Fig <ref>. Also, the Area Under the receiver curve (AUC) was computed as shown in Fig <ref>.





 

To demonstrate the robustness of DeTraC-ResNet18 in the classification of COVID-19 images, we compare it with ResNet18 using the same settings. ResNet18 achieved accuracy of 92.5%, sensitivity of 65.01%, and specificity of 94.3%.






























§ DISCUSSION



Training CNNs can be accomplished using two different strategies. They can be used as an end-to-end network, where an enormous number of annotated images must be provided (which is impractical in medical imaging). Alternatively, transfer learning usually provides an effective solution with the limited availability of annotated images by transferring knowledge from pre-trained CNNs (that have been learned from a bench-marked large-scale image dataset) to the specific medical imaging task. Transfer learning can be further accomplished by three main scenarios: shallow-tuning, fine-tuning, or deep-tuning. However, data irregularities, especially in medical imaging applications, remain a challenging problem that usually results in miscalibration between the different classes in the dataset. CNNs can provide an effective and robust solution for the detection of the COVID-19 cases from chest X-ray CXR images and this can be contributed to control the spread of the disease. 

Here, we adopt and validate our previously developed deep convolutional neural network, we called DeTraC, to deal with such a challenging problem by exploiting the advantages of class decomposition within the CNNs for image classification. DeTraC achieved high accuracy of 95.12% with ResNet on CXR images. DeTraC has demonstrated its robustness in coping with the limited availability of training images and irregularities in the data distribution. More importantly, the proposed class decomposition layer provides a generic solution to improve the efficiency of a convolutional neural network. 







§ CONCLUSION AND FUTURE WORK



Diagnosis of COVID-19 is typically associated with the symptoms of pneumonia, which can be revealed by genetic and imaging tests. Imagine test can provide a fast detection of the COVID-19 and consequently contribute to control the spread of the disease. Chest X-ray (CXR) and Computed Tomography (CT) are the imaging techniques that play an important role in the diagnosis of COVID-19 disease.
Paramount progress has been made in deep convolutional neural networks (CNNs) for medical image classification, due to the availability of large-scale annotated image datasets. CNNs enable learning highly representative and hierarchical local image features directly from data. However, the irregularities in annotated data remains the biggest challenge in coping with COVID-19 cases from Chest X-ray images.

In this paper, we adapted DeTraC deep CNN architecture that relies on a class decomposition approach for the classification of COVID-19 images in a comprehensive dataset of chest X-ray images. DeTraC showed effective and robust solutions for the classification of COVID-19 cases and its ability to cope with data irregularity and the limited number of training images too. 

With the continuous collection of data, we aim in the future to extend the experimental work validating the method with larger datasets. We also aim to add an explainability component to enhance the usability of the model. Finally, to increase the efficiency and allow deployment on handheld devices, model pruning and quantisation will be utilised. 


















    spmpsci      
	 






