Image Classification
English
File size: 3,326 Bytes
ee0510d
 
 
 
 
 
 
 
 
0d2dee9
 
ee0510d
 
 
 
 
af07aae
 
ee0510d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3dc2ec5
ee0510d
5e482ab
ee0510d
3dc2ec5
ee0510d
 
 
 
 
3dc2ec5
ee0510d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0d2dee9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
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.

![Pneumonia Detection](https://huggingface.co/DrSyedFaizan/Pneumofind/resolve/main/CAM%20picture.png)


## πŸš€ 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:**

![Non-Weighted Accuracy](https://huggingface.co/DrSyedFaizan/Pneumofind/resolve/main/Non%20Weighted%20Accuracy.png)

### **Weighted Loss Accuracy:**

![Weighted Accuracy](https://huggingface.co/DrSyedFaizan/Pneumofind/resolve/main/Weighted%20Accuracy.png)

### **Class Activation Mapping (CAM):**

Visual representation of regions critical to the model’s pneumonia classification:

![CAM Visualization](https://huggingface.co/DrSyedFaizan/Pneumofind/resolve/main/CAM%20picture.png)

---

## πŸ“ˆ 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!** ⭐