Clinical AI Research, 2025
My model scored well on every standard metric. On patients it had never seen, it did not work.
Ongoing research collaboration with West China Hospital, Sichuan University. The model failed on patients it never saw in training. A later version scores higher on 20 test slices and has not yet repeated the full test.
A medical imaging project that became a lesson in building evaluation strict enough to rule out your own model.
- r = 0.313 chest correlation on held-out patients
- 0 / 49 patients reaching the r > 0.5 bar I set for success
- ±0.02 margin of error (95% confidence), small enough to conclude

The moment I stopped trusting my numbers
Some patients can’t receive iodine contrast, because of kidney disease or an allergy. A model that synthesizes a contrast scan from a plain one could give doctors that view without the injection. West China Hospital supplied paired plain and contrast scans, and I set out to train a synthesis model on them.
The loss curves looked good and SSIM, a standard image-similarity score, climbed to 0.88. By every standard metric, the model was learning.
Then I opened a few predictions next to the ground truth, and the anatomy didn’t match. The model was painting contrast onto the wrong part of the body and still scoring well, because the metric was comparing the wrong slices.
What I found: the slices were shifted
The paired scans weren’t aligned. A plain CT and a contrast CT of the same patient are two separate acquisitions, and they start at different positions along the body. My first pipeline paired them by array index, which assumed they started at the same place. Across the dataset that assumption was off by an average of 37 slices, roughly 185 mm. “Slice 45 of the plain scan” and “slice 45 of the contrast scan” were nowhere near the same anatomy, and SSIM still rewarded the model for mapping one to the other, because SSIM measures structural similarity and has no idea which organ it is looking at.
The alignment algorithm
- Resample both volumes to a common voxel grid, so coordinates mean the same thing in both.
- Slide one volume along the z-axis and compute normalized cross-correlation at each offset. The offset with the highest correlation is the alignment.
- Gate on correlation: pairs below NCC 0.9 are dropped.
- Confirm by eye: render the aligned slices side by side and check the anatomy actually matches.
Step 4 stays manual on purpose. In this project the numbers already misled me once, and I don’t have an automated check I trust to catch a pair that is aligned by the math and wrong by the anatomy.
There used to be a second automated gate, on how much the two scans overlapped, and I turned it off. An arbitrary threshold that silently drops patients is worse than no threshold.
Building an evaluation that could say no
The first dataset was small: 17 patients and 55,639 slices as delivered, but only a handful of pairs survived alignment. Every result came back too small to tell. In August the hospital delivered a much larger cohort: 49 lung-cancer patients, each with an arterial phase, which was finally enough to answer the question.
With it I built the evaluation I hadn’t been able to run before: a patient-level three-way split, five-fold. The validation set picks the checkpoint, so only the test set is untouched, and it is evaluated exactly once.
The result
The model does not work. The confidence intervals are ±0.02 wide and nowhere near the bar, so this is a clear answer rather than a case of too little data. It is the project’s first number on unseen patients precise enough to support a conclusion.
The diagnosis is specific enough to act on. The model learned to raise brightness roughly evenly across the body instead of concentrating contrast in the vessels. In the abdomen, the model brightens the aorta and the liver by the same amount.
Where things stand
- An air-region penalty and a residual-connection architecture were both tried against that under-enhancement, and neither helped.
- A later version, the one in the film (Fig 2), scores 2.45 of 4 for visual match on 20 test slices from 10 held-out patients in one fold. The version before it scored 1.95 on the same slices: 9 slices scored higher, 11 the same and none lower. It has not yet repeated the five-fold test, so the result above is still the only one on all 49 patients.
- The five-fold result showed that my first model, a GAN, fell short, so I moved to a diffusion model.
- I also ran a membership-inference audit to check whether the model memorized its training patients. On the pixel-level metrics it came back AUC 0.70 to 0.80, which leans toward memorization; on the feature-level ones the interval still covers chance, so those say nothing either way. With only five clusters none of these intervals is reliable, which is why the project has a standing rule against writing this up as “no evidence of memorization.”
- Deployment is not on the table. The data is under hospital NDA, so there is no public repo.
What this project has produced so far is an evaluation strict enough to rule out my own model, and a report of the result it gave.
Skills & tools
- Language
- Python
- Deep learning
- PyTorch, MONAI, pix2pix GAN, diffusion models
- Medical imaging
- DICOM / NIfTI, image registration, de-identification
- Method
- Patient-level cross-validation, cluster bootstrap