Image Classification
Keras
English
resnet50
medical
diabetic-retinopathy
explainable-ai
gradcam
fundus-images
Eval Results (legacy)
Instructions to use blackstarai/resnet50-diabetic-retinopathy with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use blackstarai/resnet50-diabetic-retinopathy with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://blackstarai/resnet50-diabetic-retinopathy") - Notebooks
- Google Colab
- Kaggle
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
Space using blackstarai/resnet50-diabetic-retinopathy 1
Evaluation results
- Validation Accuracy on Kaggle EyePACS Diabetic Retinopathy Detectionself-reported0.820
- Quadratic Weighted Kappa on Kaggle EyePACS Diabetic Retinopathy Detectionself-reported0.810