# Artificial Intelligence in Mental Health: Detecting Depression and Anxiety Using Social Media Data

Daniel M Mami, Teo Rong Xuan

<figure><img src="image_1.png" /></figure>

## To cite this version:

Daniel M Mami, Teo Rong Xuan. Artificial Intelligence in Mental Health: Detecting Depression and Anxiety Using Social Media Data. International Neuropsychiatric Disease Journal, 2025, 22 (4), pp.111-123. 10.9734/indj/2025/v22i4499. hal-05175122

HAL Id: hal-05175122

https://hal.science/hal-05175122v1

Submitted on 22 Jul 2025

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_2.png" /></figure>
<figure><img src="image_3.png" /></figure>

# Artificial Intelligence in Mental Health:
# Detecting Depression and Anxiety
# Using Social Media Data

Daniel M. Mami a* and Teo Rong Xuan b

a Department of Community Medicine and Population Health, University of Alabama,
United States of America.

b Stanford Center on China's Economy and Institutions (SSCEI), Stanford University, Stanford,
CA -94305, United States of America.

## Authors' contributions

This work was carried out in collaboration between both authors. Both authors read and approved the
final manuscript.

## Article Information

DOI: https://doi.org/10.9734/indj/2025/v22i4499

**Open Peer Review History:**

This journal follows the Advanced Open Peer Review policy. Identity of the Reviewers, Editor(s) and additional Reviewers, peer review comments, different versions of the manuscript, comments of the editors, etc are available here: https://pr.sdiarticle5.com/review-history/139939

Received: 10/05/2025

Accepted: 14/07/2025

## Review Article

Published: 15/07/2025

## ABSTRACT

Mental health problems, including sadness and anxiety, have become important public health issues that affect more than 280 million people around the world. For treatment to work, it is important to diagnose problems early and start treatment right once. Unfortunately, standard therapeutic methods often fail because of underreporting, stigma, and limited access. As social media sites become more popular, user-generated content becomes a valuable source of real-time data for spotting early indicators of mental health problems. Artificial Intelligence (AI), notably machine learning and natural language processing (NLP) approaches, have shown a lot of promise in finding patterns in linguistic, behavioral, and multimodal indicators that are linked to psychological distress. This review looks at the present state of using AI to find sadness and anxiety using social media analysis. It goes into data sources, methods, feature engineering, model performance,

<footnote>*Corresponding author: E-mail: mailto:dmmami@crimson.ua.edu;</footnote>
ethical issues, and limitations. It also talks about important problems including algorithmic bias, privacy issues, and how to use AI systems in real-world mental health care. The article ends by talking about future research directions, such as creating models that can be understood, adding more culturally varied datasets, and hybrid human-AI diagnostic systems to help mental health practitioners and improve early intervention tactics.

Keywords: Artificial Intelligence (AI); mental health monitoring; depression detection; anxiety prediction; social media analysis; Natural Language Processing (NLP).

# 1. INTRODUCTION

One of the biggest health problems in the world in the 21st century is mental health diseases. According to the World Health Organization (WHO), depression and anxiety are two of the most frequent mental illnesses, affecting more than 280 million and 300 million people around the world, respectively (Anonymous, 2022). These illnesses not only make it hard for people to be well and get along with others, but they also add a lot to the world's disability and economic load (Rosario Quiro et al., 2024). Suicide, which is often connected to untreated depression, is one of the top causes of mortality among young adults. This shows how important it is to find and treat depression early (Ali, 2020).

Even though more people are aware of them, mental health illnesses are still not diagnosed or treated enough. People sometimes don't get treatment when they need it because of things like social stigma, cultural taboos, restricted access to healthcare specialists, and exorbitant expenditures (Asar, 2020). Also, traditional diagnostic approaches that rely mainly on patients reporting their own symptoms and frequent clinical exams don't show how mental health disorders change and develop over time. These strategies are typically based on personal opinion and can't be used on a wide scale to fulfill the mental health needs of many people, especially in places with few resources. Even with these problems, the digital revolution has made it possible to do new kinds of mental health research and help (Center for Drug Evaluation and Research, 2017). For billions of people, social media sites like Twitter, Facebook, Instagram, and Reddit are now a part of their everyday lives. These platforms are not just ways to talk to each other, but they are also ways to express yourself, and they often show how people are feeling, what they are thinking, and how they are feeling (Wang et al., 2016). A lot of people talk about their emotional problems, stressors, or changes in behavior online, and sometimes they're more honest than they are in person. This huge amount of user-generated

content gives us a unique chance to passively keep an eye on mental health in real time (Sledzianowski et al., 2021, Kacheru, 2020).

Researchers can get useful information from huge, complicated datasets thanks to artificial intelligence (AI), especially improvements in machine learning (ML) and natural language processing (NLP). AI can find signs of depression, anxiety, and other mental problems by looking at trends in language, posting behavior, and multimedia material. AI technologies may run all the time and without being seen, which could help catch worrying tendencies before they show up as clinical symptoms. AI is a valuable ally in the fight against the worldwide mental health epidemic because it can respond before something bad happens (Nilsen et al., 2022, Müller and Rooy, 2021).

The use of AI in mental health, notably through social media analysis, is a big change from reactive to preventive care. But there are certain problems with this method. There are a lot of problems that need to be properly looked at when it comes to data privacy, consent, algorithmic bias, and the ethical use of personal information. This review's goal is to give a full picture of the current status of AI-driven mental health detection using social media by looking at its methods, triumphs, limitations, and future possibilities (Gado et al., 2021).

# 2. RATIONALE FOR USING SOCIAL MEDIA DATA

Using social media data to find sadness and anxiety is a new way for behavioral research, digital communication, and artificial intelligence to work together (Fuente et al., 2020). The main reason for this is because more and more individuals are using digital platforms to communicate their thoughts, feelings, and daily lives. This kind of self-expression, which is typically free and quick, gives us a clear and unfiltered look into their mental condition. Traditional diagnostic tools depend on direct
interviews, self-reported questionnaires, or
clinician observations, which are typically limited
to certain times and places. Social media, on the
other hand, gives us continuous, naturalistic data
that we can look at across time and at a large
scale. More and more research shows that
psychological distress creates digital imprints
that can be easily examined using AI methods
(Bzdok and Meyer-Lindenberg, 2018,
Beauchaine et al., 2019).

One of the main reasons researchers use social media data in mental health studies is that these sites are everywhere and easy to get to. Twitter, Reddit, Facebook, and Instagram are examples of platforms that have billions of users throughout the world and millions of posts every day. This gives researchers access to huge amounts of data without needing people to actively participate in a clinical environment (Watters, 2021, Work, 2022). Most significantly, a lot of this data is public and free, so it's a great resource for passive observation and pattern detection. Social media, on the other hand, shows how a person's mood, behavior, and thoughts change over time, often in real-life situations and events. This is different from how therapeutic appointments are only episodic.

People with mental health issues typically act
differently online than they do in real life. Studies
have shown that people with depression tend to
use more first-person singular pronouns (such "I"
and "me"), use more negative emotion terms
(like "sad," "tired," and "lonely"), and be less
involved in good social interactions. In the same
way, those who are anxious may be more
worried about the future, use words that are
related to worry or fear, and post more often late
at night. Researchers have shown that these
language and behavior characteristics are
important signs that a person is mentally upset.
AI models can pick up on small details that
human evaluators might miss by looking at
language patterns, sentiment polarity, and even
how people use emojis (Using AI for Mental
Health, 2020). The visual and time-based parts
of social media conversations are also useful, in
addition to the text. For instance, studies have
shown that people with depression on Instagram
tend to appreciate photographs that are darker,
grayer, and less vibrant, and they are more
inclined to employ black-and-white filters (Jara-
Avellaneda, 2023, Kammerer-David and Murgas-
Téllez, 2024). The content and tone of shared
photographs, together with how often they are
posted and what filters are used, might give

clues about how a person is feeling inside.
Changes in how often someone posts, like
suddenly stopping or posting too much, might
also show mood swings, social retreat, or rising
worry. AI models can learn to spot these
changes over time and link them to symptoms of
depression or anxiety (Kowal et al., 2020).

It's important to note that social media can also give us information on how people interact with each other and how social support systems work, both of which are very important for mental health. The quality and quantity of social contacts, like how many replies a user gets, how those replies make them feel, and how deep the talks are, might show how connected or isolated they feel socially (Leiva and Cevazco, 2024). For instance, people with depression often say they feel alone or unsupported, and their online interactions may reflect this by having less reciprocity, fewer responses, or negative feedback. We can train machine learning algorithms to spot these trends, which will help us better comprehend the user's social situation. AI approaches make it easier to use social media data because they can be scaled up and automated (Lim, 2022). Traditional mental health screening techniques take a lot of time and money to use, and they are often hard to get to, especially in places with few resources or among groups that are already at risk. On the other hand, AI models can look at huge amounts of data in real time, detecting people who are at risk and possibly starting early intervention plans. These technologies can help doctors prioritize those who are at high risk and reach out to them in a timely manner (Macpherson, 2021). This can be very helpful when there aren't many mental health specialists available or when people don't want to get assistance because of stigma or other reasons. Also, social media monitoring is passive, so people don't have to actively use mental health services for detection to happen (Miner et al., 2019). A lot of people who are having mental health problems don't want to get help or don't realize how bad their symptoms are. Using AI to keep an eye on public digital traces could help find people who are at danger but would not be recognized or treated otherwise (Mogrovejo, 2022). This early detection can be very important because it is recognized that getting help quickly can improve treatment outcomes and lessen the long-term effects of mental health problems. But using social media to keep an eye on mental health also brings troubling ethical estimations and privacy issues that need to Canada to be wild with technological
progress. Even though the data may be available to the public, people rarely share personal posts to get help with their mental health (Nochaiwong, 2021). Even if it's legal, users may feel like their privacy is being infringed if they are watched without their permission. So, to make sure that this data is used responsibly, it needs to be clear, anonymous, and follow ethical rules. Also, it's really important to make sure that these AI systems aren't used to punish people or spy on them in ways that could hurt them or make stigma worse (Noroña et al., 2023).

## 3. DATA SOURCES AND DATASET CONSTRUCTION

The quality and variety of the datasets used to train and test AI models are what make AI-based mental health detection possible. Social media has a lot of user-generated content that shows how people think, feel, and act. This makes it a great place for psychological tests. But to get therapeutically useful information from this data, you need to carefully build the dataset, handle it ethically, and have a strong awareness of the unique features of each platform. This section talks about the social media sites that are most often used to get data, the methods used to make datasets, and the problems that come with these methods (Palomino-Quispe, 2023).

### 3.1 Social Media Platforms as Data Sources

Several social media platforms are frequently used in AI-based mental health research due to their accessibility and content structure. Each platform offers unique types of data and user behaviors (Mogrovejo, 2022, Nochaiwong, 2021, Noroña et al., 2023, Palomino-Quispe, 2023, Pareja, 2023, Rashid and Calhoun, 2020).

For instance, Twitter's short tweets make it good for text analysis and watching things happen in real time. Reddit's longer posts and subreddits that are only about one topic (like r/depression or r/anxiety) make it easier to judge how others feel. Instagram is mostly visual, but it has metadata (such filters used or brightness) that can show how someone is feeling. Facebook, on the other hand, has a long history of social connections but is ethically questionable because it is so private.

### 3.2 Dataset Construction Techniques

To train machine learning models, researchers must first label or classify the data into relevant categories such as “depressed,” “anxious,” or

“control (Restrepo & Estrin, 2024).” This labeling process can be challenging due to the absence of explicit clinical diagnoses. Researchers typically employ one or more of the following approaches (Ríos and Mosca, 2021, Ripoll-Rivaldo, 2023, Sajno et al., 2023, Segato et al., 2020).

Researchers often utilize distant supervision, which means that they presume that people who are active in certain subreddits or who use hashtags like #depression or #anxiety are likely to be going through those things. This method makes it easier to create big datasets, but it also adds label noise because not every post in these regions means a clinical diagnosis. On the other hand, clinically confirmed datasets are quite reliable, but they are hard to find because of privacy issues and the fact that it's hard to connect social media activity to electronic health records (Singla, 2021, Surianarayanan et al., 2023).

## 4. FEATURE ENGINEERING AND SIGNAL TYPES

Feature engineering is one of the most important steps in making AI models that can find mental health problems, especially when integrating data from social media. It means taking raw data—including text, photographs, timestamps, and user interactions—and picking out patterns that can show signs of mental health issues like despair and anxiety (Ullman, 2019). Because social media posts are casual, unstructured, and typically use more than one mode of communication, this stage needs a careful mix of language, temporal, behavioral, and visual analysis. The quality and relevance of the engineering features are very important for AI-based detection to work. People frequently put these features into four broad groups: linguistic, behavioral, visual, and multimodal.

Most AI models for finding sadness and anxiety are based on language features. Because much social media is text-based, especially Twitter and Reddit, natural language processing (NLP) is very important. People who are depressed or nervous typically use language in a way that is different from how they normally do. Studies have repeatedly demonstrated that people are using first-person singular pronouns like “I,” “me,” and “my” more often, which means they are focusing more on themselves. This desire to go inward and talk about oneself is very typical when someone is depressed (Valdes et al.,
2024). In the same way, people who show
indicators of psychological discomfort use
negative affect words like "sad," "tired,"
"worthless," or "hopeless" a lot more often. On
the other hand, the number of positive effect
words tends to go down. Researchers have also
found that those who are anxious are more likely
to use terms that show worry, dread, or
uncertainty, including "nervous," "afraid," or
"anxious." Using absolutist words like "always,"
"never," and "completely" a lot is another sign of
a mental condition. These words show cognitive
distortions that are common in people with
mental problems. People typically utilize
sentiment analysis tools, part-of-speech tagging,
and lexicon-based models like LIWC (Linguistic
Inquiry and Word Count) to measure these
trends in text. To find emotional or cognitive
disarray, researchers also look at things like how
complicated the syntax is, how long the
sentences are, how punctuation is used, and
how grammar is broken.

Behavioral characteristics may tell you a lot about how a user interacts with others on social media, much like the content they upload. People who are depressed may post less often or suddenly stop using the internet altogether. On the other hand, those who are anxious may publish too much or in strange ways. Posting at strange times, like late at night or early in the morning, is another activity that has been linked to sleep problems and mood issues. The circadian cycles that may be seen in timestamp data might assist find biological patterns that have been interrupted, which are often signs of anxiety and sadness. The type and quality of social contacts also give behavioral clues. For instance, a drop in likes, comments, or retweets could mean that someone is withdrawing from social media, while sudden changes in the size or activity of a social network could mean that someone is going through a lot of emotional pain. Some studies also look at how people use question marks or sentences that sound like pleas (such "help me" or "what's wrong with me") as signs of distress. In more advanced systems, graph-based metrics from the user's social network, such centrality and clustering coefficients, are utilized to figure out how connected, isolated, or influential someone is in a digital community.

In recent years, visual elements have gotten a lot
of attention, especially since image-based
networks like Instagram have become so
popular (Araujo, 2023, Hernández-Lugo, 2024,

Caballero-Cantu et al., 2023, Fernanda et al., 2023, Rasheed et al., 2023, Pérez and Díaz-Guerra, 2023). Visual clues can tell us a lot about how a person is feeling, even when there isn't much or no word data. According to research, those who are prone to depression prefer to upload pictures that are less brilliant, less saturated, and have a cooler color scheme, such grayscale or blue-toned pictures (Rincon and Sanchez, 2022, Farhaoui et al., 2023, Farhaoui et al., 2018). These choices about how things look may be unconscious ways of showing how you feel. Also, using certain Instagram filters, such "Inkwell" or "Willow," which make pictures black and white, has been connected to depression symptoms in a statistically significant way. Another strong visual sign is facial expression analysis. AI models can use computer vision techniques like convolutional neural networks (CNNs) to find indicators of unhappiness, tiredness, or a lack of emotional expression in selfies and group images. We also look closely at the content of the images. Pictures that show loneliness, messy places, or specific symbolic images (such rain, broken things, or dark themes) may show that the person is going through a lot of stress. For better understanding, visual elements are often integrated with metadata like image descriptions, hashtags, and geotags (Triantafyllou et al., 2024).

More and more people are realizing that multimodal fusion, which combines many forms of data (text, image, behavior), is the best way to find sadness and anxiety. Text-only or image-only models, for example, may miss subtle signals that come from the interaction of different modalities. For example, someone might share a dismal photo with a bright message or a happy-looking photo with a strange or sad hashtag. Multimodal AI models are made to find these kinds of inconsistencies. They can also look at temporal trends, like how a user's present conduct compares to their own historical behavior. This helps them tell the difference between transitory mood changes and long-term psychological suffering. Multimodal transformers and late-fusion models are examples of deep learning architectures that let you extract features from each modality separately and then make a judgment together. These models are very good at dealing with the noisy and varied nature of social media data, even if they take a lot of computing power. For instance, a model might look at a piece of writing to figure out how someone feels, look at a picture to see if it
makes them sad, and then connect this to how often people post at night to make it more likely that they have depression (Botvinick et al., 2020, Burba and Leardi, 2024).

## 5. AI TECHNIQUES AND MODEL ARCHITECTURES

There are a lot of different ways that artificial intelligence (AI) can be used to find sadness and anxiety in social media data. These range from traditional machine learning algorithms to the newest deep learning models. These methods learn from features taken from user-generated content, like text, pictures, and patterns of behavior (Campo et al., 2023, Chance et al., 2020). The type of data, how easy it is to understand, and how hard it is to compute all affect the choice of algorithm.

Support Vector Machines (SVM), Random Forests (RF), Naive Bayes (NB), and Logistic Regression (LR) are all common methods for generating initial models. Feature engineering is a big part of these methodologies. It involves turning text into numbers using methods like Bag of Words (BoW), TF-IDF (Term Frequency-Inverse Document Frequency), or word embeddings. Classical models are fast to compute and easy to understand, thus they work well with little datasets or when transparency is critical. But they don't always work well in complicated situations when there are non-linear and high-dimensional patterns (Cohen, 2022).

To get around these problems, people have used deep learning models like Convolutional Neural

Networks (CNNs) and Recurrent Neural Networks (RNNs) a lot. CNNs are good at working with visual data, like pictures from Instagram. RNNs, on the other hand, are great at processing sequential text data, such LSTM (Long Short-Term Memory) and GRU (Gated Recurrent Units), which can capture the flow of words over time and in context. More recently, transformer-based models like BERT (Bidirectional Encoder Representations from Transformers) and RoBERTa have done better because they can understand language's long-range dependencies and subtle meanings. These models are trained on huge amounts of data and then fine-tuned for tasks like classifying mental health conditions. This makes them much better at finding things.

Multimodal architectures are also becoming more common. They combine text, images, and behavior characteristics for a complete analysis. For example, a model might use the emotional tone of a tweet, the darkness of a shared image, and the fact that people post less often to make more accurate predictions. These systems generally use late-fusion tactics or attention mechanisms to make sure that all input types are balanced (D'Alfonso, 2020).

People often say that deep learning models are "black boxes," even if they are very powerful. So, explainable AI (XAI) methods are being added to show which words, images, or attributes had the biggest impact on a prediction. This is very important for use in healthcare contexts (González-García, 2023, Graham, 2019).

<figure><img src="image_4.png" /><figcaption>Fig. 1. Raw social media data must be preprocessed to enhance model performance. Preprocessing steps often include above steps</figcaption></figure>
<table><caption>Table 1. Data formats, advantages and limitations of several social media platforms</caption><thead><tr><td>Platform</td><td>Data Format</td><td>Advantages</td><td>Limitations</td></tr></thead><tbody><tr><td>Twitter</td><td>Short texts (tweets), timestamps, retweets, likes</td><td>Real-time updates, easy API access, popular in research</td><td>Limited content length (280 characters), context loss</td></tr><tr><td>Reddit</td><td>Long-form posts and threaded comments</td><td>Rich content, topic-based communities, anonymity encourages disclosure</td><td>Niche audience, limited metadata</td></tr><tr><td>Facebook</td><td>Status updates, photos, shares, likes</td><td>Broad demographic, personal experiences, media-rich content</td><td>API access restricted, ethical concerns regarding consent</td></tr><tr><td>Instagram</td><td>Images, captions, hashtags</td><td>Visual-based data, filter use reveals affective tone</td><td>Text content limited, harder to analyze visuals without annotations</td></tr><tr><td>YouTube/Comments</td><td>Videos, textual comments</td><td>Rich audio-visual data, context-rich comments</td><td>High noise-to-signal ratio, large data size</td></tr></tbody></table>

<table><caption>Table 2. Strengths and challenges of dataset construction techniques</caption><thead><tr><td>Dataset Type</td><td>Description</td><td>Strengths</td><td>Challenges</td></tr></thead><tbody><tr><td>Self-reported Data</td><td>Posts that explicitly mention a diagnosis (e.g., "I was diagnosed with depression today")</td><td>High specificity, real-world context</td><td>May be inaccurate or sarcastic, limited volume</td></tr><tr><td>Crowdsourced Labels</td><td>Human annotators classify posts based on predefined symptoms or DSM-V criteria</td><td>Scalability, useful for nuanced interpretation</td><td>Subjectivity, potential for inconsistency</td></tr><tr><td>Clinically Verified</td><td>Posts linked to clinical records (e.g., consented research with known mental health diagnoses)</td><td>Ground truth quality</td><td>Hard to obtain, privacy and ethics restrictions</td></tr><tr><td>Distant Supervision</td><td>Using proxies like subreddit memberships (e.g., r/depression) or use of keywords/hashtags</td><td>Large-scale dataset construction</td><td>Label noise, potential misclassification</td></tr><tr><td>Synthetic Data</td><td>Generated examples using templates or AI to balance datasets</td><td>Solves class imbalance, useful for pre-training</td><td>May lack real-world variation or nuance</td></tr></tbody></table>

<table><caption>Table 3. Summary of AI techniques used for detecting depression and anxiety</caption><thead><tr><td>AI Technique</td><td>Use Case</td><td>Strengths</td><td>Limitations</td></tr></thead><tbody><tr><td>Support Vector Machine (SVM)</td><td>Text classification (BoW, TF-IDF features)</td><td>High accuracy, interpretable</td><td>Limited to linear boundaries</td></tr><tr><td>Random Forest (RF)</td><td>Text + behavioral features</td><td>Robust to noise, works on small data</td><td>Prone to overfitting if not tuned</td></tr><tr><td>CNN</td><td>Image analysis (Instagram filters, selfies)</td><td>Effective in spatial pattern recognition</td><td>Needs large labeled image datasets</td></tr><tr><td>RNN / LSTM / GRU</td><td>Sequential text (tweets, Reddit posts)</td><td>Captures temporal context</td><td>Slower training, risk of vanishing gradients</td></tr><tr><td>BERT / Transformers</td><td>Contextual language understanding</td><td>State-of-the-art accuracy, pre-trained models</td><td>Computationally intensive</td></tr><tr><td>Multimodal Networks</td><td>Text + image + behavior</td><td>Rich representation, higher detection accuracy</td><td>Complex to train, requires multi-source data</td></tr><tr><td>Explainable AI (XAI)</td><td>All types (post-hoc analysis)</td><td>Improves trust and adoption</td><td>Still maturing in healthcare applications</td></tr></tbody></table>
## 6. MODEL PERFORMANCE AND VALIDATION

The ability of artificial intelligence (AI) to find sadness and anxiety in social media data depends a lot on how well the machine learning models work. Researchers use a number of performance measurements, including as accuracy, precision, recall, F1-score, and Area Under the Receiver Operating Characteristic Curve (AUC-ROC), to see how well their models work in the actual world. These numbers assist figure out how well a model can tell the difference between people who have mental health problems and those who don't (Graham, 2019). In a typical binary classification context (such depressed vs. not depressed), accuracy is the number of correct predictions, and precision is the number of cases that were expected to be positive that were actually positive. Recall checks how well the model can find all the real positive examples, and F1-score balances accuracy with recall, especially when the datasets are not balanced. AUC-ROC gives an overall picture of how well a system works at all categorization levels. This is especially significant in sensitive areas like mental health monitoring, where false negatives can have serious effects.

Studies in the real world have shown encouraging outcomes. For instance, models that use natural language processing (NLP) on Twitter datasets say they can find sadness with an accuracy rate of over 90%. In a multimodal configuration that used both text and image information from Instagram, Convolutional Neural Networks (CNNs) and linguistic feature extractors were able to get up to 94.2%

accuracy. Ensemble models like Random Forests and Gradient Boosting have F1-scores of about 0.85-0.90 for anxiety detection, which means they are quite good at classifying (Gual-Montolio et al., 2022).

Social media inputs (text, images, behavioral data) undergo feature extraction, followed by classification using machine learning or deep learning models. The final output is validated using standard evaluation metrics.

One of the most important uses has been to find people who are at danger of suicide early on. According to research from the CLPsych 2019 shared task, models could detect suicide thoughts an average of 7.2 days before the crisis, giving people a crucial chance to intervene. We trained models on Reddit postings using Bidirectional Encoder Representations from Transformers (BERT), which helped them recognize the linguistic context and emotional tone in a more complex way. But even though quantitative metrics say they are quite accurate, these models typically have trouble being used in the actual world and being able to be generalized. Models that were trained on English-language data might not work as well in communities that speak more than one language or have a lot of different cultures. Also, clinical adoption is limited because the model overfits to training data, doesn't have external validation, and can't explain its predictions. So, new studies stress that Explainable AI (XAI) methods should be used to make models more accurate as well as more understandable and open (Gual-Montolio et al., 2022, Horn and Weisz, 2020, Ibrahimi et al., 2023).

<figure><img src="image_5.png" /><figcaption>Fig. 2. The flowchart illustrates a typical AI-based pipeline for detecting depression and anxiety</figcaption></figure>
<figure><img src="image_6.png" /><figcaption>Fig. 3. Bar graph compares the performance of AI models in detecting depression and anxiety using social media data. Key metrics include Accuracy, Precision, Recall, F1-Score, and AUC-ROC. Depression models generally show slightly higher performance, especially in terms of recall and accuracy</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 4. AI-driven mental health monitoring workflow</figcaption></figure>

## 7. INTEGRATION INTO HEALTHCARE SYSTEMS

Integrating AI-based mental health detection techniques into real-world healthcare systems offers a game-changing chance to improve early

diagnosis, intervention, and ongoing monitoring of those who are at risk of depression and anxiety. AI-driven models can passively monitor user-generated social media content in real time, which allows for a proactive approach to mental health therapy. This is different from traditional
methods that rely on patients to visit and disclose
information. But for it to work, there needs to be
a connection between algorithmic identification
and clinical usefulness. Al systems can passively
screen people by keeping an eye on their online
activity all the time to look for changes in their
mood, negative sentiment trends, or patterns of
social retreat (Jara-Avellaneda, 2023).
These kinds of applications can send
notifications to healthcare doctors or other
specified contacts when certain levels of worry
are achieved when they are connected to social
media APIs. For instance, if a user keeps posting
about feeling despondent or having thoughts of
suicide, an AI system can flag the content for
prompt action.

Fig. 4 shows a potential AI-assisted mental health workflow. In this process, user data is gathered, pre-processed, and then analyzed by machine learning models. After that, mental health professionals sort the data and decide what to do next (D'Alfonso, 2020).

AI can be added to Decision Support Systems (DSS) that doctors utilize, in addition to alarm systems. These systems can give clinicians concise summaries of how patients use social media over time, how their feelings change, and their discovered risk scores. This helps clinicians make smart judgments regarding diagnosis and therapy. This method is especially useful for telehealth systems, which have grown a lot since COVID-19 and rely on tools for remote monitoring.

More and more people are using AI-based
mental health chatbots like Woebot, Wysa, and
Tess as their first line of defense. They don't take
the place of doctors or give formal diagnoses, but
they do help people deal with their feelings, learn
how to cope, and feel heard. These chatbots
employ natural language processing (NLP) to
understand what users say and provide them
responses that make sense in the context of
cognitive behavioral therapy (CBT). They also
give people who don't want to go to a therapist in
person a cheap, 24/7 way to get aid.

There are still problems with integration, even
with these improvements. Health systems need
to make sure that AI tools and Electronic Health
Records (EHRs) can work together, follow data
protection rules (including HIPAA and GDPR),
and develop trust with clinicians by using
explainable AI models. Also, skilled clinicians
should always look over AI-generated insights

before any therapeutic judgment is taken
(Farhaoui et al., 2023, Burba & Leardi, 2024,
Gual-Montolio et al., 2022).

8. CONCLUSIONS

Artificial Intelligence has changed the way we
keep an eye on mental health, especially when it
comes to finding signs of depression and anxiety
in social media data. AI systems can find early
signs of mental discomfort in real time by looking
at patterns in language, behavior, and visual
information posted online. This capacity has a lot
of potential for proactive mental health support,
especially for people who don't have easy
access to standard care. Still, there are a lot of
problems that need to be solved before AI
models can be used to make predictions with
high accuracy. Some of these are algorithmic
bias, datasets that don't have enough cultural
and linguistic variety, privacy and consent
difficulties, and poor clinical validation. Also,
deep learning models are sometimes too hard to
understand for use in real-world healthcare,
which worries both clinicians and regulatory
agencies. To make sure AI is used responsibly,
future research has to focus on creating AI
frameworks that are explainable, morally sound,
and open to everyone. It is important for mental
health experts, AI developers, ethicists, and
politicians to work together to close the gap
between what technologies can do and what it
can do in a therapeutic setting. In conclusion, AI
could change the way we find and keep an eye
on mental health problems early on through
social media, but it will only work if we take a
balanced approach that puts human dignity,
ethical norms, and collaboration between
different fields first.

DISCLAIMER (ARTIFICIAL INTELLIGENCE)

Author(s) hereby declare that NO generative AI
technologies such as Large Language Models
(ChatGPT, COPILOT, etc.) and text-to-image
generators have been used during the writing or
editing of this manuscript.

CONSENT AND ETHICAL APPROVAL

It is not applicable.

COMPETING INTERESTS

Authors have declared that no competing
interests exist.
REFERENCES

Al could help add $957 bn to Indian economy by 2035. (2017, December 22). NRS. Retrieved May 20, 2022, from https://nrsadvisors.com/ai-could-help-add-957-bn-to-indian-economy-by-2035

Ali, H. A. (2020). Importance of Artificial intelligence and neural network. TechEngage. https://techengage.com/artificial-intelligence-neural-network

Araujo Inastrilla, C. R. (2023). Tendencias de búsquedas en internet sobre el Metaverso. *Metaverse Basic Appl. Res.*, 2(26). https://doi.org/10.56294/mr202326

Asar, A. (2020). Five ways AI can help revolutionize mental healthcare.

Beauchaine, T. P., Bell, Z., Knapton, E., McDonough-Caplan, H., Shader, T., & Zisner, A. (2019). Respiratory sinus arrhythmia reactivity across empirically-based structural dimensions of psychopathology: A meta-analysis. *Psychophysiology*, 56.

Botvinick, M., Wang, J., Dabney, W., Miller, K., & Kurth-Nelson, Z. (2020). Deep reinforcement learning and its neuroscientific implications. *Neuron*, 107.

Burba, I. P., & Leardi, R. (2024). Isolation and depression in older adults in Argentina between 2020-2022. *SCT Proc Interdisc Insights Innovations*, 2.

Bzdok, D., & Meyer-Lindenberg, A. (2018). Machine learning for precision psychiatry: Opportunities and challenges. *Biological Psychiatry: Cognitive Neuroscience and Neuroimaging*, 3.

Caballero-Cantu, J. J., Chavez-Ramirez, E. C., López-Almeida, M. E., Inciso-Meno, E., & Méndez-Vergaray, J. (2023). El aprendizaje autónomo en educación superior. Revisión sistemática. *Salud, Ciencia y Tecnología*, 3, 391. https://doi.org/10.56294/saludcyt2023391

Campo Saltos, G., Villota Oyarvide, W., Andrade Sánchez, E., & Montero Reyes, Y. (2023). Análisis bibliométrico sobre estudios de la neurociencia, la inteligencia artificial y la robótica: énfasis en las tecnologías disruptivas en educación. *Salud, Ciencia y Tecnología*, 3.

Center for Drug Evaluation and Research. (2017). What are biomarkers and why are they important? Transcript. U.S. Food and Drug Administration.

https://www.fda.gov/drugs/biomarker-qualification-program/what-are-biomarkers-and-why-are-they-important-transcript

Chance, F., Aimone, J., Musuvathy, S., Smith, M., Vineyard, C., & Wang, F. (2020). Crossing the cleft: Communication challenges between neuroscience and artificial intelligence. *Front Comput Neurosci*, 14.

Cohen, Y. (2022). Recent advances at the interface of neuroscience and artificial neural networks. *J Neurosci*, 42.

D'Alfonso, S. (2020). AI in mental health. *Curr Opin Psychol*, 36.

Farhaoui, Y., et al. (2023). Big data mining and analytics, 6(3), I–II. https://doi.org/10.26599/BDMA.2022.9020045

Farhaoui, Y. (2018). Big data analytics applied for control systems. In Ezziyyani, M., Bahaj, M., & Khoukhi, F. (Eds.), *AITS 2017. LNNS (Vol. 25, pp. 408–415). Springer, Cham*. https://doi.org/10.1007/978-3-319-69137-4_36

Fernanda Lobaisa, N., & Payti Claros, T. M. (2023). Cultura, Sociedad y Salud. *Community Interculturality Dialogue*, 3(66). https://doi.org/10.56294/cid202366

Fuente Garcia, S., Ritchie, C. W., & Luz, S. (2020). Artificial intelligence, speech, and language processing approach to monitoring Alzheimer's disease: A systematic review. *Journal of Alzheimer's Disease*, 78.

Gado, S., Kempen, R., Lingelbach, K., & Bipp, T. (2021). Artificial intelligence in psychology: How can we enable psychology students to accept and use artificial intelligence? *Psychology Learning & Teaching*, 21.

González-García, J. C., Lozano-Pineda, C., Cuartas-Díaz, M., & Torres-Barreto, M. (2023). Ejercicio basado en el juego y centrado en la inteligencia emocional. *Región Científica*, 2.

Graham, S. (2019). Artificial intelligence for mental health and mental illnesses: An overview. *Curr Psychiatry Rep*, 21.

Gual-Montolio, P., Jaén, I., Martínez-Borba, V., Castilla, D., & Suso-Ribera, C. (2022). Using artificial intelligence to enhance ongoing psychological interventions for emotional problems in real- or close to real-time: A systematic review. *Int J Environ Res Public Health*, 19.

Hernández-Lugo, M. (2024). Artificial intelligence as a tool for analysis in social sciences:
Methods and applications. *LatLA*, 2(11).
https://doi.org/10.62486/latia202411

Horn, R., & Weisz, J. (2020). Can artificial intelligence improve psychotherapy research and practice? *Admin Policy Mental Health* **Mental Health Serv Res**, 47.

Ibrahimi, G., Merioumi, W., & Benchekroun, B. (2023). Favorecer la innovación mediante la inteligencia colectiva: Un análisis de la literatura. *Data Metadata*, 2.

Jara-Avellaneda, M. O., Huayta-Franco, Y. J., Saenz Arenas, E. R., & Cohaila Flores, J. M. (2023). Motivación en las aulas virtuales durante la COVID-19: Experiencias de estudiantes de enfermería. *Salud, Ciencia y Tecnología*, 3.

Kacheru, G. (2020). The role of AI-powered telemedicine software in healthcare during the COVID-19 pandemic. *Turkish Journal of Computer and Mathematics Education (TURCOMAT)*, 11(3).

Kammerer-David, M. I., & Murgas-Téllez, B. (2024). La innovación tecnológica desde un enfoque de dinámica de sistemas. *Región Científica*, 3.

Kowal, M., Conroy, E., Ramsbottom, N., Smithies, T., Toth, A., & Campbell, M. (2020). Gaming your mental health: A narrative review on mitigating symptoms of depression and anxiety using commercial video games. *JMIR Serious Games*, 9.

Leiva, M. L., & Cevazco, J. (2024). Need for cognitive closure and learning: Research gaps and future directions. *Salud, Ciencia y Tecnología: Proc Interdisc Insights Innovations*, 2.

Lim, J. (2022). Novel technical and privacy-preserving technology for artificial intelligence in ophthalmology. *Current Opinion in Ophthalmology*, 33.

Macpherson, T. (2021). Natural and Artificial Intelligence: A brief introduction to the interplay between AI and neuroscience research. *Neural Networks: Official Journal of the International Neural Network Society*, 144.

Miner, A., Shah, N., Bullock, K., Arnow, B., Bailenson, J., & Hancock, J. (2019). Key considerations for incorporating conversational AI in psychotherapy. *Frontiers in Psychiatry*, 10.

Mogrovejo Andrade, J. M. (2022). Estrategias resilientes y mecanismos de las organizaciones para mitigar los efectos ocasionados por la pandemia a nivel internacional. *Región Científica*, 1.

Müller, L., & Rooy, D. (2021). Digital biomarkers for the prediction of mental health in aviation personnel. *BMJ Health & Care Informatics*, 28.

Nilsen, P., Svedberg, P., Nygren, J., Frideros, M., Johansson, J., & Schueller, S. (2022). Accelerating the impact of artificial intelligence in mental healthcare through implementation science. *Implementation Research and Practice*, 3.

Nochaiwong, S. (2021). Global prevalence of mental health issues among the general population during the coronavirus disease-2019 pandemic: A systematic review and meta-analysis. *Scientific Reports*, 11.

Noroña González, Y., Colala Troya, A. L., & Peñate Hernández, J. I. (2023). La orientación para la proyección individual y social en la educación de jóvenes y adultos: Un estudio mixto sobre los proyectos de vida. *Región Científica*, 2.

Palomino-Quispe, J. F. (2023). El papel transformador de la tecnología en la educación médica. *Salud, Ciencia y Tecnología*, 4.

Pareja Pera, L. Y. (2023). Uso de dispositivos móviles en la promoción de la salud y el bienestar en estudiantes universitarios. *Salud, Ciencia y Tecnología*, 3.

Pérez Gamboa, A. J., & Díaz-Guerra, D. D. (2023). Artificial intelligence for the development of qualitative studies. *LatLA*, 1(4). https://doi.org/10.62486/latia20234

Rasheed, Z., Ghwanmeh, S., & Zaid, A. (2023). Aprovechamiento de la inteligencia artificial para el aprendizaje personalizado: Una revisión sistemática. *Data Metadata*, 2, 146.
https://doi.org/10.56294/dm2023146

Rashid, B., & Calhoun, V. (2020). Towards a brain-based predictome of mental illness. *Human Brain Mapping*, 41.

Restrepo, D. A. P., & Estrin, M. A. (2024). Suicidal tendency associated with Levetiracetam: A systematic review. *SCT Proc Interdisc Insights Innovations*, 2.

Rincon Soto, I. B., & Sanchez Leon, N. S. (2022). Cómo la inteligencia artificial configurará el futuro del metaverso. Una perspectiva cualitativa. *Metaverse Basic and Applied Research*, 1, 12.
https://doi.org/10.56294/mr202212

Ríos, N. B., & Mosca, A. M. (2021). Educación continua en el contexto actual, enfoque desde la enfermería. *Salud, Ciencia y Tecnología*, 1.
Ripoll-Rivaldo, M. (2023). El emprendimiento social universitario como estrategia de desarrollo en personas, comunidades y territorios. *Región Científica, 2*.

Rosario Quiro, F. J., Calla Vásquez, K. M., Ochoa Tataje, F. A., Morí Holguín, J. Y., & Villanueva-Batallanos, M. (2024). Revisión sistémica de los estudios de ciberbullying en adolescentes hispanoamericanos. *Salud, Ciencia y Tecnología, 4*.

Sajno, E., Bartolotta, S., Tuena, C., Cipresso, P., Pedroli, E., & Riva, G. (2023). Machine learning in biosignals processing for mental health: A narrative review. *Frontiers in Psychology, 13*.

Segato, A., Marzullo, A., Calimeri, F., & Momi, E. (2020). Artificial intelligence for brain diseases: A systematic review. *APL Bioengineering, 4*.

Singla, D. (2021). Scaling up psychological treatments: Lessons learned from global mental health. *American Psychologist, 76*.

Sledzianowski, A., Urbanowicz, K., Glac, W., Slota, R., Wojtowicz, M., Nowak, M., et al. (2021). Face emotional responses correlate with chaotic dynamics of eye movements. *Procedia Computer Science, 192*.

Surianarayanan, C., Lawrence, J., Chelliah, P., Prakash, E., & Hewage, C. (2023). Convergence of artificial intelligence and neuroscience towards the diagnosis of neurological disorders—A scoping review. *Sensors (Basel, Switzerland), 23*.

Triantafyllou, S. A., et al. (2024). Gamification and computational thinking in education: A systematic literature review. *Salud, Ciencia y Tecnología - Serie de Conferencias, 3*, 659.
https://doi.org/10.56294/sctconf2024659

Ullman, S. (2019). Using neuroscience to develop artificial intelligence. *Science, 363*.

Using AI for mental health. (2020). Verywell Health.
https://www.verywellhealth.com/using-artificial-intelligence-for-mental-health-4144239

Valdes, D. V., Villar, I. M. H., Rojas, Y. C. F., Rodríguez, Y. S., & Romero, G. (2024). Medical science education in COVID-19 times. *Salud, Ciencia y Tecnología: Proc Interdisc Insights Innovations, 2*.

Wang, Z., Xie, L., & Lu, T. (2016). Research progress of artificial psychology and artificial emotion in China. *CAAI Transactions on Intelligence Technology, 1*.

Watters, E. (2021). From Fitbit to Mindfit: The stress management score helps people recognize how their body reacts to stress. *Fitbit Blog*.
https://blog.fitbit.com/fitbit-stress-management-approach

Work, I. A. (2022). Improving mental health with machine learning. *IEEE Innovation at Work*.
https://innovationatwork.ieee.org/improving-mental-health-with-machine-learning

**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of the publisher and/or the editor(s). This publisher and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

© Copyright (2025): Author(s). The licensee is the journal publisher. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Peer-review history:
The peer review history for this paper can be accessed here:
https://pr.sdiarticle5.com/review-history/139939