A TIME-AWARE TEMPORAL BERT FRAMEWORK FOR LONGITUDINAL DETECTION OF DEPRESSIVE AND SUICIDE-RELATED RISK PATTERNS IN SOCIAL MEDIA

Authors

DOI:

https://doi.org/10.37943/25DSSM6014

Keywords:

Temporal BERT, time-aware transformers, longitudinal mental health monitoring, depression detection, suicide risk detection, early warning modeling, psycholinguistic features, user-level trajectory analysis

Abstract

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.

Author Biographies

Yntymak Abdrazakh, Khoja Akhmet Yassawi International Kazakh-Turkish University

Master of Science, Department of Computer Engineering

Batyrkhan Omarov, International Information Technology University

PhD in Information and Communication Technologies, Associate Professor, Faculty of Computer Technology and CyberSecurity

Aigerim Baimakhanova, Khoja Akhmet Yassawi International Kazakh-Turkish University

PhD in Information System, Senior Lecturer, Department of Computer Engineering

Arypzhan Aben, Khoja Akhmet Yassawi International Kazakh-Turkish University

Master of Science, Department of Computer Engineering

Aigerim Sultanali, Khoja Akhmet Yassawi International Kazakh-Turkish University

Master of Science, Department of Computer Engineering

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

2026-03-30

How to Cite

Abdrazakh, Y., Omarov, B., Baimakhanova, A., Aben, A., & Sultanali, A. . (2026). A TIME-AWARE TEMPORAL BERT FRAMEWORK FOR LONGITUDINAL DETECTION OF DEPRESSIVE AND SUICIDE-RELATED RISK PATTERNS IN SOCIAL MEDIA. Scientific Journal of Astana IT University, 25. https://doi.org/10.37943/25DSSM6014

Issue

Section

Information Technologies