Chest X-Ray Medical Diagnosis with Deep Learning

Project Name: Chest X-Ray Medical Diagnosis with Deep Learning

Team Members:

  1. Naitik Shah
  2. Ashutosh Kumar Sah

This project was completed under the guidance of:

Vimal Daga Sir

A Gist about the project: AI is transforming the practice of medicine. It’s helping doctors diagnose patients more accurately, make predictions about patients’ future health, and recommend better treatments. In this project we have created convolutional neural network image classification and segmentation models to make diagnoses of lung and the diagnoses our model can detect are:

  1. Cardiomegaly
  2. Emphysema
  3. Effusion
  4. Hernia
  5. Infiltration
  6. Mass
  7. Nodule
  8. Atelectasis
  9. Pneumothorax
  10. Pleural Thickening
  11. Pneumonia
  12. Fibrosis
  13. Edema
  14. Consolidation

In today’s world of automation, we have to find the ways which can help doctors in their work, checking if the patient is diagnosed with one of the 14 diseases mentioned above, this approach is reliable, quick, works 24/7 without getting stressed. The best part about this model is that it not only detects if the person has been diagnosed with the disease or not, but it maps it out to where that particular disease is, and it even detects that if the person is diagnosed with more than one disease. We have used the dataset from NIH Medical Centre and the dataset itself is 40GB+ before doing data augmentation. Data Leakage has been checked to prevent optimistic accuracy levels. Training the whole model took a few hours on a GPU-equipped machine, so we have already provided the pre-trained model, which we trained on a small dataset taken from NIH.

Technologies Used: I’ve used Machine Learning Linear Regression Algorithm as the data contains two columns namely: Years of Experience and Salary. Using the historical data we can predict the salary of an employee.

  • Deep learning:- For better accuracy of the model, because accuracy is the most important thing in Medical.
  • DenseNet:- We used DenseNet121 which we have used as a pre-trained model, and then we have added two layers on top of it.
  • Pandas:- To read the CSV file.
  • Keras:- Keras is a high-level API built on TensorFlow (and can be used on top of Theano too). It is more user-friendly and easy to use as compared to TF.
  • ROC Curve And AUROC:- For model evaluation.
  • GradCAM:- To visualize where the model detects the diagnoses.
  • We have even used NumPy, seaborn, matplotlib.pyplot, ImageDataGenerator, Dense, GlobalAveragePooling2D

Conclusion: We have built a state of the art chest X-Ray classifier using Keras, which will help doctors in detecting if the patient has been diagnosed with 14 different lung diseases.

Future Scope: Yes, it has a future scope as we can train the model with the different datasets to detect different diseases, like COVID-19, and a GUI version can be made or even a Mobile App can be made. With the world experiencing different diseases, which are unheard of before, this model can be trained and tuned to detect them too.

Excited to see how this project works, and how can you make this project?

Well, Good news for you! I and my team have created a YouTube video on explaining the code!

Link to the Video! (And do give this video a like so that other people can make this project and add it to their Portfolio)

GitHub repo The GitHub repo has the link to the Dataset.

(we both have published the same article so don't be confused)



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store