Depressive Emotion Detection and Behavior Analysis of Men Who Have Sex With Men via Social Media

Yong Li, Mengsi Cai, Shuo Qin, Xin LüFrontiers in Psychiatry 2020 · DOI

TL;DR

This paper introduces a machine learning approach using social media data to detect depressive emotions in men who have sex with men (MSM). By analyzing posts from a popular MSM-oriented app (Blued) and a general social media platform (Twitter), the study identifies key linguistic and behavioral features that predict depression, offering a scalable method for early detection in a high-risk population.

What Problem Does This Paper Address?

Depression is a significant public health concern, particularly for men who have sex with men (MSM), who face higher rates of stigma, discrimination, and related mental health challenges like HIV. Traditional methods for diagnosing depression, such as questionnaires, are often limited by sample size, accessibility, and the reluctance of individuals to seek help early on. The authors aim to bridge this gap by leveraging the vast amount of data available on social media platforms to develop an automated, scalable, and timely method for detecting depressive emotions within the MSM community. This early detection could facilitate timely intervention and support.

Methods

The core of this research lies in applying a machine learning algorithm, specifically XGBoost, to analyze social media data for depressive emotion detection. XGBoost, a gradient-boosted decision tree algorithm, was chosen for its strong performance and interpretability.

The methodology involved several key steps:

  • Data Collection: Publicly available data was scraped from Blued (an MSM-focused geosocial networking app) and Twitter (a general social media platform).
  • Data Preprocessing: This included handling emojis, removing topic tags and mentions, stemming words, segmenting Chinese text, and filtering stop-words.
  • Feature Extraction: A comprehensive set of 19 features was engineered, categorized into:
  • User Profile Features: Basic user information like followings and followers.
  • Social Interaction Features: Metrics related to post engagement (favors, reposts), mentions, and posting frequency/timing.
  • Emotion Features: Counts of positive and negative words, and emoticons.
  • Linguistic Features: This was a crucial group, including topic modeling (LDA) to extract salient words, counts of antidepressant drug mentions, and the presence of "depressive" keywords.
  • Model Training and Evaluation: The XGBoost model was trained on labeled datasets and evaluated using accuracy, recall, precision, and F1-score. Feature importance analysis was conducted to understand which features contributed most to the detection.

Datasets

The study utilized two primary datasets:

  • Blued Database: This dataset comprised data from the most popular MSM-oriented geosocial networking mobile application. It was divided into:
  • B_D1 (Depression Data Set): Labeled users with posts indicating depression or suicidal thoughts.
  • B_D2 (Non-Depression Data Set): Labeled users who had not posted content related to depression.
  • B_D3 (Depression-Candidate Data Set): An unlabeled dataset used to expand the sample of potential depressed users. This dataset contained approximately 13 million posts from 664,335 users.

  • Twitter Database: This was a publicly available benchmark dataset used for comparison and validation, representing non-MSM users. It was also divided into similar labeled and unlabeled sets (T_D1, T_D2, T_D3). This dataset contained over 51 million users and 41 million tweets.

Key Insights and Ideas

  • Linguistic Features Dominate: The study strongly suggests that linguistic features (words, topics, and timing of posts) are the most significant indicators of depressive emotions, outperforming user profile and social interaction features. This highlights how people express their internal states through their language online.
  • MSM Express Emotions More Directly: Compared to non-MSM users on Twitter, MSM users on Blued tend to express emotions more directly, using more emoticons and emotional words. This could be a cultural or community-specific communication style.
  • Time of Posting as a Key Indicator: The time distribution of posts (timeDist) emerged as a crucial feature, particularly for MSM users. This might be linked to sleep disturbances or altered daily routines often associated with depression.
  • "Depressive Words" are Highly Predictive: The presence of words containing "depress" or related terms was a very strong predictor, especially in the Blued dataset. This underscores the direct way individuals might self-identify or express their struggles.
  • Social Media as a Window into Mental Health: The research validates the idea that social media platforms, despite their informal nature, can serve as a valuable source of data for understanding and detecting mental health conditions like depression.

Key Results

  • High Model Performance: The XGBoost model achieved excellent classification performance on both the Blued and Twitter datasets, with accuracy rates around 96-99% and F1 scores around 96%. This demonstrates the robustness of the approach.
  • Feature Importance: The top three most important features for depressive emotion detection across both datasets were depressWordNum (presence of depressive words), LDATopicWords (salient topics from LDA), and timeDist (posting time distribution). These three features accounted for approximately 84% of the total feature importance.
  • Behavioral Differences:
    • Depressed MSM users posted more negative and positive words, suggesting a tendency to express emotions more openly.
  • MSM users, in general, showed higher online activity throughout the day compared to non-MSM users, potentially indicating a stronger reliance on social networks or issues like insomnia.
  • Depressed MSM users were more likely to use words like "depressed," "depression," and "die" in their posts, indicating a direct expression of their mental state.

Limitations and Future Work

  • Identification of MSM Users: The method for identifying MSM users on Blued was based on the platform's nature, while on Twitter, it involved removing accounts that explicitly identified as gay. This could lead to misclassifications and affect the representativeness of the MSM sample.
  • Accuracy of Depression Identification: The paper acknowledges that identifying depressed users based on posts containing "depressed" or suicidal thoughts is a less precise method compared to clinical diagnoses.
  • Generalizability: While the model performed well on Blued and Twitter, its effectiveness on other platforms (e.g., Facebook, Instagram) needs further investigation.

Future work suggested by the authors includes:

  • Improving the representativeness of MSM samples from online data.
  • Investigating the association between depression, stigma, and sexual risk behaviors in MSM.
  • Exploring the use of online recruitment methods for future research.
  • Potentially integrating other social media platforms to create a more comprehensive picture.

Summary updated

Abstract

The online MSM depressive emotion detection using machine learning can provide a proper and easy-to-use way in real-world applications, which help identify high-risk individuals at the early stage of depression for further diagnosis.
BibTeX
@inproceedings{li2020depressive,
  author = {Yong Li and Mengsi Cai and Shuo Qin and Xin Lü},
  title = {{Depressive Emotion Detection and Behavior Analysis of Men Who Have Sex With Men via Social Media}},
  booktitle = {Frontiers in Psychiatry},
  year = {2020},
  doi = {10.3389/fpsyt.2020.00830},
}
Figure