What this project is about
This pilot asks whether confidence scores can identify wrong answers to questions about medical images. Three properties need separate checks: how often an answer is correct, whether its confidence matches observed correctness, and whether confidence identifies the cases most likely to fail. Improving the second property, called calibration, does not necessarily improve the third.
The experiment uses Salesforce's general-domain BLIP VQA base model on yes/no questions from VQA-RAD. It reserves 100 training-split questions to adjust confidence scores and 150 held-out questions for testing. The project supplies the inference, image-alteration and evaluation code around existing model and dataset resources. It does not train a new medical foundation model.
How it works
- Medical image + question
- Answer + confidence score
- Calibrate and test image dependence
Make sampling and scoring reproducible
The pipeline keeps questions whose normalised answer begins with yes or no and selects calibration and test samples with seed 42. The fixed BLIP model runs on CPU without additional training. Its generated answers are checked against the reference yes/no answer. Saved metadata identifies the model, dataset, device, seed and sample sizes.
Adjust confidence on separate questions
Raw confidence combines the probabilities assigned to the generated answer's tokens, or text pieces, using their geometric mean. A logistic mapping then learns how these scores relate to correctness on the separate calibration sample; this adjustment is called Platt calibration. The same fitted mapping is applied to untouched test questions. Answers and scores are retained so the evaluation can be inspected.
Test whether visual evidence affects answers
Each test question is repeated with a strongly blurred image and a blank image. An image-aware scoring rule rewards stability under blur and penalises agreement with the blank-image answer. Brier score and expected calibration error measure probability error; correctness AUROC measures whether confidence ranks correct answers above wrong ones. The risk–coverage curve shows remaining error as lower-confidence answers are withheld; its area, AURC, summarises that trade-off.
The important design choices
Use an accessible general-domain model
Evaluate a fixed BLIP model rather than train a specialised radiology model.
The trade-offCPU execution makes the experiment practical to reproduce. The result cannot represent medical vision-language models as a class.
Keep the initial scoring rule unambiguous
Restrict the pilot to yes/no answers scored with a fixed rule.
The trade-offThis makes automatic evaluation easier to audit, but excludes clinically meaningful free-text responses and limits what accuracy describes.
Check whether image dependence helps confidence
Treat answer changes under image removal as a possible signal of reliability, then test it against correctness.
The trade-offMatching the blank-image answer can reflect patterns in the question rather than visual evidence. It does not by itself show that the original answer was wrong.
Better probabilities need not identify the wrong cases
Imagine answers with confidence scores that are too high but put correct and incorrect cases in much the same order.
- Learn a confidence adjustment on separate calibration questions.
- Check whether the adjusted probabilities better match observed correctness on the test questions.
- Separately check whether the lowest-confidence answers now contain a larger share of the errors.
What this showsThe first check can improve while the second stays weak. Both are necessary before treating confidence as a useful reason to accept or withhold an answer.
Illustrative example, not an additional measured result.
How it was tested—and what it shows
The checks
All three confidence methods are compared on the same 150 test questions. Saved predictions include answers, image-alteration comparisons and confidence scores; metadata records the separate 100-question calibration sample. Plots show whether predicted confidence matches observed correctness and whether declining lower-confidence answers actually reduces the remaining error.
The pilot uses one model, one sampling seed and a small binary-answer subset. It does not provide uncertainty estimates across repeated runs or validation on an external set of independent patients. The saved outputs support a reproducible comparison within this setup, not clinical safety, diagnostic competence or readiness to decide which patients need further review.
| Confidence method | Brier ↓ | ECE ↓ | Correctness AUROC ↑ |
|---|---|---|---|
| Raw token probability | 0.294 | 0.205 | 0.497 |
| Platt calibrated | 0.255 | 0.091 | 0.503 |
| Image-aware heuristic | 0.297 | 0.188 | 0.435 |
What to take from the results
Original-image accuracy was 54.7%. Platt calibration reduced expected calibration error from 0.205 to 0.091 and Brier score from 0.294 to 0.255; lower is better for both. Yet correctness AUROC stayed near random ranking, moving from 0.497 to 0.503. Confidence better matched average correctness without becoming a dependable way to identify individual mistakes.
The image-aware rule performed worse, with correctness AUROC 0.435 and AURC 0.502, versus 0.457 AURC after Platt calibration; lower AURC is better. Blank-image accuracy was 56.0%, and original and blank answers agreed in 48.7% of cases. This raises concerns about reliance on visual evidence in this setup. It does not establish that images are unnecessary or that these differences are statistically significant.
What to keep in mind
- This is a small pilot using a compact general-purpose model, not a clinically validated medical system.
- Improved calibration does not establish safe triage or dependable detection of individual mistakes.
- The project includes a local draft write-up, not a peer-reviewed publication. Source data and manuscript files are not publicly downloaded from this site.
Technical notes & source
Built with
Python · BLIP · VQA-RAD · probability calibration
Terms used in this project
- VQA
- Visual question answering: answering a question about an image.
- Calibration error
- A measure of how closely confidence estimates match observed correctness; lower is better.
- AUROC
- A ranking measure; about 0.5 means little ability to separate correct answers from wrong ones.
Read the source material
Local research · available on request. This page shares a summary, not private source code or raw research files.