Huseyn Ibrahimli
← HomeFig. 2 · Imaging tool

Teaching a model to say “I don’t know”

Three neural networks screen medical images, and every one has to show the pixels behind its answer. The one that failed now stays silent.

pixels it usedif unsure → no answer
Why it shows its pixels

A clinician can be asked how they reached a conclusion. A model that only returns a probability can’t. So every model in the dashboard runs Grad-CAM, which highlights the image regions the network relied on. A radiologist can see at once if it has locked onto a text label or a scanner artefact instead of the lung.

Which error matters

In screening, a false alarm costs a follow-up scan; a missed case costs a missed disease. I tuned the chest X-ray model for sensitivity rather than headline accuracy. It misses 6 of 390 pneumonia cases in the test set, a 1.5% false-negative rate, and accepts more false alarms to get there.

The one that failed

The mammography model, tested with 5-fold cross-validation, scored an AUC of 0.49: no better than chance. Its 98% sensitivity only meant it flagged almost everything as malignant. I could have deleted it or shipped it behind a warning nobody reads. Instead the dashboard still runs the scan and shows the Grad-CAM overlay, but gives no verdict and no confidence number, only a notice explaining why.

What it is

An educational project, not a validated clinical tool. The code is open source under the MIT licence and installs in one click on Windows, macOS or Linux.

ModelDataTest results
Chest X-ray → pneumonia
Gives a verdict
5,856 images
Kermany et al.
Accuracy 93.3%
Sensitivity 98.5%
AUC 0.980
False negatives 1.5%
Breast ultrasound → malignancy
Gives a verdict
780 images
Al-Dhabyani et al.
Accuracy 68.6%
Sensitivity 83.3%
AUC 0.849
False negatives 16.7%
Mammogram → malignancy
No verdict
322 images
MIAS, 5-fold CV
AUC 0.489 ± 0.057
Flags nearly everything
as malignant
What the dashboard shows for a mammogram 1 · Scansliding windows 2 · Grad-CAMregions it looked at 3 · No verdictnotice explains why The pneumonia and ultrasound models end with a verdict; the mammography model stops at step 3.

Figures from the project README. Test sets: 624 chest X-rays, 156 ultrasounds.