All Projects

OneLook.

Upload a pair of retinal photos, get a graded diabetic retinopathy report back — formerly RetinAI.

Computer VisionArchived — competition buildDenseNet1215-stage DRStreamlitDOCX → PDFWindows-bound
5
DR Stages
DenseNet121
Backbone
~85%
Self-reported accuracy
2nd Place
Competition

Overview

Problem

Diabetic retinopathy grading, without a specialist in the room

Diabetic retinopathy (DR) is graded on a 5-stage severity scale that normally requires an ophthalmologist reading a fundus photo. OneLook (built as RetinAI) grades both eyes from uploaded photos directly, no specialist required for the first pass.

It's a single-purpose classifier, not a general diagnostic platform — DR grading is the only thing the model does.

How it works

One DenseNet121, five severity classes

A DenseNet121 backbone (ImageNet-pretrained, top removed) feeds into global average pooling, dropout, and a 5-way softmax head — trained to output one of No DR, Mild, Moderate, Severe, or Proliferative DR. Left and right eyes are classified independently by the same model.

The app's own UI copy states the model runs at roughly 85% accuracy — the only accuracy figure that exists for this build; there's no separate benchmark or held-out test report backing it further.

No DR
class 0
Mild
class 1
Moderate
class 2
Severe
class 3
Proliferative DR
class 4
Reporting

From prediction to a downloadable clinical report

Each eye's grade fills a DOCX report template alongside patient fields and the source images, plus a stage-specific canned recommendation — for example, Proliferative DR triggers a note that immediate treatment is essential to prevent vision loss.

The DOCX is converted to PDF (docx2pdf), rendered to an image for in-app preview (pypdfium2), and offered as a download — which is also why the report pipeline is Windows-bound (docx2pdf's conversion path depends on pywin32).

Recognition

2nd place, 8th Hakeem Academy Competition

Built and shipped in a single session in August 2023 as a competition entry. Model weights are hosted externally rather than committed to the repo, so running it locally means downloading them separately before the first launch.

Method

Two retinal fundus photos go in, one DenseNet121 classifier grades each eye independently, and the two grades drive a templated clinical report.

  1. 01
    Upload

    left + right fundus images

  2. 02
    DenseNet121

    5-way softmax, per eye

  3. 03
    Report

    DOCX template → PDF

Fig. 12nd place, 8th Hakeem Academy Competition

Stack

Streamlitupload UI + report previewTensorFlow / KerasDenseNet121 fine-tunepython-docxfills the report templatedocx2pdfDOCX → PDF conversionpypdfium2in-app PDF preview

Reproduce it

Local (Windows recommended)
$ git clone https://github.com/baselhusam/RetinAI.git
$ pip install -r requirements.txt
# download Y_new_1.h5 from the Google Drive link in the README
$ streamlit run retinai.py