File size: 1,717 Bytes
6d2a042
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2d6cdab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bf25b2a
 
2d6cdab
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
---
title: DR Classification
emoji: 🐨
colorFrom: gray
colorTo: blue
sdk: streamlit
sdk_version: 1.44.1
app_file: app.py
pinned: false
license: mit
---




# 🐨 DR Classification

This is a Streamlit-based web app for **Diabetic Retinopathy (DR) Classification** using fundus images. The model classifies retinal images into different DR severity levels to assist in early detection and monitoring.

## 💡 Features
- Upload a fundus image and get an instant DR classification.
- Preprocessing pipeline (CLAHE, gamma correction, normalization, etc.) to enhance input quality.
- Uses a fine-tuned DenseNet-121 model pretrained on ImageNet.
- Supports visual output like prediction label and optionally Grad-CAM heatmaps for model explainability.

## 🖼 Dataset
The dataset used is uploaded on the Hugging Face Hub:  
👉 [**your-username/your-dataset-name**](https://huggingface.co/datasets/Ci-Dave/DDR_dataset_train_test)

It includes fundus images categorized into the following DR stages:
- 0: No DR  
- 1: Mild  
- 2: Moderate  
- 3: Severe  
- 4: Proliferative DR

## 🚀 How to Use
1. Click the “Open in Spaces” button or visit the live app.
2. Upload a fundus image (JPEG or PNG).
3. View the model prediction and (optional) heatmap.

## 🧠 Model Details
- **Architecture**: DenseNet-121
- **Pretrained on**: ImageNet
- **Fine-tuned on**: Fundus images from the uploaded dataset

## 🛠 Tools & Libraries
- Streamlit
- PyTorch / TensorFlow (depending on what you're using)
- OpenCV for image preprocessing
- Hugging Face Datasets

## 📄 License
This project is licensed under the MIT License.

---

**Check the app 👉 [Live Demo](https://huggingface.co/spaces/Ci-Dave/DR_Classification)**