NeuroLens helps a doctor review brain MRI scans. A 3D model outlines the tumor and measures each part; a 2D model suggests the tumor type and shows where it looked. The doctor works in a full-screen viewer, fixes the outline with a brush, compares it with the AI's, and approves a report written only from the measurements.
Behind it: leak-free data splits, honest test evaluation (99.4% accuracy, 0.93 Dice), models served on CPU with ONNX, role-based login with an audit log, and CI that deploys to Azure and Vercel. Research project, not a medical device.
Full-screen 3D viewer (NiiVue), with findings and the report in a side panel
A brush to fix the AI's outline, then a synced side-by-side compare
When the 2D and 3D models disagree, it says so instead of guessing a type
A worklist with cases waiting for review first, largest tumors on top
Safe by design
Doctor-only login with two roles; uploads, analyses and decisions go to an audit log
No patient names stored; DICOM headers are dropped on upload
The report is written from numbers only; an LLM may reword it but can't change a number or type
Every result is a draft until a doctor approves it
From upload to the doctor's decision
01Upload3D MRI (FLAIR, T1, T1ce, T2 as NIfTI or DICOM), or one 2D slice
02De-identifynames, IDs and dates removed; cases get codes like NL-FCDX69
03SegmentSegResNet outlines the tumor in 3D and measures each part in cm³
04ClassifyEfficientNet-B3 suggests the type and shows where it looked
05Doctor reviewfix with a brush, compare with the AI, approve, edit or reject
06Reportwritten only from the measurements; a signed PDF after approval
Why this stack
Simple over complex
Ten classifier options were compared. One EfficientNet-B3 on brain-cropped scans tied the best two-model ensemble, so the lighter one won: one network, one pass, about half the compute.
CPU serving without PyTorch
Both models run in ONNX Runtime with numpy-only pre- and post-processing, tested to match PyTorch (3D masks agree at Dice ≥ 0.9997). A 3D scan takes about 27 s on a 2-vCPU server.
A feedback loop with a gate
Doctors' fixes are exported as a training set, and a fine-tuned model replaces the old one only if it is not worse on the held-out test split. Tested with simulated fixes (expert masks standing in for a doctor): v2 learned them (0.745 → 0.841 Dice on those cases) and is the one served.
Screens
01 / 04
Worklist: cases waiting for review, largest tumors first
Case review: 3D outline, volume per part, suggested type
The AI's mask next to the doctor's fix, with the approved report
2D slice: suggested type and where the model looked (Grad-CAM)
Troubleshooting
01
Test scores that lied
Problem
The public dataset has duplicate images, some in both train and test, which inflates test accuracy.
Fix
Found duplicates with MD5 + perceptual hashing and removed them before training; picked models on validation only, then opened the test split.
Result
An honest 99.4% that holds on unseen images.
02
When the two models disagree
Problem
On a BraTS scan the 2D classifier said “no tumor” (81%) while the 3D model outlined one. The 2D model was trained on another dataset and sees one slice.
Fix
The app compares both and shows “Models disagree” instead of a confident type, and the report says so.