Weirdcraft
MSc Dissertation Project2025 – 2026Master's Degree (MSc Dissertation)

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.

Unique Project Permalink & Local Reference
Local Workspace Origin PathD:\Masters\Dissertation\DR_Prediction_App
Interactive In-Browser Simulation
Live Working Demo

Live Clinical CNN Inference Simulator

Simulates your Streamlit app.py and best_dr_model.h5 diagnostic pipeline

Patient ID: SCAN-0914-A
Standard Fundus Color Scan
Model Output

No DR

96.4%
No DR96.4%
Mild DR2.8%
Moderate DR0.6%
Severe DR0.1%
Proliferative DR0.1%
Clinical Recommendation:

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 File
Diabetic Retinopathy Clinical Detection System Source Codepython
File origin: D:\Masters\Dissertation\DR_Prediction_App\app.py
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354import 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])
54 linesVerified from local workspace

Technologies & Tools

PythonTensorFlow / KerasConvolutional Neural NetworksStreamlitOpenCVPandasNumPyJupyter Notebook

Academic Classification

Program / FocusMaster's Degree (MSc Dissertation)
Project Timeline2025 – 2026

More in Masters & College Projects

View all in category
Weirdcraft

The municipal department of curiosities: hand-built games, physics toys, and a gallery that re-hangs itself every midnight.

© 2026 WEIRDCRAFT · Municipal Dept. of Curiosities

Free admission · No trackers · Open all night