Coders Packet

Tuberculosis Detection Using Python

By Varun Jain

Tuberculosis is detected using Convolution Neural Network (CNN) model using X-ray Images as dataset for this model using Python.

In this project, we built a model that predicts whether a person has tuberculosis using X-ray images of a person using Python language using various packages. The dataset is found online I.e, Shenzen(ChinaSet_AllFiles), and Montogomery.

In this project, we first assign the labels to the images from the dataset and store each of the images according to its labels in its directory.

From China set dataset a person that has tuberculosis is labeled 1 and which does not have is labeled 0 and classified accordingly. These directories are split into testing, training, and validation so that we can achieve more accuracy where no image is not trained again.

Aug_dir is where they temporarily store images from a given class before feeding them into the generator for augmentation.

The augmented images are created and stored in folders together with the raw images and then feed these into the generators. The model is created using CNN basic model(RELU(Rectified Linear Unit))

CNN(Convolution Neural Network) Model(Convolution Layer, Pooling Layer, Dropout Layer, Flatten, Dense, softmax)of four such filters.

The model achieved 0.80 and a valuation loss of 0.56 if image size is(image height as 90 and image width as 90). If we keep image size as(image height as 95 and image width as 95) we achieve an accuracy of 0.87 and validation error of 0.43.

Download Complete Code

Comments

No comments yet