|
|
--- |
|
|
license: mit |
|
|
language: |
|
|
- en |
|
|
metrics: |
|
|
- accuracy |
|
|
base_model: |
|
|
- frgfm/resnet18 |
|
|
pipeline_tag: image-classification |
|
|
datasets: |
|
|
- Baldezo313/rsna-pneumonia-dataset |
|
|
--- |
|
|
# π¦ Pneumonia Classification Model |
|
|
|
|
|
Welcome to the **Pneumonia Classification Model** repository! This project utilizes a deep learning approach based on the powerful **ResNet-18** architecture to classify chest X-ray images and detect pneumonia with high accuracy. |
|
|
|
|
|
 |
|
|
|
|
|
|
|
|
## π Project Overview |
|
|
|
|
|
This repository contains code for: |
|
|
|
|
|
- Training a **ResNet-18** model for pneumonia classification |
|
|
- Evaluating model performance with detailed accuracy metrics |
|
|
- Visualizing key features using **Class Activation Mapping (CAM)** |
|
|
|
|
|
## π Key Features |
|
|
|
|
|
β
**ResNet-18 Backbone**: Fine-tuned on chest X-ray images for accurate pneumonia detection |
|
|
β
**Model Evaluation**: Includes both weighted and non-weighted accuracy assessments |
|
|
β
**Class Activation Mapping (CAM)**: Visualizes critical regions influencing the modelβs predictions |
|
|
β
**Efficient Training**: Optimized data pipelines for fast model training and inference |
|
|
|
|
|
--- |
|
|
|
|
|
## ποΈ Repository Structure |
|
|
|
|
|
``` |
|
|
Pneumonia-Classification-Model/ |
|
|
βββ PneumoniaClassification.ipynb # Jupyter Notebook for model training & evaluation |
|
|
βββ checkpoints/ # Saved model weights |
|
|
βββ data/ # Dataset folder (chest X-ray images) |
|
|
βββ outputs/ # Generated CAM images & evaluation results |
|
|
βββ README.md # Project documentation |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
## βοΈ Installation |
|
|
|
|
|
1. **Clone the Repository**: |
|
|
```bash |
|
|
git clone https://github.com/SYEDFAIZAN1987/Pneumonia-Classification-using-resnet-18-based-model-with-evaluation-and-CAM.git |
|
|
cd Pneumonia-Classification-Model |
|
|
``` |
|
|
|
|
|
2. **Install Dependencies**: |
|
|
```bash |
|
|
pip install -r requirements.txt |
|
|
``` |
|
|
|
|
|
3. **Run the Model**: |
|
|
```bash |
|
|
jupyter notebook PneumoniaClassification.ipynb |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
## π Model Performance |
|
|
|
|
|
### **Non-Weighted Accuracy:** |
|
|
|
|
|
 |
|
|
|
|
|
### **Weighted Loss Accuracy:** |
|
|
|
|
|
 |
|
|
|
|
|
### **Class Activation Mapping (CAM):** |
|
|
|
|
|
Visual representation of regions critical to the modelβs pneumonia classification: |
|
|
|
|
|
 |
|
|
|
|
|
--- |
|
|
|
|
|
## π Evaluation Metrics |
|
|
|
|
|
- **Precision, Recall, F1-Score** for performance evaluation |
|
|
- **Confusion Matrix** for classification analysis |
|
|
- **Weighted vs Non-Weighted Accuracy** comparison |
|
|
|
|
|
--- |
|
|
|
|
|
## π€ Contributing |
|
|
|
|
|
Contributions are welcome! To contribute: |
|
|
|
|
|
1. Fork the repository |
|
|
2. Create a new branch: `git checkout -b feature-branch` |
|
|
3. Commit your changes |
|
|
4. Open a pull request π |
|
|
|
|
|
--- |
|
|
|
|
|
## π License |
|
|
|
|
|
This project is licensed under the [MIT License](LICENSE). |
|
|
|
|
|
--- |
|
|
|
|
|
## π¨ββοΈ Author |
|
|
|
|
|
Developed by **Syed Faizan** |
|
|
For any queries or collaborations, feel free to connect on [GitHub](https://github.com/SYEDFAIZAN1987). |
|
|
|
|
|
β **If you found this project useful, please give it a star!** β |