Detection of Thoracic Diseases using Deep Learning

The study of using deep learning for detection of various thoracic diseases has been an active and challenging research area. Chest X-rays are currently the most common and globally used radiology practices for detecting thoracic diseases. Patients suffering from thoracic diseases need to take Chest X-Rays which are read by radiologists and a report is generated by them. However, today with the increase in the number of thoracic patients, a quick method to classify the disease and generate the report has become necessary. Also, patient history has to be considered for diagnosis. This paper offers a comparative study on the various deep learning techniques that can process chest x-rays and are capable of detecting the different thoracic diseases. Also, a technique has been proposed to classify 14 diseases namely Atelectasis, Cardiomegaly, Consolidation, Edema, Effusion, Emphysema, Fibrosis, Hernia, Infiltration, Mass, Nodule, Pneumonia, Pneumothorax, Pleural thickening based on the given X-rays using Residual Neural Network.


INTRODUCTION
The thorax, also called chest, is the upper part of the trunk located between the neck and the abdomen. It gets support from the rib cage, the girdle of the shoulder and the spine that also protects it. It is the region of the body formed by the sternum, the thoracic vertebrae, and the ribs. It resides between the neck and diaphragm excluding the upper limb. The heart and lungs reside in the thoracic cavity, as well as many blood vessels which play a vital role in feeding (oesophagus), breathing, and pumping the blood to all parts of the body.
Chest pain is the most frequent reason for consultation and emergency room visits. Chest radiography is the most common imaging examination globally, critical for screening, diagnosis, and management of many lifethreatening thoracic diseases. Today, knowledge and observation skills of radiologists are imperative to read CXRs. However, the pathologies have complex structures, and the lesions in images of the lungs have very slight differences wherein some miniscule details can be missed out by experts. Also, there is a lack of trained and expertise radiologists. Hence, in recent years there has been a lot of research to develop systems that can detect thoracic diseases as well as generate reports. In all these researches, the researchers have used deep learning, and neural networking models. This paper aims to explore these models.  [3]. Qingji Guan et. al., in this paper, a 3-branch guided CNN (AG -CNN), is used. It reduces noise and enhances the alignment of the particular affected region in the X-ray image. [4]. Imane Allaouzi et. al., this paper documents the extraction of relevant features from CXRs using pre-trained CNN and then classifying the extracted features with multi label problem transformation methods that transform the multi label problem to single-label classification [5]. Mohammad Tariqul Islam et. al., this paper detected and localized abnormalities in chest X-rays from different datasets using deep convolutional neural networks. As a measure of localization in the CXRs (Chest X-rays), heat maps are used. Trained classifiers were used to conduct localization experiments that proved to be greatly successful for abnormalities like cardiomegaly and pulmonary edema which are spread out spatially [6]. Xiaosong Wang et. al., this paper presents the chest X -Ray dataset, which comprises 108,948 frontal X -Ray images. Importantly it demonstrates the detection and localization of the commonly occurring thoracic diseases [7]. Jeremy Irvin et. al., presented CheXpert, a large dataset that contains 224,316 chest radiographs of 65,240 patients. A labeler is designed to automatically detect the presence of 14 observations in radiology reports, capturing uncertainties inherent in radiograph interpretation [8]. Juan Manuel et. al., this paper demonstrates an automatic normality/pathology classification of posteroanterior (PA) digital chest radiographs. The proposed method is not specialized in a given set of types of lesions or diseases but is able to detect anything that differs from normality [9]. Paras Lakhani et. al., recognizing the potential displayed by DCNN, a practical, result-based, statistical study was performed to determine DCNN efficiency by applying GoogLeNet and AlexNet DCNNs in the classification of images as displaying pulmonary TB or healthy [10]. The model used by Li Yao et al. is an end-to-end, two stage neural network model. It is a combination of an image encoder with dense connections, and a decoder with recurrent neural networks [11]. To localize and detect abnormalities in chest X-rays. Deep CNN is used on different datasets.

Localization:
Black level occlusion showed better results than the grey one as chest X-rays are grey.
Deep learning method improves the accuracy by 17 percent as compared to rule based methods. Localization of abnormalities that were spatially spread out like cardiomegaly were successful; however, it failed for features that were pointed like lung nodules.

7
To spatially locate and detect the eight common thoracic diseases.

Multi-label setup.
The model used (ResNet-50 [12]) was able to classify the eight diseases. Localization was achieved by creating heatmaps with the help of transition layer's activation functions and the weights obtained by the prediction layer. 8 To  [14], AlexNet [13] were used AlexNet [13] and GoogLeNet [14] DCNNs were used together to make a classifier that had an AUC of 0.99.  The proposed system is designed with the aim of automating the process of detection, classification of thoracic diseases with the help of deep learning techniques.

PROPOSED SYSTEM
The proposed system will involve use of deep convolutional neural networks for building a classifier that will extract and learn different features of the chest X-ray images along with their labels. Once the model is trained, it would be capable of detecting the thoracic disease given a new chest x-ray image. The system can be further extended to detect any type of thoracic disease. The block diagram of the proposed system is shown in Fig  1 and Fig 2. and is explained as follows: 1. Input and Labels: The input of the system are frontal-view chest x-ray images with their corresponding thoracic disease as label like pneumonia, pneumothorax. The images will be fed to the convolutional neural network (CNN) in the form of batches and they will also be shuffled. This will make the model even more robust.

2.
Pre-processing: The chest x-ray images will be preprocessed using various image processing techniques such as downscaling, normalization, etc. The training data can also be augmented using random horizontal flipping. This will help in improving the performance of the CNN. 3.
CNN: The features of the images will be extracted using a deep convolutional neural network model consisting of convolutional layers, batch normalization, ReLU activation and max pooling layers. The final layer will be a fully connected layer with output features corresponding to the number of classes which will help in classifying the image i.e predicting the disease label.

DATASET
The dataset used for training is the ChestX-ray14 dataset [7] which contains 112,120 frontal-view chest X-ray images of 30,805 unique patients. A smaller dataset was created by taking 100 images from each class. Hence, 1500 images along with their labels serve as input to the model.

DATA PREPROCESSING
Input Images: The input images are downscaled to 224x224 so that it can be fed to the network. The images are also normalized based on mean and standard deviation and are also randomly horizontally flipped.

MODEL ARCHITECTURE
ResNet (Residual Neural Network) [12], is a deep neural network model architecture which uses residual blocks as a solution to vanishing gradients problem. The residual block makes use of identity mapping i.e. 'Skip Connection'. The identity mapping does not contain any parameters, it is solely used to pass the original information from one layer to another layer without being hindered. ResNet has been one of the most successful deep learning neural network architectures.
The dataset of 1500 images is trained using ResNet -18 architecture which consists of a series of convolutional layers, batch normalization, ReLU activation layers. All these layers are then followed by an average pooling layer. The final and last layer is a fully connected layer. Fig. 9. Architecture of ResNet-18 [12].

TRAINING
The first layer of the architecture is modified to accept gray-scale images as input and the number of output features in the last layer is modified to the required number of classes for output. The model has been trained from scratch, hence, the pretrained model with Imagenet weights is not used. The dataset of 1500 images is split into 70% for training. The network is trained using Stochastic Gradient Descent as an optimizer with a learning rate of 0.001, in 4 batches for 50 epochs. A training accuracy of 97.99% is achieved. Fig. 10. Plot of loss per epoch.

CONCLUSION
The use of deep learning techniques in the field of detecting thoracic diseases from chest x-rays is still an active area of research. Thoracic diseases pose a serious, prevailing threat to the health of the global population. Hence timely diagnosis is critical. With the help of deep learning, faster and quicker diagnosis of thoracic diseases could save time. From the comparative study, the different methods used to process chest x-rays as well as detect the thoracic diseases was understood. The model proposed in the paper has been trained and the training accuracy achieved is 97.99%. Further work involves testing the model for different images belonging to each class and obtaining the results.