TL;DR
Researchers have developed a machine learning model that uses routine electronic health record (EHR) data to predict which psychiatric inpatients will eventually require electroconvulsive therapy (ECT). By identifying these patients just one week into their hospital stay with high accuracy (AUROC 0.94), the system could significantly reduce treatment delays for life-threatening mental health conditions.
What Problem Does This Paper Address?
Electroconvulsive therapy (ECT) is often a life-saving intervention for severe depression, suicidality, and catatonia. However, in clinical practice, it is frequently treated as a "last resort." Initiation is often delayed by weeks while clinicians wait for pharmacological responses or navigate legal and logistical hurdles.
These delays aren't just frustrating; they are clinically detrimental. Research suggests that the longer a patient waits for ECT, the less likely they are to respond to it once it finally begins. The authors sought to bridge this gap by creating a "clinical crystal ball": a model that can predict the need for ECT early in an admission, allowing medical teams to start the referral and consent process much sooner.
Methods
The team employed a cohort study design using the PSYCOP (PSYchiatric Clinical Outcome Prediction) framework.
- The Model: They used XGBoost (Extreme Gradient Boosting), a state-of-the-art gradient-boosted decision tree algorithm known for handling tabular data effectively.
- Feature Engineering: Predictors were constructed using a Python package called
timeseriesflattener. They looked at three "lookbehind" windows (90, 365, and 730 days) to capture both acute and historical patient data. - Data Types: The study compared three predictor sets:
- Structured data: Demographics, ICD-10 diagnoses, medications, and standardized rating scales (e.g., Hamilton Depression Scale, Brøset Violence Checklist).
- Unstructured text: Clinical notes processed via TF-IDF (Term Frequency-Inverse Document Frequency) vectorization.
- Combined: A mixture of both.
- The Prediction Task: On the 7th day of a patient's stay, the model predicted whether ECT would be initiated within the next 60 days.
Datasets
The study utilized the PSYCOP cohort, which contains routine EHR data from the Psychiatric Services of the Central Denmark Region.
- Size: 41,610 unique patients across 164,961 eligible admissions between 2013 and 2021.
- Exclusions: Patients with schizophrenia or personality disorders were excluded because ECT is rarely used for these primary diagnoses in Denmark; including them would have created a "needle in a haystack" problem that would have degraded the model's Positive Predictive Value (PPV).
Key Insights and Ideas
- Structured Data is Sufficient: Surprisingly, the model trained only on structured data performed nearly as well as the combined model (AUROC 0.94 vs 0.94). This is a win for clinical implementation, as structured data is much easier to process in real-time than free-text notes.
- The "Leakage" of Clinical Intent: Models that included clinical notes actually had a shorter warning time (9.5 days vs. 15 days for structured data). This is because the text models were picking up on the word "ECT" appearing in notes once clinicians had already started discussing it. The structured-only model was better at identifying the underlying clinical state before the word "ECT" even hit the page.
- Predictors of Severity vs. Resistance: The top features fell into two logical buckets: acute severity (high suicide risk scores, involuntary admission, violence checklist scores) and treatment resistance (a high number of temporary leaves, suggesting a long, difficult-to-treat stay).
Key Results
- Global Performance: The structured-only model achieved an AUROC of 0.94, indicating excellent discriminative ability.
- Clinical Utility: At a 2% predicted positive rate, the model showed:
- 98% Specificity: Very few "false alarms" for patients who don't need ECT.
- 47% Sensitivity: It caught nearly half of all patients who eventually received ECT.
- 24% Positive Predictive Value (PPV): About 1 in 4 "high risk" flags were correct.
- 99% Negative Predictive Value (NPV): If the model says a patient doesn't need ECT, it is almost certainly right.
- Lead Time: The model provided a median warning time of 15 days before the first ECT treatment.
Limitations and Future Work
- The Proxy Problem: The model predicts initiation of ECT, not necessarily the need for it. Patients who needed ECT but refused it or weren't offered it are marked as "negative" cases in this data.
- Generalizability: The data comes from a single Danish region. Because ECT practices and legal requirements vary wildly between countries, the model would likely need retraining to work in different healthcare systems (e.g., the US or UK).
- Referral Data Gap: The authors noted that using "referral for ECT" as an outcome would be better than "initiation," but referral data was not consistently recorded in their EHR. Future iterations could benefit from more granular tracking of the clinical decision-making process.
Summary updated