Downloads · 30 days
0
Arko007/diabetic-retinopathy-v1
diabetic-retinopathy-v1 is a image classification model from Arko007. Use it when you need a label for an image. It is set up for keras. The card lists the license as apache-2.0.
This is a deep learning model trained to detect the severity of Diabetic Retinopathy from retinal fundus images. It classifies images into one of five grades (0-4), based on the model architecture and training script…
Downloads · 30 days
0
Access
Public
Updated Sep 22, 2025
Repo size
4.8 GB
Likes
1
Public
Click a slice to open those files.
.h54.8 GB · 100%
From the Hugging Face model README
This is a deep learning model trained to detect the severity of Diabetic Retinopathy from retinal fundus images. It classifies images into one of five grades (0-4), based on the model architecture and training script provided.
(384, 384, 3) (RGB images)The model was trained on the Indian Diabetic Retinopathy Image Dataset (IDRiD), which contains a large set of high-resolution fundus images with corresponding severity grades.
You can load this model directly from the Hugging Face Hub using the huggingface_hub library.
import tensorflow as tf
from huggingface_hub import from_pretrained_keras
import cv2
import numpy as np
# Load the model from the Hugging Face Hub
try:
model = from_pretrained_keras("Arko007/diabetic-retinopathy-v1")
print("Model loaded successfully!")
except Exception as e:
print(f"Error loading model: {e}")
def preprocess_image(image_path):
'''Your preprocessing function must match the one used in training.'''
img = cv2.imread(image_path)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = cv2.resize(img, (384, 384))
img = img.astype(np.float32) / 255.0
return img
# Preprocess your image to a (384, 384, 3) tensor
# example_image = preprocess_image("path/to/your/image.jpg")
# The model expects a batch, so add a batch dimension
# example_image_batch = tf.expand_dims(example_image, axis=0)
# Get predictions
# predictions = model.predict(example_image_batch)
# predicted_class = tf.argmax(predictions, axis=1).numpy()[0]
# print(f"Predicted Retinopathy Grade: {predicted_class}")
The model was trained using the train.py script. Key aspects of the training include:
1e-4.ModelCheckpoint to save the best model based on validation accuracy and ReduceLROnPlateau to adjust the learning rate during training.