[Paper Review] Towards Preemptive Detection of Depression and Anxiety in Twitter
This paper introduces DATD, a Twitter-based dataset for detecting depression and anxiety through binary tweet classification, and evaluates state-of-the-art language models (e.g., BERT, ALBERT) and traditional classifiers (e.g., SVM with TF-IDF and word embeddings). Results show that pre-trained language models outperform traditional methods on balanced data, but performance gaps emerge with class imbalance and counterintuitive linguistic cues, highlighting the need for improved contextual understanding in mental health detection systems.
Depression and anxiety are psychiatric disorders that are observed in many areas of everyday life. For example, these disorders manifest themselves somewhat frequently in texts written by nondiagnosed users in social media. However, detecting users with these conditions is not a straightforward task as they may not explicitly talk about their mental state, and if they do, contextual cues such as immediacy must be taken into account. When available, linguistic flags pointing to probable anxiety or depression could be used by medical experts to write better guidelines and treatments. In this paper, we develop a dataset designed to foster research in depression and anxiety detection in Twitter, framing the detection task as a binary tweet classification problem. We then apply state-of-the-art classification models to this dataset, providing a competitive set of baselines alongside qualitative error analysis. Our results show that language models perform reasonably well, and better than more traditional baselines. Nonetheless, there is clear room for improvement, particularly with unbalanced training sets and in cases where seemingly obvious linguistic cues (keywords) are used counter-intuitively.
Motivation & Objective
- To develop a high-quality, publicly available dataset (DATD) for detecting depression and anxiety in Twitter posts.
- To evaluate the performance of state-of-the-art pre-trained language models (e.g., BERT, ALBERT) and traditional machine learning models (e.g., SVM with TF-IDF and word embeddings) on this detection task.
- To identify limitations in current models, particularly regarding class imbalance and counterintuitive use of linguistic cues.
- To provide qualitative insights into model failures and guide future improvements in mental health detection systems.
Proposed method
- Collected 1.2 million English-language tweets from May 2018 to August 2019 using Twitter’s Stream API.
- Constructed the DATD dataset through expert annotation of 1,000 tweets, labeling them as either indicative of depression/anxiety (1) or not (0), with inter-annotator agreement measured at Fleiss’ kappa = 0.63.
- Combined TF-IDF features with pre-trained word embeddings (GloVe) and applied them to SVM classifiers, both with and without preprocessing.
- Fine-tuned BERT and ALBERT on the DATD dataset for end-to-end classification, leveraging their contextual representations without further fine-tuning on Twitter-specific data.
- Conducted two experimental setups: DATD (original split) and DATD+Rand (randomly shuffled labels) to assess model robustness.
- Performed qualitative error analysis on misclassified tweets to identify linguistic patterns that evade detection, such as irony, metaphor, or non-literal use of positive words.
Experimental results
Research questions
- RQ1How do pre-trained language models like BERT and ALBERT compare to traditional classifiers (e.g., SVM with TF-IDF and word embeddings) in detecting depression and anxiety in Twitter posts?
- RQ2To what extent does class imbalance in the training data affect the performance of different classification models?
- RQ3What types of linguistic patterns—especially non-literal or counterintuitive expressions—commonly lead to model misclassification?
- RQ4Why do certain models succeed where others fail, particularly in cases requiring world or semantic understanding?
- RQ5Can qualitative analysis of misclassified examples reveal systematic limitations in current models for mental health detection?
Key findings
- BERT achieved the highest F1 score of 0.737 on the DATD dataset, outperforming traditional models, indicating strong performance despite no fine-tuning on Twitter data.
- ALBERT achieved the highest recall (0.880) on the DATD+Rand setup, suggesting better sensitivity to positive cases in unbalanced settings.
- SVMs with combined TF-IDF and word embedding features achieved an F1 score of 0.750, outperforming simpler TF-IDF or word embedding baselines.
- The naïve baseline (predicting all labels as positive) achieved 100% recall but only 50% precision and F1 of 0.670, highlighting the challenge of class imbalance.
- Several tweets with ironic or metaphorical expressions—such as "got a yellow phone case hoping it will cure my depression"—were misclassified by all models except BERT and SVM with hybrid features, indicating the need for deeper semantic understanding.
- Qualitative analysis revealed that models often fail when linguistic cues are used counterintuitively (e.g., positive words in negative contexts), and that only LMs correctly interpreted contextually nuanced expressions like "watching these game lol mans be stressed but these games good as hell".
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.