Docsity

Depression Detection using Machine Learning Report, High school final essays of Biology

Toggle sidebar
bg1
VISVESVARAYA TECHNOLOGICAL UNIVERSITY
"Jnana Sangama", Belgaum: 590018
A Technical Seminar (17CSS86)
Report on
“Depression Detection using Machine Learning”
Submitted in partial fulfillment of the requirement for the award of the degree of
Bachelor of Engineering
in
Computer Science & Engineering
Submitted by
Anwesha Das (1AY17CS017)
Under the guidance of
Ms. Kavitha M S
Assistant Professor
Department of Computer Science & Engineering, AIT
ACHARYA INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
(Affiliated to Visvesvaraya Technological University, Belgaum)
Soladevanahalli, Bangalore – 560090
2020-2021
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Depression Detection using Machine Learning Report and more High school final essays Biology in PDF only on Docsity!

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

"Jnana Sangama", Belgaum: 590018

A Technical Seminar (17CSS86)

Report on

“Depression Detection using Machine Learning” Submitted in partial fulfillment of the requirement for the award of the degree of Bachelor of Engineering in Computer Science & Engineering

Submitted by

Anwesha Das (1AY17CS017)

Under the guidance of

Ms. Kavitha M S

Assistant Professor Department of Computer Science & Engineering, AIT

ACHARYA INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING (Affiliated to Visvesvaraya Technological University, Belgaum) Soladevanahalli, Bangalore – 560090

ACHARYA INSTITUTE OF TECHNOLOGY

(Affiliated to Visvesvaraya Technological University, Belgaum) Soladevanahalli, Bangalore – 560090

DEPARTMENT OF COMPUTER SCIENCE &

ENGINEERING

Certificate

Certified that the Technical Seminar Report (17CSS86) entitled “Depression Detection using Machine Learning” is a bonafide work carried out by Anwesha Das (1AY17CS017) in partial fulfillment for the award of degree of Bachelor of Engineering in Computer Science & Engineering of the Visvesvaraya Technological University , Belgaum during the year 2020-

2021. This work has been approved as it satisfies the academic requirements for Bachelor of Engineering Degree.

Name and Signature of the Guide Signature of the HOD

ABSTRACT

Depression is a major health issue that imparts major impact on the stability of mind. With the extension of various social media platforms, an expansion of number of different platforms enabled people to interact and share their experiences. These provided a large dataset for identification of common traits among depressed people and identify them using various machine learning algorithms. The limit to which we can identify the depressed traits of the person is necessary to determine the level of depression. The classification plays a major role in determining the kind of help a depressed person needs and also, the person with suicidal thoughts need to be identified and helped according to his condition.

Machine learning (ML) has been introduced into the medical field as a means to provide diagnostic tools capable of enhancing accuracy and precision while minimizing laborious tasks that require human intervention. There is mounting evidence that the technology fueled by ML has the potential to detect, and substantially improve treatment of complex mental disorders such as depression. By developing a framework capable of detecting depression with minimal human intervention: AiME (Artificial Intelligence Mental Evaluation), it is possible. AiME consists of a short human-computer interactive evaluation and artificial intelligence, namely deep learning, and can predict whether the participant is depressed or not with satisfactory performance. Due to its ease of use, this technology can offer a viable tool for mental health professionals to identify symptoms of depression, thus enabling a faster preventative intervention. Furthermore, it may alleviate the challenge of interpreting highly nuanced physiological and behavioral biomarkers of depression by providing a more objective evaluation. Thus this seminar will be useful in providing information about the use of machine learning techniques in the analysis of depression detection.

CONTENTS

Chapter 1

INTRODUCTION

According to the World Health Organization, depression is the leading cause of disability worldwide. Globally, more than 300 million people of all ages suffer from the disorder. And the incidence of the disorder is increasing everywhere. Depression is a complex condition, involving many systems of the body, including the immune system, either as cause or effect. It disrupts sleep and it interferes with appetite; in some cases, it causes weight loss; in others, it contributes to weight gain. Depression is also often accompanied by anxiety. Research indicates that not only do the two conditions co-occur but that they overlap in vulnerability patterns.

Because of its complexity, a full understanding of depression has been elusive. Researchers have some evidence that depression susceptibility is related to diet, both directly—through inadequate consumption of nutrients such as omega-3 fats—and indirectly, through the variety of bacteria that populate the gut. But depression involves mood and thoughts as well as the body, and it causes pain for both those living with the disorder and those who care about them.

Even in the most severe cases, depression is highly treatable. The condition is often cyclical, and early treatment may prevent or forestall recurrent episodes. Many studies show that the most effective treatment is cognitive behavioural therapy, which addresses problematic thought patterns, with or without the use of antidepressant drugs. In addition, evidence is quickly accumulating that regular mindfulness meditation, on its own or combined with cognitive therapy, can stop depression before it starts by diminishing reactivity to distressing experiences, effectively enabling disengagement of attention from the repetitive negative thoughts that often set the downward spiral of mood in motion.

Social networks have been developed as a great point for its users to communicate with their interested friends and share their opinions, photos, and videos reflecting their moods, feelings and sentiments. This creates an opportunity to analyze social network data for user’s feelings and sentiments to investigate their moods and attitudes when they are communicating via these online tools. Machine learning techniques identify high quality solutions of mental health problems among social media users. Therefore, here machine learning techniques are used to classify a person’s mental health based on social media (Twitter) posts.

1.1 OBJECTIVES

As the society becomes more and more technically advanced, we are tuning more into the online world. But as a result, some people can feel more isolated and this can in turn increase the occurrence of anxiety and depression.

Ironically, some people turn to social media to outlet their thoughts and emotions, and platforms like twitter, offers users a level of anonymity, which can entice the user to be more uninhibited in their expressions.

This offers an opportunity for emotional detection of users based on their tweets. From the medical perspective, it provides a good opportunity to identify potential depression in the users and from there offer suitable support and assist them to a path of recovery, by introducing them to self-care chatbots such as woebot, that uses Cognitive Behavioral Therapy to help its users change their negative thought patterns, as well as providing friendship in their time of need.

We aim to provide a dataset that is specifically designed for depression identification based on tweets.

The goal of this report is to apply Natural Language Processing and Machine Learning techniques to build a system that given a set of tweets from a user can identify at-risk tweets and hence at-risk users. For this task, we need to identify useful textual or community features. This system needs to take into account knowledge of social media posts, such as:

  1. Tweets are short and may convey emotions,

  2. Users tweet about a wide variety of topics.

This leads to a secondary goal of the report, which is to identify relevant tweets for analysis from the large amount of Twitter data. In this study, we aim to perform depression analysis on Twitter data. To investigate the effect of depression detection, we would propose an NLP Tool that use machine learning to classify a person's mental health based on social media posts (Twitter API) into 2 categories; depressed or not depressed. We report an implementation of the proposed method. We evaluate the efficiency of our proposed method using a set of various psycholinguistic features. We show that our proposed method can significantly improve the accuracy and classification error rate.

Based and Appearance-Based. Depending upon the program, program bundles such as OpenFace, CERT, SEMAINE API are utilized for preprocessing. Depending on the distinct investigation objectives, different choice strategies may be connected which incorporate classification strategies such as SVM, Closest Neighbour, etc. to address categorical questions and regression strategies such as SVR, Straight relapse, etc. The exactness of the framework is computed agreeing to the confusion matrix. The system poses a limitation that sample sizes are inadequate in number to be tested, finding optimal dataset is difficult. The analysts conclude that persistent approaches are more suitable for clinical involvement. Too, multimodal strategies (audio/visual) vanquish those depending totally on visual signals. The incorporation of sound signals come about in execution improvement in 17 out of 22 strategies.

The study [3] points to look at attentional inclination for emotional facial boosts in depressed as well as non-depressed people using an eye tracker gadget [4] for a Brazilian database. The study utilizes fixation term and gaze bearing amid the test, presumed as inclination. The most modifications watched in this test between accomplice group's accumulated information were that energized bunch displayed fixation term time to upbeat faces higher than discouraged bunch; which the discouraged bunch had less Area Of Interest obsession term. These conclusions can be connected to the hypothesis that discouraged people have more withdrawal indications. Points of interest of this research incorporate a sketched out strategy to degree attention, the short-term degree of the explore and the environment with uninvolved traits. This study has a few confinements. The current finding affirms that it is fundamental to have a greater test estimate and analyze variables that seem to influence the participant’s demeanour at the moment of the application of the try.

This paper [5] aims at highlighting the use of low dimensional data to auto-detect visual behaviour and various approaches to extricate long term dynamic features from variable length time-series data. The paper brings to consideration the ought to investigate and analyze the objective evaluation strategies to help monitoring and diagnosis. The research helps compensate the subjective behaviour causing computational load and the presence of redundant information. The paper [5] proposes approaches based on non-verbal biomarkers which include physical signs such as facial expression or audio signal etc. The two global depression extraction features evaluated in this paper are calculating statistics and Convolution Neural Network (CNN). The researchers have analyzed the features of CNN, emphasizing its requirement for a fixed input dimension, since a human conduct signal cannot be

straightforwardly treated as an input to the system. As a work around, paper proposes [5] use of handcrafted input method, wherein the facial landmarks are extracted to get dynamic facial shape and head position data and are then joined with the Gaussian Mixture Model. This resulted to an improvement in Fisher vector and compact dynamic feature set. The paper [5] additionally assesses sequence level representations Statistics of primitives and Spectrum coming about because of Fourier Transformation. A detailed analysis of depression detection results show that above methods generate competitive results as opposed to the conventional methods. The system was restricted to Gender-specific experiments and confined training data.

The methods used in this paper [6] are participants and data acquisition, feature extraction, analysis and evaluation, and Normalization. Feature extraction involves speech behaviour feature, eye action, and movement, and head posture features. For classification, the SVM classifier is used and to increase accuracy cost and gamma were optimized. In feature extraction, to maximize recognition rate two methods statistical T-test and feature transformation were implemented. Feature, score, decision and hybrid fusion methods were used to boost performance. A comparatively reasonable number of features and subject- specific actions were the limitations of the system.

The paper [7] thinks about the facial expression geometry in conjunction with speech examination utilized and tried for highlight extraction male, female and both, with different combination procedures on the Trouble Investigation Meet Corpus (DAIC) and Audio-Visual Feeling Challenge (AVEC) dataset. The OpenFace instrument was utilized to extricate the facial points of interest and AVEC suggested the Collaborative Voice Investigation Store for sound characteristic extraction. Smile intensity, Veraguth folds and blinks were the highlights extricated from facial points of interest. The combination plans tried were feature level combination and decision level combination. BDI-II scores were utilized to characterize an individual's sadness. BDI-II result in 82% classification exactness. Two classification calculations were tried, the nearest neighbour and decision tree. In all, the framework showed a tall victory rate in recognizing people detailing high levels of depressive symptoms (94.8%) joined with the wrong positive decision rate (60.6%).

Many researchers has shown that Feature-Fusion and optimization may increase the accuracy of classification.

Many researchers tried to improve classification system performance by combining both speech and facial expression of a person which yielded good results. Lang He et al. has proposed Convolution neural networks model for automatic depression detection from speech.

3.3 Questionnaire Interview and Observational Procedures

Detecting depression at primary care set up is a complex and is carried out by a professionally trained psychiatrist. They perform a series of mental tests to confirm the condition and objectively categorize the levels of depression- low, medium or high. Hamilton Rating scale for Depression(HAMD), self-assessment questionnaire like Beck Depression Index(BDI), Patient Health Questionnaire-8 (PHQ-8) are the ones which are universally used by psychiatrists. These methods need willingness and honest response of the individual about his mental situations like interest/pleasure in doing things, Sleeping and eating habits, energy levels, hopelessness etc. The Patient Health Questionnaire-8 (PHQ-8) is an objective self-report questioner containing multiple choices to check mental health disorders of depression based on the score obtained. It is a useful measure for analysing depression state of a person and its diagnostic algorithm with a cut point greater than or equal to 10 can be used for defining current depression.

3.4 Machine Learning Approaches

Modern trend in detecting depression is using Trained machines by using speech audio, interview videos, images and text responses, etc. The digital data collected in various forms is analysed and features that are specifically related to depression are extracted. For example, in text responses or transcriptions, words that are frequently used when a person is depressed are identified. In audio data, the specific spectral or cepstral features that signify depression are identified. In video and image data, expressions, eye movement and postures are identified. Various machine learning algorithms like K Nearest neighbours(KNN), Gaussian Mixture Model(GMM), Support Vector Machine(SVM) are widely used to investigate depression using different speech types and emotions. Neural networks are used to train machines for early detection of depression using linguistic and text sequences.

3.5 Existing System

Sridharan et al. presented the detection diagnostics on online social media with the assistance of Convolution Neural Networks (CNN) where accentuation was to get information posted by different clients while also ensuring algorithm protects the security with the assistance of separating agents which deal with information.

M N Stollar, M Lechh, S J Stollar, N B Allen approach utilizes an upgraded spectral move off parameters for detection of the depression side effects from discourse signals on the clinical dataset obtained. The classification of these highlights is done with the assistance of basic SVM classifier. In past investigation, gender dependence has improved depression classification either best for females, males and fluctuated amongst highlights.

3.6 Earlier Proposed Model Architecture

A 6-layer Convolutional Neural Network (CNN) model was employed consisting of 2 convolutional layers with max- pooling and 2 fully connected layers. Each spectrogram input is an image with dimension 513x125 representing 4 seconds of audio and frequencies ranging from 0 to 8kHz. The frequency range was tuned as a hyperparameter, since most human speech energy is concentrated between 0.3-3kHz. Each input is normalized according to decibels relative to full scale (dBFS). Though there are some differences, the actual architecture employed in this effort was largely inspired by a paper on Environmental Sound Classification with CNNs. The network employed in this is shown in Figure 1, with DepressionDetect’s displayed in Figure 2. The CNN used here begins with an input layer being convolved with 32- 3x3 filters to create 32 feature maps followed by a ReLU activation function. Next, the feature maps undergo dimensionality reduction with a max-pooling layer, which used a 4x3 filter with a stride of 1x3. A second similar convolutional layer was employed with 32- 3x3 filters followed by a max-pooling layer with a 1x3 filter and stride of 1x3. This layer was then followed by two dense layers. After the second dense layer, a dropout layer of 0.5 was used (meaning each neuron in the second dense layer had a 50% chance of turning off after each batch update). Lastly, a softmax function is applied, which returns the probability that a spectrogram was in the depressed class or not depressed class. The sum probabilities of each class was equal to 1. A batch size of 32 (out of 2480 spectrograms) was used along with an Adadelta optimizer, which dynamically adapted the learning rate based on the gradient.

3.7 Limitations

There are some limitations of the existing work:

  1. Most of them conducted their experiments on a very small set of samples, so it is difficult to justify the robustness and generality of their findings on a large-scale depression group.

  2. Few of them characterized the potential depressed users from multiple modalities of social media.

  3. They did not systematically investigate the depression behaviours on social media, and very little work looked into the newly-presented depression symptoms as the world develops.

  4. In recent years, many reviews on depression recognition and analysis have been published based on audio, and visual cues. These surveys provided a comprehensive scope for ADE(Application Development Environment). Yet, there remain two unexplored aspects. As existing reviews only focus either on audio or visual cues for estimating the depression scale, the combined use of audiovisual cues has not been adequately discussed. In addition, existing surveys only consider traditional approaches and upgraded Machine Learning techniques have not yet been covered in their analyses. As far as we know, an in-depth review on multi-modal approaches for depression recognition is still missing. Our goal is to fill the gap in the existing extensive reviews by including the increasingly important multi-modal ADE approaches.

Chapter 4

METHODOLOGY

4.1 Problem Statement

Depression Detection in Social Media by Analyzing User’s Sentiment

For this problem statement our aim is to predict early signs of depression through Social Media text mining and sentiment analysis. In Machine Learning, there are many ways for sentiment analysis such: decision-based systems, Bayesian classifiers, support vector machine, neural networks and sample-based methods.

After reading some papers about using different Machine Learning and artificial intelligence techniques to detect depression on Social Media, I decided to apply sentiment analysis through a powerful theorem from probability theory called Baye’s Theorem. The model will be written in python and it will tell whether a given tweet is depressive or not.

The aim of sentiment analysis for depression based on Twitter posts is to analyze linguistic markers in social media posts and creating a model that can give an invidual insight into user's mental mealth.

4.1.1. Sentiment Analysis:

Sentiment is an opinion or view that is based on an exaggerated feeling of something (contrary to the judgment of the mind). Every human being will generally express a response related to an event / situation based on his experience which is the cumulative result of the thought process to the input that has been received by him so far. These responses can generally be categorized into three major groups, namely positive, negative and neutral. Sentiment Analysis itself is one of the techniques in extracting information in the form of views (Sentiment) of a person towards an issue or event. Sentiment analysis can be used to uncover public opinion on an issue, service satisfaction, policy, stock price prediction and competitor analysis based on textual data. However, the phenomenon exponential growth of data to be new challenges in the sentiment analysis process. Approach conventional is no longer the right answer to reveal and determine the type of sentiment in the textual data. Employing humans to classify types of sentiment from a textual data set that is very large and varied, of course it will take time and

4.1.4. Naive Bayes Classifier:

Naive Bayes Classifier is a classifier which implements Bayes theorem with a solid (naive) independence assumptions, particularly, independent feature model. Bayes Theorem works on conditional probability which finds out the probability of an event given that some other event has already occurred. It predicts the conditional probability of a class given the set of evidences and finds the most likely class based on the highest one. A naive Bayes classifier is a famous and popular technique because it is very fast approach and gives a high accuracy. The equation of the conditional probability is defined as follows:

Here,

H is the probability of a classification

E1 to En are the Evidence variables

M is the Set of all evidences

 Naive Bayes Classifier is a kind of classifier that works on Bayes theorem.  Prediction of membership probabilities is made for every class such as the probability of data points associated to a particular class.  The class having maximum probability is appraised as the most suitable class.  This is also referred as Maximum A Posteriori (MAP).  The MAP for a hypothesis is: o 𝑀𝐴𝑃 (𝐻) = max 𝑃((𝐻|𝐸)) o 𝑀𝐴𝑃 (𝐻) = max 𝑃((𝐻|𝐸) ∗ (𝑃(𝐻)) /𝑃(𝐸)) o 𝑀𝐴𝑃 (𝐻) = max(𝑃(𝐸|𝐻) ∗ 𝑃(𝐻)) o 𝑃(𝐸) is evidence probability, and it is used to normalize the result. The result will not be affected by removing 𝑃(𝐸).  NB classifiers conclude that all the variables or features are not related to each other.  The Existence or absence of a variable does not impact the existence or absence of any other variable.  Example:

o Fruit may be observed to be an apple if it is red, round, and about 4″ in diameter. o In this case also even if all the features are interrelated to each other, and NB classifier will observe all of these independently contributing to the probability that the fruit is an apple.  We experiment with the hypothesis in real datasets, given multiple features.  So, computation becomes complex.

There are three types of Naive Bayes Classifier:

  1. Gaussian Naive Bayes: When characteristic values are continuous in nature then an assumption is made that the values linked with each class are dispersed according to Gaussian that is Normal Distribution.
  2. Multinomial Naive Bayes: Multinomial Naive Bayes is favored to use on data that is multinomial distributed. It is widely used in text classification in NLP. Each event in text classification constitutes the presence of a word in a document.
  3. Bernoulli Naive Bayes: When data is dispensed according to the multivariate Bernoulli distributions then Bernoulli Naive Bayes is used. That means there exist multiple features but each one is assumed to contain a binary value. So, it requires features to be binary-valued.

For our problem statement, Multinomial Naive Bayes has been used as classifier. The Multinomial Naive Bayes works well on multinomially distributed data and is widely used in text classification.

4.1.5. Support Vector Machine:

Support Vector Machine(SVM) is a supervised learning algorithm that analyzes the data and recognizing patters used for classification. Given an input set, SVM classifies them as one or the other of two categories. SVM can deal both with both linear and non-linear classification.

With kernel trick, it can efficiently perform non-linear classification. It does so by mapping the input set to high dimensional feature space. The types of kernel includes polynomial, Gaussian radial basis function (RBF), Laplace RBF kernel, Hyperbolic tangent kernel and Sigmoidal kernel. Construction of hyper plane is employed by SVM for the classification.