Designing Retrospective Validation Studies

How to design rigorous retrospective studies using existing clinical data. Cohort selection, temporal validation, handling missing data, and the limitations of retrospective evidence.


Almost every AI validation starts retrospectively. The images are already in the archive, the outcomes have already happened, and you can assemble in a few months a cohort that would take years to recruit prospectively. For a first serious test of a model, that's the right choice.

Retrospective designs also have the weaknesses you already know from diagnostic accuracy research, plus a few that are particular to software. The good news is that most of them are design problems, and they can be dealt with on paper before anybody pulls a single study from the PACS.

Start from the intended use

Before choosing cases, write down what the model is for, in one or two sentences: which patients, in which setting, at which point in the pathway, with what done on the basis of the output. "Flags suspected pneumothorax on adult chest radiographs in the emergency department, to prioritize the radiologist's worklist" is a usable statement. "Detects pneumothorax" isn't.

Everything else follows from it. The cohort should be the patients who would get the tool. The comparator is what happens to them now. The reference standard and the endpoint are whatever the intended decision depends on. If the intended use is vague, the study will be too, and a regulator will ask the same question later anyway (see 6.1 When Does Your AI Algorithm Become a Medical Device?).

Choosing the cohort

Consecutive beats convenient

The cleanest retrospective cohort is every eligible patient over a defined period at defined sites: all adult ED chest radiographs from January to June, say. That gives you the natural mix of disease severity, image quality, comorbidities and confusing look-alikes, and the natural prevalence.

The tempting alternative is a case-control design: collect known positives from a pathology or registry database and a set of known normals from somewhere else. It is far less work, and it flatters the model. Jeroen Lijmer and colleagues showed in 1999 that diagnostic studies comparing severe cases with healthy controls overestimated accuracy about threefold, measured by the diagnostic odds ratio, compared with studies in a clinically relevant population. The reason is the missing middle: early disease, borderline findings, and patients who have something else that looks similar.

For AI there is a second problem with case-control sampling, which we covered in 2.4 Class Imbalance. When positives and negatives arrive by different routes, they often differ in scanner, site or period as well as in disease, and the model's score partly reflects those differences.

If the condition is rare and you have to enrich, we'd suggest a compromise. Define the consecutive cohort first, then take all the positives in it and a random sample of the negatives from the same cohort. You keep the realistic spectrum on both sides, you know the sampling fractions, and you can weight back to the true prevalence when computing predictive values.

Inclusion and exclusion criteria

Write them before looking at the data, and keep them few. Each exclusion narrows the population you can make claims about.

The exclusions to be most careful with are the ones based on image quality. Dropping studies with motion, poor positioning or hardware in the field makes the results look better and describes a clinic that doesn't exist. If the model has a built-in quality check that rejects some images, those rejections are a result, and they should be counted and reported.

Keep a count at every step and draw the flow diagram: how many were eligible, how many were excluded and why, how many the model couldn't process, how many had no reference standard. The STARD reporting guideline asks for this, and reviewers look for it (see 9.1 Reporting Standards).

Independence from the development data

No patient in the validation cohort can have contributed to training or tuning. With retrospective data from the same institution this takes active checking, because the same patients come back for more imaging. Match on a patient identifier, not a study identifier (see 3.2 Training, Validation, and Test Sets).

Temporal validation

If you only have one site, the strongest design available is to validate on a later period than the training data. Train on 2018 to 2021, lock the model, test on 2023.

This is a modest but real step toward external validation. Scanners get replaced, protocols drift, staff and referral patterns change, so the later data is a slightly different world. It also mirrors how the model would be used: trained on the past and applied to the future. A random split of the same period can't show you any of that.

Two details are worth attention. Leave a gap between the periods if patients are likely to have repeat studies. And report what changed between the periods, such as a new scanner or a revised protocol, because it helps readers interpret any drop.

Lock everything first

This is the piece of discipline that is most specific to AI. With a drug, nobody can adjust the molecule after seeing the trial results. With a model, it's a few minutes' work to retrain, move the threshold or change the preprocessing after a look at the validation data, and each such adjustment makes the validation a little less independent.

So before the validation data is touched, fix the model version, the preprocessing, and the decision threshold, and write them into a protocol together with the primary endpoint, the subgroups and the analysis plan. Registering the protocol, or at least time-stamping it, makes this verifiable. Then run the model once.

If the result is disappointing and you go back and change the model, that's a perfectly reasonable thing to do. It just means the dataset you used is now development data, and you need a fresh one for validation (see 4.5 Statistical Significance, Confidence Intervals, and Sample Size for AI Studies for sizing it).

The reference standard in old data

In a retrospective study the reference standard is whatever routine care happened to record, and routine care wasn't designed for your study. There are a few standard problems.

Partial verification. Only some patients got the definitive test, and they were chosen because something looked suspicious. If you restrict the study to patients with a biopsy, you have selected the cohort on a variable related to the index test, and measured sensitivity goes up while specificity goes down. If you include unbiopsied patients and treat them as negative, you are assuming that everyone who wasn't worked up was disease-free.

Differential verification. Positives are confirmed by pathology and negatives by two years of uneventful follow-up. These are different reference standards with different error rates. It's often unavoidable, and it should be reported as what it is.

Incorporation. If the original radiology report is the reference standard, and the model was trained on reports from the same radiologists, the model is being scored on its agreement with its teachers.

The usual remedy for all three is to have the cases re-read for the study by a panel that is blind to the model's output, using follow-up information where it exists. 5.7 Reference Standards and Ground Truth in Medical AI covers how to set that up.

Missing and unusable data

Retrospective data has holes: a series missing from the study, a clinical variable never recorded, an image the model fails on.

For clinical variables, the usual statistical advice applies. Complete-case analysis is only safe if data are missing at random, which they seldom are in health records, since a test that wasn't ordered tells you something about the patient. Multiple imputation is the standard approach for a prediction model's inputs.

For the model's own failures, the choice is how to count them. A study that drops the 8% of images the model couldn't process and reports sensitivity on the rest is answering a question about a tool that doesn't exist. The more honest analysis treats them the way a trial treats non-adherence: report the proportion, and give results both excluding them and counting them against the model (as a miss when the case was positive, as a referral or false alarm when the intended workflow would send an unreadable image to a human).

What to report

Along with the headline metric and its confidence interval:

  • Performance in the subgroups you specified in advance: by sex, age band, scanner vendor, site, disease severity, and whichever demographic groups are relevant (see 7.2 Demographic Fairness).
  • A comparison with something. Current practice, the original clinical report, an existing risk score, a simple baseline model. An AUC with nothing next to it is hard to interpret.
  • Predictive values at the real prevalence, if the cohort was enriched.
  • A review of the errors. Have a clinician look at the false negatives and false positives and describe them. This is often the most useful paragraph in the paper.

Two tools are worth knowing as a designer, since reviewers will use them on you: QUADAS-2, a checklist for risk of bias in diagnostic accuracy studies, and PROBAST, its counterpart for prediction models. Running your own protocol through the relevant one before you start takes an hour or so.

What a retrospective study can't show

Even a careful one has limits, and it's better to state them in the paper than to have a reviewer do it.

It can't show what clinicians would have done with the output. The model had no effect on any decision, so you have accuracy and nothing about its consequences.

It only includes patients and images that made it into the archive. The scan that was repeated because the first attempt was unusable, the patient who was never imaged: they aren't there. Real-time use meets them.

It runs the model under ideal conditions. Somebody curated the inputs, selected the right series and fixed the format. In live use that has to happen automatically.

And the data were recorded for care, with all the gaps and inconsistencies that implies.

So a good retrospective study is the evidence that justifies a prospective one (see 5.3 Designing Prospective Clinical Validation Studies). For some low-risk intended uses it may also be enough for regulatory clearance. Either way it is worth doing well, because a weak retrospective result mostly gets found out at the next stage, at much greater cost.

Key takeaways

  • Write the intended use first. The cohort, comparator, reference standard and endpoint all follow from it.
  • Prefer a consecutive cohort from a defined period. Case-control sampling of obvious positives and healthy normals overestimates accuracy. If you must enrich, sample the negatives from the same consecutive cohort.
  • Keep exclusions few, don't exclude on image quality, and report a flow diagram.
  • With one site, validate on a later period than the training data.
  • Lock the model, preprocessing, threshold and analysis plan before touching the validation data. If you change the model afterwards, you need new validation data.
  • Routine-care reference standards suffer from partial and differential verification. A blinded study re-read is the usual fix.
  • Count the model's failures to produce an output as results.
  • A retrospective study shows accuracy on archived data. It doesn't show the effect on decisions or outcomes.

This article is part of the AI in Clinical Research Knowledge Base.