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
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.
Cite this paper
Filippis, R. D. and Foysal, A. A. (2026). 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. Open Access Library Journal, 13, e15671. doi: http://dx.doi.org/10.4236/oalib.1115671.
Wehr, T.A. and Goodwin, F.K. (1987) Can Antidepressants Cause Mania and Worsen the Course of Affective Illness? <i>American Journal of Psychiatry</i>, 144, 1403-1411.
Tondo, L. and Baldessarini, R.J. (1998) Rapid Cycling in Women and Men with Bipolar Manic-Depressive Disorders. <i>American Journal of Psychiatry</i>, 155, 1434-1436. <br>https://doi.org/10.1176/ajp.155.10.1434
Yatham, L.N., Kennedy, S.H., Parikh, S.V., Schaffer, A., Bond, D.J., Frey, B.N., <i>et</i><i> al</i>. (2018) Canadian Network for Mood and Anxiety Treatments (CANMAT) and International Society for Bipolar Disorders (ISBD) 2018 Guidelines for the Management of Patients with Bipolar Disorder. <i>Bipolar Disorders</i>, 20, 97-170.<br>https://doi.org/10.1111/bdi.12609
Hochreiter, S. and Schmidhuber, J. (1997) Long Short-Term Memory. <i>Neural Computation</i>, 9, 1735-1780. <br>https://doi.org/10.1162/neco.1997.9.8.1735
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., <i>et al</i>. (2017) Attention Is All You Need. 31<i>st Conference on Neural Information Processing Systems </i>(<i>NIPS</i> 2017), Long Beach, 4-9 December 2017, 1-11.
Su, G., Wang, H., Zhang, Y., Zhang, W. and Lin, X. (2024) Simple and Deep Graph Attention Networks. <i>Knowledge</i>-<i>Based Systems</i>, 293, Article 111649.<br>https://doi.org/10.1016/j.knosys.2024.111649
Post, R.M. (2007) Kindling and Sensitization as Models for Affective Episode Recurrence, Cyclicity, and Tolerance Phenomena. <i>Neuroscience & Biobehavioral Reviews</i>, 31, 858-873. <br>https://doi.org/10.1016/j.neubiorev.2007.04.003
Boudebesse, C., Geoffroy, F. and Bellivier, F. (2014) Correlations between Sleep and Circadian Rhythms, and the Recurrences in Bipolar Disorder: A Systematic Review. <i>Chronobiology International</i>, 31, 696-712.
DeLong, E.R., DeLong, D.M. and Clarke-Pearson, D.L. (1988) Comparing the Areas under Two or More Correlated Receiver Operating Characteristic Curves: A Nonparametric Approach. <i>Biometrics</i>, 44, 837-844. <br>https://doi.org/10.2307/2531595
Kass, R.E. and Raftery, A.E. (1995) Bayes Factors. <i>Journal of the American Statistical Association</i>, 90, 773-795. <br>https://doi.org/10.1080/01621459.1995.10476572
Chen, T.Q. and Guestrin, C. (2016) XGBoost: A Scalable Tree Boosting System. <i>Proceedings of the </i>22<i>nd ACM SIGKDD International Conference on Knowledge Dis</i><i>covery and Data Mining</i>, San Francisco, 13-17 August 2016, 785-794. <br>https://doi.org/10.1145/2939672.2939785
Lundberg, S.M. and Lee, S.I. (2017) A Unified Approach to Interpreting Model Predictions. <i>Advances in Neural Information Processing Systems</i>, 30, 4765-4774.
Insel, T.R. (2017) Digital Phenotyping: Technology for a New Science of Behaviour. <i>J</i><i>ournal of the </i><i>A</i><i>merican </i><i>M</i><i>edical </i><i>A</i><i>ssociation</i>, 318, 1215-1216. <br>https://doi.org/10.1001/jama.2017.11295
Ehlers, C.L., Frank, E. and Kupfer, D.J. (1988) Social Zeitgebers and Biological Rhythms. <i>Archives of General Psychiatry</i>, 45, 948-952. <br>https://doi.org/10.1001/archpsyc.1988.01800340076012
Saccaro, L.F., Amatori, G., Cappelli, A., Mazziotti, R., Dell’Osso, L. and Rutigliano, G. (2021) Portable Technologies for Digital Phenotyping of Bipolar Disorder: A Systematic Review. <i>Journal of Affective Disorders</i>, 295, 323-338. <br>https://doi.org/10.1016/j.jad.2021.08.052
Keramatian, K., Chithra, N.K. and Yatham, L.N. (2023) The CANMAT and ISBD Guidelines for the Treatment of Bipolar Disorder: Summary and a 2023 Update of Evidence. <i>Focus</i>, 21, 344-353. <br>https://doi.org/10.1176/appi.focus.20230009
Lipschitz, J.M., Lin, S., Saghafian, S., Pike, C.K. and Burdick, K.E. (2025) Digital Phenotyping in Bipolar Disorder: Using Longitudinal Fitbit Data and Personalized Machine Learning to Predict Mood Symptomatology. <i>Acta Psychiatrica Scandinavica</i>, 151, 434-447. <br>https://doi.org/10.1111/acps.13765