TITLE:
Deep Learning Classification of Treatment-Emergent Mania Following Antidepressant Initiation in Bipolar II Disorder: A Synthetic-Data Proof-of-Concept Using Longitudinal and Episode-Feature Attention
AUTHORS:
Rocco de Filippis, Abdullah Al Foysal
KEYWORDS:
Treatment-Emergent Mania, Bipolar II Disorder, Antidepressant Safety, LSTM, Graph Attention Network, Digital Phenotyping, SHAP, Bayesian Model Selection, Circadian Biomarkers, Episode Chronology
JOURNAL NAME:
Open Access Library Journal,
Vol.13 No.8,
August
24,
2026
ABSTRACT: Treatment-emergent mania (TEM), including antidepressant-associated hypomanic or manic switching and cycle acceleration, is an important safety concern in bipolar II disorder. This study is a synthetic-data proof of concept: all patients, digital phenotyping streams, episode histories, pharmacological variables, and TEM outcomes were simulated. The findings, therefore, evaluate methodological feasibility rather than clinical effectiveness. We developed a multimodal modelling framework combining an LSTM with multi-head self-attention for 30-day pre-antidepressant digital sequences, an episode-feature attention network operating on a fixed 14-feature episode-history vector, and gradient-boosting models for clinical and pharmacological variables. The proposed out-of-fold stacking ensemble consistently comprised XGBoost, LightGBM, and LSTM + Attention outputs; the episode-feature attention model was evaluated as a separate comparator and was not included in the stack. The fully synthetic cohort contained N = 750 simulated BD-II patients. Model development used patient-level development, validation, and held-out test partitions created after cohort synthesis but before preprocessing or model fitting. On the held-out synthetic test set, the proposed ensemble achieved AUC = 0.997 (95% CI: 0.988 - 1.000), F1 = 0.958, sensitivity = 0.958, specificity = 0.989, and Brier score = 0.025. LSTM + Attention achieved AUC = 0.984. These unusually high estimates may partly reflect the simulator’s embedded temporal and pharmacological risk structure and require external evaluation. SHAP analysis of XGBoost and LightGBM identified prior TEM history, antidepressant-class risk, mood-stabilizer adequacy, circadian IS score, and episode-interval shortening as prominent predictors. The results support the technical feasibility of sequence-informed TEM risk modelling in a controlled simulation. They do not establish near-perfect prediction, treatment safety, or readiness for clinical deployment. Independent validation on prospectively collected BD-II data is required.