This repository contains a PyTorch-based implementation for classifying Chest X-Ray images using two popular deep learning architectures: MobileNet and DenseNet. The project focuses on leveraging transfer learning to achieve high accuracy in medical image diagnosis.
The goal of this project is to automate the classification of chest X-ray images into specific categories (e.g., Normal vs. Opacity). By comparing MobileNet (optimized for speed/efficiency) and DenseNet (optimized for feature reuse), this notebook provides a comprehensive evaluation of model performance on medical datasets.
- Framework: PyTorch
- Libraries: Torchvision, NumPy, Pandas, Matplotlib, Scikit-learn
- Models: MobileNetV2, DenseNet121
- Data Preprocessing: Custom dataset loaders with image resizing and normalization.
- Transfer Learning: Fine-tuning pre-trained models on medical imagery.
- Evaluation: Includes comprehensive metrics such as:
- Accuracy & F1-Score.
- Confusion Matrix visualization.
- Classification reports for per-class performance.
The models were evaluated based on their ability to generalize to unseen X-ray data. Visualizations within the notebook show the training/validation loss curves and final metric comparisons between the two architectures.
- Clone the repository:
git clone [https://github.com/Nidal-Shahin/CXR-Classification-MobileNet-DenseNet.get](https://github.com/Nidal-Shahin/CXR-Classification-MobileNet-DenseNet.get)- Install dependencies:
pip install -r requirements.txt- Run the notebook:
Open notebooks/cxr-classification.ipynb in Jupyter or Google Colab and run the cells.- Original Dataset: COVID-19 Radiography Database.
- Our Dataset: A custom version specifically prepared for this project.
- Hamza Sawaftah
- Nidal Shahin