A TIME-AWARE TEMPORAL BERT FRAMEWORK FOR LONGITUDINAL DETECTION OF DEPRESSIVE AND SUICIDE-RELATED RISK PATTERNS IN SOCIAL MEDIA
DOI:
https://doi.org/10.37943/25DSSM6014Keywords:
Temporal BERT, time-aware transformers, longitudinal mental health monitoring, depression detection, suicide risk detection, early warning modeling, psycholinguistic features, user-level trajectory analysisAbstract
In this paper, we introduce a time-aware deep learning model designed to identify and predict signs of depression and suicidal ideation across social networks. Standard static text classifiers typically analyze updates in isolation; however, our method tracks the long-term progression of a person's emotional state by merging contextual language embeddings with temporal encodings and specific psycholinguistic markers. We gathered our primary dataset from Twitter, Reddit, and Facebook, ensuring all user histories were strictly anonymized and organized chronologically. The study evaluates multiple neural network architectures, specifically Temporal BERT (Bidirectional Encoder Representations from Transformers), time-encoded BiLSTM (Bidirectional Long Short-Term Memory), and a temporal transformer utilizing positional features. Our experiments demonstrate that factoring in the chronological dimension substantially boosts classification accuracy, allowing for the earlier detection of declining mental health. The Temporal BERT model achieved the highest F1 score (harmonic mean of precision and recall) and AUC (Area Under the Receiver Operating Characteristic Curve) values on several datasets, outperforming both standard (static) BERT and basic recurrent models. Analysis of temporal trajectories also allowed us to identify clear clusters of user behavior: stable, improving, and deteriorating - this makes conclusions more interpretable and helps us understand personal emotional dynamics. The early-warning module was evaluated at 7-, 14-, and 21-day prediction horizons and showed that risk-related deterioration patterns could be identified in advance of the reference event. Across all evaluated horizons, Temporal BERT demonstrated the strongest Recall@k performance, meaning that it more consistently captured at-risk users among the top-ranked predictions.
This article emphasizes that depressive and suicide-related risk signals are often not evident in isolated posts but emerge through longitudinal behavioral patterns. The proposed approach may support earlier and more sensitive identification of elevated risk patterns in digital mental health monitoring settings. At the same time, such use requires strict ethical safeguards, rigorous anonymization, and human-in-the-loop oversight. Future research should extend the framework toward multimodal, multilingual, and socially contextualized modeling.
References
Keles, B., McCrae, N., & Grealish, A. (2020). A systematic review: The influence of social media on depression, anxiety, and psychological distress in adolescents. International Journal of Adolescence and Youth, 25(1), 79–93. https://doi.org/10.1080/02673843.2019.1590851
Cheng, J. C., & Chen, A. L. P. (2022). Multimodal time-aware attention networks for depression detection. Journal of Intelligent Information Systems, 59, 319–339. https://doi.org/10.1007/s10844-022-00704-w
Ilias, L., & Askounis, D. (2023). Multitask learning for recognizing stress and depression in social media. Online Social Networks and Media, 37–38, 100270. https://doi.org/10.1016/j.osnem.2023.100270
Chandrasekaran, R., Kotaki, S., & Nagaraja, A. H. (2024). Detecting and tracking depression through temporal topic modeling of tweets: insights from a 180-day study. npj Mental Health Research, 3, 62. https://doi.org/10.1038/s44184-024-00107-5
Birnbaum, M. L., Ernala, S. K., Rizvi, A. F., De Choudhury, M., Kane, J. M., et al. (2020). Identifying signals associated with psychiatric illness utilizing language and images posted to Facebook. Schizophrenia, 6, Article 38. https://doi.org/10.1038/s41537-020-00125-0
Li, Z., An, Z., Cheng, W., Zhou, J., Zheng, F., & Hu, B. (2023). MHA: a multimodal hierarchical attention model for depression detection in social media. Health Information Science and Systems, 11(1), 6. https://doi.org/10.1007/s13755-022-00197-5
Chancellor, S., & De Choudhury, M. (2020). Methods in predictive techniques for mental health status on social media: a critical review. npj Digital Medicine, 3, 43. https://doi.org/10.1038/s41746-020-0233-7
Seabrook, E. M., Kern, M. L., Fulcher, B. D., & Rickard, N. S. (2018). Predicting depression from language-based emotion dynamics: longitudinal analysis of Facebook and Twitter status updates. Journal of Medical Internet Research, 20(5), e9267. https://doi.org/10.2196/jmir.9267
Kerasiotis, M., et al. (2024). Depression detection in social media posts using transformer-based models and auxiliary features. Social Network Analysis and Mining, 14, Article 116. https://doi.org/10.1007/s13278-024-01360-4
Farruque, N., Goebel, R., Sivapalan, S., & Zaïane, O. (2024). Deep temporal modelling of clinical depression through social media text. Natural Language Processing Journal, 100052. https://doi.org/10.1016/j.nlp.2023.100052
Narynov, S., Mukhtarkhanuly, D., Omarov, B., Kozhakhmet, K., & Omarov, B. (2020). Machine learning approach to identifying depression related posts on social media. In 2020 20th International Conference on Control, Automation and Systems (ICCAS) (pp. 6–11). IEEE. https://doi.org/10.23919/ICCAS50221.2020.9268336
Omarov, B., Narynov, S., & Zhumanov, Z. (2023). Artificial intelligence-enabled chatbots in mental health: A systematic review. Computers, Materials & Continua, 74(3), 5105–5122. https://doi.org/10.32604/cmc.2023.034655
Bokolo, B. G., & Liu, Q. (2023). Deep learning-based depression detection from social media: Comparative evaluation of ML and transformer techniques. Electronics, 12(21), 4396. https://doi.org/10.3390/electronics12214396
Teferra, B. G., Rueda, A., Pang, H., Valenzano, R., Samavi, R., Krishnan, S., & Bhat, V. (2024). Screening for depression using natural language processing: Literature review. Interactive Journal of Medical Research, 13, e55067. https://doi.org/10.2196/55067
Malgaroli, M., Hull, T. D., Zech, J. M., et al. (2023). Natural language processing for mental health interventions: A systematic review and research framework. Translational Psychiatry, 13, 309. https://doi.org/10.1038/s41398-023-02592-2
Jaidka, K. (2022). Cross-platform- and subgroup-differences in the well-being effects of Twitter, Instagram, and Facebook in the United States. Scientific Reports, 12, 3271. https://doi.org/10.1038/s41598-022-07219-y
Lasri, S., Nfaoui, E. H., & Mrizik, K. (2024). Suicide ideation and risk detection from social media using GPT models. Journal of Computer Science, 20(10), 1349–1356. https://doi.org/10.3844/jcssp.2024.1349.1356
Malhotra, A., & Jindal, R. (2022). Deep learning techniques for suicide and depression detection from online social media: A scoping review. Applied Soft Computing, 130, 109713. https://doi.org/10.1016/j.asoc.2022.109713
Liu, D., Zhang, R., Choo, H., & Li, D. (2022). Detecting and measuring depression on social media using a machine learning approach: Systematic review. JMIR Mental Health, 9(3), e27244. https://doi.org/10.2196/27244
Figuerêdo, J. S. L., Maia, A. L. L. M., & Calumby, R. T. (2022). Early depression detection in social media based on deep learning and underlying emotions. Online Social Networks and Media, 31, 100225. https://doi.org/10.1016/j.osnem.2022.100225
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Articles are open access under the Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Authors who publish a manuscript in this journal agree to the following terms:
- The authors reserve the right to authorship of their work and transfer to the journal the right of first publication under the terms of the Creative Commons Attribution License, which allows others to freely distribute the published work with a mandatory link to the the original work and the first publication of the work in this journal.
- Authors have the right to conclude independent additional agreements that relate to the non-exclusive distribution of the work in the form in which it was published by this journal (for example, to post the work in the electronic repository of the institution or publish as part of a monograph), providing the link to the first publication of the work in this journal.
- Other terms stated in the Copyright Agreement.