Views
No views yet
| Grade | Label | Description |
|---|---|---|
| 0 | No_DR | No diabetic retinopathy |
| 1 | Mild | Mild non-proliferative DR |
| 2 | Moderate | Moderate non-proliferative DR |
| 3 | Severe | Severe non-proliferative DR |
| 4 | Proliferative_DR | Proliferative diabetic retinopathy |
| Parameter | Value |
|---|---|
| Base model | google/mobilenet_v2_1.0_224 (ImageNet pretrained) |
| Optimizer | AdamW (lr=3e-4, weight_decay=0.01) |
| LR Schedule | Cosine with 200 warmup steps |
| Batch size | 32 |
| Epochs | 5 |
| Loss | Focal Loss (γ=2.0) + class weights |
| Augmentations | RandomResizedCrop, H/V flips, rotation ±30°, color jitter |
| Hardware | CPU (2 vCPU, 16GB RAM) |
| Grade | Count | % |
|---|---|---|
| 0 - No DR | 18,583 | 73.5% |
| 1 - Mild | 1,759 | 7.0% |
| 2 - Moderate | 3,811 | 15.1% |
| 3 - Severe | 628 | 2.5% |
| 4 - Proliferative | 509 | 2.0% |
| Epoch | Loss | Accuracy | QWK |
|---|---|---|---|
| 1 | 1.064 | 9.0% | 0.182 |
| 2 | 0.819 | 11.6% | 0.345 |
| 3 | 0.828 | 13.6% | 0.373 |
| 4 | 0.889 | 14.0% | 0.298 |
| 5 | 0.775 | 14.2% | 0.363 |
| Class | Precision | Recall | F1 |
|---|---|---|---|
| No DR | 0.00 | 0.00 | 0.00 |
| Mild | 0.08 | 0.90 | 0.14 |
| Moderate | 0.43 | 0.31 | 0.36 |
| Severe | 0.34 | 0.55 | 0.42 |
| Proliferative | 0.32 | 0.63 | 0.42 |
1from transformers import pipeline
2
3classifier = pipeline("image-classification", model="Aditya-Sai-19/diabetic-retinopathy-swin")
4result = classifier("path/to/retinal_image.jpg")
5print(result)
6# [{'label': 'Moderate', 'score': 0.45}, {'label': 'Mild', 'score': 0.22}, ...]1from transformers import AutoImageProcessor, AutoModelForImageClassification
2from PIL import Image
3import torch
4
5processor = AutoImageProcessor.from_pretrained("Aditya-Sai-19/diabetic-retinopathy-swin")
6model = AutoModelForImageClassification.from_pretrained("Aditya-Sai-19/diabetic-retinopathy-swin")
7
8image = Image.open("retinal_scan.jpg")
9inputs = processor(image, return_tensors="pt")
10
11with torch.no_grad():
12 logits = model(**inputs).logits
13 predicted_class = logits.argmax(-1).item()
14
15print(f"Predicted: {model.config.id2label[predicted_class]}")I_ce = 4*I - 4*G(σ=w/90)*I + 128) and FOV cropping — this alone adds +2-5% AUC