# A Hybrid CNN-GRU-LSTM Algorithm with SHAP-Based Interpretability for EEG-Based ADHD Diagnosis
## 3 Materials and Methods
### Dataset Collection  
The dataset used in this study was collected by Shahed University and is publicly accessible via the IEEE DataPort repository [[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). It was specifically designed to support research on ADHD in children through the analysis of EEG signals. The primary purpose of this dataset is to identify ADHD and TD children based on neurophysiological differences. These EEG recordings are a guided and annotated resource that enable machine learning algorithms to be created and evaluated for the automatic classification of cognitive and attention states. Therefore, the dataset has an important application in the creation of data-driven diagnostic tools and intelligent clinical decision support systems in the field of pediatric neurodevelopmental disorders. The data consist of EEG recordings from 121 children aged 7 to 12 years, comprising 61 ADHD children and 60 TD controls. ADHD was clinically diagnosed by a psychiatrist based on DSM-IV criteria. All the ADHD children were receiving Ritalin for a period of up to six months prior to data collection. EEG was registered using 19 electrodes placed according to the international 10-20 system. Recordings were accomplished at a sampling rate of 128 Hz, and the reference electrodes were placed on the earlobes (A1 and A2). The task was a visual cognitive task in which the participants looked at images of cartoon characters and had to count them (numbers ranging from 5 to 16). EEG samples were recorded during the task and analyzed to determine stimulus-locked neural responses and temporal dynamics of cognitive processing. A single EEG sample was stored as a single row in the dataset, with numeric values for all 19 channels and two additional columns:  
Class: Target label (0 = control, 1 = ADHD);  
ID: Unique identifier of the EEG record. These electrode sites are Fp1, Fp2, F3, F4, C3, C4, P3, P4, O1, O2, F7, F8, T7, T8, P7, P8, Fz, Cz, and Pz. Recording was performed in a controlled setting with a rigidly predetermined protocol to provide consistency and reproducibility. The ensuing dataset is a treasure to the fields of neuroscience and computational science, facilitating the creation of advanced diagnostic systems intended for clinical decision-making via EEG biomarkers. Figure 1 displays the distribution of the EEG dataset classes utilized in the current study. Class 0 indicates TD children (control), while Class 1 illustrates children with ADHD. The dataset is a valuable asset in machine learning modeling because it provides unbiased data across all classes, which can be useful when training new models. Enhanced class imbalance is linked to an improved processing power that enhances the classification process and minimizes errors. A heatmap of power spectral density (PSD) for five frequency bands--delta (1-4 GHz), theta (4-8 Hz), alpha (8-13 Hz), beta (13-30 Hz), and gamma (30-45 Hz)--is shown in Figure 2. It is averaged across all the EEG segments in both the control and ADHD groups. The top panel of the figure displays results for TD children (control). Alpha and beta activities are more prominent in the frontal (F3 and F4), central (C3 and C4), and  
Figure 1: Class distribution in EEG dataset. Figure 2: PSD patterns across EEG bands and channels in control and ADHD groups. parieto-occipital (P3, P4, O1, and O2) areas, indicating that cognitive engagement and attention stability during the task are indicators of high activity levels. Theta-band power is moderately spread over most channels, with no obvious peaks, which is characteristic of a resting or concentrated cognitive state. The lower panel displays the corresponding heatmap for the ADHD-diagnosed group.