Transformer-Based Multimodal Prediction of Depressive Episode Onset in Bipolar Disorder from Simulated 30-Day Digital Phenotyping Streams: A Proof-of-Concept Study of Actigraphy, HRV, and Smartphone Behaviour
Depressive episodes in bipolar disorder are preceded by a prodromal phase in which subtle physiological and behavioural changes reduced daytime activity, fragmented and lengthened sleep, blunted circadian rhythm, diminished heart rate variability, and social withdrawal emerge before the patient or clinician recognises a clinical episode. Digital phenotyping, the continuous passive collection of behavioural and physiological data from wearable sensors and smartphones, offers an unprecedented window onto this prodrome. Yet existing approaches typically analyse single sensor streams in isolation and fail to exploit the rich temporal structure and cross-modal interactions across the full multimodal data stream. No transformer-based multimodal architecture has been developed for depressive episode onset prediction in bipolar disorder from combined actigraphy, HRV, and smartphone behaviour streams. We developed a proof-of-concept multimodal transformer for depressive episode onset prediction using a fully synthetic digital phenotyping cohort of N = 700 simulated bipolar disorder patients (simulated onset prevalence 28.6%). Three modality streams were encoded: actigraphy (activity counts, sleep duration and efficiency, circadian amplitude, intradaily variability), heart rate variability (SDNN, RMSSD, LF/HF ratio, mean HR), and smartphone behaviour (screen time, typing speed, app-use entropy, GPS displacement, call and text frequency). Each 30-day modality stream was processed by a dedicated transformer encoder with a learnable CLS summary token and sinusoidal positional encoding; the three modality embeddings were combined via cross-modal multi-head attention fusion and concatenated with clinical meta-features for classification. The architecture was compared against single-modality transformers (ablation), a gradient-boosting model on summary statistics, and a multimodal LSTM. Cross-modal attention weights were extracted for interpretability. In this simulated proof-of-concept evaluation, the multimodal transformer achieved AUC = 0.981 (95% CI: 0.948 - 0.999), F1 = 0.901 (CI: 0.815 - 0.971), sensitivity = 0.933, and specificity = 0.947, with a Brier score of 0.039. Modality ablation demonstrated that no single modality achieved comparable performance (actigraphy 0.928, HRV 0.875, smartphone 0.910), and that multimodal fusion delivered a substantial AUC gain over the best single modality. Bayesian model comparison favoured the multimodal transformer over the evaluated baselines, including the multimodal LSTM. Simulated digital phenotyping trajectories diverged from approximately day 16 of the 30-day observation window, with reduced activity and HRV, blunted circadian amplitude, increased screen time, and social withdrawal in simulated onset cases. These simulation results support the technical feasibility of multimodal attention-based fusion for modelling a digitally expressed depressive prodrome. They do not establish clinical validity or a deployable two-week warning window; both require prospective validation in real-world bipolar disorder cohorts with naturally observed episode onset, missing data, device heterogeneity, and independent external evaluation.
Cite this paper
Filippis, R. D. and Foysal, A. A. (2026). Transformer-Based Multimodal Prediction of Depressive Episode Onset in Bipolar Disorder from Simulated 30-Day Digital Phenotyping Streams: A Proof-of-Concept Study of Actigraphy, HRV, and Smartphone Behaviour. Open Access Library Journal, 13, e15678. doi: http://dx.doi.org/10.4236/oalib.1115678.
Jackson, A., Cavanagh, J. and Scott, J. (2003) A Systematic Review of Manic and Depressive Prodromes. <i>Journal of Affective Disorders</i>, 74, 209-217. <br>https://doi.org/10.1016/s0165-0327(02)00266-5
Insel, T.R. (2017) Digital Phenotyping: Technology for a New Science of Behavior. <i>JAMA</i>, 318, 1215-1216. <br>https://doi.org/10.1001/jama.2017.11295
Onnela, J. and Rauch, S.L. (2016) Harnessing Smartphone-Based Digital Phenotyping to Enhance Behavioral and Mental Health. <i>Neuropsychopharmacology</i>, 41, 1691-1696. <br>https://doi.org/10.1038/npp.2016.7
Torous, J., Kiang, M.V., Lorme, J. and Onnela, J. (2016) New Tools for New Research in Psychiatry: A Scalable and Customizable Platform to Empower Data Driven Smartphone Research. <i>JMIR Mental Health</i>, 3, e16. <br>https://doi.org/10.2196/mental.5165
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, Ł. and Polosukhin, I. (2017) Attention Is All You Need. <i>Advances in Neural Information Processing Systems</i>, 30, 5998-6008.
Xu, P., Zhu, X. and Clifton, D.A. (2023) Multimodal Learning with Transformers: A Survey. <i>IEEE Transactions on Pattern Analysis and Machine Intelligence</i>, 45, 12113-12132. <br>https://doi.org/10.1109/tpami.2023.3275156
Merikangas, K.R., Swendsen, J., Hickie, I.B., Cui, L., Shou, H., Merikangas, A.K., <i>et al</i>. (2019) Real-Time Mobile Monitoring of the Dynamic Associations among Motor Activity, Energy, Mood, and Sleep in Adults with Bipolar Disorder. <i>JAMA Psychiatry</i>, 76, 190-198. <br>https://doi.org/10.1001/jamapsychiatry.2018.3546
Kemp, A.H., Quintana, D.S., Gray, M.A., Felmingham, K.L., Brown, K. and Gatt, J.M. (2010) Impact of Depression and Antidepressant Treatment on Heart Rate Variability: A Review and Meta-Analysis. <i>Biological Psychiatry</i>, 67, 1067-1074. <br>https://doi.org/10.1016/j.biopsych.2009.12.012
Saeb, S., Zhang, M., Karr, C.J., Schueller, S.M., Corden, M.E., Kording, K.P., <i>et al</i>. (2015) Mobile Phone Sensor Correlates of Depressive Symptom Severity in Daily-Life Behavior: An Exploratory Study. <i>Journal of Medical Internet Research</i>, 17, e175. <br>https://doi.org/10.2196/jmir.4273
Wang, R., Wang, W., daSilva, A., Huckins, J.F., Kelley, W.M., Heatherton, T.F., <i>et al</i>. (2018) Tracking Depression Dynamics in College Students Using Mobile Phone and Wearable Sensing. <i>Proceedings of the ACM on Interactive</i>,<i> Mobile</i>,<i> Wearable and Ubiquitous Technologies</i>, 2, 1-26. <br>https://doi.org/10.1145/3191775
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
Slack, D., Hilgard, A., Singh, S. and Lakkaraju, H. (2021) Reliable Post hoc Explanations: Modeling Uncertainty in Explainability. <i>Advances in Neural Information Processing Systems</i>, 34, 9391-9404.
Chen, T. and Guestrin, C. (2016) XGBoost: A Scalable Tree Boosting System. <i>Proceedings of the </i>22<i>nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining</i>, San Francisco, 13-17 August 2016, 785-794. <br>https://doi.org/10.1145/2939672.2939785
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
Faurholt‐Jepsen, M., Vinberg, M., Frost, M., Christensen, E.M., Bardram, J.E. and Kessing, L.V. (2015) Smartphone Data as an Electronic Biomarker of Illness Activity in Bipolar Disorder. <i>Bipolar Disorders</i>, 17, 715-728. <br>https://doi.org/10.1111/bdi.12332
Carr, O., Saunders, K.E.A., Tsanas, A., Bilderbeck, A.C., Palmius, N., Geddes, J.R., <i>et al</i>. (2018) Variability in Phase and Amplitude of Diurnal Rhythms Is Related to Variation of Mood in Bipolar and Borderline Personality Disorder. <i>Scientific Reports</i>, 8, Article No. 1649. <br>https://doi.org/10.1038/s41598-018-19888-9
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-845. <br>https://doi.org/10.2307/2531595
Devlin, J., Chang, M., Lee, K. and Toutanova, K. (2019) BERT: Pre-Training of Deep Bidirectional Transformers for Language Understanding. <i>Proceedings of the </i>2019 <i>Conference of the North</i>, Minneapolis, 2 June-7 June 2019, 4171-4186. <br>https://doi.org/10.18653/v1/n19-1423
Pratap, A., Neto, E.C., Snyder, P., Stepnowsky, C., Elhadad, N., Grant, D., <i>et al</i>. (2020) Indicators of Retention in Remote Digital Health Studies: A Cross-Study Evaluation of 100,000 Participants. <i>npj Digital Medicine</i>, 3, Article No. 21. <br>https://doi.org/10.1038/s41746-020-0224-8
Yatham, L.N., Kennedy, S.H., Parikh, S.V., Schaffer, A., Bond, D.J., Frey, B.N., Sharma, V., Goldstein, B.I., Rej, S., Beaulieu, S. and Alda, M. (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.