ResNet50 Fine-Tuned for Diabetic Retinopathy Detection

This model is a fine-tuned ResNet50 convolutional neural network trained to classify diabetic retinopathy (DR) severity stages from retinal fundus images.

Classification Classes

  • 0: No DR (Healthy retina)
  • 1: Mild NPDR (Microaneurysms only)
  • 2: Moderate NPDR (Hemorrhages, exudates, microaneurysms)
  • 3: Severe NPDR (Intraretinal microvascular abnormalities - IRMA)
  • 4: Proliferative DR (Neovascularization, abnormal vessel growth)

Training & Dataset Details

  • Base Architecture: ResNet50 (pre-trained on ImageNet, base layers frozen during initial epochs).
  • Dataset: Kaggle Diabetic Retinopathy Detection (EyePACS).
  • Target Size: 224x224 pixels.
  • Optimizer: Adam (learning_rate=1e-4).
  • Loss Function: Categorical Cross-Entropy.

Evaluation

Provide a summary of validation performance:

  • Validation Accuracy: [e.g., 82%]
  • Quadratic Weighted Kappa: [e.g., 0.81]

How to Load and Run Inference in Python

from huggingface_hub import hf_hub_download
from keras.models import load_model
import numpy as np

# Download weights from Hugging Face Hub
model_path = hf_hub_download(
    repo_id="your-username/resnet50-diabetic-retinopathy", 
    filename="best_resnet50_model.keras"
)

# Load the model
model = load_model(model_path)

# Run prediction on a preprocessed numpy image (shape: 1, 224, 224, 3)
# predictions = model.predict(preprocessed_image)
# print("Predicted Class:", np.argmax(predictions[0]))

──────

Downloads last month
13
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using blackstarai/resnet50-diabetic-retinopathy 1

Evaluation results

  • Validation Accuracy on Kaggle EyePACS Diabetic Retinopathy Detection
    self-reported
    0.820
  • Quadratic Weighted Kappa on Kaggle EyePACS Diabetic Retinopathy Detection
    self-reported
    0.810