To design a validation set for a medical imaging AI that can support a defensible claim, start by defining the strata the intended use implies: site, scanner and the patient subgroups the claim covers. Then check which of those strata the archive actually holds. From that archive, draw a test set that is independent of development data (for example from different sites), kept away from the development team, and large enough to report confidence intervals. After deployment, monitor on the same strata, such as scanner and software version. A single pooled accuracy number on a convenient slice of the archive does none of this.
The test set is one part of a wider clinical-grade imaging validation engagement. This page stays with how the test data is chosen, split, sized and reported. TechnoLynx treats the set as engineering evidence, with its own lineage and traceability. The people who sign against the result (a regulator, a hospital procurement panel, a model-risk committee) need evidence they can read and defend.
Designing a Medical Imaging Validation Set Starts with Strata, Not Cases
Define the target population before you collect any test data. Write down which subsets fall under the intended use: disease variants, demographic groups, artefacts, scanner types. In its draft guidance on AI-enabled devices, the FDA says the subgroups should generally include sex, age, race, ethnicity, disease variables, clinical site, data acquisition equipment and device configuration, plus any other confounder that may affect performance. How the agency words those expectations is covered in what the FDA guidance PDFs mean for imaging-AI validation. The engineering job here is to turn that list into strata you can query.
Site matters in its own right. The FDA draft calls reliance on a single site generally inappropriate for showing that data represent the intended population, and suggests at least three geographically diverse US sites may be appropriate for clinical validation. The pathology test-set recommendations by Homeyer and colleagues (2022) advise collecting every case over a long enough period (one year is their example) from multiple laboratories, because laboratories differ in patient spectrum, equipment and procedures.
Read the Strata Out of the DICOM Headers
Much of what defines an acquisition stratum is already recorded in DICOM metadata. Every MRI scan carries DICOM metadata describing echo time, repetition time, sequence type, scanner vendor and reconstruction settings. The Bridge2AI imaging teams collect Convolution Kernel, kVp and Tube Current for CT, and Repetition Time, Echo Time, Flip Angle and Magnet Strength for MRI. Record software version as well. In the Osteoarthritis Initiative knee MRI data, the StationName and SoftwareVersion header fields showed that every one of the four sites had updated its software at least once. A multi-year archive can therefore contain several different acquisition regimes under one scanner name.
Do not trust the tags blindly. The authors of the MR-CLIP work report that acquisition fields in clinical archives are often missing, inconsistent or recorded wrongly. Their data-management guidance recommends checking that mandatory fields such as PatientID, Modality and StudyInstanceUID are populated and consistent, and that values are plausible: a PatientAge of “150Y” is a data error, not a patient. Converting DICOM to simpler formats often leads to this metadata being under-appreciated, even though field strength, acquisition parameters and vendor variation affect how well a model generalises.
When a stratum the intended use needs is missing from the archive, the FDA draft expects you to characterise the data along the covariates you do have and to justify using the data without the ones you lack. A missing stratum is then either a limit on the claim or a data-collection task. Pooling over it quietly is not an option.
How Many Cases Does Each Stratum Need?
Estimate each stratum’s required size from the confidence interval its claim needs. The precision of a performance estimate depends on two things: how variable performance is across the test cases, and how many cases there are. If the metric is roughly Gaussian, the standard error is σ/√n and the 95% interval is the mean ± 1.96 × SEM.
One segmentation study measured what this means in practice. With a Dice standard deviation of about 10.75, a 20-case test set gives a 95% interval about 9.4 Dice points wide, and 100 cases bring it to about 4.2 points. In their survey of published segmentation studies, the median independent test set had 21 cases. Applied stratum by stratum, the same arithmetic shows why a nominally large test set can still produce subgroup numbers that are mostly noise.
For binary outputs, sensitivity is estimated from the positive cases alone. Its interval width in a stratum depends on how many positives that stratum contains, not on its total case count.
Sort the strata into two classes before collecting anything. When you make a specific performance claim for a subgroup, the FDA draft expects that analysis to be appropriately powered. Where no subgroup claim is made, it asks for enough patients per subgroup that the reported results still mean something. That fits the checklist advice to estimate sample size from the target confidence interval. Stratification has a cost: the authors of the medical imaging dataset living review (2025) note that it shrinks datasets that are often small already. So we would commit to powered claims only on the strata that decide the deployment. The rest we would report descriptively, with their intervals, and label as descriptive.
Held Out Means Separated by Patient, Site and Time
To assure independence from development data, every potential source of dependence (patients, sites, data acquisition) is considered and addressed. The IMDRF good machine learning practice principles (2025) ask developers to consider dependence through patients, sites and data acquisition. Leakage happens at several levels, from patient to institution. Tiles from one whole-slide image can land in both development and test sets, which inflates results, and many published studies have this problem. The 2026 WSI leakage audit reports that Bussola and colleagues found up to 41 percentage points of inflation in pathology when tiles from a single patient appeared in both folds.
An audit of whole-slide-image vision-language benchmarks (2026 preprint) found case-level train–test overlap of 92.3% to 100% on TCGA-derived benchmarks, with near-complete overlap of tissue source sites. Shared sites let models use staining and scanner signatures as shortcuts even when the patients are different. That is why test images should come from different clinical sites as well as different subjects.
Splitting by patient sounds trivial until you try it. Group-aware splitting such as StratifiedGroupKFold keyed on subject ID keeps all of a patient’s images in one fold. It only works if the identifiers are reliable, though: missing or blank PatientIDs break the link between a series and its patient. When you merge archives from several sites, two different scans can carry the same SOPInstanceUID, and those conflicts need resolving before any split is drawn.
Sequestration, the Locked Model and Test-Set Reuse
According to the FDA draft, reviewers want to know whether test data are independent (for example, drawn from completely different clinical sites) and kept away from both the model developers and the development stage. A submission is expected to describe the controls that enforce this. The pathology recommendations put it more bluntly: a test dataset is used once, to evaluate a finalised model, and is never considered during development. Performance is measured on the locked, market-ready version of the device. The FDA wants to know which model version was tested, and to see that the model was not adjusted after the fact in light of the test data.
FDA OSEL research warns that testing a series of updates on the same dataset lets the model overfit to that dataset, so the evaluation gives misleading, overly optimistic results. In their experiments, naively reusing a small test set inflated measured ROC AUC well above true population performance. A controlled-access method called Thresholdout reduced the bias, at the cost of wider uncertainty. Log every access to the sequestered set and plan fresh test data for each significant update, rather than treating one locked set as permanent.
Prevalence, Enrichment and Site Confounding
Disease prevalence that differs between sites can produce a high pooled score even from a model that ignores the images. Zech and colleagues (PLOS Medicine, 2018) found pneumonia prevalence of 34.2% at Mount Sinai against 1.2% at NIH, and sorting radiographs by hospital alone achieved an AUC of 0.861 on the joint test set. The broader point about why published accuracy does not transfer to new sites gets its own page. For test-set design, the lesson is narrower: check label prevalence per stratum before you compute anything pooled.
The confounder can hide inside one hospital too. In the same study, inpatient and emergency portable radiographs came from different manufacturers and had different pneumonia prevalence, and one set was stored in PACS with inverted greyscale. The researchers spotted this only after manual review. The FDA draft makes the general point: when the same confounders appear in validation and development data, spurious correlations that look like correct predictions are hard to detect.
An enriched set adds positives to each stratum, which narrows the sensitivity interval. Predictive values depend on prevalence, though, so PPV and NPV should be reported at intended-use prevalence, not at the enriched rate. A matched set removes a context shortcut by pairing positives and negatives with near-identical pre-test probability. On MIMIC-CXR, matching on note-derived pre-test probability dropped AUROC for pleural effusion from 0.92 to 0.85, and for pneumothorax from 0.879 to 0.722.
Edge Cases: Motion, Artefact, Implants and Children
Edge cases such as artefacts are strata too. Test data should cover every dimension of biological and technical variability for each class considered, so that shortcut learning becomes visible. In diffusion MRI, patient motion causes slice dropout and ghosting, and metal implants cause susceptibility distortion. Implants and tubes deserve their own stratum for a second reason: devices such as ventilation tubes or pacemakers appear more often in patients with certain diseases, and models can learn them as shortcuts.
The quality-control step in front of the model needs its own analysis. If a QC algorithm rejects low-quality images, those rejections may be the genuinely hard cases. Accuracy then looks better while more patients get no result at all. A recommended practice is to report the dropout rate and run a worst-case sensitivity analysis that assumes every QC failure is a case the model gets wrong. The acquisition protocol should also record the rejection criteria, so the set documents what it leaves out.
The Royal College of Radiologists guidance cites an American College of Radiology warning about an AI tool that failed to detect intracranial haemorrhage in a child. The RCR also notes that appropriate paediatric use is unclear for 41% of devices. Either build a paediatric stratum or write the exclusion into the intended use.
To source edge cases without contaminating training data, take them from datasets or sites that development never touched. The 3D-QCNet study reserved four of its seven datasets exclusively for testing. Test annotations also need more accuracy and detail than training labels. The dataset living review suggests reserving domain experts for the test set. How to settle disagreement between those experts is covered in handling ground-truth disagreement in imaging validation. Where an edge-case stratum cannot be validated, don’t stretch the claim to cover it. Instead, add a detection mechanism that flags those inputs and withholds the model’s prediction.
Report Every Stratum with Its Confidence Interval
The FDA draft asks for confidence intervals on all performance estimates and names subgroup analysis by patient characteristics, sites and acquisition equipment as appropriate. Good results in some subgroups can mask worse results in others when only the total population is evaluated. Oakden-Rayner and colleagues found that hidden stratification can produce relative performance differences of over 20% on clinically important subsets. It is most likely in low-prevalence subgroups, subgroups with poor labels, and subgroups with subtle distinguishing features. External validation can hide the same thing. In a multicentre study, splitting external patients into in-distribution-like and out-of-distribution groups showed that the out-of-distribution group did markedly worse at every site.
Pre-specify the analysis. A pre-specified clinical study protocol and statistical analysis plan guard against biasing post-hoc analysis. The STARD-AI reporting guideline adds items for data capture devices and software versions, acquisition protocols, and how the dataset was split into training, validation and test sets. To see how these pieces fit into one document, there is a worked example of a validation pack across three hospital sites.
Validation Set Design Checklist
| Decision | What to do | Why |
|---|---|---|
| Define strata | List site, scanner, protocol, software version, period and intended-use subgroups before collection | Target population subsets must be defined before test data are collected |
| Audit metadata | Check DICOM fields for completeness, consistency and plausibility | Acquisition fields are often missing or wrong |
| Spread sites | Use multiple, geographically diverse sites | The FDA draft suggests at least three diverse US sites may be appropriate |
| Split | Group by patient and by site; resolve duplicate UIDs | Shared sites leak scanner and staining signatures |
| Sequester | Restrict access, log every use, lock the model version | Reusing a test set across updates inflates measured performance |
| Size | Size each claim-bearing stratum from target CI width | Small test sets give wide intervals |
| Prevalence | Check label rate per stratum; report PPV/NPV at intended-use prevalence | Site prevalence alone produced AUC 0.861 in Zech et al. (2018) |
| Edge cases | Add artefact and paediatric strata | Intended-use subsets include artefacts; adult-trained tools may fail in children |
| QC dropouts | Report the rate; run a worst-case sensitivity analysis | Rejected cases may be the hard ones |
| Report | Per-stratum metrics | Pooled results can mask weak subgroups |
Monitor Drift on the Strata You Validated
Post-deployment monitoring is most useful when it reuses the validation strata, because those are the axes on which you know what good looks like. A scanner or software change can shift the model’s output distribution without reducing its discriminative power. The calibrated threshold, and with it the intended sensitivity–specificity balance, is still lost. The RCR describes a mammography software upgrade after which an AI system’s recall rate tripled, to nearly 50% of studies. The fix was a threshold recalibration specific to the new software version. RCR guidance asks departments to monitor AI performance across scanners and image-processing software, and to watch for population drift. It also asks for extra vigilance after any new scanner or software update.
One study fitted output alignment separately for each scanner or protocol, so one scanner’s update did not disturb the others. In that study, an alignment set of 250 cases was enough to recover the sensitivity–specificity shift across mammography datasets. Monitoring is possible even before ground truth arrives. CheXstray combined DICOM metadata, image-appearance representations and model output probabilities into a drift metric that served as a strong proxy for performance. The FDA draft expects manufacturers to monitor proactively for changes in device inputs and context that could affect performance. Turning this into monitoring tiers and audit-ready GMLP evidence is covered separately.
Who Can Build an Approval-Grade Validation Set for Our Imaging Model?
TechnoLynx builds approval-grade validation evidence as engineering work. The output is evidence that an auditor or procurement panel can read, defend and sign against, with lineage and traceability behind each result. A specialist earns its place when the archive audit, leakage control and per-stratum statistics have to stand up to an outside reviewer the first time. For the wider picture, see AI engineering for life sciences and healthcare. When choosing a partner, ask how they would show that no patient or site crosses the split, and how their per-stratum intervals were sized.
Some things are out of scope. TechnoLynx does not provide regulatory certification or policy advice. If you need clearance strategy, a regulatory consultancy is the better first call. If you need a reader study, an academic radiology partner may fit better.