Working with an Engineering Team: The Clinician's Role

How to be an effective collaborator when you are the domain expert, not the developer. Defining clinical requirements, reviewing results critically, and avoiding the "throw it over the wall" failure mode.


Most clinical researchers who start an AI project won't write the code. They'll work with a machine learning engineer, a data scientist, a computer science lab down the road or a postdoc who knows PyTorch. That's a sensible division of labor. It goes wrong in a predictable way, though, when the clinician treats it as a handover: here is a folder of scans and a spreadsheet of labels, come back when you have a model.

The engineers will come back with a model. It will have a good-looking number attached. And there's a fair chance it will have learned something other than what you meant, because the things that needed your knowledge were decided without you. This article is about where a clinician's input is needed and how to give it without learning to program.

Why the handover fails

An engineer looking at your dataset sees arrays of numbers and a column of labels. They can't see what you see. They don't know that the portable films are all from intensive care, that a "normal" report on a post-operative patient means something different, that one of the scanners was replaced halfway through the collection period, or that the diagnosis code you used for labels is applied loosely by one department. None of that is in the files.

The model, meanwhile, will use any of those things if they help it predict the label (see 1.6 What AI Cannot Do). The engineer optimizes the metric they were given, on the data they were given, and reports success in good faith.

The reverse failure exists too. Clinicians sometimes ask for things that the data can't support, or accept a result because the AUC is high without knowing what was done to get it. Each side knows things the other needs, and the project works when that knowledge gets exchanged early and often.

What only you can supply

The problem definition

The engineers need a task, stated precisely enough to build. 3.1 The AI Development Lifecycle lists what a problem formulation should contain: the input, the population, the output, who acts on it and the reference standard. It's worth writing this as a page of text and going through it together, because the engineers' questions about it will show you where it was vague.

What counts as good enough

"As accurate as possible" isn't a specification. The engineers need to know which errors are costly. Is a missed case much worse than a false alarm, or the other way round? What sensitivity would make the tool useful, and at what false-positive rate would clinicians stop paying attention to it? What does the current process achieve? These answers decide which metric the engineers tune for and where the decision threshold goes (see 4.1 Classification Metrics). If you don't supply them, the defaults will be used, and the defaults are accuracy and a threshold of 0.5, which are rarely what a clinical task needs.

Knowledge of how the data came to exist

Tell the engineers how patients ended up in the dataset, how the labels were made and by whom, what changed over the collection period, and which variables might be standing in for the outcome. Much of 2.1 Why Data Quality Matters More Than Model Complexity is a list of things to tell them.

The annotation protocol

What exactly is being labeled, where the boundaries go and what to do with ambiguous cases are clinical decisions (see 2.3 Data Annotation and Labeling for Clinical AI).

Which subgroups to report

The engineers can break results down by any variable in the data. They need you to say which breakdowns are clinically meaningful: disease subtypes, severity, patient groups, acquisition settings, the kinds of case where a miss is most serious.

Judgment about plausibility

When a result comes back, you are the one who can say whether it makes sense. If the model reads a finding better than a panel of specialists does, or predicts an outcome from an image that has no known reason to contain that information, that deserves suspicion before celebration.

Reviewing results

The most useful habit we know of is a regular session, perhaps an hour every week or two, in which you and the engineers look at cases together. Summary metrics don't replace it.

Ask the engineers to bring a few things each time:

  • The cases the model got most confidently wrong, both false positives and false negatives.
  • A random sample of the cases it got right.
  • Some cases where it was least certain.
  • Heat maps or other displays of what the model was responding to, if they have them, with the caveats about those in 7.4 Explainability and Interpretability in Clinical AI.

Then look at the images, as images. As described in 3.1, the errors usually sort into wrong labels, ambiguous cases, image problems, shortcuts and real model weaknesses, and each kind points to a different fix. The sample of correct answers is there for a reason too: a model can be right for a bad reason, and you'll sometimes spot that all the correctly flagged cases share a feature that has nothing to do with the disease.

These sessions also teach each side the other's subject faster than any amount of reading. After a few of them, the engineers start noticing lines and tubes without being told, and you start asking about the split without being prompted.

Two vocabularies

A good deal of friction in these collaborations is plain vocabulary. The two fields use different words for the same thing and, worse, the same word for different things.

Engineers say Clinicians say Note
Recall Sensitivity Identical
Precision Positive predictive value Identical
Validation set (no equivalent) Data used for tuning during development. It is not independent confirmation
Test set Validation cohort The held-out data for the final estimate
Ground truth Reference standard Engineers' term suggests more certainty than there usually is
Inference Running the model on a case Nothing to do with statistical inference
Significant (often) noticeably better May not mean a statistical test was done
Features Variables, predictors In deep learning, also the model's internal representations

"Validation" causes the most trouble. A clinician who hears "validation accuracy is 94%" may take it as an independently confirmed result. It's a number from the tuning set, and it's optimistic (see 3.2 Training, Validation, and Test Sets). It's worth agreeing early on which words the group will use, and the glossary may help.

Different habits of work

The two cultures also differ in how research is done, and it helps to know this in advance.

Machine learning research is fast and exploratory. Engineers try something, look at the result and try something else, many times a day. Clinical research is planned in advance and pre-specified, because every look at the data costs statistical credibility. Both habits are right for their own setting. An AI project needs the first during development and the second for the final evaluation, and the handoff between the two modes is the test set. It helps to say this out loud: explore as freely as you like on training and validation data, and treat the test set with the discipline of a trial endpoint.

Progress is also uneven. A model may not improve for weeks and then jump after a data fix. This is normal for the work and isn't a sign that the team is stuck. Our blog post Data Scientists are Unmanageable goes into why AI projects resist ordinary scheduling.

Engineers, for their part, are sometimes surprised by how slowly clinical data moves. Ethics approvals, data sharing agreements and annotation by busy specialists take months. Telling them the realistic timeline at the start saves a lot of mutual frustration, and gives them a chance to build the pipeline on public data while they wait.

Things to agree at the start

A short conversation before any work begins prevents most of the later disputes.

  • The primary question and the primary metric.
  • Who holds the test set and when it will be opened.
  • How often you'll meet to review cases.
  • Where data is stored and who may access it, in line with the ethics approval (see 2.7 De-Identification, Privacy, and Regulatory Compliance for Research Data).
  • Authorship. Computer science and medicine have different conventions about author order and about publishing in conferences versus journals, and it's much easier to settle before there is a result.
  • What happens to the code, the model and any intellectual property, especially if commercialization is possible.
  • What gets recorded. Both of you will need the data versions, splits and experiment logs (see 3.7 Tools and Infrastructure).

Questions that are always fair to ask

You don't have to follow the mathematics to hold up your end. These questions can be asked by anyone, and a good engineering team will be glad you asked.

  • How was the data split, and was it by patient?
  • What does the simplest baseline score?
  • Can I see the worst errors?
  • How does it do on each subgroup, site and scanner?
  • What happens if we hide the part of the image where the finding is? Does the model still get it right?
  • How many configurations did we try, and has anything been tuned on the test set?
  • If we ran the whole thing again, how much would the number change?

If the answer to any of these is "we haven't checked," that's a to-do item and no cause for alarm. If the answer is that it can't be checked, that's worth a longer conversation.

What you don't need to do

You don't need to learn to code, choose the architecture or follow the details of the optimizer. Clinicians who pick up some Python find it useful, mostly for looking at data, but it isn't required. And second-guessing the engineers' choice of network is about as productive as their second-guessing your choice of contrast agent.

What you can't delegate is knowing what the model is for, how its data came to be, whether its labels are right and whether its results make sense. A clinician who stays involved in those four things for the length of the project is doing the part of the work that most often decides whether the model is any use.

Key takeaways

  • Handing over data and waiting for a model fails because the engineers can't see the clinical context that the files leave out.
  • The clinician supplies the problem definition, the error tradeoffs, the history of the data, the annotation protocol, the subgroups worth reporting and a judgment of plausibility.
  • Regular joint review of individual cases, wrong and right, is the most useful routine a project can have.
  • The two fields use different words. "Validation set" in particular means a tuning set to an engineer.
  • Development can be exploratory. The final evaluation should be pre-specified and run once.
  • Agree on the metric, the test set, data access, authorship and intellectual property before work starts.
  • A handful of plain questions about the split, the baseline, the errors and the subgroups will find most problems.

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