Good Machine Learning Practice (GMLP): The 10 Guiding Principles

The FDA/Health Canada/MHRA consensus principles for AI/ML medical device development. What each principle means in practice and how to build compliance into your development process.


In 2021, the FDA, Health Canada, and the UK's MHRA released a joint guidance document on Good Machine Learning Practice. It's not The Law and there's no jail time for violating it. But it's the closest thing we have to a shared consensus about what "responsible ML in medical devices" looks like, and regulators increasingly expect it.

Read through the 10 principles and most of them feel like good science more than regulation. If you're already running clinical trials right, thinking about data quality and generalization, and documenting your decisions, you're most of the way there.

1. Multi-disciplinary expertise: you need more than data scientists

Your ML model is being built by your data science team. That's necessary but wildly insufficient.

You also need clinical expertise (someone who knows the disease, the current diagnostic or treatment approach, the clinician's workflow), statistical expertise (someone who understands power, bias, confounding, validation), software engineering expertise (someone building production-ready code, not Jupyter notebooks), and regulatory or quality expertise (someone who knows compliance, documentation, traceability).

If you're a startup of three data scientists, or on the flip side an endocrinologist with a great AI idea, this seems impossible. But "expertise" doesn't always mean a full-time employee. It means you have access to someone who can challenge your choices: a cardiologist who looks at your training data and says, "Wait, this doesn't reflect how we actually manage STEMI in our hospital," or a biostatistician who reviews your cross-validation strategy and spots the data leakage issue you missed.

For many academic teams, this is your normal department structure. For startups, it's your advisory board or your regulatory consultant.

You need these people because ML models have invisible failure modes. A data scientist might think a feature is predictive when it's a proxy for data quality issues specific to one hospital system, which a clinician would catch. A statistician might see that your model's performance differs dramatically between subgroups and flag generalization risk. A software engineer might notice you're training and validating on data from the same source, which violates independence assumptions.

Checklist:

  • Do you have a clinician reviewing your training data and intended use for plausibility?
  • Is a statistician reviewing your study design, validation approach, and power calculations?
  • Is your code reviewed for security, logging, and production readiness, not just bugs?
  • Is someone (you, a consultant, an advisory board) making sure you're meeting documentation and traceability standards?

If the answer to any is "no," you have a knowledge gap to fill.

2. Good software engineering and security practices: your model is software

Good software engineering practices aren't that relevant to most research software, but the FDA expects them throughout the model development process. You've built a beautiful ML pipeline in Python. It's modular, it's reproducible, it's validated. Then you try to deploy it, and suddenly you're thinking about Docker containers, dependency management, access logs, encryption, code signing, and a hundred other things that make you miss Jupyter.

Your ML code has to follow software engineering standards as rigorously as any other medical device software. That includes version control (every change tracked and traceable), code review (another engineer looks at your code before it goes to production), automated testing (you run tests every time code changes), logging and monitoring (you know what the model is doing in the field), and security hardening (access controls, data encryption, secure communication).

For the regulatory pathway you're pursuing, the FDA will ask for evidence of this. They'll ask to see your software development plan, your change control process, your testing strategy and your deployment architecture. If your answer is "we have version control in GitHub and we manually test before deploying," you're going to get deficiency letters.

A model with a data quality drift bug silently produces wrong answers in production. A model without access logs can't prove what decision it made for which patient. A model without encryption during data transmission can leak training data. Security and engineering discipline aren't nice-to-haves when people's health is on the line.

Checklist:

  • Is all code in version control with meaningful commit messages and traceability?
  • Is there a code review process before code merges to your main branch?
  • Do you have automated tests that run on every code change?
  • Do you have logging in production that captures inputs, model versions, predictions, and decision points?
  • Is your codebase documented so someone else could maintain it?
  • Is sensitive data encrypted in transit and at rest?
  • Do you have a documented process for updating models and deploying changes?

If you're a startup running on cloud infrastructure, your cloud provider can handle a lot of this (managed logging, encryption, access control). But you need to know what you're relying on.

3. Representative clinical study participants and datasets: generalization doesn't happen by accident

Your model performs beautifully on your training data. Then you deploy it and performance drops 16%. This generalization problem is so common for AI models that it's got a name: the Stanford problem. If your entire training set consists of Stanford medical students who have to participate in a research study, it may not work as well when deployed to a hospital in Minnesota.

The patients in your training dataset must represent the patients in your intended use population. If you're building an AI for retinopathy screening in sub-Saharan Africa, your training data needs people from sub-Saharan Africa (different retinal imaging equipment, different disease prevalence, different patient factors). If you're building for the US, you need adequate representation of the racial and ethnic groups that exist in the US, older patients, younger patients, and patients with comorbidities.

The clinical settings need to be representative too. If you train on fundus images from a tertiary care ophthalmology center and then deploy in a primary care clinic with older imaging equipment, you'll have problems.

ML models are excellent at fitting the specific data they see. If all your ultrasounds come from one Philips machine, the model learns features specific to that machine. If your training population is 80% male and 20% female (and women have different disease presentation), your model will perform worse on women.

This is especially acute in medical AI because disease and patient presentation vary by demographics, geography, and healthcare systems. Generalization is hard.

Checklist:

  • Does your training dataset include the demographic groups (age, sex, race/ethnicity) represented in your intended use population?
  • Do you have data on how model performance varies by subgroup? (You do, because you measured it in validation, right?)
  • Is your training data from imaging systems, labs, or settings similar to where the device will be deployed?
  • If deploying internationally or to new healthcare systems, do you have validation data from those settings?
  • Can you describe your intended use population explicitly? (Not "people with diabetic retinopathy" but "adults with type 2 diabetes, aged 40-80, with or without known retinopathy, in primary care or diabetic clinics in the US, using digital fundus photography.")

The more specific you can be about intended use, and the more your training data matches that description, the better your generalization will be.

4. Training data independence from test sets: don't peek at the answer key

This is basic science, and it's very easy to mess up in ML.

Your training set, validation set, and test set must be truly independent. Different patients is the minimum. The data should also be collected independently, ideally from different time periods, different locations, or different data sources. If you do have to split a single dataset, try to make sure both sets are diverse (explained in point 3 above).

Here's a common mistake an AI newbie might make. You learn enough Python to train a segmentation model. As part of your code, you split the data into training and test sets, do a bunch of training, pay Amazon a bunch of money for the GPUs, and test the model on your test set. It's not great, so you adjust the architecture and fiddle with some hyperparameters, then do it again: split into training/test sets, pay Amazon, and test the model.

You probably spotted it: you're leaking between training runs, because scans that were in your first training set are now in your test set. Given enough training runs, everything will be training data and your AI model will just be memorizing the data.

If you've trained on your test set (even implicitly, by doing hyperparameter tuning on it), you've overfitted to that specific data. Your reported performance is optimistic and deployment performance will be worse. Regulatory review cares about this too. The FDA expects to see three independent datasets: one for training, one for validation (used during development to tune the model), and one for testing (held out, used to generate your primary performance claims).

Checklist:

  • Do you have three explicitly separate datasets (training, validation, test)?
  • Is the test set held completely separate until final evaluation? (No hyperparameter tuning on test data, no peeking.)
  • Is there temporal or geographic or site independence between training and test if possible?
  • Can you describe exactly which patients/records went into training vs. test?
  • Have you used cross-validation or other resampling to estimate performance, and reported both cross-validated performance and held-out test performance?

5. Reference datasets based on best available methods: your gold standard needs to be defensible

Every time your model makes a prediction, there's a ground truth. The tumor is or isn't present. You need a reference standard (also called a gold standard) to compare your model against.

Your reference standard should be the best available method for determining the truth, not the easiest. If you're building an AI for detecting pneumonia, the reference should be radiologist interpretation by experienced clinicians, ideally with multiple readers and adjudication of disagreements. What counts as a gold standard is very domain-specific, and there might not even be consensus within a discipline, so be prepared to justify your choice with literature references.

The reference standard should also be consistent across the entire dataset. If some patients have a reference standard based on clinical assessment and others have one based on imaging, you have a mixing problem.

Your model is only as good as your reference standard. If the reference standard is noisy or biased, your model learns noise and bias. If you train against a weak reference, you'll underestimate what the model could achieve with a strong one. If regulators see you trained against clinical documentation (which is often incomplete or inconsistent), they'll question whether your performance estimates are real.

For regulatory submissions, the FDA will ask how your reference standard was determined, how it was quality-assured, and why it is the best available method. "We used the diagnosis in the EHR" is not an answer that will satisfy them, at least without documentation and evidence of how that EHR record was created.

Checklist:

  • Is your reference standard the best available method for determining ground truth? (Not the easiest, the best.)
  • Is it applied consistently across your entire dataset?
  • If multiple readers are involved, do you have reader qualifications described and documented?
  • Have you assessed inter-reader reliability? (Kappa or ICC for your reference standard itself.)
  • Are there any systematic differences in how the reference standard was determined across subgroups? (Different readers for different sites, different methods for different time periods.)

6. Model design tailored to available data and intended use: fit the model to reality, not vice versa

There's a temptation to use the fanciest model architecture. Transformers are in vogue now: vision transformers for images, BERT-like models for NLP. Your humble correspondent is a Reinforcement Learning fanboy, but that doesn't mean RL is the best architecture for every problem.

Your model architecture should match the size and quality of your dataset and the constraints of your intended use. If you have 500 patient records, you can't use a transformer. You probably need something simpler (logistic regression, random forest, small neural network) that won't overfit to your small dataset. If you're deploying in a resource-constrained setting, you need a model that runs efficiently, not one that requires GPU inference.

Your intended use constrains the choice as well. If your device needs to provide a recommendation in under 100 milliseconds (for real-time clinical use), you can't use a model that takes 30 seconds to run inference. If clinicians need to understand why the model made a recommendation, you need something interpretable, not a black-box deep neural network.

A fancy model overfitted to your training data will generalize worse than a simple model trained thoughtfully. A slow model won't be used in time-critical settings. An opaque model will fail regulatory review in contexts where interpretability is needed.

The art is choosing a model that's complex enough to capture the signal in your data but not so complex that it memorizes noise.

Checklist:

  • Does your model architecture match your dataset size? (More parameters than samples is usually a red flag.)
  • Have you considered simpler models as baselines to compare against?
  • Does your model meet the computational requirements of your intended use? (Response time, hardware available, power consumption.)
  • If interpretability matters (it usually does in clinical settings), have you chosen a model that supports explanation?
  • Have you validated that your model generalizes? (Same performance on held-out test data as on training data, or close enough that you can explain the gap.)

7. Focus on human-AI team performance: you're optimizing for clinician + AI, not AI alone

This principle often gets missed, because it changes what you measure.

Your clinical validation study shouldn't measure just the AI's performance. It should measure what happens when a clinician uses the AI versus when they don't. Does the AI reduce error rate? Does it reduce time to diagnosis? Does it improve diagnostic agreement among clinicians? Does it increase appropriate referrals and decrease unnecessary workups?

If your AI is a diagnostic assistant, you measure accuracy when a clinician reviews the AI's recommendation versus accuracy with standard practice. If your AI is a risk classifier, you measure whether clinician decision-making improves when given the AI's risk score.

A model that's 95% accurate in a vacuum might not improve clinical care if clinicians ignore it, over-rely on it, or get confused by it. Conversely, a model that's 87% accurate might dramatically improve clinical care if clinicians know when to trust it and when to override it.

This is also what regulators care about. The FDA doesn't certify algorithms in a vacuum. They certify devices for use in clinical contexts, so your evidence should reflect that.

Checklist:

  • Does your clinical validation study include clinician users, not just a retrospective comparison?
  • Are you measuring clinician performance with the AI (e.g., diagnostic accuracy when viewing the AI recommendation alongside clinical data) versus without?
  • Have you assessed whether clinicians understand the AI's output and when to trust it?
  • Are there scenarios where clinicians should override the AI, and have you identified them?
  • Are you measuring something that matters clinically (time to diagnosis, diagnostic accuracy, appropriate referrals, patient outcomes), not just algorithmic accuracy?

8. Clinically meaningful performance testing: measure what matters

You report sensitivity, specificity, area under the ROC curve. Those are fine for academic papers. For clinical validation, you also need to report metrics that clinicians understand and care about. For a diagnostic system, those are positive predictive value (what fraction of positive results are actually positive in your test population), negative predictive value (what fraction of negative results are truly negative), and likelihood ratios (how much the test changes the probability of disease). For a screening system, they are the referral rate, the disease detection rate, and the false positive rate that triggers unnecessary workups.

Report performance by clinically relevant subgroups as well as overall. If your AI is for diabetic retinopathy screening and performance is 95% overall but 85% in Black patients, that's a problem you need to address, not hide.

Use confidence intervals, not just point estimates. "Sensitivity 94%" is less informative than "Sensitivity 94% (95% CI 91-97%)."

Sensitivity and specificity are important, but they don't tell a clinician what to do. A radiologist wants to know: if this AI flags this lung nodule as suspicious, what's the probability it's actually cancer in my population? That's the positive predictive value. A cardiologist wants to know how many false alarms this AI will generate (what's the false positive rate in my population).

Different clinical contexts care about different metrics. A screening test needs high sensitivity (you can't miss cases). A confirmatory test can tolerate lower sensitivity if the specificity is very high (you need to be sure before acting).

Checklist:

  • Are you reporting sensitivity, specificity, but also PPV/NPV or likelihood ratios?
  • Are performance metrics reported separately for demographic subgroups?
  • Do you include confidence intervals?
  • Are performance metrics reported in the population where the device will be used? (Not just your development population.)
  • Have you chosen a threshold for positivity that makes clinical sense, not just maximizes accuracy on your test set?
  • Have you measured failure modes? (How often does the AI fail to detect cases it should detect, and in what scenarios?)

9. Clear essential information for users: tell clinicians what they need to know

You've built the AI. You've validated it. Now clinicians need to use it. What do they need to know?

Your user documentation should cover:

  • The intended use: what clinical problem this AI solves, who it is for, and in what settings it should be used.
  • The intended user: who is trained to use this. Radiologists, cardiologists, nurses, general clinicians?
  • Limitations: the scenarios where this AI might not work well, any patient populations where performance is lower, and any imaging quality requirements or other prerequisites.
  • How to interpret results: what a positive result means, what a negative result means, what the positive predictive value is in the clinician's population, and whether results should always be reviewed by a physician.
  • When to seek additional evaluation: what the clinician should do if the AI is uncertain or contradicts clinical suspicion.
  • Training requirements: what clinicians need to know before using this.
  • Maintenance and monitoring: how often the model is updated, and how clinicians know if performance is degrading.

This isn't marketing material. It's the user manual, and the FDA will review it carefully.

An AI that generates wrong answers is bad. An AI that generates wrong answers that clinicians trust without verification is dangerous. Clear documentation helps clinicians use the AI appropriately and know when to be skeptical.

Checklist:

  • Do you have a clear description of intended use and intended users?
  • Do you explicitly state limitations? (Populations with lower performance, required image quality, contraindications.)
  • Do you explain how to interpret results in a way clinicians understand?
  • Do you discuss scenarios where overriding the AI is appropriate?
  • Is the documentation reviewed and approved by clinician reviewers?
  • Do you have training materials or guidance for clinical users?

10. Deployed models monitored for performance: you ship it, now watch it

Your AI is approved and deployed. That's the beginning, not the end.

You need a system for monitoring how the AI performs in real clinical use. Are sensitivity and specificity holding up? Are you seeing patterns in where the AI fails? Is there population drift (the patients or imaging systems in the deployed setting are different from your validation data)? Is there data drift (the imaging quality, patient factors, or disease prevalence has changed)?

Track these continuously: accuracy on new cases (if you can get labels), false positive rate, false negative rate, performance by subgroup, processing time, and any errors or exceptions the system logs. If performance degrades below acceptable thresholds, you have a process to investigate, revalidate, and retrain if needed.

Real-world data is messier than your validation data. Disease prevalence is different. Imaging equipment deteriorates or gets upgraded. Patient populations shift. Your model, trained on 2022 data, might not work as well in 2025 data. Without monitoring, you won't know.

Regulators increasingly expect this too. The FDA's proposed framework for modifications to AI/ML medical devices hinges on real-world performance monitoring. If you can demonstrate that your model is performing as expected in the field, you can make certain updates without re-running full validation. If you can't, you're stuck.

Checklist:

  • Do you have a system to log inputs, predictions, and confidence scores for every use?
  • Are you tracking performance metrics on new data as it comes in?
  • Do you have a threshold for acceptable performance, and a process to investigate if you fall below it?
  • Can you segment performance by patient group, imaging type, or deployment site to spot problems?
  • Do you have a plan to retrain or adjust the model if performance degrades?
  • Is monitoring documented and auditable?

How the principles fit together

The principles depend on each other.

Multi-disciplinary expertise comes first, because those are the people who ask what problem you're solving and what clinical success looks like. The answer shapes your data collection and your validation approach. You build with software engineering rigor because the model is going to be used in clinical care, and it has to be maintainable and trustworthy. You assemble representative data because the model has to work in the real world, not just your development setting.

You keep training and test sets independent because you want honest estimates of how well the model generalizes. You use good reference standards because your model is only as good as what you train it against. You choose a model architecture that fits your data and use case, not one that impresses people at conferences.

You validate human-AI team performance because the question is whether clinicians make better decisions with your AI, and you measure clinically meaningful metrics because those are what let clinicians use your device. You document clearly for users because a model that no one understands or trusts won't help anyone. And you monitor performance in the field because that's where the real test happens.

If you're doing clinical research with AI, you're probably already thinking about most of these. The GMLP principles aren't revelatory. They're a checklist of what responsible ML development looks like and what regulators expect to see. Reading through them should feel less like "oh no, how do we do all this" and more like "yes, we're already doing that."

Key takeaways

  • Multi-disciplinary expertise (clinical, statistical, software, regulatory) catches blind spots that pure data science misses.
  • Software engineering rigor (version control, testing, logging, security) isn't optional for medical devices.
  • Representative data (diverse populations, realistic settings) is the foundation of generalization.
  • Independent train-test splits (temporally, geographically, or by site) prevent overfitting and give honest performance estimates.
  • Strong reference standards (best available methods, consistently applied) mean your model learns from high-quality ground truth.
  • Model design matched to your data and use case beats fancy architectures that overfit.
  • Human-AI team performance (what clinicians achieve with the AI) is what counts clinically.
  • Clinically meaningful metrics (PPV, NPV, subgroup performance) let clinicians understand how to use the AI.
  • Clear user documentation (intended use, limitations, interpretation) prevents misuse.
  • Performance monitoring in the field (tracking real-world accuracy, performance degradation) catches drift early.

This article is part of the AI in Clinical Research Knowledge Base. The 10 GMLP principles are outlined in the FDA/Health Canada/MHRA joint guidance on machine learning in medical devices.