DOI : 10.17577/IJERTV14IS070153
- Open Access

- Authors : Deborah T. Joy, Charu Jain, Shalini B. Bajaj, Ekta Soni
- Paper ID : IJERTV14IS070153
- Volume & Issue : Volume 14, Issue 07 (July 2025)
- Published (First Online): 01-08-2025
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Deep Learning for Mental Health: RNN-Based Diagnosis of Depression, Anxiety and PTSD
Deborah T. Joy
Xebia India, Gurgaon, Haryana
Charu Jain
Xebia India, Gurgaon, Haryana
Shalini B. Bajaj
Amity University, Amity Education Valley, Gurgaon, Haryana
Ekta Soni
Amity University, Amity Education Valley, Gurgaon, Haryana
Abstract The foundational principles of artificial intelligence rely on the absolute personification of the homo sapiens, the anatomy in question, the brain. It is facile to presume that the brain can be dissected and studied to reach graspable surmises, on the antithetical, the human brain in fact is quite complex in a specified individual and when referring to more than one, the interpretation of its working becomes a cacophony. This research works on the lines of divulging into the beauty of the human mind and imbuing the very resource of human behaviour into artificial intelligence with respect to interpreting psychological disorders. The paper works towards answering if comorbid disorders can be identified using deep neural networks. There are without a doubt multiple facets to this very take ranging from chatbots to advisories to diagnosis and much more, thus, the authors only deal with the underlying model for disorder diagnosis and prognosis for comorbidity. Using data that can be measured does not support the cause, so the authors have taken the challenge to work towards building AI for psychology with the touch of neural networks.
Keywords: Artificial Intelligence, Recurrent Neural Network, Psychological Disorders, ML, DL, Depression (CDD), Anxiety (GAD), Post Traumatic Stress (PTSD), Mental Health
- INTRODUCTION
Artificial Intelligence has rivetted the attention and curiosity of scholars and researchers alike. Machine Learning and Deep Learning, further subsets of AI are the buzzwords of the decade. Moreover, there have been endless developments on using machine learning to trace out patterns in psychological disorders leading to an end result that can potentially decide whether a person is affected by a disorder or not. All of this brings us to theorize that there can be an expert system that leads not only to the analysis and pattern matching of a disorder but a formal diagnosis that can be clinically tested and proven based on symptoms and health history. In this particular paper, we will walk through the work that has been done in said field, the deep learning methodology applied, and the final outcome of the models developed for each of the disorders.
AI tools can also improve therapy, automate administrative tasks, and assist in the training of new therapists. From a scientific standpoint, artificial intelligence provides new insights into human intelligence, while machine learning helps scientists to derive valuable insights from massive volumes of data [1]. This we know because, psychologists are qualified to scrutinize presumptions regarding emerging technology and assess its effects on consumers when it comes to artificial intelligence. AI is expected to assist in reducing the time and cost associated with having humans rate and code various aspects of the patient-provider interaction during a therapy session. This process is essential for onboarding new therapists, assessing the efficacy of therapy, and carrying out psychotherapy research and clinical trials [2]. Now, without question, AIs worth and promise have been acknowledged in psychology, and mental health care in particular. AI-based conversational agents and decision support systems that can effectively identify mental diseases are two examples of how AI is being used in psychology and mental health care [3]. But it’s important to remember that using AI tools in treatment comes with hazards, particularly for clients who are more sensitive. Interactions with forms of apraxia may yield unexpected outcomes, and reactions may have unfavourable effects.
To make an effort to run full circle, virtual therapy, brain imaging, cognitive testing, suicide tendency treatments, diagnosis and planning medical journeys, customizing need for medical attention, are the applications of AI in psychology to name a few. With automating the mathematical scoring of adaptive testing, indulging textual adherence of data, biometric data analysis, extrapolative investigation, and other capabilities, using AI for psychological testing is actually feasible. Moreover, in cognitive psychology we have modelling cognitive processes, automated data analysis, virtual agents, neural imaging. Surprisingly there are applications to assist the same. Applications for psychology powered by AI are another exciting field of study. These applications can assess
a user’s behaviour using machine learning algorithms and offer tailored suggestions for enhancing mental health. An application might, for instance, suggest exercise or meditation depending on the user’s sleep habits and stress levels [4]. A few more references to applications for psyche have been discussed in the literature review of related works.
The development direction of artificial intelligence by combining cognitive psychology with artificial intelligence systems allows computers to mimic human intelligence, to learn and think, to recognize emotions and comprehend human feelings, and ultimately engage in dialogue and empathy with humans and other artificial intelligence. This is achieved through a systematic analysis and application examples. Combining human psychological cognition with artificial intelligence allows for the replication of both the perceptual thoughts of the heart and rational thinking of the brain as well as the emotional interactions that resemble human-machine communication [5].
Thus, the objective of the paper can be surmised in two statements. Build individually crafted RNN model that can independently categorize depression, anxiety, and post- traumatic stress disorder. Provide a plaintive diagnosis based on data received / produced by practicing mental health practitioners. To interpret the former statement, RNN stands for recurrent neural network that has its dealings in sequential data. Given below is the structure of an unrolled RNN.
Fig 1. Structure of Unrolled RNN [6]
- RELATED WORK
The working of AI with respect to neural networks has been broadly classified as Artificial Neural Networks and these models can also help healthcare workers formulate suggestions for optimizing their decision-making through the application of AI in supporting clinical decisions. This can enhance the final resultants of patient treated and even improve the general quality of healthcare provisions [7]. Let us take a look at the ways in which artificial intelligence will actually help. It is useful for us to note that AI is a part of the diagnosis and advice on the prescription, not taking the place of a healthcare professional but aiding their analysis and take on the nature of affliction in a patient. Safe to say, with no compromise to the integrity and better judgement of a human healthcare intervener, artificial intelligence is the preliminary nurse to the general practitioner and in no way supersedes therapeutic diagnosis and medical administration of drugs.
AI in clinical diagnosis can morph into one of two basic forms, predictive analysis that can decide if a patient is most likely to face such and such disease or disorder in the near future and secondly medical verdict, which can reveal the disease or disorder that currently resides in the body of a
patient. The former requires a point-o-point check based on analysis of historical heath data while the latter requires an inquiry rather an investigation into the current symptoms experienced by a subject. With their enhanced comprehension of human language and their refined subject knowledge, neural network models hold promise in aiding healthcare decision-making [8]. More than which it is advantageous for the model itself to hold the primary decision. As a human doctor does right in asking the nature of discomfort felt, AI holds the ability to do the same, the major difference here being, a preferentially accurate diagnosis that can be both validated and verified by an attending physician. It is incredibly efficient when it comes to aiding well-written prescriptions and disease or disorder specific drugs, which will revolutionize the way healthcare professionals produce diagnosis in general [9].
Brining in the idea of the mentioned facets of diagnosis and prognosis, it is necessary to note that AI is likely to assist the firsthand disorder detection with regard to device that collect data that are generated by us. Data that actually connects to dangers of internal turmoil and alert the closest specialists. Ideally the initial purpose was for people to keep track of their own heath but quite enchantingly these very devices have been known to save lives. So, we extend this idea of the interpretation of physique into construal of brain signals. Furthermore, a preliminary study on Neurodevelopmental disorder suggests that machine learning and deep learning models can be tuned to identify the existence of the same in growing children. To help people identify a potential neurodevelopment disorder and treat it early on, imagine deep learning-based algorithms that have the capacity to learn from patterns in neural disorders and forecast the right class of the disorder [10]. Only in recent years have we shifted to an assurance of mathematical models identifying and / or diagnosing disorders at developmental stage. NeuroQ brings an effort to hand the very concept in the form of an application to not only healthcare workers but also teachers and parents [11]. A wide range of data types, comprising but not limited to medical imaging, the prediction of protein edifice, medical paperwork, diagnostic support, interpretation of radiological outcomes, clinical decision support, remedial inscribing and billing, drug development, and representation at the molecular level, can be analysed with the help of general artificial intelligence models. And according to Yasin and Sahar, Drug synthesis, data reconstruction, and clinical diagnostics have all improved as a result of this application [12]. Further concerns are brought forward by David, Jordan and Yifan in their research on the ethics involved where AI in healthcare is concerned [13]. Because of worries about transparency and other related issues, AI has recently invited a lot of attention in the area of medical research, sparking discussions about its potential applications in the healthcare industry. However, there are significant moral apprehensions about the use of this technology in healthcare due to concerns about modelling biases potentially escalating health inequities. The assurance lies in the fact that though there may be several challenges and questions raised against AI, its uniqueness and ability to reduce the delivery gap between
implementation and productivity even quality gains make AI indispensable [14].
Coming to an explanation and understanding of the psyche vista to the aim of this study. According to DSM-V, proper diagnoses, and parameters for defining Chronic Depression Disorder, General Anxiety Disorder and Post-Traumatic Stress Disorder are given in the clinical front. They are subject to the manual development process, the distinguishing factors where normal psychological functions are concerned and cross-sectional vs longitudinal diagnosis, how different the diagnostic characteristics are and in multiple cases which heed severity, the role of instrumental diagnosis, all of which is a justified psychological diagnosis [15]. The questionnaires and corresponding scoring have been done on the same basis. It is good to note that psychology terms them as instruments. The data collected for the purpose of this paper follow the Patient Health Questionnaire (PHQ-9), Hamilton Anxiety Rating Scale (HAM-A) and PTSD Checklist (PCL-5). These are standardised tests that mental healthcare professionals use for the diagnosis and subsequent prognosis of prevalent disorders, their severity and environmental likelihood.
Now, to bring the idea into perspective, this paper will be dealing with clinical diagnosis in primarily the verdict facet which can be further extended into the predictive side. The major challenges of taboo, patient specific diagnosis, accuracy in diagnosis and validity of outcome will be
is applied at every connected neuron to act as a test factor to decide if the neuron is active or not. When looking at the plot, it is easy to say that tanh is a stretched and relatively shifter form of the sigmoid activation function as given in fig 2.
Fig 2. TanH Activation Function Graph
The outcome of a neural network is well reliant on the final activation function. This brings us to the softmax activation. The advantage here is that softmax can tolerate multiclass classification [18]. Given that there is no binary measure of a psychological disorder, the model uses activation functions that accommodate more than one category, hence, softmax.
addressed. Here the aim is to make the complete process more facile and non-redundant. It is helpful to note that an AI model assisting clinical diagnosis by no means takes
() =
=1
(3.2)
away the privilege of an experienced practitioners diagnosis. Rather aids the precision of it, leading to better resultants in the overall treatment. Artificial Intelligence has already been a major part of the administrative processes and an aide to many obstacles, including following standard operating procedures (SOPs), controlling inventory, preserving the quality of the equipment, and allocating time as efficiently as possible [16]. We now take it forward into the onsite health data analysis, almost as a promotion towards a better health environment and stronger medical assertions, so let us dive right in.
- METHODOLOGY
The math working behind the prediction model is a combined complex structure run by different activation functions that accommodate multi-faceted outcomes. The initial activation function tanh expanded tangent hyperbolic, gained popularity on the basis of better performance as compared to the traditional sigmoid activation. Albeit, tanh did not solve the generalized vanishing gradient problem, it worked well with multi layered NNs [17]. The tanh activation function is given by equation 3.1 in its mathematical format.
() = +
Plotting the same gives the underlying structure of tanh, the need of which is realized in the neural network when it
According to equation 3.2, the raw outputs in the form of a vector are contained in x, the predicted probability of the ith entry is held in belongingness to class i.
Neural Networks are of many kinds, this paper has performed research using the Recurrent neural network as mentioned. An RNN model is essentially a deep learning neural network that trains itself on sequential data [19]. This helps the fact that data fed from the perspective of the disorders in enthrallingly sequential. A simple RNN model can be layered up to accommodate multiple aspects in the forms of activation functions, embeddings, and dense layers. Before we address the model, let us understand the process.
Fig 3. Process Flow Diagram
uilt to In
(3.1)
The flow diagram given in fig 3 summarizes the action plan of model tuning. Each specification chosen and referred to in this study has een built on the same underlying foundation. Importing modules and data, building models, weight training and predictions. The key difference here is that the models for each of the three categories is b specifically accommodate the very issue addressed. a manner of saying, the depression model built is different
from the model parameters of the anxiety model and vice versa.
The datasets used in this paper initially had variant classes, ranging in 3, 4, 5 levels from mild to severe in anxiety, PTSD and depression respectively. For the work that has been carried out in this research, relevant values or rather mathematically absolute values were taken into consideration, non-numeric values had been filtered out and given that the research cannot be auto completed in places of missing values the null / empty values were excluded while training the algorithms. With the categorical models in place, once the individual models were implemented, each was subject to comparisons on grounds of personal performance, measured in terms of accuracy; and the impact of data flow on their complexity, measured in terms of duration and memory. Conclusively, deducing itself in the classic confusion matrix [20].
- EXPERIMENTAL RESULTS
Disorder prediction can be done using several machine learning and deep learning algorithms. The purpose of the RNN model lies in the quality of raw dataset that was acquired with reference to the DSM-V. The dataset dimensions after the initial train-test split are given in TABLE I. The process was done using the sklearn.model_selection library with the test size parameter taking 25% of the overall length of data.
Table I: Shape and Splits of Datasets
Disorder Model Dataset Dimensions Training Testing Chronic Depression Disorder
(1312, 10) 1049 (80%)
263 (20%)
General Anxiety Disorder (1245, 14) 996 (80%)
249 (20%)
Post-Traumatic Stress Disorder (1107, 20) 885 (80%)
222 (20%)
Furthermore, here is a summary of the model that has been tuned for chronic depression disorder analysis. Given the dimensions of the dataset the embedding parameters are 4 & 64. Activation function used is tanh and the simple RNN layer and lower dense layer, the final computing activation function is SoftMax. Fig 4 show the structure of the RNN model and the count of paraments that it is trained on.
Fig 4. Sequential Model Structure for SimpleRNN
Once the built model is compiled over sparse_categorical_crossentropy loss and the Adam optimizer, it is fitted with the training data with a 20% validation split. The next step is to make predictions and test the model accuracy. Before we understand the confusion matrix, which assists us in understanding the accuracy structure, given in fig 5 is the loss graph while training the model for chronic depression disorder.
Fig 5. Training and Validation Loss for CDD
This is aided by using a confusion matrix, that depicts the actual values per predicted value. The arenas are divided into four categories, true positives, true negatives, false positives and false negatives. Comprehending the confusion matrix gives hard end advantage of knowing the quality of the model used. For example, the 0s predicted 0s are True Positives, the 0s predicted differently are False Positives, variants predicted 0s are False Negatives and variants not predicted 0s are True Negatives. The subsets are such divided to accommodate all the classes. The confusion matrix for PTSD is given in fig 6.
Fig 6. Confusion Matrix for PTSD Specifications
In all the RNN models the accuracy is subject to the fine tuning of parameters, such to say a sigmoid activation would severely reduce the accuracy given the lack of multi-class categorization. Similarly, relU activation may raise or lower the accuracy based on the split shift [21]. The comparatively better evaluation has been drawn on the tanh-tanh-softmax combined with sparse_categorical_crossentropy loss and adam optimizer.
Model Performance
140
120
100
80
60
40
20
0
CDD GAD PTSD
Observations Parameters Accuracy
Fig 7. Model-Wise Performance Chart
In the chart given in fig 7, observations are the ratio of data availability per model, parameters are the DSM-5 approved test constraints which have been key in the model tuning process and finally the Chronic Depression Disorder gives a launching validity with 95% accuracy, the General Anxiety Disorder gives a 98% accuracy and Post Traumatic Stress Disorder gives a raising 93% accuracy.
- CONCLUSION & SCOPE
Artificial neural networks have been known to baffle the most brilliant of minds and yet there is a whole black box that needs revealing. Given that the human brain generated millions of signals that are both uniquely identified and readily interpreted by a set of sensory receivers that we can only imagine replicating. The methods adopted in this paper are a step towards those doors. The deep learning network has given more than satisfactory results. One can only hope that us human beings, the authors included, learn to accept that AI can assist psychological analysis and comorbid disorder detection. If done right, this diagnosis of disorder and prognosis of comorbidity can be translated to large language models. Given that, lately, the next big thing that has caught researchers fancy is Generative AI, which is a subset of AI seated in Deep Learning. An ardent extension of this research is the mysterious idea that a psychological therapist can be found in deep rooted and morally founded artificial intelligence.
REFERENCES
- Zara Abrams, AI is changing every aspect of psychology. Heres what to watch for! Vol. 54 No. 5, https://www.apa.org/monitor/2023/07/psychology-embracing-ai
- Summer Allen, Improving Psychotherapy With AI: From the Couch to the Keyboard, IEEE Plus, https://www.embs.org/pulse/articles/improving-psychotherapy- with-ai-from-the-couch-to-the-keyboard
- Tutun, S., Johnson, M. E., Ahmed, A., Albizri, A., Irgil, S., Yesilkaya, I., Ucar, E. N., Sengun, T., & Harfouche, A. (2023). An AI-based decision support system for predicting mental health disorders. Information Systems Frontiers, 25(3), 12611276.
- Swarnabha Sinha, AI in Psychology, Scaler Topics, https://www.scaler.com/topics/artificial-intelligence-tutorial/ai-in- psychology
- Zhao Jian , Wu Mengqing , Zhou Liyun , Wang Xuezhu , Jia Jian; Cognitive psychology-based artificial intelligence review, Frontiers in Neuroscience VOLUME=16, YEAR=2022 DOI=10.3389/fnins.2022.1024316 ISSN=1662-453X
- Abid Ali Awan, Recurrent Neural Network Tutorial (RNN), Data Camp, Mar 2022, https://www.datacamp.com/tutorial/tutorial-for- recurrent-neural-network
- Liu S, Wright AP, Patterson BL, Wanderer JP, Turer RW, Nelson SD, McCoy AB, Sittig DF, Wright A. Using AI-generated suggestions from ChatGPT to optimize clinical decision support. J Am Med Inform Assoc. 2023 Jun 20;30(7):1237-1245. doi: 10.1093/jamia/ocad072. PMID: 37087108; PMCID: PMC10280357.
- Zhang P, Kamel Boulos MN. Generative AI in Medicine and Healthcare: Promises, Opportunities and Challenges. Future Internet. 2023; 15(9):286. https://doi.org/10.3390/fi15090286
- Julian Varghese, Julius Chapiro, ChatGPT: The transformative influence of generative AI on science and healthcare, Journal of Hepatology, 223, ISSN 0168-8278, https://doi.org/10.1016/j.jhep.2023.07.028
- Joy, Deborah & Prangyanidhi, Sushree & Jatain, Aman & Bhaskar, Shalini. (2022). Artificial Intelligence Aided Neurodevelopmental Disorders Diagnosis: Techniques Revisited. 10.1007/978-981-16- 9650-3_1.
- Vashisht, Priyanka & Jatain, Aman. (2023). A Novel Approach for Diagnosing Neuro-Developmental Disorders using Artificial Intelligence. Inteligencia Artificial. 26. 13-24. 10.4114/intartif.vol26iss71pp13-24.
- Yasin Shokrollahi and Sahar Yarmohammadtoosky and Matthew M. Nikahd and Pengfei Dong and Xianqi Li and Linxia Gu, A Comprehensive Review of Generative AI in Healthcare, 2023, 2310.00795 https://doi.org/10.48550/arXiv.2310.00795
- Oniani, D., Hilsman, J., Peng, Y. et al. Adopting and expanding ethical principles for generative artificial intelligence from military to healthcare. npj Digit. Med. 6, 225 (2023). https://doi.org/10.1038/s41746-023-00965-x
- Wachter RM, Brynjolfsson E. Will Generative Artificial Intelligence Deliver on Its Promise in Health Care? JAMA. 2024;331(1):6569. doi:10.1001/jama.2023.25054
- Widiger, T. A., & Clark, L. A. (2000). Toward DSMV and the classification of psychopathology. Psychological Bulletin, 126(6), 946963. https://doi.org/10.1037/0033-2909.126.6.946
- Jain, S., Subzwari, S.W.A., Subzwari, S.A.A. (2024). Generative AI for Healthcare Engineering and Technology Challenges. In: Sharma, S.K., Dwivedi, Y.K., Metri, B., Lal, B., Elbanna, A. (eds) Transfer, Diffusion and Adoption of Next-Generation Digital Technologies. TDIT 2023. IFIP Advances in Information and Communication Technology, vol 697. Springer, Cham. https://doi.org/10.1007/978-3- 031-50188-3_7
- B. L. Kalman and S. C. Kwasny, “Why tanh: choosing a sigmoidal function,” [Proceedings 1992] IJCNN International Joint Conference on Neural Networks, Baltimore, MD, USA, 1992, pp. 578-581 vol.4, doi: 10.1109/IJCNN.1992.227257.
- R. Hu, B. Tian, S. Yin and S. Wei, “Efficient Hardware Architecture of Softmax Layer in Deep Neural Network,” 2018 IEEE 23rd International Conference on Digital Signal Processing (DSP), Shanghai, China, 2018, pp. 1-5, doi: 10.1109/ICDSP.2018.8631588.
- Tsoi, A.C. (1998). Recurrent neural network architectures: An overview. In: Giles, C.L., Gori, M. (eds) Adaptive Processing of Sequences and Data Structures. NN 1997. Lecture Notes in Computer Science, vol 1387. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0053993
- Ting K.M. (2017) Confusion Matrix. In: Sammut C., Webb G.I. (eds) Encyclopedia of Machine Learning and Data Mining. Springer,
Boston, MA. https://doi.org/10.1007/978-1-4899-7687-1_50
- Zhang, C., Woodland, P.C. (2015) Parameterised sigmoid and reLU hidden activation functions for DNN acoustic modelling. Proc. Interspeech 2015, 3224-3228, doi: 10.21437/Interspeech.2015-649
