Predicting depression and anxiety: an AI X social media collaboration

Written by Emma Hall (Digital Editor)

While it usually contributes to the problem, in this case, scientists have used social media for good to help predict individuals at risk of mental health disorders such as depression and anxiety.

A group of scientists from the University of São Paulo (Brazil) are creating prediction models for mental health conditions such as anxiety and depression. Through employing a combination of AI techniques and data from social media, the model has the potential to identify early indications of these conditions prior to diagnosis.

We all know that, in general, social media isn’t the best for our mental health. We are aware of the countless studies that have found powerful links between frequent social media use and the risk of developing anxiety and depression. I am sure some, if not most of us have found ourselves suppressing the overwhelming impatience to check our notifications for likes, comments or messages. And I am certain some of us have found ourselves falling victim to the dreaded FOMO (fear of missing out).

It is estimated that approximately 1 in 4 adults will suffer from a mental health disorder each year. Globally, 210 million people suffer from social media addiction, the majority of which are teenagers and young adults. To break this down further, individuals who spend the most time on social media platforms such as Instagram, Facebook and Twitter have a significantly increased likelihood of developing severe depression and anxiety disorder, with some studies reporting a threefold increased risk, particularly among teenagers and young adults. These are staggering statistics.

Mental health disorders are becoming a rising concern. The COVID-19 pandemic has only increased the global prevalence of depression and anxiety: the World Health Organization estimated a 25% rise in these mental health disorders in the first year of the pandemic.

While past research has applied natural language processing to study associations between social media and mental health disorders such as bipolar disorder, depression and anxiety, these have mostly included English narratives and are not necessarily representative of Brazilian users, who rank third among the countries that consume the most social media globally.

The team from São Paulo are now in a position to combat this growing concern. Information comprising a corpus of Portuguese texts and network-related connections, from 3900 Twitter users who self-reported a treatment or diagnosis for mental health problems, was used to construct a database termed SetembroBR, named after an annual suicide awareness and prevention campaign.

The corpus encompassed all publicly posted tweets that were tweeted by the users during the COVID-19 pandemic (excluding retweets), which amounted to a whopping 47 million texts. Tweets posted by friends and followers were also included since previous research has demonstrated that individuals suffering from mental health disorders usually engage with accounts of people who have shared interests and publicly discuss their depression, such as influencers, celebrities and certain discussion forums. All texts were anonymized.

Two datasets were utilized to differentiate between the general population and those suffering from depression. The first dataset included individuals who self-reported a mental health disorder diagnosis while the second dataset was selected at random for control purposes. Although the study is currently still ongoing, the team have some preliminary results.

When analyzing the datasets, the team eliminated any hashtags, emoticons, non-standard characters and URLs from the texts. The team utilized AI deep learning, based on artificial neural networks, to generate word embeddings (representations of words with similar meaning) and four text classifiers utilizing a machine learning algorithm for natural language processing, termed BERT. Parameters were established by cross-validating the training data (a random sample of 200 tweets from each user) five times and calculating the average.

The results indicated that BERT was statistically significant better at predicting anxiety and depression, when compared to the next best alternative model LogReg. The models discovered that individuals with depression were inclined to write using phrases and verbs in the first person about themes they connected to, in addition to subjects concerning psychology, crisis and death.

“The signs of depression that can be detected during a visit to the doctor aren’t necessarily the same as the ones that appear on social media,” Paraboni commented. “For example, use of the first-person singular pronouns I and me was very evident, and in psychology this is considered a classic sign of depression. We also observed frequent use of the heart emoji by depressive users. This is widely felt to be a symbol of affection and love, but maybe psychologists haven’t yet characterized it as such.”

At present, these results are very promising. The team are currently expanding the database and refining their computational models in the hope that they can provide a tool with the ability to screen and identify individuals with a risk of developing mental health disorders. This AI model has the potential to assist and guide the management and treatment of mental health disorders, as well as help the sufferers’ friends and families.