Skip to the scanner shift demo

Medical AI lab · Scanner shift ·

Scanner shift in medical imaging: interactive demo

An imaging model tuned on one scanner can fail on another even when the anatomy is identical. In this demo a segmentation rule scores Dice 0.86 on scanner A and 0.85 on new images from the same scanner, but 0.01 on scanner B with the Lower contrast preset (0.70×), where it finds almost none of the lesion. An internal test set cannot show the second number; only images from the new scanner can.

In one line: Dice is 0.86 on the scanner the model was tuned on and 0.01 on a scanner with 0.70× contrast, with identical anatomy in both images.

SYNTHETIC DATA

These demos are illustrative. Every signal, image, patient and note is synthetic and fictional, generated and scored in your browser, and every number shown is computed from that synthetic data. They show general principles, not the performance of any real model, product or project, and none of them is a medical device.

Nothing is uploaded. No patient data is used.

04

Medical imaging AI / domain shift

Tuned on one scanner. Tested on another.

What this shows: a segmentation rule tuned on scanner A fails on scanner B when contrast or noise changes, although the anatomy is identical. Normalising intensities first removes most of the contrast effect, not the noise.

Change scanner B

The model smooths the image and keeps pixels inside an intensity window. The window was chosen to give the best Dice on scanner A.

Same anatomy, two scanners

128 × 128 synthetic slice
Scanner A · where the model was tuned
Scanner B · new site

Blue: correct lesion pixelsRed: false lesionAmber: missed lesion

Scanner B intensity histogramLesion and tissue intensities and the model’s window.

Blue: lesion pixels on BAmber: other tissue on BWhite dashed: window learned on A

Dice on scanner A—
Dice on scanner B—
Extra · missed pixels on B—

Synthetic data · illustrative · not a medical device

Where this matters

Imaging models moved between scanners, protocols, vendors or sites. Learned models are far more flexible than this rule, but they can still depend on intensity and noise characteristics of the scanners they were trained on, which is why external, multi-site testing matters.

What this experiment models

A procedural slice: a body outline, two organs, a bright bony structure and an irregular lesion with a brighter core. Scanner A adds fixed Gaussian noise. Scanner B scales contrast around the image mean and adds its own noise. The “model” is a 3 × 3 mean filter followed by an intensity window, grid-searched for the best Dice on scanner A and then frozen. Normalisation, when on, z-scores each image before the window is applied, and the window is re-tuned on normalised scanner A.

The principle

How it works

The image is a procedural slice: a body outline, two organs, a bright bony structure and an irregular lesion with a brighter core. The model smooths the image with a 3 × 3 mean filter and labels every pixel inside an intensity window as lesion. The window is chosen by grid search for the best Dice on scanner A and then frozen, as a trained model’s parameters would be.

Scanner B stretches or compresses the contrast around the image mean and adds its own noise. Lower contrast pulls the lesion’s intensities out of the window and it is missed; higher contrast pushes organ tissue into it and creates false lesions; more noise scatters pixels across the window edges. The histogram shows the lesion and tissue intensities on scanner B against the window learned on A.

Normalising each image’s intensities before segmentation removes the contrast change almost completely, but not the noise. Deep networks are far more flexible than one intensity window, yet they can also depend on the intensity and noise characteristics of their training scanners, so imaging models need testing on data from other scanners and sites. See medical imaging AI.

Worked example

A segmentation model moved to a second site

Picture a team that develops a lesion segmentation on images from one scanner. They report Dice on held-out images from that scanner and then install the model at a second site, where the scanner and protocol are different.

The demo’s default settings stand for the held-out test. Scanner B has the same settings as scanner A, contrast 1.00× and noise 0.030, and only the noise pattern is new. Dice is 0.86 on scanner A and 0.85 on scanner B, with 55 extra and 7 missed lesion pixels. New images from the same scanner are handled about as well as the tuning image, which is all an internal test set can show.

Now change scanner B with the presets. With Lower contrast (0.70×), Dice on scanner B falls to 0.01, with 81 extra and 180 missed pixels: the lesion’s intensities have slid out of the window the model learned, so the lesion is no longer found. With Higher contrast (1.40×), Dice is 0.02, with 1,284 extra and 166 missed pixels, because organ tissue has moved into the window. With Noisier (noise 0.110 at contrast 1.00×), Dice is 0.70, with 110 extra and 24 missed pixels. The anatomy is identical in every case.

Tick the normalisation box and repeat. Dice on scanner B is 0.83 at lower contrast and 0.85 at higher contrast, so the contrast problem is almost gone. With the noisier scanner it is 0.71, practically unchanged. Harmonisation fixes the kind of shift it models and not the others.

One intensity window is a deliberately brittle model, and a trained network would usually degrade less sharply. The mechanism is the same, though: a model can depend on intensity and noise characteristics of the scanners it was trained on. The correct practice is to test on images from each scanner, protocol and site where the model will be used before it goes live, to report results per site instead of pooled, to normalise or augment for the variation you expect, and to check again after a scanner or software change.

Checklist

What to check in your own project

  • Which scanners, vendors, protocols and reconstruction settings are in the training data, and which are used at the target site?
  • Are results reported per scanner and per site, not only pooled?
  • Is there a truly external test set, from a site that contributed nothing to training?
  • Is intensity normalisation or harmonisation part of the pipeline, and was it tested against noise and resolution differences as well as contrast?
  • Does the training augmentation cover the range of contrast and noise you expect in use?
  • Is there a plan to re-check performance after a scanner upgrade or protocol change?

Related: our medical imaging AI service, the wiki page on medical AI validation, and the demos on Dice score vs clinical error and patient-level data leakage.

FAQ

Common questions

How do I test a medical imaging AI model on a new scanner?

Collect images from the new scanner and protocol with reference annotations, run the frozen model on them without retraining, and report the results for that site separately from the development results. In the demo an internal test on the same scanner gives Dice 0.85, almost the tuning score of 0.86, while the same model scores 0.01 on a lower-contrast scanner. Only an external, per-site test shows the second number.

Why does my segmentation model fail on images from another hospital?

The model learned the intensity and noise characteristics of the scanners it was trained on, not only the anatomy. When another scanner shifts contrast or adds noise, the lesion’s intensities slide out of the range the model expects. In the demo Dice falls from 0.86 to 0.01 at 0.70× contrast with identical anatomy.

What is domain shift in medical imaging?

Domain shift is a change in the distribution of images between where a model was developed and where it is used: a different scanner, protocol, vendor, site or patient population. It can degrade a model that performed well in internal testing. The demo isolates two forms of it, contrast and noise, on identical anatomy.

What is scanner shift in medical imaging AI?

Scanner shift is a form of domain shift: the images a model meets in use differ systematically from its training images because they come from another scanner, vendor, protocol or site. The anatomy and disease are the same, but contrast, brightness, noise and resolution are not, and performance can drop.

Why does a medical imaging model perform worse at a new site?

Usually because something about the images changed: the scanner model, the acquisition protocol, the reconstruction software or the patient mix. A model can come to rely on intensity and noise characteristics of its training scanners. In this demo a rule tuned on scanner A drops from a Dice of 0.86 to 0.01 when scanner B has lower contrast.

Does intensity normalisation fix scanner differences?

Partly. Normalisation removes global differences in brightness and contrast, and in this demo it brings Dice at lower contrast back from 0.01 to 0.83. It does not remove differences in noise, resolution or artifacts: with the noisier scanner, Dice is 0.70 without normalisation and 0.71 with it.

How should an imaging model be tested before it is used at a new site?

Collect a sample of images from the new site’s own scanners and protocols, with reference annotations, and run the frozen model on it without retraining. Report the results for that site separately and compare them with the development results. If performance drops, find the cause before adjusting the model, and validate any adjusted version on separate data.

Medical AI lab

More demos

01 / Heart rate from ECGHeart rate from a noisy ECG – interactive demoMissed and false beats behind a correct average02 / Patient leakagePatient-level data leakage – interactive demoRecord-level vs patient-level train/test splits03 / Calibration & thresholdsCalibration and decision thresholds – interactive demoCalibration plot, decision curve and net benefit05 / Dice vs clinical errorDice score vs clinical error – interactive demoDice, HD95 and lesions detected06 / Note de-identificationDe-identifying a clinical note – interactive demoEnglish, Hebrew and mixed notes vs a rule-based detector07 / Nodule volume 3DNodule volume and CT slice thickness – 3D interactive demoThe same nodule, measured on thin and thick slices08 / Sample sizeSample size for validating a clinical AI model – interactive demoHow wide the interval is around a measured sensitivity09 / SubgroupsHidden subgroup failure in clinical AI – interactive demoA good overall score next to a weak subgroup10 / Slice-by-slice 3DSlice-by-slice segmentation of a 3D lesion – 3D interactive demoA high per-slice Dice and a lesion reported in pieces11 / Predictive value 3DPositive predictive value and prevalence – 3D interactive demoWhat a positive result means when the condition is rare12 / Shortcut learningShortcut learning in medical imaging AI – interactive demoA model that reads the hospital tag, not the disease13 / DriftModel drift and performance monitoring – interactive demoHow late a monitoring rule notices a slow decline14 / Alert burdenAlert burden of a clinical early-warning model – interactive demoA threshold counted in alerts per nurse per shift

MLAIA DATA SCIENCE

Tell us what
you’re working on.

Share the problem, the data you have and what success would look like. We’ll discuss a practical next step.

Please don’t include confidential datasets, credentials or patient information.

yochai@mlaia.com
WhatsApp: +972 52 484 6282

Your inquiry is handled under our Privacy Policy.