You are on page 1of 4

Project Report

Chest X-RAY Classification


Manjusha Nair

Aim

The aim of this project is to train an image classification model that can categorize Chest X-Ray images.

Introduction

Chest X-ray exams are one of the most frequent and cost-effective medical imaging examinations
available. And Image Classification models can analyze and categorize and assigning labels to groups of
pixels or vectors within an image dependent on rules.

Dataset

The dataset used in this project can be found on https://www.kaggle.com/nickuzmenkov/nih-chest-


xrays-tfrecords
The dataset consists of
• preprocessed DataFrame: preprocessed_data.csv (For Data Analysis)
• 256 TFRecord files with 768x768 images of 15 classes
The TFRecord format is a tensorflow simple format for storing a sequence of binary records. Each of
these files contain batch of samples(images) and the entire information about each sample including ids
and labels. The csv file is provided only for data analysis and visualization.

In all there are 112120 samples or images for this dataset and 15 classes (14 diseases, and one for "No
findings"). Images can be classified as "No findings" or one or more disease classes ( Atelectasis,
Consolidation, Infiltration, Pneumothorax, Edema, Emphysema, Fibrosis, Effusion, Pneumonia, Pleural
thickening, Cardiomegaly, Nodule Mass, Hernia)

Data Preprocessing

The dataset must be first split into 3 sets for training, validation and test dataset by random sampling.

This dataset is of TFRecord format and hence it needs preprocessing before it can used which means the
images have to be extracted from the dataset. The website shares a simple Dict type feature map that
maps the name of data entries to their format. A decoding function will decode the image data and then
a tfrecord dataset is created which maps the images and labels.
Figure 1: Feature Map

The dataset can be now used for further processing.

Data Visualization

Some images with their labels have been plotted using the matplotlib library

Figure 2: Data Visualization

Data Augmentation

I initially used the technique of applying data augmentation over the dataset by with image rotation, flip,
applying contrasts with batches and shuffling, but it severely affected the kernel performance after
which I just randomly applied techniques to the dataset.

There is another way of data augmentation by applying them to layers of the model, but I encountered
some issues with versions of keras not supporting this feature.
Approaches

1. Simple basic CNN


The model consists of combination of layers; I have used ‘relu’ activation function and for the
dense layer ‘sigmoid ’ function and Adam optimizer.
For this approach, I have not used hyperparameter tuning to compare its influence with the
second approach.
After training the model, the accuracy achieved was just over 53%

2. Transfer Learning
I have used the EfficientNetB1 model in this approach and the hyperparameter tuning with Keras
tuner. There are three methods of hyperparameter tuning methods: random search, Hyperband,
and Bayesian optimization. To train the model with transfer learning, I have used the Random
Search method. The objective is the function to optimize. The tuner will infer if it is a
maximization, or a minimization problem based on its value.

The accuracy of this model is shown as a very slight improvement to the first approach.
Challenges
The lack of a highly capable computing system or GPU at my end limits the ability to experiment with the
parameters due to very long computational time and at times when the kernel has ended abruptly. I had
to also limit the number of search executions with respect to hyperparameter tuning.

Conclusion
The models have their limits and accuracy is just near 55% though after adding more convolutional
layers. The models in both approaches show lower accuracy which needs more tuning, a larger number
of convolutional layers and more tuning with data augmentation.

You might also like