Bipolar disorder is a severe psychiatric condition characterized by mood instability, and a specific subtype known as rapid cycling presents with frequent mood episodes, complicating diagnosis and treatment. Accurate identification of rapid cycling is critical for early intervention and personalized care strategies. This study explores the feasibility of using Transformer-based deep learning models to predict rapid cycling in bipolar disorder through an integrative analysis of synthetic multimodal data. A simulated dataset comprising 200 virtual patients was created to reflect 30 consecutive days of behavioural and clinical signals, including mood ratings, sleep duration, physical activity, and pharmacological dosage (lithium), combined with static features such as age, sex, body mass index (BMI), baseline mood score, and medication status. Seven comprehensive visualizations were developed to examine temporal trends, distributional properties, and correlations among features. The results show clear separability in mood dynamics between stable and rapid cycling patients, with mood variance emerging as a highly discriminative marker. While physical activity and dosage patterns reflected structured behaviours suitable for modelling, sleep and sex-related variables showed less predictive utility. The mood trajectory and variability plots particularly justified the selection of attention-based architectures like Transformers, which are adept at capturing long-range temporal dependencies. This research provides a foundational pipeline that simulates real-world longitudinal data and prepares it for Transformer model implementation. While the dataset is synthetic, the methodology replicates realistic digital phenotyping workflows. The study underscores the value of combining behavioural dynamics and pharmacologica history within AI frameworks to support next-generation mental health diagnostics and personalized treatment planning in bipolar disorder.
Cite this paper
Filippis, R. D. and Foysal, A. A. (2025). Transformer-Based Models for Predicting Rapid Cycling in Bipolar Disorder: Integrative Analysis of Digital Phenotyping and Pharmacological Data. Open Access Library Journal, 12, e13960. doi: http://dx.doi.org/10.4236/oalib.1113960.
Tondo, L., Vazquez, G.H. and Baldessarini, R.J. (2017) Depression and Mania in Bipolar Disorder. Current Neuropharmacology, 15, 353-358. https://doi.org/10.2174/1570159x14666160606210811
Vázquez, G.H., Lolich, M., Cabrera, C., Jokic, R., Kolar, D., Tondo, L., et al. (2018) Mixed Symptoms in Major Depressive and Bipolar Disorders: A Systematic Review. Journal of Affective Dis-orders, 225, 756-760. https://doi.org/10.1016/j.jad.2017.09.006
Kilzieh, N. and Akiskal, H.S. (1999) Rapid-Cycling Bipolar Disorder. Psychiatric Clinics of North America, 22, 585-607. https://doi.org/10.1016/s0193-953x(05)70097-6
Buoli, M., Cesana, B.M., Maina, G., Conca, A., Fagiolini, A., Steardo, L., et al. (2019) Correlates of Current Rapid-Cycling Bipolar Disorder: Results from the Ital-ian Multicentric RENDiBi Study. European Psychiatry, 62, 82-89. https://doi.org/10.1016/j.eurpsy.2019.09.001
Rodrigues, J., Reis, J. and Novais, F. (2025) Emerging Pharmacological Interventions for Refractory Rapid Cycling Bipolar Disorder: New Frontiers in Treatment. Current Treatment Options in Psychiatry, 12, Article No. 16. https://doi.org/10.1007/s40501-025-00354-z
Fountoulakis, K.N., Kontis, D., Gonda, X. and Yatham, L.N. (2013) A Systematic Review of the Evidence on the Treatment of Rapid Cycling Bipolar Disorder. Bipo-lar Disorders, 15, 115-137. https://doi.org/10.1111/bdi.12045
Kupka, R.W., Lucken-baugh, D.A., Post, R.M., Suppes, T., Altshuler, L.L., Keck, P.E., et al. (2005) Comparison of Rapid-Cycling and Non-Rapid-Cycling Bipolar Disorder Based on Prospective Mood Ratings in 539 Outpatients. American Journal of Psychiatry, 162, 1273-1280. https://doi.org/10.1176/appi.ajp.162.7.1273
Nelson, B., McGorry, P.D., Wichers, M., Wigman, J.T.W. and Hartmann, J.A. (2017) Moving from Static to Dynamic Models of the Onset of Mental Disorder. JAMA Psychiatry, 74, 528-534. https://doi.org/10.1001/jamapsychiatry.2017.0001
Koukopoulos, A., Sani, G., Koukopoulos, A.E., Minnai, G.P., Girardi, P., Pani, L., et al. (2003) Duration and Stability of the Rapid-Cycling Course: A Long-Term Personal Follow-Up of 109 Patients. Journal of Affective Disorders, 73, 75-85. https://doi.org/10.1016/s0165-0327(02)00321-x
Wichers, M. (2013) The Dynamic Nature of Depression: A New Micro-Level Perspective of Mental Disorder That Meets Current Challenges. Psychological Medicine, 44, 1349-1360. https://doi.org/10.1017/s0033291713001979
Gauld, C. and Depannemaecker, D. (2023) Dynamical Systems in Computational Psychiatry: A Toy-Model to Apprehend the Dynamics of Psychiatric Symptoms. Frontiers in Psychology, 14, Article ID: 1099257. https://doi.org/10.3389/fpsyg.2023.1099257
Dunster, G.P., Swendsen, J. and Merikangas, K.R. (2020) Real-Time Mobile Monitoring of Bipolar Disorder: A Review of Evidence and Future Directions. Neuropsychophar-macology, 46, 197-208. https://doi.org/10.1038/s41386-020-00830-5
Maatoug, R., Oudin, A., Adrien, V., Saudreau, B., Bonnot, O., Millet, B., et al. (2022) Digital Phenotype of Mood Disorders: A Conceptual and Critical Review. Frontiers in Psychiatry, 13, Article ID: 895860. https://doi.org/10.3389/fpsyt.2022.895860
Anmella, G., Corponi, F., Li, B.M., Mas, A., Sanabra, M., Pacchiarotti, I., et al. (2023) Exploring Digital Biomarkers of Illness Activity in Mood Episodes: Hypotheses Generating and Model Development Study. JMIR mHealth and uHealth, 11, e45405. https://doi.org/10.2196/45405
Yang, M., Ngai, E.C.H., Hu, X., Hu, B., Liu, J., Gelenbe, E., et al. (2024) Digital Pheno-typing and Feature Extraction on Smartphone Data for Depression Detection. Proceedings of the IEEE, 112, 1773-1798. https://doi.org/10.1109/jproc.2025.3542324
Catarino, A., Fawcett, J.M., Ewbank, M.P., Bateup, S., Cummins, R., Tablan, V., et al. (2020) Refining Our Understanding of Depressive States and State Transitions in Response to Cognitive Behavioural Therapy Using Latent Markov Modelling. Psychological Medicine, 52, 332-341. https://doi.org/10.1017/s0033291720002032
Hampel, H., Gao, P., Cummings, J., Toschi, N., Thompson, P.M., Hu, Y., et al. (2023) The Foundation and Architecture of Precision Medicine in Neurology and Psychiatry. Trends in Neurosciences, 46, 176-198. https://doi.org/10.1016/j.tins.2022.12.004
Sakib, M., Mustajab, S. and Alam, M. (2025) Ensemble Deep Learning Techniques for Time Series Analysis: A Comprehensive Review, Applications, Open Issues, Challenges, and Future Directions. Cluster Computing, 28, Article No. 73. https://doi.org/10.1007/s10586-024-04684-0
Shi, J, Shirali, A., Jin, B., Zhou, S., Hu, W., Rangaraj, R., Wang, S., et al. (2025) Deep Learning and Foundation Mod-els for Weather prediction: A Survey. arXiv:2501.06907.
Jing, Z., Huo, C., Tong, H., Teng, R. and Zhang, L. (2025) Re-search on Big Data Prediction Methods Based on Deep Learning. 2025 International Conference on Digital Analysis and Processing, Intelligent Computation (DAPIC), Incheon, 26-28 February 2025, 447-452. https://doi.org/10.1109/dapic66097.2025.00089
Galassi, A., Lippi, M. and Torroni, P. (2021) Attention in Natural Language Processing. IEEE Transactions on Neural Networks and Learning Systems, 32, 4291-4308. https://doi.org/10.1109/tnnls.2020.3019893
Choi, S.R. and Lee, M. (2023) Transformer Architecture and Attention Mechanisms in Genome Data Analysis: A Comprehensive Review. Biology, 12, Article 1033. https://doi.org/10.3390/biology12071033
Chernyavskiy, A., Ilvovsky, D. and Nakov, P. (2021) Transformers: “The End of History” for Natural Language Processing? In: Oliver, N., Pérez-Cruz, F., Kramer, S., Read, J. and Lozano, J.A., Eds., Joint European Conference on Machine Learning and Knowledge Discovery in Databases, Springer International Publishing, 677-693. https://doi.org/10.1007/978-3-030-86523-8_41
Khoo, L.S., Lim, M.K., Chong, C.Y. and McNaney, R. (2024) Machine Learning for Multimodal Mental Health Detection: A Systematic Review of Passive Sensing Approaches. Sensors, 24, Article 348. https://doi.org/10.3390/s24020348
Shatte, A.B.R., Hutchinson, D.M. and Teague, S.J. (2019) Machine Learning in Mental Health: A Scoping Review of Methods and Applications. Psychological Medicine, 49, 1426-1448. https://doi.org/10.1017/s0033291719000151
Marzano, L., Bardill, A., Fields, B., Herd, K., Veale, D., Grey, N., et al. (2015) The Application of Mhealth to Mental Health: Opportunities and Challenges. The Lancet Psychiatry, 2, 942-948. https://doi.org/10.1016/s2215-0366(15)00268-0
Greco, C.M., Simeri, A., Tagarelli, A. and Zumpano, E. (2023) Transform-er-Based Language Models for Mental Health Issues: A Survey. Pattern Recognition Letters, 167, 204-211. https://doi.org/10.1016/j.patrec.2023.02.016
Kerasiotis, M., Ilias, L. and Askounis, D. (2024) Depression Detection in Social Media Posts Using Transformer-Based Models and Auxiliary Features. Social Network Analysis and Mining, 14, Article No. 196. https://doi.org/10.1007/s13278-024-01360-4
McIntyre, R.S., Alda, M., Baldessarini, R.J., Bauer, M., Berk, M., Correll, C.U., et al. (2022) The Clinical Characterization of the Adult Patient with Bipolar Disorder Aimed at Personalization of Management. World Psychiatry, 21, 364-387. https://doi.org/10.1002/wps.20997
Treuer, T. and Tohen, M. (2010) Predicting the Course and Outcome of Bipolar Disorder: A Review. European Psychiatry, 25, 328-333. https://doi.org/10.1016/j.eurpsy.2009.11.012
Möller, H., Bandelow, B., Bauer, M., Hampel, H., Herpertz, S.C., Soyka, M., et al. (2015) DSM-5 Reviewed from Different Angles: Goal Attainment, Rationality, Use of Evidence, Consequenc-es—Part 2: Bipolar Disorders, Schizophrenia Spectrum Disorders, Anxiety Disorders, Obsessive-Compulsive Disorders, Trauma- and Stressor-Related Disorders, Personality Disorders, Substance-Related and Addictive Disorders, Neurocognitive Disorders. European Archives of Psychiatry and Clinical Neuroscience, 265, 87-106. https://doi.org/10.1007/s00406-014-0521-9
Montano, C.B., Patel, M., Jain, R., Masand, P.S., Harrington, A., Gillard, P., et al. (2021) The Rapid Mood Screener: A Novel and Pragmatic Screener Tool for Bipolar I Disorder. CNS Spectrums, 26, 167-168. https://doi.org/10.1017/s1092852920002709
Sree Hari Rao, V., Raghvendra Rao, C. and Yeragani, V.K. (2006) A Novel Technique to Evaluate Fluctuations of Mood: Implications for Evaluating Course and Treatment Effects in Bipolar/Affective Disorders. Bipolar Disorders, 8, 453-466. https://doi.org/10.1111/j.1399-5618.2006.00374.x
Ortiz, A. and Grof, P. (2016) Electronic Monitoring of Self-Reported Mood: The Return of the Subjective? International Journal of Bipolar Disorders, 4, Article No. 28. https://doi.org/10.1186/s40345-016-0069-x
Lam, D.H., Jones, S.H. and Hayward, P. (2010) Cognitive Therapy for Bipolar Disorder: A Therapist’s Guide to Concepts, Methods and Practice. Wiley. https://doi.org/10.1002/9780470970256
Zhuparris, A., Maleki, G., van Londen, L., Koopmans, I., Aalten, V., Yoca-rini, I.E., et al. (2023) A Smartphone- and Wearable-Based Biomarker for the Estimation of Unipolar Depression Severity. Scientific Reports, 13, Article No. 18844. https://doi.org/10.1038/s41598-023-46075-2
Leon, E., Clarke, G., Calla-ghan, V. and Sepulveda, F. (2004) Real-Time Detection of Emotional Changes for Inhabited Environments. Computers & Graphics, 28, 635-642. https://doi.org/10.1016/j.cag.2004.06.002
van Genugten, C.R., Schuurmans, J., van Ballegooijen, W., Hoogendoorn, A.W., Smit, J.H. and Riper, H. (2021) Discovering Different Profiles in the Dynamics of De-pression Based on Real-Time Monitoring of Mood: A First Exploration. Internet Interventions, 26, Article 100437. https://doi.org/10.1016/j.invent.2021.100437
Rutledge, R.B., Chekroud, A.M. and Huys, Q.J. (2019) Machine Learning and Big Data in Psychiatry: Toward Clinical Applications. Current Opinion in Neurobiology, 55, 152-159. https://doi.org/10.1016/j.conb.2019.02.006
Koppe, G., Meyer-Lindenberg, A. and Durstewitz, D. (2020) Deep Learning for Small and Big Data in Psychiatry. Neuropsychopharmacology, 46, 176-190. https://doi.org/10.1038/s41386-020-0767-z
Ermers, N.J., Hagoort, K. and Scheepers, F.E. (2020) The Predictive Validity of Machine Learning Models in the Classification and Treatment of Major Depressive Disorder: State of the Art and Future Directions. Frontiers in Psychiatry, 11, Article ID: 472. https://doi.org/10.3389/fpsyt.2020.00472
Patel, M.J., Andreescu, C., Price, J.C., Edelman, K.L., Reynolds, C.F. and Aizenstein, H.J. (2015) Machine Learning Approaches for Inte-grating Clinical and Imaging Features in Late‐Life Depression Classification and Response Prediction. International Journal of Geriatric Psychiatry, 30, 1056-1067. https://doi.org/10.1002/gps.4262
Moor, M., Horn, M., Rieck, B., Roqueiro, D. and Borgwardt, K. (2019) Early Recognition of Sepsis with Gaussian Process Temporal Convolutional Networks and Dynam-ic Time Warping. Machine Learning for Healthcare Conference, 2-26.
Martín-Palomeque, P., Escudero-Arnanz, ó., álvarez-Rodríguez, J. and Soguero-Ruiz, C. (2024) Irregular Temporal Classification of Multidrug Resistance Development in Intensive Care Unit Patients. 2024 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), Lisbon, 3-6 December 2024, 5016-5023. https://doi.org/10.1109/bibm62325.2024.10822248
Yang, X., Qi, X. and Zhou, X. (2023) Deep Learning Technologies for Time Series Anomaly Detection in Healthcare: A Review. IEEE Access, 11, 117788-117799. https://doi.org/10.1109/access.2023.3325896
Pardiñas, A.F., Owen, M.J. and Walters, J.T.R. (2021) Pharmacogenomics: A Road Ahead for Precision Medicine in Psychiatry. Neuron, 109, 3914-3929. https://doi.org/10.1016/j.neuron.2021.09.011
Zanardi, R., Prestifilippo, D., Fabbri, C., Colombo, C., Maron, E. and Serretti, A. (2020) Precision Psychiatry in Clinical Practice. International Journal of Psychiatry in Clinical Practice, 25, 19-27. https://doi.org/10.1080/13651501.2020.1809680
Huys, Q.J.M., Maia, T.V. and Frank, M.J. (2016) Computa-tional Psychiatry as a Bridge from Neuroscience to Clinical Applications. Nature Neuroscience, 19, 404-413. https://doi.org/10.1038/nn.4238
Carvalho, A.F., Dimellis, D., Gonda, X., Vieta, E., McIntyre, R.S. and Fountoulakis, K.N. (2014) Rapid Cycling in Bipolar Disorder. The Journal of Clinical Psychiatry, 75, e578-e586. https://doi.org/10.4088/jcp.13r08905
Haberer, J.E., Sabin, L., Amico, K.R., Orrell, C., Galárraga, O., Tsai, A.C., et al. (2017) Improving Antiretroviral Therapy Adherence in Resource‐Limited Settings at Scale: A Discussion of Interventions and Recommendations. Journal of the International AIDS Society, 20, Article 21371. https://doi.org/10.7448/ias.20.1.21371
Man, K. and Chahl, J. (2022) A Review of Syn-thetic Image Data and Its Use in Computer Vision. Journal of Imaging, 8, Article 310. https://doi.org/10.3390/jimaging8110310
Rich, B.A., Carver, F.W., Holroyd, T., Rosen, H.R., Mendoza, J.K., Cornwell, B.R., et al. (2011) Different Neural Pathways to Nega-tive Affect in Youth with Pediatric Bipolar Disorder and Severe Mood Dysregulation. Journal of Psychiatric Research, 45, 1283-1294. https://doi.org/10.1016/j.jpsychires.2011.04.006