Blog Post

High-Dimensional Data and Machine Learning for SaMD (Software as a Medical Device)

High-Dimensional Data and Machine Learning for SaMD (Software as a Medical Device)

Series: Advanced Biostatistics for MedTech: Bridging Clinical Evaluation and Engineering

The Regulatory Shift Toward Algorithmic Validation

The integration of machine learning (ML) into Software as a Medical Device (SaMD), has fundamentally altered the regulatory landscape. The industry’s transition from the use of traditional statistical modeling (SM) to machine learning (ML) within device technology, has necessitated a paradigm shift in how predictive algorithms are validated. Under the EU Medical Device Regulation (MDR 2017/745) and the FDA’s evolving framework for AI/ML-based SaMD, the regulatory expectation of safety, efficacy, and generalisability remains unchanged.

Harrell (2018) distinguishes between SM and ML not by dataset size or dimensionality (both approaches can operate in high-dimensional settings) but by the following three considerations:

  • Uncertainty (whether a probability model for the data is specified),
  • Structure (whether additivity of predictor effects is assumed), and
  • Empirical emphasis (whether high-order interactions are pre-specified or discovered algorithmically).

One constraint he identifies is information content rather than dimensionality. Where additive effects dominate, SM typically requires on the order of twenty events per candidate predictor, whereas ML may require in the region of two hundred. Simulation evidence found that logistic regression reached a stable AUC at approximately 20-50 events per variable. In contrast, random forest, support vector machine and neural network models still exhibited instability and optimism bias beyond 200 events per variable (van der Ploeg et al., 2014).

This distinction is critical for medtech. ML achieves its strongest results in domains with high signal-to-noise ratios and knowable ground truths, such as image recognition. Clinical outcome prediction involves a large irreducible component of variation. The proliferation of continuous monitoring devices (e.g., continuous glucose monitors, wearable ECGs) is routinely offered as evidence that the data-volume problem has been solved. High-frequency sampling, however, inflates the number of data rows without proportionately increasing the effective sample size. For example, a fourteen-day CGM trace yields roughly twenty thousand readings from a single patient; a single-lead ambulatory ECG patch sampling at 200Hz yields upwards of two hundred million over the same period. If the endpoint is a clinical event the effective sample size is the number of patients and events, not rows. The defensible application of ML in SaMD therefore relies on the genuine presence of strong, non-pre-specifiable interactions (such as those in waveform morphology or image-derived features) rather than data volume alone.

Collinearity and Regularisation: Beyond PLS and Ridge

Under the taxonomy just described, penalised regression (such as ridge, LASSO, and the Elastic Net) falls on the statistical modelling side of the divide. The usual LASSO assumes that every predictor acts linearly and that the model is fully additive. It is a regularised regression, not an algorithmic learner. The methods in this section are best understood as high-dimensional statistical modelling, with the tree-based ensembles discussed later constituting the ML component proper. The distinction determines which sample-size heuristics apply, which structural assumptions must be verified and what a reviewer is entitled to ask about functional form.

In high-dimensional medtech data, multicollinearity is the norm. Standard Ordinary Least Squares (OLS) regression fails when the number of regressors p approaches or exceeds the sample size n, as the matrix X^TX becomes singular or ill-conditioned.

Pardo (2023) discusses classical remedies to this, including Partial Least Squares (PLS) and Ridge Regression. Ridge regression adds an L_2 penalty to the loss function:

\min_{\beta} \left\{ \sum_{i=1}^{n} (y_i - x_i^T \beta)^2 + \lambda \sum_{j=1}^{p} \beta_j^2 \right\}

While Ridge regression shrinks coefficients toward zero, it does not perform feature selection. All p regressors remain in the model. In high-dimensional SaMD applications clinical interpretability and regulatory traceability are paramount. Retaining hundreds of non-informative features is, therefore, undesirable.

The Least Absolute Shrinkage and Selection Operator (LASSO) regression addresses this by imposing an L_1 penalty:

\min_{\beta} \left\{ \sum_{i=1}^{n} (y_i - x_i^T \beta)^2 + \lambda \sum_{j=1}^{p} |\beta_j| \right\}

The L_1 penalty forces some coefficients to exactly zero, which performs implicit feature selection. The LASSO estimate corresponds to the posterior mode under independent double-exponential (Laplace) priors on the coefficients.

For SaMD the algorithm must be traceable and defensible. LASSO regression offers a mathematically defensible method for isolating a sparse set of features that are sufficient for prediction, however, this selection should not be overstated. LASSO is model-selection consistent only under restrictive conditions on the design matrix (Zhao & Yu, 2006). The selected set can be markedly unstable across bootstrap resamples when predictors are correlated. It does not inherently identify the physiologically or causally critical features of the data. Where a stable and reportable feature set is required, selection stability should be quantified. This can be achieved by refitting the model across resamples and reporting the selection frequencies, or through the stability selection framework (Meinshausen & Bühlmann, 2010).

The Elastic Net regularisation regression combines L_1 and L_2 penalties. It is often preferable when features are highly correlated (e.g., adjacent time-points in a physiological waveform) as it selects groups of correlated variables, where LASSO regression might arbitrarily pick one. Both these choices have trade-offs. The objection to Ridge regression (that every regressor survives) applies in weakened form to the Elastic Net. Sparsity and stability are in tension. The appropriate operating point is a risk-based judgement of how much model transparency the intended use, risk classification, and clinical decision context actually demands.

Evaluating Predictive Performance: Leakage, Metrics, and Validation

Data leakage is among the more consequential and least visible defects in SaMD model development. It occurs when information from the validation or test data inadvertently influences the model training process. Generally, it produces performance estimates that are optimistic and fail to survive contact with the intended use population. The FDA’s December 2024 final guidance is pointed on this matter, setting out expectations for the purpose, timing, characteristics, and independence of test data.

Standard k-fold cross-validation partitions the data into k subsets, training on k-1 and testing on the held-out fold. In SaMD development data preprocessing (e.g., feature scaling, imputation, and even the LASSO penalty parameter \lambda) is frequently performed on the entire dataset before cross-validation. This violates the principle that the model must be completely blind to the test data. To prevent this preprocessing leakage, all preprocessing and hyperparameter tuning must be nested within the cross-validation loop. In R, this is enforced using the caret or tidymodels frameworks, where preprocessing recipes are estimated solely on the training folds and then applied to the validation fold.

Preprocessing leakage is not, however, the form of leakage most likely to invalidate a continuous-monitoring device submission. Two structural varieties matter more. The first is subject-level leakage. Continuous monitoring generates many observations per patient. Where those observations are allocated to folds at random, records from the same individual appear in both training and validation. Here the model is rewarded for recognising the patient rather than the pathology. The consequences of this are not marginal. Saeb et al. (2017) demonstrated that record-wise cross-validation of mobile-sensor models yields accuracies substantially above the subject-wise estimates obtained from the identical data, and it is the subject-wise estimate that approximates the intended use. Partitioning must therefore occur at the level of the independent unit: grouped k-fold, or leave-one-subject-out where the patient count permits. In R, this is implemented via group_vfold_cv() in rsample or groupKFold() in caret.

The second most likely form of leakage is temporal leakage. Where the deployed model will predict forward in time, random partitioning of a series permits the algorithm to interpolate between observations it has effectively already seen.To effectively prevent this problem, blocked or rolling-origin designs preserve temporal ordering and produce an estimate corresponding to the deployed task (Roberts et al, 2017).

The choice of performance metric is highly scrutinised. R^2 has no natural definition for a binary outcome in the sense familiar from OLS; pseudo-R^2 variants exist but do not address discrimination directly. For binary SaMD outputs, the Area Under the Receiver Operating Characteristic Curve (AUC-ROC) is standard. It is often said that AUC-ROC is misleading under severe class imbalance, and the claim requires care. AUC-ROC is computed from the true-positive and false-positive rates, both conditioned on the true class, and is therefore invariant to prevalence. The genuine difficulty is that a respectable AUC-ROC is entirely compatible with poor positive predictive value when the event is rare. This is because a small false-positive rate applied to a large population of negatives generates a great many false alarms. The Area Under the Precision-Recall Curve (AUC-PR) reflects this directly and is the more informative summary of the deployed decision (Saito & Rehmsmeier, 2015). Though, like the Brier score, AUC-PR depends on prevalence and is not comparable across populations with differing event rates. Where the clinical consequence of a false positive differs materially from that of a false negative, net benefit and decision curve analysis address the question more directly (Vickers & Elkin, 2006).

The Brier score, a strictly proper scoring rule, summarises the overall accuracy of predicted probabilities. Under the Murphy decomposition, it partitions into a reliability (calibration) term, a resolution (discrimination) term entering with a negative sign, and an irreducible uncertainty term determined by the base rate. Because it is a summary measure, a low Brier score does not guarantee good calibration: a model can attain a respectable score through strong discrimination while remaining poorly calibrated. Calibration should therefore be verified directly, using a calibration plot together with the calibration slope and intercept.

While nested cross-validation provides a solid estimate of internal model performance, it is not a substitute for external clinical validation. Regulators expect final out-of-sample (OOS) performance derived from test data held strictly independent of both training and tuning, and drawn so as to represent the intended use population. Temporal separation is one means of achieving this; geographical, site-level, and device-level separation address the generalisability question at least as directly. Performance should in addition be reported across clinically relevant subgroups rather than in aggregate alone, since an acceptable pooled estimate can conceal materially degraded performance in a subpopulation the device is indicated to serve. Finally, the reporting itself is now standardised: TRIPOD+AI (Collins et al., 2024) sets out what a prediction model study should disclose, and aligning the Statistical Analysis Plan (SAP) and clinical evaluation report to this checklist materially reduces the volume of reviewer questions.

Classification and Regression Trees (CART) and Random Forests

For the complex, non-linear interactions common in physiological data, tree-based methods offer powerful alternatives. Classification and Regression Trees (CART) partition the feature space into rectangular regions then make predictions based on the mean or mode of the observations within each terminal node. A single CART model is highly interpretable. The tree structure explicitly shows the decision rules, which is a significant advantage for regulatory submissions. Single trees, do however, suffer from high variance whereby small changes in the training data can drastically alter the tree structure.

Random Forests mitigate this variance by aggregating (bagging) many trees. A Random Forest algorithm constructs B trees on bootstrapped samples, then considers a random subset of features at each split to decorrelate the trees. For classification, it predicts by majority vote. A critical output of Random Forests for SaMD validation is the Variable Importance Measure (VIM). In R’s randomForest package, the impurity-based importance for a classification model is reported as MeanDecreaseGini. This represents the total decrease in Gini impurity attributable to splits on a given variable, aggregated over all splits and averaged across the B trees. The analogous quantity for a regression forest is IncNodePurity, which is computed from the reduction in residual sum of squares.

This impurity-based measure must be interpreted with care. It is biased toward continuous predictors and predictors with many categories (Strobl et al., 2007). Additionally, it becomes unreliable when predictors are strongly correlated. Under such correlation, importance may be diluted across a group of near-equivalent features. For regulatory feature attribution, permutation importance (MeanDecreaseAccuracy) is often preferable. This is the drop in out-of-bag accuracy when a variable’s values are randomly permuted. Two practical caveats should be noted here. First, conditional permutation importance is not implemented in randomForest; it requires fitting a conditional inference forest (via the party or permimp packages). Second, unrestricted permutation evaluates the model at feature combinations that never occur in the data, so the resulting importances are in part artefacts of extrapolation (Hooker et al., 2021). The defensible position is not that one measure is correct, but that the measure selected, its known biases, and the correlation structure of the predictors all must be stated in the regulatory submission.

Providing these measures yields a defensible, non-parametric account of which physiological features are driving predictions on average. It is worth stating plainly what this does and does not deliver. Global variable importance is a population-level summary. It does not explain any individual prediction, and it is not equivalent to the algorithmic traceability that design controls and technical documentation are required to establish. Where the intended use requires a clinician to interrogate a particular output, per-prediction attribution is a separate undertaking, and in that setting the simpler, more auditable model may remain the better regulatory choice.

From the ‘Locked Algorithm’ to the Predetermined Change Control Plan

Historically, ML-based SaMD was authorised as a “locked algorithm”: the model parameters were fixed at market authorisation, and any material subsequent changes triggered a fresh regulatory submission. This remains a valid path but is no longer the only one. The FDA’s 2024 guidance on Predetermined Change Control Plans (PCCPs) for AI-enabled device software functions allows a manufacturer to pre-authorise a defined envelope of future modifications. A PCCP comprises three elements: a Description of Modifications, a Modification Protocol, and an Impact Assessment. In October 2023, the FDA, Health Canada, and the MHRA jointly issued five guiding principles for such plans: that they be focused, risk-based, evidence-based, transparent, and lifecycle-oriented.

In October 2023, the FDA, Health Canada, and the MHRA jointly issued five guiding principles for predetermined change control plans (PCCPs), holding that such plans should be 1. focused and bounded, 2. risk-based, 3. evidence-based, 4. transparent, and 5. oriented to the total product lifecycle. The FDA gave this approach concrete form in its 2024 final guidance on PCCPs for AI-enabled device software functions, which allows a manufacturer to pre-authorise a defined envelope of future modifications. A PCCP comprises three elements: a Description of Modifications, a Modification Protocol, and an Impact Assessment.

The alternative option is a predetermined change control plan (PCCP), under which a defined envelope of future algorithm modifications is pre-defined at the time of the original regulatory submission. In October 2023, the FDA, Health Canada, and the MHRA jointly issued five guiding principles for such plans: that they be 1. focused and bounded, 2. risk-based, 3.evidence-based, 4.transparent, and 5. oriented to the total product lifecycle. The FDA’s 2024 guidance on PCCPs for AI-enabled device software functions then set the requirement for a PCCP to comprise of the following three elements: 1.a Description of Modifications, 2. a Modification Protocol, and 3. an Impact Assessment.

The PCCP guidance does not stand alone. The FDA’s draft guidance of January 2025, Artificial Intelligence-Enabled Device Software Functions: Lifecycle Management and Marketing Submission Recommendations, addresses the total product lifecycle and speaks directly to matters within the biostatistician’s remit.These include data provenance, the independence of test data, performance evaluation, and subgroup reporting. If the device algorithm is governed by a PCCP, the SAP must define the performance boundaries of the deployed model and the criteria under which model retraining is permitted. Real-world device performance should then be monitored against those boundaries using control charts, such as a CUSUM on the prediction-error rate (Pardo, 2023). For certain devices the adjudicated outcomes must necessarily arrive too late to support that, or they are not available at a sufficient scale. In these cases, the PCCP must instead specify drift in the input and predicted-probability distributions as surrogates, together with the mechanism by which “ground truth” will periodically be recovered. Where actual drift falls outside the pre-authorised envelope, a Corrective and Preventive Action (CAPA) and a new regulatory submission are required.

The EU MDR has no direct equivalent to PCCPs. The European analogue sits in the AI Act (Regulation (EU) 2024/1689). SaMD subject to third-party conformity assessment is high-risk under Article 6(1). Article 43(4) provides that, for high-risk systems that continue to learn after being placed on the market, changes pre-determined by the provider at the initial conformity assessment and documented in the technical file do not constitute a substantial modification. The resemblance to a PCCP is structural: a bounded, pre-specified, documented envelope of change. MDCG 2025-6 carries this across into device change control, taking the view that pre-determined changes falling within Article 43(4) should not be understood as a change to the certified device under MDR Annex IX Section 4.10. The guidance is non-binding, and notified bodies have so far applied it conservatively. The AI Act requirements are intended to be folded into the conformity assessment already conducted under MDR.

The Digital Omnibus on AI, adopted as Regulation (EU) 2026/1744 and in force from 27 July 2026, defers the high-risk obligations for AI embedded in products regulated under Annex I (the route most SaMD follows) from 2 August 2027 to 2 August 2028. This deferral relieves timeline pressure without altering the substance of the data governance, logging, and post-market monitoring obligations required.

Conclusion

The integration of machine learning into medical devices demands a higher level of vigilance. Regularisation, disciplined resampling, and global feature attribution are each necessary contributions to that vigilance. There is a regulatory obligation to ensure that predictive accuracy is established by validation in a population that resembles the one the device will meet and traceability is established by design controls and technical documentation, of which the statistical work forms a part. The biostatistician’s contribution is to ensure that the performance claim is honest, that the conditions under which it holds are stated, and that the mechanism by which it will be monitored over the device’s lifecycle is specified in advance.

References

  • Breiman, L., Friedman, J. H., Olshen, R. A., & Stone, C. J. (1984). Classification and Regression Trees. Wadsworth.
  • Collins, G. S., et al. (2024). TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods. BMJ, 385, e078378.
  • Harrell, F. E. (2018). Road map for choosing between statistical modeling and machine learning. Statistical Thinking. https://www.fharrell.com/post/stat-ml/
  • Hooker, G., Mentch, L., & Zhou, S. (2021). Unrestricted permutation forces extrapolation: variable importance requires at least one more model. Statistics and Computing, 31, 82.
  • Meinshausen, N., & Bühlmann, P. (2010). Stability selection. Journal of the Royal Statistical Society: Series B, 72(4), 417–473.
  • Pardo, S. A. (2023). Statistical Methods and Analyses for Medical Devices. Springer.
  • Regulation (EU) 2024/1689 (Artificial Intelligence Act).
  • Roberts, D. R., et al. (2017). Cross-validation strategies for data with temporal, spatial, hierarchical, or phylogenetic structure. Ecography, 40, 913–929.
  • Saeb, S., Lonini, L., Jayaraman, A., Mohr, D. C., & Kording, K. P. (2017). The need to approximate the use-case in clinical machine learning. GigaScience, 6(5), 1–9.
  • Saito, T., & Rehmsmeier, M. (2015). The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets. PLoS ONE, 10(3), e0118432.
  • Strobl, C., Boulesteix, A.-L., Zeileis, A., & Hothorn, T. (2007). Bias in random forest variable importance measures. BMC Bioinformatics, 8, 25.
  • US Food and Drug Administration. (2024). Marketing Submission Recommendations for a Predetermined Change Control Plan for Artificial Intelligence-Enabled Device Software Functions.
  • US Food and Drug Administration. (2025). Artificial Intelligence-Enabled Device Software Functions: Lifecycle Management and Marketing Submission Recommendations. Draft Guidance.
  • van der Ploeg, T., Austin, P. C., & Steyerberg, E. W. (2014). Modern modelling techniques are data hungry. BMC Medical Research Methodology, 14, 137.
  • Vickers, A. J., & Elkin, E. B. (2006). Decision curve analysis: a novel method for evaluating prediction models. Medical Decision Making, 26(6), 565–574.
  • Zhao, P., & Yu, B. (2006). On model selection consistency of Lasso. Journal of Machine Learning Research, 7, 2541–2563.
  • US FDA, Health Canada, & MHRA. (2023). Predetermined Change Control Plans for Machine Learning-Enabled Medical Devices: Guiding Principles.

Related Posts