TUBERCULOSIS DIAGNOSIS USING X-RAY IMAGES

Saad Akbar 1 , Najmi Ghani Haider 2 And Humera Tariq 3 . 1. Postgraduate Student, NED University of Engineering & Technology, Karachi, Pakistan. 2. Professor, Department of Computer Science & Information Technology, NED University of Engineering & Technology, Karachi, Pakistan. 3. Assistant Professor, Department of Computer Science, University of Karachi, Karachi, Pakistan. ...................................................................................................................... Manuscript Info Abstract ......................... ........................................................................ Manuscript History Received: 10 February 2019 Final Accepted: 12 March 2019 Published: April 2019

Tuberculosis (TB) is caused by the bacteria Mycobacterium tuberculosis. It most often affects the lungs. Tuberculosis is a preventable and curable disease. The Global Annual TB report, 1.5 million TB related deaths were reported in 2015. In 2016, this increased with 1.7 million reported deaths and more than 10 million people infected with the disease. The objective of this work is to analyze medical X-ray images using deep learning methods and explore images to achieve classification of Tuberculosis. The Convolutional Neural Networks (CNN) algorithm based deep learning classification approaches has been chosen as it has the ability to intrinsically extract the low level representations from data using little pre-processing in comparison with other image classification algorithms. This simple and efficient model will lead clinicians towards better diagnostic decisions for patients to provide them solutions with good accuracy for medical imaging. Supervised learning algorithms convolutional neural networks (CNN) were considered for the classification task. The performance of the designed model is measured on two publicly available datasets: the Montgomery County chest X-ray (MC) and Shenzhen chest X-ray set. It achieves accuracy of 90% and 80% respectively on these datasets.

…………………………………………………………………………………………………….... Introduction:-
Tuberculosis (TB) is an infectious disease affecting populations all over the world and is commonly caused by bacteria known as Mycobacterium tuberculosis, and mostly affecting the lungs of human beings. However, it can also affect other organs. TB is spread through the air by infected persons, by coughing, sneezing, spitting, as well as eating utensils used by patients. The TB bacteria spread widely through the air. One third of population of the world every year gets Mycobacterium TB bacteria at a rate of one percent of population with new infection [1]. TB is among one of the top 10 causes of death and the leading cause from a single infectious agent, which is above HIV/AIDS. TB causes millions of people to fall ill each year. TB caused an estimated 1.3 million deaths (range, 1.2-1.4 million) among HIV-negative people and there were an additional 300,000 deaths from TB (range 266,000-335,000) among HIV-positive people in 2017 [1].
According to WHO report, in 2017, globally 10 million people (between 9 -11 million) experienced TB disease in which there were 5.8 million men, 3.2 million women and 1.0 million children. There were cases in all countries, but two thirds were in eight countries: Pakistan, India, Indonesia, China, the Philippines, Nigeria, South Africa and Bangladesh, and in all age groups, but overall 90% were adults (aged ≥15 years), 9% were people living with HIV (72% in Africa) [1]. For many countries, however, the -end‖ of TB as an epidemic and major public health problem is still a distant reality. This is despite the fact that, with a timely diagnosis and correct drug treatment, most people who develop the disease can be cured. Twenty-five years ago, in 1993, WHO declared TB a global health emergency.
The studies done on human skeletons have found that it has been affecting humans for thousands of years. The cause remained unknown to science before 24 March 1882, when Dr. Robert Koch declared that he had found the bacillus Mycobacterium tuberculosis, an event that is now commemorated each year as World TB Day [2]. The disease is extended when the infected people with TB disperse bacteria into the atmosphere, for example by sneezing, coughing. TB was one of the leading causes of death in the late 1800s in some European countries according to the cause-of-death data from national vital registration system. But with a number of TB victims started to decline in North America, Europe and few other countries around the globe in the 20th century. From the 1940s, drug treatments' discovery, development and their use significantly accelerated these trends, with national TB case rates ((per 100,000) population) decreasing to about 10% per year death rates declining even faster. TB is considered as a disease of the past in countries that have only around 10 or less cases and less than 1 death per 100,000 populations each year.
The aim of this work is the classification of healthy and unhealthy lungs based on chest radiographs only using Convolutional Neural Network (CNN). The framework should be able to classify pulmonary Tuberculosis depending on the available data for training. In order to achieve the best possible results, machine learning frameworks were applied and evaluated. The classification of radiographs was chosen because it is the most commonly used type of medical imaging and it is the first step in Tuberculosis detection due to its quick availability. To give an example, 54% of all diagnostic images made from March 2016 to March 2017 in England were radiographs [3]. Therefore a lot of data exists that could be used to train and test the resulting frameworks. This framework should support doctors in classification and to make their workflow faster. This work exploits the convergence of imaging research and system to advance the knowledge in automated CXR image analysis by automatically detecting presence of pulmonary tuberculosis in digital CXRs, leading to suitable discrimination for screening, as well as to compute a measure of confidence in its determination.
Literature Review:-In this study [4] state-of-the-art CADx software makes use of machine learning (ML) techniques that use global and local feature descriptors to extract features from the underlying data. Previously, ML tools have been used to detect abnormal texture in chest radiographs and to exhibit extraction of texture and shape features and classification with a binary classifier in the process of TB screening from CXRs. Algorithms based on morphology have been put forth to extract features including circularity, size, contrast and local curvature of the lung nodules for classification of abnormal and normal CXRs. Machine learning (ML) techniques are used by the state of the art software CADx that utilizes global and local feature descriptors to extract features from the underlying data. Previously, ML tools have been used to detect unusual texture in chest radiographs and to show extraction of texture and shape features and classification with a binary classifier in the process of TB screening from CXRs. Algorithms based on morphology have been made to extract features including circularity, size, contrast and local curvature of the lung nodules for the classification of abnormal and normal CXRs.
In this study [5] author assess the feasibility of Deep Learning-based detection and classification of pathological patterns in a set of digital photographs of chest X-ray (CXR) images of tuberculosis (TB) patients. Patients with previously diagnosed TB were enrolled in this prospective for observational study. A consumer-grade digital still camera was used to take photographs of their CXRs. The images were stratified by pathological patterns into classes: cavity, consolidation, effusion, interstitial changes, miliary pattern or normal inspection. Image analysis was done with commercially available Deep Learning software in two steps. Pathological areas were initially localized; detected areas were then classified. Detection was evaluated using receiver operating characteristics (ROC) analysis, and a confusion matrix was used for classification.
In another paper [6] a residual learning system is provided to simplify the training of networks that are considerably deeper than those which were used in the past. The layers are clearly reformulated as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. Inclusive factual evidence is provided to show that these residual networks are easier to optimize, and can attain accuracy from significantly increased detail. Dataset assesses residual nets with a depth of up to 152 layers on the ImageNet-8x deeper than VGG nets yet still having lower complication. On the ImageNet dataset 3.57% error is attained by an ensemble of these residual nets. On the ILSVRC classification task of 2015, this result won the 1st place. Analysis is also provided on CIFAR-10 with 100 and 1000 layers. The depth of representations is of central importance for many visual recognition tasks. Just because of extremely deep representations, 28% relative improvements on the COCO object detection data set. The deep residual nets are foundations of submissions to ILSVRC& COCO 2015 competitions, where it also won the 1st places on the tasks of ImageNet localization, ImageNet detection, COCO segmentation, and COCO detection.
Hardware Requirement: -Training of CNN is very expensive and it requires a lot of resources. From low level perspective it translates into many multiplications of matrices. Modern Central Processing Units (CPUs) are not optimized for such computations and therefore are not very good at it. This experiment was performed in Google Colaboratory -Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. With Colaboratory easily write and execute code, save and share analyses, and access powerful computing resources, all for free from internet browser. Colaboratory supports Python 2.7 and Python 3.6. Code is executed in a virtual machine dedicated to Google's account. Python3 Google Compute Engine (GPU), 358.72 GB of Hard drive, 12.72 GB of RAM.

Software Requirement: -
The model is created using the python programming language and with the KERAS deep learning framework.

Proposed Convolutional Neural Network: -
Convolutional Neural Network (CNN) is a particular implementation of a neural network used in machine learning that specifically processes array data such as images, commonly used in machine learning applications applied at medical images [7]. CNN uses weight sharing network structure and has the ability to minimize the number of weights and complexity of the neural network [8]. It has shown an important ability to extract the mid-level and high level abstractions gained from raw data [9]. As CNN is multi-layered and fully trainable hence it can capture highly nonlinear mapping between inputs and outputs, [10]. CNN consists of input, output and multiple hidden layers. These hidden layers consist of convolutional layers, pooling layers and fully connected layers [11]. As shown in figurer 1. Convolutional Neural Networks (CNN) Layers it establishes a feed-forward group of deep networks, where neuron receives an input (are images) for passing it through a series of hidden layers. Each hidden layer is totally linked to all neurons of the preceding layer and where neurons in a single layer work independently without sharing any connection. The final layer is called the output layer which represents the class scores in classification settings. The hidden layers to build CNN architectures are pooling layers, convolutional layers, normalization layers and fully connected layers [12]. Every Layer accepts an input 2D volume for converting it to an output 2D volume through a differentiable function.
In Convolutional neural networks the information (images) is processed by layers of mathematical processing to make sense. Convolutional neural network has few to millions of artificial neurons-known as units-set in a series of layers. After preprocessing steps, the input layer receives images from the outside. This is the original data (images) in the proposed model that the network aims to learn or process about. From the input layer, the data (images) travels through one or more hidden units. The hidden unit's task is to convert the input into something the output unit can utilize, as shown in Figure 1.
Many of the neural networks are fully linked from one layer to another. These connections are weighted; the higher the number, the greater influence one unit has on another, just like a human brain. As the data travels through every unit the network is learning more about the data. The output unit is on the other side of the network, and this is where the network responds to the data that it was given and processed. for resize the images are to overcome the memory errors. So resize the images is one of the technique used to solve this problem. CXR images after the padding stage is now resize to size 128 x 128 pixels in size. The images were pre-processed before use to the network.  Table 1.  Experimental Results: -Training and validation process is also divided into different parts, all data/images are randomly chosen for training and all the data/images for cross validation are randomly chosen form the dataset. The accuracy and loss are illustrated in different graphs.

(a) Results of proposed CNN model on Montgomery Dataset images:
In first part, the images' total number for training and testing are 105 and 25 respectively; total numbers of epochs are 100. The graph in Figure 3(a) indicates that the network has tried to memorize the training data and thus, is able to get better accuracy on it. In the graph given below, the training accuracy is 100%. Similarly the validation accuracy is also near 86% after the end of the 100 epochs. Also an interesting trend shows that validation accuracy keeps uniform after around 15 epochs. Validation accuracy is near 83% while the validation loss is around 8% at the end of the 100 epochs, also the trend where the training loss is near to 0% after 22 epochs, while the validation loss keeps decreasing as shown in Figure 3(b).

(b) Results of proposed CNN model on China Set -The Shenzhen set
Training and validation process is also divided into different parts, all data/images are randomly chosen for training and for cross validation from dataset. In the first test, some changes are made to improve more results the images' total number for training and testing are 345 and 230 respectively; total numbers of epochs are 200 and the batch size is now 50. The graph in Figure 5(a) indicates that the network has tried to memorize the training data and thus, is able to get accuracy 100% after 175 epochs. Similarly the validation accuracy is near 79.57% after the end of the 200 epochs. Validation accuracy is near 79.57% at the end of 200 epochs, while the validation loss is 1.4030 at the end of the 200 epochs, also the trend where the training loss is near to 0% after 200 epochs, while the validation loss keeps fluctuating as shown in Figure 5(b). In second test, the images' total number for training and testing are 460 and 115 respectively; total numbers of epochs are 500 and this time batch size is now 100. The graph in Figure 6(a) indicates that the network has tried to memorize the training data and thus, is able to get accuracy 100% after 100 epochs. Similarly the validation accuracy is near 80.87% after the end of the 500 epochs. This shows better results when batch size increased as shown in figure 6(a). The validation loss is 1.6596 at the end of the 500 epochs, also the trend where the training loss is near to 0% at the end of 500 epochs.

Conclusion:-
In this paper, a model for medical application of chest pathology detection in chest radiography using Convolutional Neural Networks (CNN) and the propose of the model to address effective diagnosis of tuberculosis diseases on chest radiography by doing the recognition and classification of pathological structures from classified anatomies which will help doctors fasten the detection process for multiple diseases. Hence, providing them additional valuable time to focus more on the curing the diseases. This model consists of a classification branch. Classification branch performs as a uniform feature extraction classification network. The result of this model indicate that this model out performs other methods, which use no extra training data and less preprocessing. Despite the fact that this model is not prepared for clinical selection.
Future Work: -In this research work, successfully recognized and classified tuberculosis disease using chest X-rays dataset collected from different sources. Which is basically data collected from USA and China. In near future, I will collect X-ray images from local hospitals to train and test the system to predict better results. I come to know that data augmentation will also help to generate better results. I also have planned to work with more complex medical data like Computerized Tomography (CT) and Magnetic Resonance Imaging (MRI) images.