Professional Documents
Culture Documents
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
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
Data Visualization
Some images with their labels have been plotted using the matplotlib library
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
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.