Skip to content
Licensed Unlicensed Requires Authentication Published by De Gruyter February 10, 2022

Automated detection of clinical depression based on convolution neural network model

  • Dan-Dan Yan , Lu-Lu Zhao EMAIL logo , Xin-Wang Song , Xiao-Han Zang and Li-Cai Yang EMAIL logo


As a common mental disorder, depression is placing an increasing burden on families and society. However, the current methods of depression detection have some limitations, and it is essential to find an objective and efficient method. With the development of automation and artificial intelligence, computer-aided diagnosis has attracted more and more attention. Therefore, exploring the use of deep learning (DL) to detect depression has valuable potential. In this paper, convolutional neural network (CNN) is applied to build a diagnostic model for depression based on electroencephalogram (EEG). EEG recordings are analyzed by three different CNN structures, namely EEGNet, DeepConvNet and ShallowConvNet, to dichotomize depression patients and healthy controls. EEG data were collected in the resting state from three electrodes (Fp1, Fz, Fp2) among 80 subjects (40 depressive patients and 40 normal subjects). After the preprocessing step, the DL structures are employed to classify the data, and their recognition performance is evaluated by comparing the classification results. The classification performance shows that depression was effectively detected using EEGNet with 93.74% accuracy, 94.85% sensitivity and 92.61% specificity. In the process of optimizing the parameters of EEGNet structure, the highest accuracy can reach 94.27%. Compared with traditional diagnostic methods, EEGNet is highly worthy for the future depression detection and valuable in terms of accuracy and speed.

Corresponding authors: Lu-Lu Zhao, School of Instrument Science and Engineering, Southeast University, Nanjing 210096, China, E-mail: ; and Li-Cai Yang, School of Control Science and Engineering, Shandong University, Jinan 250061, China, E-mail:


The authors appreciate the psychiatrists and nurses from the Second Affiliated Hospital of Jining Medical College, for their long time help in patients’ data collection.

  1. Research funding: Authors state no funding involved.

  2. Conflict of interest: Authors state no conflict of interest.

  3. Informed consent: Informed consent has been obtained from all individuals included in this study.

  4. Ethical approval: Ethical approval was given by the ethics committee of the Second Affiliated Hospital of Jining Medical College.


Table A1:

Listing of the DeepConvNet layers and their properties.

Block Layer Filter size Output Other parameters
1 Input (1, 3, 1,500)
Conv2D (1, 10) (25, 3, 1,491) Filters=25, mode=valid
Conv2D (3, 1) (25, 1, 1,491) Filters=25, mode=valid
BatchNorm (25, 1, 1,491)
Activation (25, 1, 1,491) Activation=ELU
MaxPooling2D (1, 3) (25, 1, 497)
Dropout (25, 1, 497) Rate=0.5
2 Conv2D (1, 10) (50, 1, 488) Filters=50, mode=valid
BatchNorm (50, 1, 488)
Activation (50, 1, 488) Activation=ELU
MaxPooling2D (1, 3) (50, 1, 162)
Dropout (50, 1, 162) Rate=0.5
3 Conv2D (1, 10) (100, 1, 153) Filters=50, mode=valid
BatchNorm (100, 1, 153)
Activation (100, 1, 153) Activation=ELU
MaxPooling2D (1, 3) (100, 1, 51)
Dropout (100, 1, 51) Rate=0.5
4 Conv2D (1, 10) (200, 1, 42) Filters=200, mode=valid
BatchNorm (200, 1, 42)
Activation (200, 1, 42) Activation=ELU
MaxPooling2D (1, 3) (200, 1, 14)
Dropout (200, 1, 14) Rate=0.5
Classification Flatten 2,800
Dense 2 Activation=Softmax
Table A2:

Listing of the ShallowConvNet layers and their properties.

Layer Filter size Output Other parameters
Input (1, 3, 1,500)
Conv2D (1, 25) (40, 3, 1,476) Filters=40, mode=valid
Conv2D (3, 1) (40, 1, 1,476) Filters=40, mode=valid
BatchNorm (40, 1, 1,476)
Activation (40, 1, 1,476) Activation=square
AveragePooling2D (1, 75) (40, 1, 94) Strides=(1, 15)
Activation (40, 1, 94) Activation=log
Dropout (40, 1, 94) Rate=0.5
Flatten 3,760
Dense 2 Activation=Softmax


1. Organization WH. Depression and other common mental disorders: global health estimates. World Health Organization; 2017.Search in Google Scholar

2. Lu, Y, Tang, C, Liow, CS, Ng, WWN, Ho, CSH, Ho, RCM. A regressional analysis of maladaptive rumination, illness perception and negative emotional outcomes in Asian patients suffering from depressive disorder. Asian J Psychiatry 2014;12:69–76. in Google Scholar

3. Smith, K. Mental health: a world of depression. Nature 2014;515:180–1. in Google Scholar

4. Cai, H, Han, J, Chen, Y, Sha, X, Wang, Z, Hu, B, et al.. A pervasive approach to EEG-based depression detection. In: Wang, H, editor. Complexity; 2018, vol 2018:5238028 p.10.1155/2018/5238028Search in Google Scholar

5. Robinson, DL. The technical, neurological and psychological significance of ‘alpha’, ‘delta’ and ‘theta’ waves confounded in EEG evoked potentials: a study of peak latencies. Clin Neurophysiol 1999;110:1427–34. in Google Scholar

6. Craik, A, He, Y, Contreras-Vidal, JL. Deep learning for electroencephalogram (EEG) classification tasks: a review. J Neural Eng 2019;16:031001. in Google Scholar PubMed

7. Li, L, Ma, N, Li, Z, Tan, L, Liu, J, Gong, G, et al.. Prefrontal white matter abnormalities in young adult with major depressive disorder: a diffusion tensor imaging study. Brain Res 2007;1168:124–8. in Google Scholar PubMed

8. Taylor, WD, MacFall, JR, Payne, ME, McQuoid, DR, Provenzale, JM, Steffens, DC, et al.. Late-life depression and microstructural abnormalities in dorsolateral prefrontal cortex white matter. Am J Psychiatr 2004;161:1293–6. in Google Scholar PubMed

9. Murphy, CF, Gunning-Dixon, FM, Hoptman, MJ, Lim, KO, Ardekani, B, Shields, JK, et al.. White-matter integrity predicts stroop performance in patients with geriatric depression. Biol Psychiatr 2007;61:1007–10. in Google Scholar PubMed PubMed Central

10. Rahman, MA, Hossain, MA, Kabir, MR, Sani, MH, Abdullah-Al-Mamun, Awal, MA. Optimization of sleep stage classification using single-channel EEG signals. In: 2019 4th International conference on electrical information and communication technology (EICT), Khulna, Bangladesh. IEEE; 2019:1–6 pp.10.1109/EICT48899.2019.9068825Search in Google Scholar

11. Bachmann, M, Lass, J, Hinrikus, H. Single channel EEG analysis for detection of depression. Biomed Signal Process Control 2017;31:391–7. in Google Scholar

12. Sharma, M, Achuth, PV, Deb, D, Puthankattil, SD, Acharya, UR. An automated diagnosis of depression using three-channel bandwidth-duration localized wavelet filter bank with EEG signals. Cognit Syst Res 2018;52:508–20. in Google Scholar

13. Bhati, D, Sharma, M, Pachori, RB, Nair, SS, Gadre, VM. Design of time–frequency optimal three-band wavelet filter banks with unit Sobolev regularity using frequency domain sampling. Circ Syst Signal Process 2016;35:4501–31. in Google Scholar

14. Bachmann, M, Päeske, L, Kalev, K, Aarma, K, Lehtmets, A, Ööpik, P, et al.. Methods for classifying depression in single channel EEG using linear and nonlinear signal analysis. Comput Methods Progr Biomed 2018;155:11–7. in Google Scholar PubMed

15. Thoduparambil, PP, Dominic, A, Varghese, SM. EEG-based deep learning model for the automatic detection of clinical depression. Phys Eng Sci Med 2020;43:1349–60. in Google Scholar PubMed

16. Dose, H, Møller, JS, Puthusserypady, S, Iversen, HK. A deep learning MI-EEG classification model for BCIs. In: 2018 26th European signal processing conference (EUSIPCO), Rome, Italy. IEEE; 2018. pp. 1676–9.10.23919/EUSIPCO.2018.8553332Search in Google Scholar

17. Mei, H, Xu, X. EEG-based emotion classification using convolutional neural network. In: 2017 International conference on security, pattern analysis, and cybernetics (SPAC), Shenzhen, China. IEEE; 2017:130–5 pp. in Google Scholar

18. Ullah, I, Hussain, M, Qazi, E-H, Aboalsamh, H. An automated system for epilepsy detection using EEG brain signals based on deep learning approach. Expert Syst Appl 2018;107:61–71. in Google Scholar

19. Chambon, S, Thorey, V, Arnal, PJ, Mignot, E, Gramfort, A. A deep learning architecture to detect events in EEG signals during sleep. In: 2018 IEEE 28th international workshop on machine learning for signal processing (MLSP), Aalborg, Denmark, IEEE; 2018:1–6 pp.10.1109/MLSP.2018.8517067Search in Google Scholar

20. Acharya, UR, Oh, SL, Hagiwara, Y, Tan, JH, Adeli, H, Subha, DP. Automated EEG-based screening of depression using deep convolutional neural network. Comput Methods Progr Biomed 2018;161:103–13. in Google Scholar PubMed

21. Lawhern, VJ, Solon, AJ, Waytowich, NR, Gordon, SM, Hung, CP, Lance, BJ. EEGNet: a compact convolutional neural network for EEG-based brain–computer interfaces. J Neural Eng 2018;15:056013. in Google Scholar PubMed

22. Raza, H, Chowdhury, A, Bhattacharyya, S. Deep learning based prediction of EEG motor imagery of stroke patients’ for neuro-rehabilitation application. In: 2020 International joint conference on neural networks (IJCNN), Glasgow, UK. IEEE; 2020:1–8 pp.10.1109/IJCNN48605.2020.9206884Search in Google Scholar

23. Schirrmeister, RT, Springenberg, JT, Fiederer, LDJ, Glasstetter, M, Eggensperger, K, Tangermann, M, et al.. Deep learning with convolutional neural networks for EEG decoding and visualization. Hum Brain Mapp 2017;38:5391–420. in Google Scholar PubMed PubMed Central

24. Ju, C, Gao, D, Mane, R, Tan, B, Liu, Y, Guan, C. Federated transfer learning for EEG signal classification. In: 2020 42nd Annual international conference of the IEEE Engineering in Medicine Biology Society (EMBC), Montreal, QC, Canada. IEEE; 2020:3040–5 pp.10.1109/EMBC44109.2020.9175344Search in Google Scholar PubMed

25. Hamilton, M. A rating scale for depression. J Neurol Neurosurg Psychiatry 1960;23:56. in Google Scholar PubMed PubMed Central

26. Zimmerman, M, Martinez, JH, Young, D, Chelminski, I, Dalrymple, K. Severity classification on the Hamilton depression rating scale. J Affect Disord 2013;150:384–8. in Google Scholar PubMed

27. George, MS, Ketter, TA, Post, RM. Prefrontal cortex dysfunction in clinical depression. Depression 1994;2:59–72. in Google Scholar

28. Zhang, J, Zhong, Q, Dai, Y. The determination of the threshold and the decomposition order in threshold de-noising method based on wavelet transform. In: Proceedings of the Chinese Society for Electrical Engineering, Beijing, China; 2004:118–22 pp.Search in Google Scholar

29. Zhang, T, Chen, W, Li, M. AR based quadratic feature extraction in the VMD domain for the automated seizure detection of EEG using random forest classifier. Biomed Signal Process Control 2017;31:550–9. in Google Scholar

30. Rui, Z, Yan, R, Chen, Z, Mao, K, Gao, RX. Deep learning and its applications to machine health monitoring. Mech Syst Signal Process 2019;115:213–37.10.1016/j.ymssp.2018.05.050Search in Google Scholar

31. Ang, KK, Chin, ZY, Zhang, H, Guan, C. Filter Bank common spatial pattern (FBCSP) in brain-computer interface. In: 2008 IEEE International Joint Conference on Neural Networks (IEEE World Congress on Computational Intelligence), Hong Kong, China. IEEE; 2008:2390–7 pp.Search in Google Scholar

32. Liao, S-C, Wu, C-T, Huang, H-C, Cheng, W-T, Liu, Y-H. Major depression detection from EEG signals using kernel Eigen-filter-bank common spatial patterns. Sensors 2017;17:1385. in Google Scholar PubMed PubMed Central

33. Uyulan, C, Ergüzel, TT, Unubol, H, Cebi, M, Sayar, GH, Asad, MN, et al.. Major depressive disorder classification based on different convolutional neural network models: deep learning approach. Clin EEG Neurosci 2021;52:38–51. in Google Scholar PubMed

34. Shim, M, Im, C-H, Kim, Y-W, Lee, S-H. Altered cortical functional network in major depressive disorder: a resting-state electroencephalogram study. NeuroImage Clin 2018;19:1000–7. in Google Scholar PubMed PubMed Central

35. Damborská, A, Tomescu, MI, Honzírková, E, Barteček, R, Hořínková, J, Fedorová, S, et al.. EEG resting-state large-scale brain network dynamics are related to depressive symptoms. Front Psychiatr 2019;10:548.10.3389/fpsyt.2019.00548Search in Google Scholar PubMed PubMed Central

36. Kalev, K, Bachmann, M, Orgo, L, Lass, J, Hinrikus, H. Lempel-Ziv and multiscale Lempel-Ziv complexity in depression. In: 2015 37th Annual international conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Milan, Italy. IEEE; 2015:4158–61 pp.10.1109/EMBC.2015.7319310Search in Google Scholar PubMed

37. Lee, PF, Kan, DPX, Croarkin, P, Phang, CK, Doruk, D. Neurophysiological correlates of depressive symptoms in young adults: a quantitative EEG study. J Clin Neurosci 2018;47:315–22. in Google Scholar PubMed

38. Zhao, L, Yang, L, Li, B, Su, Z, Liu, C. Frontal alpha complexity of different severity depression patients. J Healthc Eng 2020;2020:8854725. in Google Scholar PubMed PubMed Central

Received: 2021-07-24
Accepted: 2022-01-24
Published Online: 2022-02-10
Published in Print: 2022-04-26

© 2022 Walter de Gruyter GmbH, Berlin/Boston

Downloaded on 30.11.2023 from
Scroll to top button