This project leverages the power of deep learning to classify lung diseases using X-ray images. The dataset consists of five classes:
- Bacterial Pneumonia
- Coronavirus Disease
- Tuberculosis
- Viral Pneumonia
- Normal
We use pre-trained models from the Keras library, such as VGG16, ResNet152V2, and DenseNet201, which are fine-tuned for optimal performance. The models undergo multiple trials, where data augmentation and preprocessing techniques are applied to improve generalization.
Key performance metrics such as accuracy, loss, and confusion matrices are generated, along with Grad-CAM heatmaps to interpret and visualize the model’s decisions.
💡 Significance: Early and accurate detection of lung diseases can greatly improve patient outcomes, especially in resource-limited settings where such technology can augment healthcare delivery.
To accurately classify lung diseases using fine-tuned pre-trained models and interpret model decisions using visual explainability techniques like Grad-CAM.
- Python (TensorFlow, Keras, NumPy, Pandas)
- Deep Learning (CNN architectures, Transfer Learning)
- Image Processing (Data Augmentation, Normalization)
- Model Fine-Tuning (Pre-trained Models, Training Techniques)
- Grad-CAM (Model Interpretability)
- Data Visualization (matplotlib)
- 🔍 Analytical Thinking
- 🧠 Problem-Solving
- 🎯 Attention to Detail
- 📚 Research & Adaptability
- 🏗 Fine-Tuned Models (e.g., VGG16, ResNet152V2, DenseNet201)
- 🧮 Confusion Matrices & ROC Curves
- 📊 Model Performance Comparison: Accuracy & Loss (Training, Validation, Testing)
- 🔥 Grad-CAM Heatmaps for Explainability
- 📈 Bar Charts Comparing Model Metrics
- 🗂 Dataset Source: Kaggle - Lung Disease Dataset (4 types)
- 🌐 Real-World Applicability: Early and accurate detection of lung diseases through AI-based solutions.
- 💡 Challenges Overcome:
- Fine-tuning multiple pre-trained models.
- Addressing class imbalance via data augmentation techniques.
- 🌍 Impact: This project offers a scalable and automated solution for healthcare providers, especially in underserved areas where radiologists are scarce.
src
: Contains the main Python scriptmain.py
.data
: Placeholder for the dataset, includingtrain
andtest
folders.models
: Stores the saved trained model.results
: Stores output images, metrics, and Grad-CAM visualizations.notebooks
: Contains Jupyter notebooks for exploratory data analysis (EDA).
- Data Augmentation: Applied techniques like rescaling, rotation, and zooming.
- Transfer Learning: Used pre-trained CNN architectures for fine-tuning.
- Grad-CAM: Visualizes areas the model focuses on for predictions.
- Evaluation: Provides training, validation, and test metrics.
- Clone this repository:
git clone https://github.com/AliNikoo73/Automated-Medical-Image-Classification.git cd Automated-Medical-Image-Classification
Thank you for considering contributing to this project!
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add a new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
If you encounter any issues, please report them in the Issues section of this repository.
To create and train the model, modify the parameters in the main.py
file as needed and run:
python src/main.py