Back

Development and Evaluation of Machine Learning Models to Predict Mechanical Restraint and Related Coercive Measures in Hospital Psychiatry

Kolding, S.; Damgaard, J. G.; Bernstorff, M.; Hansen, L.; Ostergaard, S. D.; Danielsen, A. A.

2025-12-16 psychiatry and clinical psychology
10.64898/2025.12.15.25342272 medRxiv
Show abstract

IntroductionUse of coercive measures in psychiatric hospitals is clinically and ethically challenging. Aiming to support prevention, we developed and evaluated machine learning models to predict both mechanical restraint and a broader composite outcome that includes related coercive measures. MethodsThe dataset comprised electronic health records (EHR) from adults ([≥]18 years) who had at least one admission to the Psychiatric Services in the Central Denmark Region between 2015 and 2021. For each inpatient day, XGBoost machine learning models were trained to predict mechanical restraint or composite (mechanical, chemical, or manual) restraint within 48 hours. Hyperparameters were optimised for the area under the receiver operating characteristic curve (AUROC) using five-fold cross validation on 85% of the data, with performance validated on a held-out 15% test set. ResultsThe cohort included 16,834 patients with 45,179 inpatient stays, covering 687,388 prediction days. Of these, 2,736 days were followed by a restraint episode within 48 hours, including 983 episodes of mechanical restraint. The final models were trained on 2,389 EHR-based predictors, derived from demographics, diagnoses, medications, and clinical notes. The mechanical restraint model achieved an AUROC of 0.921 (95% CI: [0.918-0.922]) and a positive predictive value (PPV) of 4.9% when classifying the top 1% of risk scores as positive. The composite model achieved an AUROC of 0.912 (95% CI: [0.909-0.913]) and a PPV of 4.2% when predicting mechanical restraint, and 0.900 (95% CI: [0.898-0.900]) with a PPV of 10.4% when predicting composite restraint. ConclusionThe results indicate that incorporating related coercive measures into model training did not improve discrimination (AUROC) for predicting mechanical restraint but did increase PPV when predicting composite restraint, reflecting the higher outcome prevalence. This suggests that leveraging related outcomes can inform prediction of rare events, emphasising the importance of problem framing in clinical prediction modelling. Future work should include external validation across temporal, geographic, and demographic contexts. Significant Outcomes- A machine learning model trained solely for predicting mechanical restraint achieved strong performance (AUROC 0.92), identifying nearly one-third of restraint cases at high specificity. - Training on a broader composite outcome yielded similar discriminatory performance when predicting mechanical restraint, while the higher base rate resulted in a higher positive predictive value for predicting composite restraint. - Broadening the outcome to include multiple restraint types increased the number of at-risk patients detected due to the higher prevalence, without compromising accuracy for mechanical restraint, supporting shared underlying risk factors. Limitations- The model requires more extensive external validation to assess generalisability across time, demographic groups, and settings, which may be limited by regional/national differences in legislation and clinical documentation. - Prediction performance was highest near the restraint event, limiting early forecasting and suggesting that limiting predictions to the early phase of hospitalisation, where most restraint occurs, could elevate the base rate and improve model performance.

Matching journals

The top 11 journals account for 50% of the predicted probability mass.

1
Acta Psychiatrica Scandinavica
10 papers in training set
Top 0.1%
8.3%
2
European Psychiatry
10 papers in training set
Top 0.1%
6.7%
3
PLOS ONE
4510 papers in training set
Top 28%
6.3%
4
BMJ Open
554 papers in training set
Top 4%
4.8%
5
BJPsych Open
25 papers in training set
Top 0.1%
4.8%
6
Journal of Affective Disorders
81 papers in training set
Top 0.5%
3.9%
7
BMC Medicine
163 papers in training set
Top 2%
3.5%
8
JAMA Network Open
127 papers in training set
Top 1%
3.5%
9
Psychiatry Research
35 papers in training set
Top 0.5%
3.5%
10
BMC Medical Informatics and Decision Making
39 papers in training set
Top 0.9%
3.2%
11
The British Journal of Psychiatry
21 papers in training set
Top 0.3%
3.0%
50% of probability mass above
12
Frontiers in Artificial Intelligence
18 papers in training set
Top 0.1%
2.7%
13
Frontiers in Psychiatry
83 papers in training set
Top 1%
2.6%
14
Acta Neuropsychiatrica
12 papers in training set
Top 0.3%
2.1%
15
npj Digital Medicine
97 papers in training set
Top 2%
2.1%
16
PLOS Medicine
98 papers in training set
Top 2%
1.9%
17
Computational Psychiatry
12 papers in training set
Top 0.1%
1.9%
18
BMC Health Services Research
42 papers in training set
Top 1%
1.8%
19
Journal of Medical Internet Research
85 papers in training set
Top 3%
1.7%
20
Drug and Alcohol Dependence
37 papers in training set
Top 0.4%
1.7%
21
Scientific Reports
3102 papers in training set
Top 60%
1.6%
22
BMC Psychiatry
22 papers in training set
Top 0.4%
1.3%
23
JMIR Public Health and Surveillance
45 papers in training set
Top 2%
1.3%
24
Translational Psychiatry
219 papers in training set
Top 3%
1.3%
25
Psychological Medicine
74 papers in training set
Top 1%
1.2%
26
Journal of Psychiatric Research
28 papers in training set
Top 0.6%
1.1%
27
International Journal of Medical Informatics
25 papers in training set
Top 1%
0.9%
28
BMJ Mental Health
15 papers in training set
Top 0.3%
0.9%
29
Frontiers in Digital Health
20 papers in training set
Top 1%
0.8%
30
Epidemiology and Psychiatric Sciences
10 papers in training set
Top 0.4%
0.7%