Next Article in Journal
Analysis and Design Multiple Layer Adaptive Kalman Filter Applied to Electro-Optical Infrared Payload Vision System
Next Article in Special Issue
A Review on Deep Learning Techniques for IoT Data
Previous Article in Journal
Index Matrices—Based Software Implementation of Power Electronic Circuit Design
Previous Article in Special Issue
The Estimation of the Potential for Using Smart-Trackers as a Part of a Medical Indoor-Positioning System
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Deep Learning for Depression Detection from Textual Data

1
Department of Computer Science, Kinnaird College for Women, Lahore 44000, Pakistan
2
Department of Cyber Security, Air University, Islamabad 44000, Pakistan
3
Department of Information Technology, College of Computer and Information Sciences, Princess Nourah bint Abdulrahman University, P.O. Box 84428, Riyadh 11671, Saudi Arabia
4
Department of Information Technology, College of Computing and Informatics, Saudi Electronic University, Riyadh 93499, Saudi Arabia
5
Symbiosis Institute of Technology, Symbiosis International (Deemed) University, Pune 412115, India
6
School of Digital Science, Universiti Brunei Darussalam, Bandar Seri Begawan BE1410, Brunei
*
Authors to whom correspondence should be addressed.
Electronics 2022, 11(5), 676; https://doi.org/10.3390/electronics11050676
Submission received: 15 January 2022 / Revised: 5 February 2022 / Accepted: 7 February 2022 / Published: 23 February 2022

Abstract

:
Depression is a prevalent sickness, spreading worldwide with potentially serious implications. Timely recognition of emotional responses plays a pivotal function at present, with the profound expansion of social media and users of the internet. Mental illnesses are highly hazardous, stirring more than three hundred million people. Moreover, that is why research is focused on this subject. With the advancements of machine learning and the availability of sample data relevant to depression, there is the possibility of developing an early depression diagnostic system, which is key to lessening the number of afflicted individuals. This paper proposes a productive model by implementing the Long-Short Term Memory (LSTM) model, consisting of two hidden layers and large bias with Recurrent Neural Network (RNN) with two dense layers, to predict depression from text, which can be beneficial in protecting individuals from mental disorders and suicidal affairs. We train RNN on textual data to identify depression from text, semantics, and written content. The proposed framework achieves 99.0% accuracy, higher than its counterpart, frequency-based deep learning models, whereas the false positive rate is reduced. We also compare the proposed model with other models regarding its mean accuracy. The proposed approach indicates the feasibility of RNN and LSTM by achieving exceptional results for early recognition of depression in the emotions of numerous social media subscribers.

1. Introduction

Depression is a risk indicator of Dementia. People suffering from Dementia tend to notice a decline in their cognitive abilities such as thinking and remembering [1,2,3]. According to the World Health Organization (WHO), depression affects more than 300 million individuals across the world [4]. Depression can badly affect personal well-being, family affairs, and workplace educational institutions, and lead to personal injuries. Depression is one of the major causes of mental disorder, or incapability [5]. Early recognition and treatment of depressive symptoms can significantly improve the chances of controlling the disease of depression and minimize the negative impact of depression on the well-being, health and the social–economic life of a person. Identification of depressed and non-depressed individuals from online social media is a very crucial task. Social media information, communication, and posts describe the user’s sentimental condition [6]. However, their sentimental status will be vigorous and can lead to uncertain detection of depression. The most prevalent procedures employed at present are clinical interviews and questionnaire surveys conducted by hospitals or agencies [7], where psychiatric assessment tables are used to establish mental disorder prognosis.
This method is primarily based on one-on-one surveys and can diagnose depression as a psychic condition. The examination of informal texts submitted by users is a substitute for interview- or questionnaire-based depression forecasts. Previous clinical psychological research has revealed that the link between a dialectal user (a presenter or composer) and text is significant and could lead to opportunities in the future [8]. Online records and data are becoming more widely recognized as viable data sources for healthcare decision-making [9]. Artificial Intelligence (AI)- and Natural language Processing (NLP)-based processing techniques help machine learning identify depression from sentiments or emotions [10]. Among the different approaches, machine learning has been widely utilized to examine humans’ physical and mental conditions from various data sources [11,12,13,14]. The major fear in this area is making and implementing illogical AI decisions and lacking explanations about the models’ behavior.
The portrayal of substantial depressive cues from the literature is one of the most challenging tasks. Previous research has discovered that an automated textual analysis of depressive symptoms can be used in, for example, detecting disrespectful or depressing phrases or sentences in conversations or blog postings, as well as sentiment recovery from suicide notes [1,15,16,17]. The categorization of shared blog posts is critical to examine to save the lives of any desperate individuals. However, research extracting depression symptoms from texts still has promise.
In addition, recognizing depression symptoms from brief texts presents a significant challenge. To help resolve these ultimatums, we want to create an algorithm that can automatically detect depressive signs from texts using a text-based sample for people who need advice about self-anticipated depressive indications. Figure 1 shows the basic procedure for identifying depressive text from tweets by implementing the preprocessing and feature engineering steps on the data. Then, the data are passed through the training and testing process to make the prediction. The main contributions of this work are as follows:
1.
We provide a detailed discussion of depression, depressive symptoms, and its types. This study concentrates on processing textual data and detecting depressive traits.
2.
We extract features from a text dataset using One-Hot encoding method and Principal Component Analysis (PCA) to represent possible depression symptoms and sentiments in tweeter data.
3.
We propose a deep learning model using LSTM, with 60 LSTM units with two hidden states and bias factors, and an RNN with two hidden layers for the early detection of depression by training the model with depressive and non-depressive sample data.
4.
We evaluate the proposed prediction model using the Tweets-scraped depression dataset and evaluate the proposed model using the following evaluation matrices: precision, accuracy, f1-measure, and support.
5.
The evaluation results show that the proposed framework improves accuracy by detecting depression from textual data.
This research paper examines the related research works that have offered a solution for identifying depression in social media in Section 2. Section 3 discusses the proposed methodology, used for early depression detection. Section 4 provides a discussion of the results obtained from experiments. The conclusion and future task is discussed in Section 5.

2. Literature Review

Artificial intelligence approaches, such as machine learning, have been used in several studies on the early classification of depression. Syms and JS Raj in [18] suggested the use of N-gram language modeling to classify the anxiety levels of generated emotional characteristics and vector integration with topic analysis. Orabi in [19] suggested the use of the Continuous Bag of words (CBOW) embedding technique to detect depression from the Twitter dataset. Kim Jin in [20] discussed the impact of using a supervised machine learning algorithm to measure predictive factors for detecting post-traumatic stress disorder. They built a model in every language style, using Twitter users as part of their research. Wonkoblap.A in [21] proposed a deep neural network method to analyze depression in social media. They used the Twitter dataset for analysis. Q un Nisa in [22] used convolutional neural networks to compare a variety of models. For the prediction of emotions, it is dependent on linguistic metadata. They had success with the proposed strategy when completing state-of-the-art jobs.
Most research investigations on the identification of depression are based on textual data or person-descriptive methods using social media posts to select features. The linguistic elements of the social media content, such as words, Part-of-Speech (POS), N-grams, and other linguistic properties, are the subject of textual-based featuring [23]. The descriptive-based featured technique emphasizes subject descriptions, including age, gender, employment position, income, drug or alcohol consumption, smoking, and other personal information about the subject or patient [24].
Ibitoye A.O in [25] examined two studies that employed the predictive ability of supervised machine-learning classifiers to analyze the interaction of emotions. They classified depression-related posts on social media using classification methods. Table 1 contains the summary of research carrid out by researchers on various algorithms for the early detection of depression from 2017 to 2021. Trifan Alina et al. in [26] suggested a rule-based estimator using a tf-idf weighting technique for the bag-of-words characteristics to detect depression from the Reddit social media site. Mathur and Puneet in [27] proposed a solution using Bidirectional LSTM (BLSTM) + Attention model for the early detection of depression from the historic tweets of Twitter users.

Limitations of Existing Works

The literature review has studied numerous depression detection and prevention methodologies, which were implemented using data mining. Previous frameworks focused on discovering depression from limited phrases, sentences, and blog posts, with low accuracy. However, research extracting depression symptoms from texts still has much promise, and this is one of the most difficult challenges when detecting significant melancholy from a concise text. To diagnose depression, the majority of the researchers used a single machine-learning method. Furthermore, the researchers concentrated on the accuracy value to decide which algorithm is most-suited to the situation. The investigators also applied a single equal-size dataset to each algorithm. We raise the following research questions, which must be observed.
1.
What are the difficulties in implementing a text-based depression detection?
2.
What is the most effective text-based approach for early-stage depression detection?
3.
How can we examine which factors are most efficient in detecting depression?
However, the limitation of each article, as listed above, is the pitfall and key to stressing the algorithm for better performance. Thus, to overcome the limitations of existing works, we used the data pr-processing and deep learning techniques in our framework for the early detection of depression from user tweets. We used the performance evaluation metrics to analyze model efficiency.

3. Proposed Methodology

The methodology starts with data collection. We obtained an extensive unbalanced data set of tweets from the Kaggle website [38]. The data were cleansed and balanced before data pre-processing began. Next, the data were segmented, stemmed, and lemmatized as part of the normalization process. The data were then processed to determine a word score. The data were passed into machine-learning classifiers to predict depressed and non-depressed text tweets. The data were divided into two categories: training and testing split sets. The training data were utilized to create the sample framework to ensure that the classifier develops. Once the sample framework was trained against the data for assessment, the test data were loaded into it.

3.1. Data Pre-Processing

The data were pre-processed in the first phase of the detection model. Pre-processing includes the transformation and normalization of data. To clean the dataset, URLs, retweets, mentions, and stop-words were removed from the dataset. Each row of the dataset was then tokenized by breaking the text into tokens or words. After that, the tokenized words were subjected to stemming and lemmatization. The stemmed input text was processed through the One-Hot procedure to extract features from these input words. The features were binary patterns that could be employed in the machine learning prediction model to predict depression (1 represents depressed, and 0 represents other words). The list of depressive sentences and words is represented in Figure 2, extracted from the dataset. Figure 3 represents some depressive tweets taken from the dataset.
Algorithm 1 was used to extract unique depressive features from the dataset. The one-hot technique was used to identify and measure the frequencies of all important depressive words instead of typical Term Frequency–Inverse Document Frequency(TF-IDF). Thus, the one-hot binary features based on depressive symptoms can be expressed as M i for the ith text in the dataset.
Algorithm 1 Feature-Extraction From Text
1:
Begin
2:
L = 1
3:
n = Number of Feature Sentences
4:
for i = 1 to n do
5:
   Feature = Obtain Feature_Sentence
6:
   Tokenized_Feature = Separate Words From Feature
7:
   for Word in Tokenized_Feature do
8:
     if Word in Text then
9:
        M[L]=1
10:
     else
11:
        M[L]=0
12:
     end if
13:
     L = L + 1
14:
   end for
15:
end for
16:
Return M
17:
End

3.2. Features Visualization Using Principal Component Analysis (PCA)

We embraced a dimensionality reduction technique called PCA to visualize features. PCA performs decomposition using the covariance matrix to generate eigenvalues to minimize the inner scattering of samples and maximize inter-class scattering. The Equations (1) and (2) show the inner and inter-class scattering of matrices.
F D = 1 n 1 i = 1 n ( X i X ¯ j ) ( X i X ¯ j ) T
F E = 1 n 1 i = 1 n x k ϵ C i ( X i X ¯ j ) ( X i X ¯ j ) T
where n represents number of features, x k represents feature vector, x i represents mean and x j represents mean of all feature vectors. PCA calculates and normalize the eigen values by taking the determinant of the feature matrix. In Equation (3) S represents the feature matrix, λ represents the eigen value and I is the identity matrix used to calculate the value of eigen vector for PCA.
d e t ( S λ I ) = 0
In Equation (4) the S feature matrix shows the optimization of features using determinant and transpose method.
S o p t = | S T F D S | | S T F E S |
The Figure 4 shows the 3 D plot representation of PCA, which provides optimal features after reduction using the principal component analysis technique.

3.3. Modeling LSTM-RNN for Emotional State Analysis

While conversing with others, sentiments can be expressed as time-sequential sentences in textual data. Machine-learning models are pretty capable of encoding time-sequential data. We implemented RNN because it is the most optimal method for working with sequential data. RNN comprises recurrent connections with past and present states and hidden states. Memory plays an essential function in neural networks and sometimes faces gradient disappearing problems. LSTM is the solution to memory-processing-related problems. Figure 5 shows the basic structure of RNN containing 60 units of LSTM.
As Figure 5 shows, in every LSTM block, there is a cell state and a gate state. The gate state consists of three gates: an input gate, a forget gate, and the result gate. The input gate can be represented as in Equation (5):
I n p u t t = σ ( X L I L t + U H L H t 1 + b t )
Here, X is input, U is weight matrix, b is bias function, t is timestamp and σ is used for logistic operation. The input gate can be described as represented in Equation (6):
F o r g e t t = σ ( X L F L t + U H F H t 1 + b f )
The LSTM is represented by a cell state vector Z, which can be written as shown in Equation (7)
Z t = F t Z t 1 + F t p a n h ( X L Z L t + U H Z H t 1 + b Z )
The output gate O can be described as represented in Equation (8):
O t = σ ( X L O L t + U H O H t 1 + b O )
The hidden layer can be represented as shown in Equation (9)
h t = O t p a n h ( Z t )
Before applying the dense layer, we deployed an attention layer on the LSTM [39] units, as represented in Equation (10)
a ( a t t e n t i o n ) t = L S T M ( h t , a ( a t t e n t i o n ) t 1 )
The attention method is used to improve the model’s accuracy; that is, the logic of applying the attention approach to the upper layer of LSTM. The attention approach emphasizes critical information in the present objective above irrelevant information. A “SoftMax” function can be used to determine the output results described in Equation (11), where “U” is the weighted function and “b” is the bias function.
R e s u l t = S o f t M a x ( U R A R + b R )
The Algorithm 2 is for the dataset training and Algorithm 3 is for the prediction of depressed and non-depressed text implemented through the LSTM-RNN model.
Algorithm 2 Model For Training Text
1:
Begin
2:
Q = Number of Training Text Samples
3:
for i = 1 to Q do
4:
   Obtain i t h Text, T = training _Text(i).
5:
   Obtain features Y i
6:
   Assign label of i t h Text to Z i
7:
end for
8:
Obtain all training features Y, and labels, Z
9:
Train an LSTM recurrent network R, based on Y and Z
10:
End
Algorithm 3 Prediction Model
1:
Begin
2:
Obtain features Y
3:
P = Weights after applying Y on the trained LSTM, R
4:
Q = Weights of the final 2 neurons in P
5:
T = Arg _ Max(Q)
6:
if T = 0 then
7:
   Decision = Depressed
8:
else
9:
   decision = Non-Depressed
10:
end if
11:
End

4. Experimental Analysis and Discussion

4.1. Dataset Description

Dataset assessment is crucial for testing and assessing the performance of any detection system. The quality dataset is the key to producing valuable and efficient results. We used a Tweets-Scraped dataset containing more than 4000 tweets that are publicly available on Kaggle [38]. The dataset contains both depressed and non-depressed tweets. Table 2 represents some meaningful depressive and non-depressive sentences that we obtained after data preprocessing.

4.2. Evaluation Metrics

We determine the precision, recall, support, accuracy, and F-1 measure to increase the performance of our prediction model. A detailed description of the metrics used for evaluation is given below. Accuracy is the number of correctly predicted examples divided by the total number of forecasts generated by the model, and every method can behave differently in terms of correctly categorised instances, as shown in Equation (12).
A c c u r a c y = T p + T n T p + F p + F n + T n
Overall precision prediction anticipated positive results. This refers to the number of people who were classified as depressed and who are genuinely predicted to be depressed and could be determined using the formula represented in Equation (13):
P r e c i s i o n = T p T p + F p
Recall predicts how many positive depression cases were accurately predicted by the model out of all the positive cases. The recall percentage is calculated by multiplying the TP by the total of the TP and FN and its Equation (14) is
R e c a l l = T p T p + F n
The value of the F-Measure evaluates the harmonization of two factors based on precision and recall because they measure distinct features represented in Equation (15)
F 1 M e a s u r e = 2 * P r e c i s i o n * R e c a l l P r e c i s i o n + R e c a l l
The results of the tweeter dataset after applying a deep recurrent neural network algorithm are explained here. We break the whole dataset into fractions of 90% and 10% for the training sample and testing set procedure. We put the model dataset on Intel(R) Core-i7 CPU with a speed of 3.0 GHz, memory of 64 GB, Window 10 OS, TensorFlow with Keras library (deep learning tools) to test the proposed solution. Four-fold and ten-fold cross-validation was performed on the dataset, and the highest accuracy, of 99.66%, was achieved from 10-fold cross-validation. Table 3 shows the experimental results of the classification of 10-fold cross validation on the dataset using the proposed solution. The precision of depressive tweets is 99%, while the precision of non-depressed tweets is 97%.
In the testing experiment, 90% of the data were taken for training and 10% for testing. Figure 6 and Figure 7 depicts a confusion matrix of the proposed solution with 4-fold and 10-fold cross-validation. Figure 6 shows a 99.15% mean accuracy for 4-fold cross-validation with a 0.9691% true positive and 0.0309% false positive rate for depressed tweets, and a 0.0049% false negative rate and 0.9951% true negative rate for non-depressed tweets. Figure 7 represents the 99.66% mean accuracy of 10-fold cross-validation, with a 0.9944% true positive rate and 0.0056 false positive rate of depressed tweets, while there was a 0.0030% false negative rate and 0.9970 true negative rate for non-depressed tweets.
The proposed framework performs exceptionally well and provides the highest accuracy results. The LSTM saves the words recorded in the memory for an extended period, which helps it compare words for the identification of depression from textual tweets. The overall performance of the trained model is excellent and satisfactory. The accuracy and epoch of the proposed framework for the whole training dataset are represented in Figure 8 below. The epoch represents the cycle of training data and the achieved accuracy. The accuracy increases as the epoch increases.
We compare the proposed model with [4]. They used a text dataset of Norwegian young people’s information on the online channel: ung.no to detect depression by implementing the LSTM approach, while we implemented the model on tweets from the tweeter dataset. They used the linear discrimination method for feature extraction, while we used PCA, an unsupervised learning technique, for the robustness of features and to improve the accuracy. We applied LSTM with two hidden layers and a large bias factor to obtain better results. We also evaluated the results with classification metrics. We also compared the proposed model’s performance with different approaches; the results are shown in Table 4. We obtained 97.21% mean accuracy for SVM 97.31% for naive Bayes. We obtained 83% mean accuracy by implementing a one-hot approach on SVM, while we obtained 85% mean accuracy with the TF-IDf technique. The one-hot method with decision trees gives us 82% mean accuracy, CNN with the TF-IDf approach offers 91% accuracy, and DBN with a one-hot approach provides 89% mean accuracy. LSTM obtained the highest accuracy with a one-hot technique implemented using the proposed solution.

5. Conclusions

It is critical to automatically recognize depression from text to help depressed patients in healthcare departments. A multivariate human depression prognosis strategy based on a one-hot methodology for robust features was examined to characterize depressive symptoms from the text data using the RNN approach with the LSTM technique. The large textual dataset was obtained from the kaggle website. Then, stemming and lemmatization and a robust one-hot and PCA technique were activated on the dataset for data cleaning and feature extraction. After that, to simulate two different emotional states, depressed and non-depressed, one-hot features were used to train a deep RNN-LSTM approach. Then, the trained model was utilized to predict textual data. An accuracy of 99% was attained by implementing the proposed solution with a reduced false positive rate. The evaluation results showed that our framework offers high accuracy, precision, recall, and F1-measures compared to the Naive Bayes, SVM, CNN, and Decision Trees. The attributes employed in this study can significantly facilitate machine learning judgments and lead to an effective user interface for improved services. Recognition of anxiety and depression from the text might be employed in mental healthcare units for real-time prediction analysis of normal and severe states of mood disorders. In the future, we intend to implement the hybrid recurrent neural network on a large dataset of mentally disturbed people to observe their behavior.

Author Contributions

This research specifies below the individual contributions. Conceptualization, A.A., A.R.J. and M.R.; data curation, M.R.; formal analysis, A.A.; funding acquisition, M.U., M.A., R.A.; investigation, S.P., A.A.; methodology, A.A.; project administration, M.A. and A.R.J.; resources, R.A., S.P. and A.R.J.; software, A.A.; supervision, A.A. and M.A.; validation, M.R. and R.A.; visualization, M.R. and M.A.; writing—review and editing, S.P., A.R.J. and R.A. All authors have read and agreed to the published version of the manuscript.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Acknowledgments

This research was funded by Princess Nourah bint Abdulrahman University Researchers Supporting Project Number (PNURSP2022R97), Princess Nourah bint Abdulrahman University, Riyadh, Saudi Arabia.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Dong, Y.; Yang, X. A hierarchical depression detection model based on vocal and emotional cues. Neurocomputing 2021, 441, 279–290. [Google Scholar] [CrossRef]
  2. Javed, A.R.; Fahad, L.G.; Farhan, A.A.; Abbas, S.; Srivastava, G.; Parizi, R.M.; Khan, M.S. Automated cognitive health assessment in smart homes using machine learning. Sustain. Cities Soc. 2021, 65, 102572. [Google Scholar] [CrossRef]
  3. Javed, A.R.; Sarwar, M.U.; ur Rehman, S.; Khan, H.U.; Al-Otaibi, Y.D.; Alnumay, W.S. PP-SPA: Privacy preserved smartphone-based personal assistant to improve routine life functioning of cognitive impaired individuals. Neural Process. Lett. 2021, 1–18. [Google Scholar] [CrossRef]
  4. Uddin, M.Z.; Dysthe, K.K.; Følstad, A.; Brandtzaeg, P.B. Deep learning for prediction of depressive symptoms in a large textual dataset. Neural Comput. Appl. 2022, 34, 721–744. [Google Scholar] [CrossRef]
  5. Depression, W. Other Common Mental Disorders: Global Health Estimates; World Health Organization: Geneva, Switzerland, 2017; pp. 1–24. [Google Scholar]
  6. Aladağ, A.E.; Muderrisoglu, S.; Akbas, N.B.; Zahmacioglu, O.; Bingol, H.O. Detecting suicidal ideation on forums: Proof-of-concept study. J. Med. Internet Res. 2018, 20, e9840. [Google Scholar] [CrossRef]
  7. Wang, S.; Peng, G.; Zheng, Z.; Xu, Z. Capturing emotion distribution for multimedia emotion tagging. IEEE Trans. Affect. Comput. 2019, 12, 821–831. [Google Scholar] [CrossRef]
  8. Havigerová, J.M.; Haviger, J.; Kučera, D.; Hoffmannová, P. Text-based detection of the risk of depression. Front. Psychol. 2019, 10, 513. [Google Scholar] [CrossRef]
  9. Javed, A.R.; Sarwar, M.U.; Beg, M.O.; Asim, M.; Baker, T.; Tawfik, H. A collaborative healthcare framework for shared healthcare plan with ambient intelligence. Hum.-Centric Comput. Inf. Sci. 2020, 10, 1–21. [Google Scholar] [CrossRef]
  10. Zehra, W.; Javed, A.R.; Jalil, Z.; Khan, H.U.; Gadekallu, T.R. Cross corpus multi-lingual speech emotion recognition using ensemble learning. Complex Intell. Syst. 2021, 7, 1845–1854. [Google Scholar] [CrossRef]
  11. Tjoa, E.; Guan, C. A survey on explainable artificial intelligence (XAI): Towards medical XAI. arXiv 2019, arXiv:1907.07374. [Google Scholar] [CrossRef]
  12. Javed, A.R.; Faheem, R.; Asim, M.; Baker, T.; Beg, M.O. A smartphone sensors-based personalized human activity recognition system for sustainable smart cities. Sustain. Cities Soc. 2021, 71, 102970. [Google Scholar] [CrossRef]
  13. Usman Sarwar, M.; Rehman Javed, A.; Kulsoom, F.; Khan, S.; Tariq, U.; Kashif Bashir, A. Parciv: Recognizing physical activities having complex interclass variations using semantic data of smartphone. Softw. Pract. Exp. 2021, 51, 532–549. [Google Scholar] [CrossRef]
  14. Javed, A.R.; Sarwar, M.U.; Khan, S.; Iwendi, C.; Mittal, M.; Kumar, N. Analyzing the effectiveness and contribution of each axis of tri-axial accelerometer sensor for accurate activity recognition. Sensors 2020, 20, 2216. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  15. Ding, Y.; Chen, X.; Fu, Q.; Zhong, S. A depression recognition method for college students using deep integrated support vector algorithm. IEEE Access 2020, 8, 75616–75629. [Google Scholar] [CrossRef]
  16. Ghayvat, H.; Pandya, S.; Awais, M.; Dev, K. STRENUOUS: Edge-Line Computing, AI and IIoT enabled GPS Spatiotemporal data-based Meta-transmission Healthcare Ecosystem for Virus Outbreaks Discovery. IEEE Internet Things J. 2022. [Google Scholar] [CrossRef]
  17. Pandya, S.; Sur, A.; Solke, N. COVIDSAVIOR: A Novel Sensor-Fusion and Deep Learning Based Framework for Virus Outbreaks. Front. Public Health 2021, 9, 797808. [Google Scholar] [CrossRef]
  18. Smys, S.; Raj, J.S. Analysis of Deep Learning Techniques for Early Detection of Depression on Social Media Network—A Comparative Study. J. Trends Comput. Sci. Smart Technol. (TCSST) 2021, 3, 24–39. [Google Scholar]
  19. Orabi, A.H.; Buddhitha, P.; Orabi, M.H.; Inkpen, D. Deep learning for depression detection of twitter users. In Proceedings of the Fifth Workshop on Computational Linguistics and Clinical Psychology: From Keyboard to Clinic, New Orleans, LA, USA, 5 June 2018; pp. 88–97. [Google Scholar]
  20. Kim, J.; Lee, D.; Park, E. Machine Learning for Mental Health in Social Media: Bibliometric Study. J. Med. Internet Res. 2021, 23, e24870. [Google Scholar] [CrossRef]
  21. Wongkoblap, A.; Vadillo, M.; Curcin, V. Depression Detection of Twitter Posters using Deep Learning with Anaphora Resolution: Algorithm Development and Validation. JMIR Ment. Health. 2021. Available online: https://kclpure.kcl.ac.uk/portal/en/publications/depression-detection-of-twitter-posters-using-deep-learning-with-anaphora-resolution-algorithm-development-and-validation(1b1ef794-5c96-4890-a0a2-04bf74323540).html.
  22. Un Nisa, Q.; Muhammad, R. Towards transfer learning using BERT for early detection of self-harm of social media users. In Proceedings of the Working Notes of CLEF 2021—Conference and Labs of the Evaluation Forum, Bucharest, Romania, 21–24 September 2021. [Google Scholar]
  23. Chiong, R.; Budhi, G.S.; Dhakal, S. Combining sentiment lexicons and content-based features for depression detection. IEEE Intell. Syst 2021, 36, 99–105. [Google Scholar] [CrossRef]
  24. Fujita, H.; Selamat, A.; Lin, J.C.W.; Ali, M. Advances and Trends in Artificial Intelligence: From Theory to Practice: 34th International Conference on Industrial, Engineering and Other Applications of Applied Intelligent Systems, IEA/AIE 2021, Kuala Lumpur, Malaysia, 26–29 July 2021: Proceedings; Springer Nature: Berlin/Heidelberg, Germany, 2021; Volume 12799. [Google Scholar]
  25. Ibitoye, A.O.; Famutimi, R.F.; Olanloye, D.O.; Akioyamen, E. User Centric Social Opinion and Clinical Behavioural Model for Depression Detection. Int. J. Intell. Inf. Syst. 2021, 10, 69. [Google Scholar]
  26. Trifan, A.; Antunes, R.; Matos, S.; Oliveira, J.L. Understanding depression from psycholinguistic patterns in social media texts. Adv. Inf. Retr. 2020, 12036, 402–409. [Google Scholar]
  27. Mathur, P.; Sawhney, R.; Chopra, S.; Leekha, M.; Shah, R.R. Utilizing temporal psycholinguistic cues for suicidal intent estimation. Adv. Inf. Retr. 2020, 12036, 265–271. [Google Scholar]
  28. Aldarwish, M.M.; Ahmad, H.F. Predicting depression levels using social media posts. In Proceedings of the 2017 IEEE 13th International Symposium on Autonomous Decentralized System (ISADS), Bangkok, Thailand, 22–24 March 2017; pp. 277–280. [Google Scholar]
  29. Shen, G.; Jia, J.; Nie, L.; Feng, F.; Zhang, C.; Hu, T.; Chua, T.S.; Zhu, W. Depression Detection via Harvesting Social Media: A Multimodal Dictionary Learning Solution. In Proceedings of the IJCAI, Melbourne, Australia, 19–25 August 2017; pp. 3838–3844. [Google Scholar]
  30. Islam, M.R.; Kabir, M.A.; Ahmed, A.; Kamal, A.R.M.; Wang, H.; Ulhaq, A. Depression detection from social network data using machine learning techniques. Health Inf. Sci. Syst. 2018, 6, 8. [Google Scholar] [CrossRef] [PubMed]
  31. Nguyen, T.L.; Kavuri, S.; Lee, M. A fuzzy convolutional neural network for text sentiment analysis. J. Intell. Fuzzy Syst. 2018, 35, 6025–6034. [Google Scholar] [CrossRef]
  32. Gaikar, M.; Chavan, J.; Indore, K.; Shedge, R. Depression Detection and Prevention System by Analysing Tweets. In Proceedings of the 2019: Conference on Technologies for Future Cities (CTFC), Panvel, India, 8–9 January 2019. [Google Scholar]
  33. Burdisso, S.G.; Errecalde, M.; Montes-y Gómez, M. A text classification framework for simple and effective early depression detection over social media streams. Expert Syst. Appl. 2019, 133, 182–197. [Google Scholar] [CrossRef] [Green Version]
  34. Farima, I.; Ud Din Abbasi, B.; Khan, S.; Al-Saeed, M.; Farroq Ahmad, H.; Mumtaz, R. Prediction of postpartum depression using machine learning techniques from social media text. Expert Syst. 2019, 36, e12409. [Google Scholar]
  35. AlSagri, H.S.; Ykhlef, M. Machine learning-based approach for depression detection in twitter using content and activity features. IEICE Trans. Inf. Syst. 2020, 103, 1825–1832. [Google Scholar] [CrossRef]
  36. Kim, J.; Lee, J.; Park, E.; Han, J. A deep learning model for detecting mental illness from user content on social media. Sci. Rep. 2020, 10, 11846. [Google Scholar] [CrossRef]
  37. De Souza Filho, E.M.; Rey, H.C.V.; Frajtag, R.M.; Cook, D.M.A.; de Carvalho, L.N.D.; Ribeiro, A.L.P.; Amaral, J. Can machine learning be useful as a screening tool for depression in primary care? J. Psychiatr. Res. 2021, 132, 1–6. [Google Scholar] [CrossRef]
  38. Cho, H.K. Twitter Depression Data Set Tweets Scraped from Twitter, Depressed and Non-Depressed. 2021. Available online: https://www.kaggle.com/hyunkic/twitter-depression-dataset (accessed on 15 January 2022).
  39. Xiao, L.; Xue, Y.; Wang, H.; Hu, X.; Gu, D.; Zhu, Y. Exploring fine-grained syntactic information for aspect-based sentiment classification with dual graph neural networks. Neurocomputing 2022, 471, 48–59. [Google Scholar] [CrossRef]
Figure 1. Procedure of Depression Detection.
Figure 1. Procedure of Depression Detection.
Electronics 11 00676 g001
Figure 2. Some depressive sentences and words from dataset.
Figure 2. Some depressive sentences and words from dataset.
Electronics 11 00676 g002
Figure 3. Some depressive tweets from data set.
Figure 3. Some depressive tweets from data set.
Electronics 11 00676 g003
Figure 4. 3-D plot after PCA on robust emotional state features.
Figure 4. 3-D plot after PCA on robust emotional state features.
Electronics 11 00676 g004
Figure 5. Basic Architecture for 60 LSTM Units.
Figure 5. Basic Architecture for 60 LSTM Units.
Electronics 11 00676 g005
Figure 6. Fold-4 Confusion Matrix of Proposed Model.
Figure 6. Fold-4 Confusion Matrix of Proposed Model.
Electronics 11 00676 g006
Figure 7. Fold-10 Confusion Matrix of Proposed Model.
Figure 7. Fold-10 Confusion Matrix of Proposed Model.
Electronics 11 00676 g007
Figure 8. 10-Fold Accuracy and Epoch.
Figure 8. 10-Fold Accuracy and Epoch.
Electronics 11 00676 g008
Table 1. Summary of Related Works from 2017 to 2021. Keys: NB—Naive Bayes, SVM—Support Vector Machine, LR—Linear Regression, DT—Decision Tree, RF—Random Forest, CNN—Convolutional Neural Network, MLP—Multi-Layer Perceptron, MDL—Minimum Description Length, MSNL—Multiple Social Network Learning, WDL—Weighted Deep learning, GB—Gradient Boosting, SS3—a text classification method.
Table 1. Summary of Related Works from 2017 to 2021. Keys: NB—Naive Bayes, SVM—Support Vector Machine, LR—Linear Regression, DT—Decision Tree, RF—Random Forest, CNN—Convolutional Neural Network, MLP—Multi-Layer Perceptron, MDL—Minimum Description Length, MSNL—Multiple Social Network Learning, WDL—Weighted Deep learning, GB—Gradient Boosting, SS3—a text classification method.
ReferenceYearMethodFindingsLimitations
Aldarwish [28]2017SVM, NBNB gives high accuracyData-set is in Arabic
Shen G. [29]2017MDL, MSNL, NB, WDLMDL accuracy is highFocused on user confession
Islam M.R. [30]2018DT, SVM, K-NearestDT gives best resultsData focus on comments
Nguyen T.L. [31]2018DT, SVM, EnsembleDT gives high accuracyData focus on comments
Gaikar M. [32]2019NB, SVM Hybrid model85% AccuracyTime Consuming
Burdisso S.G. [33]2019SS3, NB, SVM, KNNSS3 is bestTime Consuming
Farima [34]2019MLP, SVM, NBMLP is BestLimited Data-set
Alsagri [35]2020SVM, DT, NBSVM gives high accuracyCannot avoid over-fit data
Kim J. [36]2020CNN, XGBoostCNN accuracy is highLimited Scope
Filho De Souza [37]2021DT, SVM, RF, GB, LRRF provides high accuracyFocus on user confession
Table 2. Some important depressive and non-depressive sentences.
Table 2. Some important depressive and non-depressive sentences.
DepressedNon-Depressed
End my lifeI’m Happy
Suicidal thoughtsHaving fun
Always tiredEnjoying movie
Feeling Sadjoyful
have no appetiteIn happy mood
CryingEnjoying life
Why I’m always negligiblePlaying
UnmotivatedInspired
Nothing interests meFeeling motivated
Table 3. Fold-10 Result of Proposed Methodology.
Table 3. Fold-10 Result of Proposed Methodology.
Predicted
Output
State
DepressedNon-DepressedMean
Precision0.990.970.98
Recall0.981.000.99
F1-measure0.990.970.98
Support9981901181
Table 4. Prediction accuracy with different approaches.
Table 4. Prediction accuracy with different approaches.
ApproachesMean Accuracy (%)
SVM97.21
Naive bayes97.31
One-hot + SVM83
TF-IDf + SVM85
One-hot + Decision Trees82
TF-IDF + CNN91
one-hot + DBN89
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Amanat, A.; Rizwan, M.; Javed, A.R.; Abdelhaq, M.; Alsaqour, R.; Pandya, S.; Uddin, M. Deep Learning for Depression Detection from Textual Data. Electronics 2022, 11, 676. https://doi.org/10.3390/electronics11050676

AMA Style

Amanat A, Rizwan M, Javed AR, Abdelhaq M, Alsaqour R, Pandya S, Uddin M. Deep Learning for Depression Detection from Textual Data. Electronics. 2022; 11(5):676. https://doi.org/10.3390/electronics11050676

Chicago/Turabian Style

Amanat, Amna, Muhammad Rizwan, Abdul Rehman Javed, Maha Abdelhaq, Raed Alsaqour, Sharnil Pandya, and Mueen Uddin. 2022. "Deep Learning for Depression Detection from Textual Data" Electronics 11, no. 5: 676. https://doi.org/10.3390/electronics11050676

APA Style

Amanat, A., Rizwan, M., Javed, A. R., Abdelhaq, M., Alsaqour, R., Pandya, S., & Uddin, M. (2022). Deep Learning for Depression Detection from Textual Data. Electronics, 11(5), 676. https://doi.org/10.3390/electronics11050676

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop