Diabetic Retinopathy Clinical Detection System
Deep learning computer vision system and clinical Streamlit application that analyzes retinal fundus imagery to diagnose and classify 5 clinical stages of Diabetic Retinopathy.
Live Clinical CNN Inference Simulator
Simulates your Streamlit app.py and best_dr_model.h5 diagnostic pipeline
No DR
Routine annual diabetic eye screening recommended.
Project Overview & Architecture
Developed as the cornerstone Master's dissertation research project ('Early Detection of Diabetic Retinopathy Using Deep Learning-Based Image Analysis of Retinal Fundus Images'). The project engineers a high-accuracy Convolutional Neural Network (CNN) trained on thousands of standardized retinal fundus scans. The system features an automated diagnostic dashboard built in Streamlit, empowering healthcare specialists to upload patient fundus images, inspect feature salience, and retrieve instant stage classifications with confidence scores.
Key Implementation Highlights
- ✓Trained and fine-tuned deep CNN model (best_dr_model.h5) resolving retinal vascular abnormalities.
- ✓Multi-class diagnostic engine distinguishing: No DR, Mild, Moderate, Severe, and Proliferative DR.
- ✓Real-time interactive Streamlit web dashboard for clinical file upload and instant inference.
- ✓Empirical evaluation with precision, recall, F1-score metrics, and confusion matrix validation.
Implementation Source Code
1 File123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354import streamlit as st
import tensorflow as tf
import numpy as np
import cv2
from PIL import Image
st.set_page_config(page_title="Diabetic Retinopathy Detection", layout="wide")
MODEL_PATH = "best_dr_model.h5"
IMG_SIZE = 224
class_names = [
"No DR",
"Mild DR",
"Moderate DR",
"Severe DR",
"Proliferative DR"
]
class_descriptions = {
"No DR": "No visible signs of diabetic retinopathy are detected.",
"Mild DR": "Early microaneurysms detected in retinal vessels.",
"Moderate DR": "Retinal abnormalities present (haemorrhages or exudates).",
"Severe DR": "Advanced vascular changes present; urgent specialist review needed.",
"Proliferative DR": "Advanced neovascularization detected in retina."
}
@st.cache_resource
def load_model():
return tf.keras.models.load_model(MODEL_PATH)
def preprocess_image(image):
# Ben Graham preprocessing: Gaussian blur circle subtraction
img = np.array(image)
img = cv2.resize(img, (IMG_SIZE, IMG_SIZE))
img = cv2.addWeighted(img, 4, cv2.GaussianBlur(img, (0, 0), 10), -4, 128)
img = img / 255.0
return np.expand_dims(img, axis=0)
st.title("Retinal Fundus Image Analysis")
uploaded_file = st.file_uploader("Upload Retinal Scan (.png, .jpg)", type=["png", "jpg", "jpeg"])
if uploaded_file is not None:
image = Image.open(uploaded_file).convert("RGB")
st.image(image, caption="Uploaded Retinal Image", width=300)
processed = preprocess_image(image)
model = load_model()
predictions = model.predict(processed)[0]
predicted_class = class_names[np.argmax(predictions)]
confidence = float(np.max(predictions)) * 100
st.subheader(f"Prediction: {predicted_class} ({confidence:.2f}% confidence)")
st.info(class_descriptions[predicted_class])Technologies & Tools
Academic Classification
More in Masters & College Projects
View all in categoryCar Rental Enterprise Database Management System
Enterprise-grade relational database architecture modeling vehicle fleets, dynamic reservations, customer identification, and multi-branch transactional ledgers.
International Dropshipping Multi-Vendor E-Commerce
Full-stack multi-vendor dropshipping e-commerce platform built within an Agile Scrum framework, featuring order lifecycles, vendor catalogs, and token authentication.
Academic Examination & Question Bank System
Desktop examination platform engineered with Java Swing and MySQL, supporting dynamic question authoring, student testing, and automated grade reporting.