Model Card for TransferLearningDR: Diabetic Retinopathy Detector

TransferLearningDR is a convolutional neural network (CNN) model built on EfficientNetB3 and trained to classify retinal fundus images into two categories: No DR and Diabetic Retinopathy (DR). The model leverages transfer learning from ImageNet weights to accelerate training and improve generalization.

⚠️ Disclaimer: This model is intended for research and educational purposes only. It is not a substitute for professional medical diagnosis. Always consult a licensed healthcare provider for medical decisions.


Model Details

Key Features:

  • Binary classification of retinal images (No DR vs DR)
  • Transfer learning using EfficientNetB3 pretrained on ImageNet
  • Input size: 224x224 RGB images, normalized
  • Custom dense head with batch normalization, dropout, and L1/L2 regularization
  • Evaluated on separate validation and test sets with high accuracy

Skills & Technologies Used:

  • TensorFlow / Keras for model design & training
  • ImageDataGenerator for preprocessing and optional augmentation
  • EfficientNetB3 for feature extraction
  • Matplotlib & Seaborn for visualization
  • Hugging Face Hub for model hosting
  • Kaggle for dataset and training environment

  • Developed by: Rawan Alwadeya
  • Model type: Convolutional Neural Network (CNN) with Transfer Learning
  • Language(s): N/A (Image model)
  • License: MIT

Uses

This model can be used for:

  • Research in diabetic retinopathy detection and AI-assisted diagnosis
  • Educational demonstrations of transfer learning on medical images
  • Portfolio projects showcasing preprocessing, model training, and deployment

πŸ‘©β€πŸ’» Author

Rawan Alwadeya
AI Engineer | Generative AI Engineer | Data Scientist


Example Usage

import numpy as np
from keras.models import load_model
from PIL import Image
import requests
from io import BytesIO
from huggingface_hub import hf_hub_download

# Load the model from Hugging Face Hub
model_path = hf_hub_download(repo_id="RawanAlwadeya/TransferLearningDR", filename="TransferLearningDR.h5")
model = load_model(model_path)

# Preprocess an example image
def preprocess_image(image):
    IMG_SIZE = (224, 224)
    image = image.convert("RGB")  
    image = image.resize(IMG_SIZE)
    img_array = np.array(image) / 255.0
    img_array = np.expand_dims(img_array, axis=0)  # add batch dimension
    return img_array

# Example: load an image from URL
url = "https://example.com/sample_fundus.jpg"
response = requests.get(url)
image = Image.open(BytesIO(response.content))

img_array = preprocess_image(image)
prediction = model.predict(img_array)[0][0]

if prediction >= 0.5:
    print("⚠️ Diabetic Retinopathy likely detected")
else:
    print("βœ… Likely No DR")
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for RawanAlwadeya/TransferLearningDR

Finetuned
(8)
this model