The AI Development Lifecycle: From Hypothesis to Deployment

An end-to-end map of the development process: problem formulation, data curation, model selection, training, validation, and iteration. Where clinical expertise is essential at each stage.


If you have run a clinical study, most of an AI project will feel familiar. There is a question, a cohort, a measurement, an analysis plan and a result that somebody else has to be able to check. The unfamiliar parts are the loop in the middle, where the team trains a model, looks at what it got wrong and goes back to change something, and the long tail at the end, where a working model has to become something a hospital can use.

This article walks through the stages in order. The other articles in this section go into each one. At every stage we'll say what the clinical researcher contributes, because it is more than most clinicians expect and it doesn't end when the data is handed over.

The stages at a glance

Stage The question it answers Who leads
Problem formulation What exactly should the model do, for whom, and why? Clinician
Data curation Which cases, with which labels? Clinician and engineer together
Splitting Which cases are kept back for the final test? Engineer, with clinical input
Model selection and training Which approach, and does it learn? Engineer
Error analysis and iteration What does it get wrong, and why? Both
Final test How good is it on cases nobody has touched? Whoever is independent
Clinical validation Does it help in practice? Clinician
Deployment and monitoring Does it keep working? Everyone, indefinitely

The table makes it look like a straight line, which it isn't. We'll get to that.

Problem formulation

Every project starts with a clinical question, and the first job is to turn it into a task a model can be trained on. "Can AI help with stroke?" is a topic. "Given a non-contrast head CT from an adult presenting to the emergency department, flag studies with a suspected large-vessel occlusion so they are read first" is a task. It names the input, the patient population, the output and what happens with the output.

A good formulation answers these:

  • What is the input, and is it available at the moment the model would be used?
  • What is the output: a category, a number, an outline, a ranking?
  • Who acts on the output, and what do they do differently because of it?
  • What is the reference standard that says whether the output was right?
  • What does a miss cost, and what does a false alarm cost?
  • How is this done today, and how well?

The last question is the one that gets skipped most often. If we don't know how well the current process performs, we can't say whether the model is an improvement. It's also worth asking at this stage whether the problem needs machine learning at all, or whether a simple rule or a measurement would do (see 1.5 Matching the Problem to the Approach).

This stage belongs to the clinician. An engineer can tell you whether a task is feasible, but only someone who knows the clinical setting can say whether it is worth doing. If the work might become a product, the formulation you write here is also the first draft of the "intended use" statement that determines how it will be regulated (see 6.1 When Does Your AI Algorithm Become a Medical Device?).

Data curation

Next comes assembling the dataset: deciding inclusion and exclusion criteria, extracting the cases, de-identifying them, and getting them labeled. All of section 2 is about this stage, so we'll only say two things here.

First, it takes longer than anything else. There's a piece of folklore that data preparation is 80% of a machine learning project. Nobody seems to know where the number came from, but few people who have done a medical imaging project would argue with the general idea. Ethics approval, data extraction, de-identification and annotation each take weeks to months, and model training takes days.

Second, the decisions made here are clinical ones wearing technical clothes. Which patients are included decides which patients the model will work for. How the labels are defined decides what the model learns to call disease (see 2.3 Data Annotation and Labeling for Clinical AI). An engineer handed a folder of images and a spreadsheet has no way of knowing that the "normal" cases were all outpatients, or that the labels came from reports written with the pathology result already in hand.

Splitting the data

Before any training, the data is divided into three parts: a training set the model learns from, a validation set used to make choices during development, and a test set that is put away until the end. The division is done by patient, so nobody has images on both sides.

This step takes an afternoon, and how it is done determines whether the final result can be believed. It gets its own article: 3.2 Training, Validation, and Test Sets.

Model selection and training

Now the engineers choose an approach and train it. The choice is mostly dictated by the task. Segmentation of a 3D structure means some kind of U-Net. Classification of an image means a convolutional network or a vision transformer, almost always starting from a pretrained model (see 1.3 Common AI Architectures in Medicine and 3.3 Transfer Learning).

A sensible team starts with a baseline, meaning the simplest thing that could plausibly work: a standard architecture with default settings, or even a logistic regression on a few measurements. The baseline tells you how hard the problem is, and it gives every later, fancier attempt something to beat. If a carefully tuned deep network beats logistic regression on age and lesion diameter by one point of AUC, that is worth knowing before you write the paper.

Training itself is mostly waiting, with the engineers watching curves that show whether the model is learning or memorizing (see 3.5 Overfitting, Underfitting, and Regularization). They will also adjust the settings that control training, called hyperparameters (see 3.4 Hyperparameter Tuning and Model Selection). The clinician's role during this stretch is small, which is perhaps why many clinicians assume their role is small throughout.

Error analysis and iteration

Once a first model exists, the most useful thing anyone can do is look at what it gets wrong. This is where the clinician comes back in.

The engineers pull the cases from the validation set where the model was most confidently wrong, and you go through them together. The errors tend to sort into a few piles pretty quickly:

  • The label was wrong, and the model was right.
  • The case is ambiguous, and experts would disagree about it too.
  • The image has a problem: wrong body part, heavy artifact, a preprocessing bug.
  • The model is using something it shouldn't, like a marker or a device.
  • The model is plain wrong on a kind of case it hasn't seen enough of.

Each pile sends the project back to a different earlier stage. Wrong labels mean relabeling. Ambiguous cases mean the annotation protocol needs a rule. Too few examples of a subtype means collecting more data. A shortcut means changing how the data was sampled or preprocessed. Only some of the time does the answer lie in changing the model.

So the real shape of the lifecycle is a loop: train, look at errors, fix something upstream, train again. Most of the improvement in a typical project comes from going round this loop, and most trips round it end in a change to the data (see 2.1 Why Data Quality Matters More Than Model Complexity).

The loop also explains why progress is hard to schedule. A project can sit at the same performance for three weeks and then jump because somebody found a labeling inconsistency. If you manage an AI team or collaborate with one, plan for that kind of unevenness. Our blog post Data Scientists are Unmanageable has more on why ordinary project management fits this work badly.

The final test

At some point the team decides the model is done: the performance target is met, or the loop has stopped producing gains, or the deadline has arrived. Only then does the test set come out.

The model, its preprocessing and its decision threshold are frozen first. The analysis plan (which metrics, which subgroups, which comparisons) is written down first. Then the model is run on the test set once, and what comes out is the result, whether or not we like it. If the team goes back and adjusts the model after seeing the test result, the test set has become a second validation set and the number no longer means what the paper will say it means.

Ideally the test includes data from a site that contributed nothing to training (see 2.6 Multi-Site and Multi-Device Data). Section 4 covers the metrics and statistics.

Clinical validation

A good test-set result shows the model can do the task on stored cases. It doesn't show that using the model changes anything for patients or clinicians. That takes studies of a different kind: reader studies comparing clinicians with and without the tool, prospective studies in the real workflow, and occasionally randomized trials. Section 5 covers these, starting with 5.1 Technical Validation vs. Clinical Validation.

Many research projects stop before this stage, and that's a legitimate place to stop as long as the paper is clear about what was and wasn't shown.

Deployment and monitoring

Getting a model into clinical use means integrating it with the imaging and records systems, designing how its output is shown, training the users and, if it meets the definition of a medical device, obtaining regulatory clearance first. Section 8 covers integration and section 6 covers regulation.

Deployment isn't the end either. Scanners get replaced, protocols change, the patient mix shifts, and a model that was accurate at launch can degrade without anyone noticing unless somebody is measuring (see 8.6 Monitoring AI Performance in Production). When monitoring turns up a problem, the project re-enters the loop at data curation.

What to write down as you go

A year after the project starts, somebody will ask which version of the dataset produced the result in Table 2. It might be a reviewer, a regulator or you. The projects that can answer are the ones that kept records from the beginning:

  • The problem statement and the analysis plan, dated.
  • Each version of the dataset: which cases, which labels, which version of the annotation protocol.
  • The split, as a fixed list of patient IDs.
  • Each training run: code version, settings, data version and results. Experiment tracking tools do this automatically (see 3.7 Tools and Infrastructure).
  • Decisions and the reasons for them, including the things that were tried and dropped.

For a research paper this is what makes the methods section possible to write. For a product it is the beginning of the design history file a regulator will ask for (see 6.10 Design History File and Quality Management System Essentials), and it is far easier to keep as you go than to reconstruct afterwards.

Key takeaways

  • An AI project runs from problem formulation through data curation, splitting, training, error analysis, a final test, clinical validation and deployment.
  • Problem formulation is the clinician's job. It should name the input, the population, the output, who acts on it and the reference standard.
  • Data curation takes the most time, and its decisions about inclusion and labels are clinical decisions.
  • Development is a loop. The team trains, reviews errors with a clinician, fixes something (usually in the data) and trains again.
  • The test set is used once, after the model and the analysis plan are frozen.
  • A good test result is technical validation. Showing clinical benefit takes further studies.
  • Deployed models need monitoring, and problems found there send the project back to the data.
  • Keep records of data versions, splits, runs and decisions from the first day.

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