Volume 11 , Issue 1 , PP: 58-86, 2026 | Cite this article as | XML | Html | PDF | Full Length Article
Safaa Zaman 1 * , El-Sayed M. El-Kenawy 2
Doi: https://doi.org/10.54216/JAIM.110103
The growing prevalence and clinical complexity of Obsessive–Compulsive Disorder (OCD) motivate the need for reliable, data-driven decision-support systems capable of improving diagnostic accuracy and robustness beyond traditional assessment methods. In this study, we propose an optimized deep learning framework that integrates a Deep Learning framework distilled by Gradient Boosting Decision Trees (DeepGBM) with a novel metaheuristic optimizer, the Ninja Optimization Algorithm (NiOA), to enhance OCD-related classification using structured demographic and clinical data. The main contribution of this work lies in the design of a unified optimization pipeline in which NiOA is employed for automated hyperparameter tuning of DeepGBM, and in the comprehensive comparison of this approach against baseline deep learning models and alternative metaheuristic optimizers, including Multiverse Optimization (MVO), Bat Algorithm (BA), and Particle Swarm Optimization (PSO). Experimental evaluation demonstrates that, at the baseline stage, DeepGBM outperforms Artificial Neural Networks (ANN), Convolutional Neural Networks (CNN), and Bidirectional Long Short-Term Memory networks (BiLSTM), achieving an accuracy of 0.8970 and an F-score of 0.8935. Following optimization, the proposed NiOA+DeepGBM framework achieves substantial performance gains, reaching an accuracy of 0.9779, sensitivity of 0.9763, specificity of 0.9793, and an F-score of 0.9770, consistently surpassing MVO+DeepGBM, BA+DeepGBM, and PSO+DeepGBM across all evaluation metrics. These results confirm the superior capability of NiOA in navigating complex hyperparameter spaces and enhancing both predictive accuracy and generalization. The implications of this work are significant for intelligent mental health assessment, as the proposed NiOA-optimized DeepGBM model offers a robust, clinically relevant decision-support tool that can assist clinicians in improving diagnostic reliability, reducing uncertainty, and supporting the development of scalable, AI-driven mental healthcare systems.
Obsessive&ndash , Compulsive Disorder , DeepGBM , Ninja Optimization Algorithm , Metaheuristic Optimization , Clinical Decision Support Systems
[1] W. H. Organization, World mental health report: Transforming mental health for all. World Health Organization, 2022.
[2] W. H. Organization, Optimizing brain health across the life course: WHO position paper.World Health Organization, 2022.
[3] A. Dondu and L. Sevincok, “Clinical characteristics of obsessive-compulsive disorder comorbid withobsessive-compulsive personality disorder: Subtype implications,” Frontiers in psychiatry, vol. 16, p. 1 577 042, 2025. DOI: https://doi.org/10.3389/fpsyt.2025.1577042.
[4] S. Pardossi, A. Cuomo, and A. Fagiolini, “Unraveling the boundaries, overlaps, and connections between schizophrenia and obsessive–compulsive disorder (ocd),” Journal of Clinical Medicine, vol. 13, no. 16, 2024, ISSN: 2077-0383. DOI: 10.3390/jcm13164739. [Online]. Available: https:// www.mdpi.com/2077-0383/13/16/4739.
[5] A. Borrego-Ruiz and J. J. Borrego, “Biological, psychosocial, and microbial determinants of childhood-onset obsessive–compulsive disorder: A narrative review,” Children, vol. 12, no. 8, 2025, ISSN: 2227-9067. DOI: 10.3390/children12081063. [Online]. Available: https://www. mdpi.com/2227-9067/12/8/1063.
[6] J. Kim et al., “Artificial intelligence in obsessive-compulsive disorder: A systematic review,” Current Treatment Options in Psychiatry, vol. 12, no. 1, p. 23, 2025. DOI: https://doi.org/10.1007/ s40501-025-00359-8.
[7] N. Kansara, B. Vala, and M. S. Shaikh, “Machine learning in mental health: Bridging gaps in diagnosis and intervention,” in 2025 Eleventh International Conference on Bio Signals, Images, and Instrumentation (ICBSII), 2025, pp. 1–9. DOI: 10.1109/ICBSII65145.2025.11013436.
[8] B. Liu, C. Hu, and P. Bao, “Precision tms through the integration of neuroimaging and machine learning: Optimizing stimulation targets for personalized treatment,” Frontiers in Human Neuroscience, vol. 19, p. 1 682 852, 2025. DOI: https://doi.org/10.3389/fnhum.2025.1682852.
[9] S. Kulkarni, “Expert systems in behavioral and mental healthcare: Applications of ai in decision-making and consultancy,” Big Data Analytics and Machine Intelligence in Biomedical and Health Informatics: Concepts, Methodologies, Tools and Applications, pp. 147–186, 2022. DOI: https://doi.org/ 10.1002/9781119792376.ch6.
[10] B. Stahnke, “A systematic review of misdiagnosis in those with obsessive-compulsive disorder,” Journal of Affective Disorders Reports, vol. 6, p. 100 231, 2021, ISSN: 2666-9153. DOI: https://doi.org/ 10.1016/j.jadr.2021.100231. [Online]. Available: https://www.sciencedirect. com/science/article/pii/S2666915321001578.
[11] L. Weinberg, L. A. Martin, K. M. Post, and E. J. Ricketts, “Psychologists’ diagnostic accuracy and treatment recommendations for obsessive-compulsive disorder,” Journal of Clinical Psychology, vol. 81, no. 5, pp. 324–333, 2025. DOI: https://doi.org/10.1002/jclp.23775.
[12] X. Liu and Q. Fan, “Early identification and intervention in pediatric obsessive-compulsive disorder,” Brain Sciences, vol. 13, no. 3, 2023, ISSN: 2076-3425. DOI: 10 . 3390 / brainsci13030399. [Online]. Available: https://www.mdpi.com/2076-3425/13/3/399.
[13] D. Faustino, M. M. Goncalves, R. Braga, M. J. Faria, and J. T. Oliveira, “Exposure and response prevention in ocd: A framework to capitalize change,” Journal of Clinical Psychology, 2025. DOI: https://doi.org/10.1002/jclp.23797.
[14] S. C. Jessup, A. Mariaskin, and B. O. Olatunji, “Strategies for optimizing traditional exposure and response prevention: A case study example in an adolescent with contamination-based ocd,” Journal of Clinical Psychology, vol. 81, no. 3, pp. 182–192, 2025. DOI: https://doi.org/10.1002/ jclp.23758.
[15] B. A. Zaboski and L. Bednarek, “Precision psychiatry for obsessive-compulsive disorder: Clinical applications of deep learning architectures,” Journal of Clinical Medicine, vol. 14, no. 7, p. 2442, 2025. DOI: https://doi.org/10.3389/fpsyt.2025.1750938.
[16] F.-F. Huang et al., “Functional and structural mri based obsessive-compulsive disorder diagnosis using machine learning methods,” BMC psychiatry, vol. 23, no. 1, p. 792, 2023. DOI: https://doi.org/ 10.1186/s12888-023-05299-2.
[17] B. A. Zaboski, A. Wilens, J. P. McNamara, and G. N. Muller, “Predicting ocd severity from religiosity and personality: A machine learning and neural network approach,” Journal of Mood & Anxiety Disorders, vol. 8, p. 100 089, 2024, ISSN: 2950-0044. DOI: https : / / doi . org / 10 . 1016 / j . xjmad . 2024 . 100089. [Online]. Available: https : / / www . sciencedirect . com / science/article/pii/S2950004424000439.
[18] M. Sachdeva, H. K. Sharma, A. Kumar, A. Bansal, K. Saluja, and Shikha, “Applying neural imaging and ml to ocd severity prediction,” in 2022 Seventh International Conference on Parallel, Distributed and Grid Computing (PDGC), 2022, pp. 402–406. DOI: 10.1109/PDGC56933.2022.10053257.
[19] B. A. Zaboski and L. Bednarek, “Precision psychiatry for obsessive-compulsive disorder: Clinical applications of deep learning architectures,” Journal of Clinical Medicine, vol. 14, no. 7, 2025, ISSN: 2077-0383. DOI: 10.3390/jcm14072442. [Online]. Available: https://www.mdpi.com/ 2077-0383/14/7/2442.
[20] W. S. Aljebreen, N. A. Alturaiqi, M. I. Almushyti, H. F. Alhasson, and S. S. Alharbi, “Advancing precision psychiatry: Machine learning integration with neuroimaging for early detection and diagnosis of obsessive-compulsive disorder,” Psychiatry Research: Neuroimaging, vol. 357, p. 112 137, 2026, ISSN: 0925-4927. DOI: https://doi.org/10.1016/j.pscychresns.2026.112137. [Online]. Available: https : / / www . sciencedirect . com / science / article / pii /
S0925492726000028.
[21] M. Naderi and A. Jahanian-Najafabadi, “A systematic review of eeg-based machine learning classifications for obsessive-compulsive disorder: Current status and future directions,” BMC psychiatry, vol. 25, no. 1, p. 854, 2025. DOI: https://doi.org/10.1186/s12888-025-07296-z.
[22] U. M. Haque, E. Kabir, and R. Khanam, “Early detection of paediatric and adolescent obsessive–compulsive, separation anxiety and attention deficit hyperactivity disorder using machine learning algorithms,” Health information science and systems, vol. 11, no. 1, p. 31, 2023. DOI: https: //doi.org/10.1007/s13755-023-00232-z.
[23] K. Patel, A. K. Tripathy, L. N. Padhy, S. K. Kar, S. K. Padhy, and S. P. Mohanty, “Accu-help: A machine-learning-based smart healthcare framework for accurate detection of obsessive compulsive disorder,” SN Computer Science, vol. 5, no. 1, p. 36, 2023. DOI: https://doi.org/10.1007/ s42979-023-02380-1.
[24] Naseerullah, M. Hayat, N. Iqbal, M. Tahir, S. A. AlQahtani, and A. M. Alamri, “Early diagnosis of obsessives-compulsive disorder through gene expression analysis using machine learning models,” Chemometrics and Intelligent Laboratory Systems, vol. 248, p. 105 107, 2024, ISSN: 0169-7439. DOI: https://doi.org/10.1016/j.chemolab.2024.105107. [Online]. Available: https: //www.sciencedirect.com/science/article/pii/S0169743924000479.
[25] M. Tubio-Fungueirino et al., “Prediction of pharmacological response in ocd using machine learning techniques and clinical and neuropsychological variables,” Spanish Journal of Psychiatry and Mental Health, vol. 18, no. 1, pp. 51–57, 2025, ISSN: 2950-2853. DOI: https://doi.org/10.1016/ j . sjpmh . 2024 . 11 . 001. [Online]. Available: https : / / www . sciencedirect . com / science/article/pii/S295028532400070X.
[26] C. Segalas et al., “Cognitive and clinical predictors of a long-term course in obsessive compulsive disorder: A machine learning approach in a prospective cohort study,” Journal of Affective Disorders, vol. 350, pp. 648–655, 2024, ISSN: 0165-0327. DOI: https://doi.org/10.1016/j.jad. 2024 . 01 . 157. [Online]. Available: https : / / www . sciencedirect . com / science / article/pii/S0165032724001757.
[27] M. Grassi et al., “Prediction of illness remission in patients with obsessive-compulsive disorder with supervised machine learning,” Journal of Affective Disorders, vol. 296, pp. 117–125, 2022, ISSN: 0165-0327. DOI: https://doi.org/10.1016/j.jad.2021.09.042. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0165032721010016.
[28] Z. Zhao et al., “Exploring potential resting-state eeg biomarkers of obsessive-compulsive disorder based on explainable machine learning analysis of independent training and test samples,” BMC psychiatry, vol. 25, no. 1, p. 1164, 2025. DOI: https://doi.org/10.1186/s12888-025-07583-9.
[29] S. Hinduja et al., “Multimodal prediction of obsessive-compulsive disorder and comorbid depression severity and energy delivered by deep brain electrodes,” IEEE Transactions on Affective Computing, vol. 15, no. 4, pp. 2025–2041, 2024. DOI: 10.1109/TAFFC.2024.3395117.
[30] W. B. Bruin et al., “The functional connectome in obsessive-compulsive disorder: Resting-state mega-analysis and machine learning classification for the enigma-ocd consortium,” Molecular psychiatry, vol. 28, no. 10, pp. 4307–4319, 2023. DOI: https://doi.org/10.1038/s41380- 023-02077-0.