mou11 commited on
Commit
9575f2c
Β·
verified Β·
1 Parent(s): 64b5a19

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +52 -0
README.md CHANGED
@@ -10,5 +10,57 @@ tags:
10
  - gradcam
11
  - vit
12
  ---
 
 
 
 
 
13
 
 
 
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  - gradcam
11
  - vit
12
  ---
13
+ # 🫁 Pneumonia Detector
14
+ ![Python](https://img.shields.io/badge/Python-3.10-blue)
15
+ ![ViT](https://img.shields.io/badge/ViT-Base%20Patch16%20224-green)
16
+ ![PyTorch](https://img.shields.io/badge/PyTorch-2.0-red)
17
+ ![HuggingFace](https://img.shields.io/badge/HuggingFace-Spaces-yellow)
18
 
19
+ ## 🎯 Live Demo
20
+ πŸ‘‰ [Try it on Hugging Face Spaces](https://huggingface.co/spaces/mou11/pneumonia-detector)
21
 
22
+ ## πŸ” Overview
23
+ A medical image classification system that detects pneumonia from chest X-ray images using Vision Transformer (ViT) with Grad-CAM explainability. The model highlights which regions of the X-ray influenced the prediction, making it transparent and trustworthy for medical screening.
24
+
25
+ ## πŸ“Š Results
26
+ | Metric | Score |
27
+ |--------|-------|
28
+ | Overall Accuracy | 87% |
29
+ | AUC-ROC | 0.9805 |
30
+ | PNEUMONIA Recall | 1.00 |
31
+ | NORMAL Precision | 0.99 |
32
+
33
+ ## πŸ“ˆ Classification Report
34
+ | Class | Precision | Recall | F1-Score |
35
+ |-------|-----------|--------|----------|
36
+ | NORMAL | 0.99 | 0.66 | 0.79 |
37
+ | PNEUMONIA | 0.83 | 1.00 | 0.91 |
38
+
39
+ ## ✨ Features
40
+ - βœ… Chest X-ray classification: NORMAL vs PNEUMONIA
41
+ - βœ… Vision Transformer (ViT) fine-tuned on medical images
42
+ - βœ… Grad-CAM heatmap visualization for explainability
43
+ - βœ… Handles class imbalance with weighted loss
44
+ - βœ… Gradio demo for interactive predictions
45
+
46
+ ## πŸ—οΈ Architecture
47
+ Chest X-Ray Image β†’ Preprocessing (224x224) β†’ ViT Base Patch16 β†’ Fine-tuned Classifier Head β†’ Prediction + Grad-CAM Heatmap
48
+
49
+ ## πŸ› οΈ Tech Stack
50
+ | Component | Tool |
51
+ |-----------|------|
52
+ | Model | Google ViT Base Patch16 224 |
53
+ | Framework | PyTorch |
54
+ | Explainability | Grad-CAM |
55
+ | Dataset | Chest X-Ray Images (Pneumonia) β€” Kaggle |
56
+ | UI | Gradio |
57
+ | Training | Google Colab T4 GPU |
58
+
59
+ ## πŸ“ Dataset
60
+ - **Source:** [Chest X-Ray Images (Pneumonia)](https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia)
61
+ - **Total Images:** 5,863
62
+ - **Classes:** NORMAL (1,341) vs PNEUMONIA (3,875)
63
+ - **Split:** Train / Val / Test
64
+
65
+ ## πŸš€ How to Use
66
+ ```python