Jayden Wang

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.

Role
Sole student researcher, in a research collaboration with West China Hospital, Sichuan University
My contribution
West China Hospital provided the scans and the clinical question. The research and all of the code are mine: I found the slice-misalignment bug, wrote the alignment algorithm, built the patient-level evaluation, and ran the cross-validation that produced the negative result.
Built with
Python, PyTorch, MONAI, Medical imaging (DICOM), Image registration
  • 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
Three chest CT slices of the same patient side by side: the plain scan, the contrast scan the model produced from it, and the real contrast scan.
Fig 1Left, the ordinary scan the model was given. Middle, the dye scan it drew. Right, the real dye scan. At a glance they match, but in the real scan the dye outlines the heart’s chambers, while the model brightens the whole heart evenly.
Fig 2A 48-second overview, no sound. It shows a later version of the model than the five-fold result below, and that version has not yet repeated the five-fold test. Scores are visual match on 20 slices from 10 held-out patients in one fold. The misaligned pair is re-created at the 37-slice average gap. Research only, not for diagnosis.

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

Two CT slices with the same slice number: the plain scan at the lung bases and the top of the liver, and the contrast scan paired with it by array index, at the kidneys
Fig 3Before alignment, the model compares two different anatomical locations.

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.

Diagram: a non-contrast and a contrast CT of the same patient start at different positions along the body, an average offset of 37 slices or about 185 millimetres, yet were paired by array index
Fig 4Two scans of the same patient start at different positions along the body. This misalignment is what made every metric look good.

The alignment algorithm

Alignment pipeline: resample to a common grid, find the best z-shift by normalized cross-correlation, then gate on correlation and confirm visually
Fig 5Resample, find the best z-shift by normalized cross-correlation, then gate.
  1. Resample both volumes to a common voxel grid, so coordinates mean the same thing in both.
  2. Slide one volume along the z-axis and compute normalized cross-correlation at each offset. The offset with the highest correlation is the alignment.
  3. Gate on correlation: pairs below NCC 0.9 are dropped.
  4. 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.

Five-fold split diagram: in each fold one block of patients is the test set and the next block is the validation set, the rest train. The test block moves one place per fold, so all 49 patients are tested once: 10, 10, 10, 9 and 10 per fold.
Fig 6Training, validation and test sets are separated by patient, so one patient’s slices never sit on both sides of a boundary.

The result

Dot chart, one dot per patient, 49 patients sorted from lowest to highest. Chest correlations run from 0.145 to 0.487, mean 0.313; abdomen from 0.008 to 0.322, mean 0.184. A dashed line at r = 0.5 marks the bar for success, and no dot reaches it.
Fig 7Each patient’s correlation between the model’s scan and the real one. None of the 49 reaches the bar.

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.

Bar chart of enhancement in high-uptake regions divided by enhancement overall. Chest: real scan 4.5 times, model 2.0 times. Abdomen: real scan 4.6 times, model 1.0 times. A dashed line at 1 times marks equal brightening everywhere.
Fig 8Measured as enhancement in high-uptake regions divided by enhancement overall. The real scans concentrate the dye; the model spreads it out.

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