# A Hybrid CNN-GRU-LSTM Algorithm with SHAP-Based Interpretability for EEG-Based ADHD Diagnosis
## 6 Conclusions  
This study proposed a novel, interpretable deep learning framework for EEG-based diagnosis of ADHD in children. By integrating CNN, recurrent (GRU and LSTM), and transformer components, the study systematically evaluated a range of architectures--from baseline CNN-LSTM and CNN-GRU-LSTM models to transformer encoders, a spatiotemporal transformer, and the newly introduced hybrid CNN-RNN-transformer model. Among all architectures, the hybrid CNN-GRU-LSTM model outperformed conventional recurrent models by capturing both short- and long-term temporal dependencies alongside robust spatial features. While transformer-based models demonstrated impressive accuracy during cross-validation, they exhibited limitations in generalization, particularly due to a high false positive rate and reduced specificity. The spatiotemporal transformer partially addressed these issues through the use of 2D positional encoding, yielding near-perfect performance on several metrics. Nonetheless, the proposed hybrid CNN-RNN-transformer model outperformed others on all metrics evaluated, i.e., accuracy, F1-score, AUC, MCC, and class balance. The model's multi-faceted synergistic architecture provides the ability to capture localized, local, and global temporal dependencies at the same time. Also, SHAP-based interpretability confirms the interpretable importance of certain EEG regions relevant to ADHD pathophysiology. Notably, the CNN-GRU-LSTM model demonstrates strong diagnostic reliability with low variance, offering an efficient and interpretable alternative to more complex transformer-based architectures.  
In summary, this study provides a strong foundation for the ADHD detection system using EEG by automating the processes and making it interpretable at the same time, facilitating the development of transparent AI-powered technology in pediatric neurodiagnostics.  
Conceptualization, M.B., M.A., M.K., L.A., and U.S.; methodology, M.B., M.K., R.B., and A.K.; software, M.A., M.O., and M.K.; validation, M.A., and U.S.; formal analysis, M.A., M.K., Z.S., and G.U.; investigation, M.B., M.K., L.A., and Z.S.; resources, M.A., U.S., and M.O.; data curation, M.O. and G.U.; writing--original draft preparation, M.B. and M.K.; writing--review and editing, M.B., M.K., and L.A.; visualization, M.B., M.A., and M.K.; supervision, M.B.; project administration, M.B. and M.A.; funding acquisition, M.K. All authors have read and agreed to the published version of the manuscript.  
This research has been funded by the Committee of Science of the Ministry of Science and Higher Education of the Republic of Kazakhstan (Grant No. AP26105045 \"Development of artificial intelligence models and algorithms for analyzing social signals in children with autism\").  
Data Availability Statement: The dataset used in this study was collected by Shahed University and is publicly accessible via the IEEE DataPort repository at [[https://ieee-dataport.org/open-access/eeg-data-adhd-control-children](https://ieee-dataport.org/open-access/eeg-data-adhd-control-children)]([https://ieee-dataport.org/open-access/eeg-data-adhd-control-children](https://ieee-dataport.org/open-access/eeg-data-adhd-control-children)) (accessed on 10 June 2025).  
**Acknowledgments:** Throughout the preparation of this manuscript, the authors used the OpenAI GPT-4 model for the purposes of linguistic enhancement and text editing. The authors have reviewed and edited the generated output carefully and are entirely responsible for the contents of this publication.  
**Conflicts of Interest:** The authors declare no conflicts of interest.