Epileptic spasm recognition: EEG classification using time–frequency features and machine learning Authors: Yingtao Zhang, Jieming Li, Lin Li, Yan Chen, Jinlong Li, Wei Xing Published: 2025 ABSTRACT AbstractEpileptic spasm (ES), characterized by sudden muscle contractions and loss of consciousness, poses significant challenges in early diagnosis and treatment, especially in infants and young children. Despite advances in EEG-based seizure detection, the automatic classification of ES remains a complex task due to the variability of seizure patterns. In this study, we propose an approach for classifying ES EEG based on clinically collected data, using time–frequency domain features derived from EEG signals and machine learning models. A total of 54 time–frequency features were extracted, and three machine learning algorithms—Random Forest (RF), K-Nearest Neighbors (KNN), and Support Vector Machine (SVM)—were employed to classify the seizures. The results show that the RF model achieved the highest classification accuracy of 81.18% when fewer features were used, whereas KNN has increased performances with larger feature sets. This work highlights the potential of combining time–frequency features with machine learning for accurate seizure classification, offering a promising tool for automated monitoring and diagnosis of ES. Further research is needed to refine feature extraction methods and improve model robustness for clinical applications.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12938-025-01483-5.Keywords: Epileptic spasm, EEG classification, Time–frequency features, Machine learning Introduction Epileptic seizures impact approximately 10% of the global population and lead to epilepsy in about 1%–2% of individuals worldwide [1]. Among them, the incidence of epilepsy is highest in infants and young children, with a range of 81–118 cases per 100,000 persons per year [2]. In this age group, epileptic spasms (ES) are one of the most common seizure types [3]. ES is typically manifested as brief symmetric, salaam-like contractions of the trunk, accompanied by extension and elevation of the arms and tonic extension of the legs [4]. These spasms usually occur in clusters of 3–20, with multiple episodes occurring daily. Epileptic spasms, arrest of psychomotor development, and hypsarrhythmia on electroencephalogram (EEG) collectively characterize West syndrome, an age-specific epileptic encephalopathy that profoundly affects intellectual development in children [5]. Thus, early detection and treatment of ES are of great significance. Traditionally, neurologists rely on visual EEG inspection to detect ES, a method that is labor-intensive, time consuming, costly, and prone to human error. Therefore, the implementation of automated detection systems can significantly improve the diagnostic process for clinicians. A reliable solution involves extracting discriminative features from seizure and nonseizure EEG signals, followed by training classifiers to recognize ES patterns [6]. Effective feature selection and classification algorithms are critical for achieving diagnostic accuracy [7]. Moreover, identifying robust features not only enhances the understanding of ES pathophysiology but also guides clinical decision making and improves algorithm generalizability. Despite these benefits, feature selection strategies tailored to ES remain underdeveloped, partly due to limited data availability. The recent advances in time–frequency analysis and machine learning have shown promise for seizure detection [8–10]. Although previous studies have focused on status epilepticus [11, 12], the current approaches extract features from multiple domains: time–domain parameters capture amplitude dynamics [13], frequency–domain analysis reveals spectral patterns [14], and wavelet transforms provide time–frequency resolution [15]. However, the optimal feature subset for ES classification remains unclear. Machine learning models, including Random Forest (RF), Support Vector Machine (SVM), and K-Nearest Neighbors (KNN), have shown promise in EEG-based seizure detection. RF leverages ensemble learning to reduce overfitting and enhance generalizability. For example, Ben et al. achieved 82.07% sensitivity in seizure prediction using RF classifiers [16]. Ridouh et al. combined SVM with DWT, in which the features extracted from the sub-bands were fed into the SVM for training to evaluate the overall performance of the model [17]. SVM excels in high-dimensional spaces by mapping data via kernel functions; Zhang et al. reported 100% sensitivity with an RBF-SVM model [18]. KNN, while simpler, relies on distance metrics for classification. Wang et al. proposed a multi-distance KNN variant (CRMKNN) that achieved 99.5% accuracy in epilepsy diagnosis [19]. These findings underscore the importance of model selection and parameter optimization for maximizing classification performance. The datasets used in the aforementioned studies mainly focus on the ictal state of epilepsy, where a single episode may contain multiple seizures. To the best of our knowledge, no publicly available dataset specifically targeting the epileptic spasm pattern has been released so far. The dataset collected in this study fills this gap. In this study, we collected EEG data from patients with ES and extracted 54 time–frequency features during seizure and nonseizure periods. We employed the minimum redundancy maximum relevance (mRMR) algorithm for feature selection and evaluated three classifiers (RF, SVM, KNN) to identify the optimal strategy for ES detection. Our approach achieved high-precision classification, demonstrating the feasibility of automated ES monitoring. The remainder of this paper is organized as follows: Sect. “Results and discussion” presents the results and discussion; Sect. “Conclusion” presents the conclusions; Sect. “Experimental setup” details data acquisition, preprocessing, and methodology. Results and discussion The initial experiment evaluated the classification efficacy using all 54 features without selection. For the Random Forest (RF) classifier, increasing the number of decision trees (n_estimators) beyond 500 yielded diminishing returns in accuracy improvement, while limiting the maximum tree depth (max_depth) to 30 effectively balanced model complexity and generalization. The out-of-bag (OOB) score reached 0.79, corroborating the test accuracy of 80.22%. As shown in Fig. 1, Support Vector Machine (SVM) with RBF kernel exhibited strong dependence on regularization parameter C and kernel coefficient gamma. A grid search over logarithmic scales identified C = 10 and gamma = 0.1 as optimal values, achieving 76.42% accuracy. Higher C values (> 100) led to overfitting, evidenced by widening gaps between training and validation accuracy. Final loss in the key parameter intervals using support vector machine: a Regulation parameter C, b Kernel parameter gamma The K-Nearest Neighbors (KNN) classifier showed a nonlinear relationship between neighbor count (K) and performance, as shown in Fig. 2. With Manhattan distance weighting, K = 2 achieved peak accuracy (81.18%), despite theoretical expectations that small K values increase noise sensitivity. This anomaly suggested potential feature space distortions in high dimensions, which subsequent feature selection addressed. Classification accuracy using different number of neighbors of KNN Hence, selected key parameters of Random Forest (RF), Support Vector Machine (SVM), and K-Nearest Neighbors (KNN) are shown in Table 1. Table 1Parameters selection of Random Forest (RF), Support Vector Machine (SVM), and K-Nearest Neighbors (KNN) classifiersRFSVMKNNParameterValueParameterValueParameterValueEstimators500C10K2max_depth30KernelrbfWeightsUniformmax_featuresNoneGamma0.1MetricManhattan Parameters selection of Random Forest (RF), Support Vector Machine (SVM), and K-Nearest Neighbors (KNN) classifiers As shown in Table 2, quantitative evaluation metrics highlighted critical performance trade-offs. Although RF maintained balanced precision (78.11%) and recall (83.15%), KNN achieved exceptional recall (83%) at the cost of elevated false positives (22.62%). The SVM model showed symmetrical error patterns with 20.97% false negatives and 26.11% false positives. Table 2Classification performance using all of 54 extracted featuresEvaluation metricsAccuracyPrecisionRecallF1-scoreML modelRandom forest80.22%78.11%83.15%80.54%Support vector machine76.42%74.61%79.03%76.75%K-nearest neighbors81.18%79.65%83%81.29% Classification performance using all of 54 extracted features As evidenced by the confusion matrix analysis in Fig. 3, KNN achieves a clinically favorable false negative rate (20.58%), a critical performance metric in seizure detection. However, this diagnostic sensitivity is achieved through an elevated false positive incidence—a trade-off that necessitates rigorous operational analysis in clinical monitoring frameworks. In such systems, the substantial risks associated with missed seizure events generally outweigh the tolerability of occasional false alarms, although optimization of diagnostic specificity remains imperative. Classification confusion matrix of three machine learning classifiers: a Random Forest, b Support Vector Machine, c K-Nearest Neighbors Two fundamental conclusions emerged from this experiment. First, the baseline accuracy exceeding 76% across all models confirmed the discriminative capacity of conventional time–frequency features for ES detection. Second, the observed performance variations underscored the necessity of algorithm selection, where clinical priorities (e.g., minimizing false negatives versus reducing overall error rates) should guide model deployment. These findings set the foundation for subsequent feature selection experiments aimed at optimizing this trade-off. We balanced the number of seizure and nonseizure samples for each patient, conducted fivefold cross-validation, and plotted the ROC curves, as shown in Fig. 4. Analysis of the ROC curves and the corresponding average AUC values indicates that the Random Forest (RF) classifier significantly outperforms both SVM and KNN on this dataset, demonstrating superior capability in distinguishing seizure from nonseizure samples. The SVM achieves a slightly lower average AUC than RF but remains above 0.6, suggesting a moderate discriminative power. In contrast, KNN exhibits relatively limited performance, with an average AUC of only 0.62, indicating its constraints in handling high-dimensional EEG feature spaces. ROC curves of three machine learning classifiers: a Random Forest, b Support Vector Machine, c K-Nearest Neighbors Overall, RF demonstrates the optimal performance for detecting spasmodic epilepsy EEG signals in this study, offering higher sensitivity, robustness, and stability, making it the preferred model for potential clinical auxiliary diagnosis. The results of SVM and KNN provide additional benchmarks, highlighting differences in feature space handling among classifiers. This evaluation also lays the groundwork for further optimization of model architectures, feature selection strategies, and ensemble approaches. The Minimum Redundancy Maximum Relevance (mRMR) algorithm identified salient features for ES detection as shown in Appendix Table A1. It can be seen that the maximum amplitude is the most discriminative feature. However, it may come from data interference because the data used in this study are excerpts, mainly including the EEG when the patient is at rest and during the seizure. In clinical practice, the patient’s blinking and other motor artifacts, and other interferences can cause many maxima to exceed the maximum value at the time of the seizure. Subsequent features in the ranking hierarchy included band-specific power metrics—notably average power in the delta band (0.5–4 Hz) and root mean square (RMS) in the theta band (4–8 Hz)—suggesting that low-frequency oscillations carry critical diagnostic information. Therefore, the dominance of low-frequency features (delta/theta bands) reinforces their diagnostic value, although their integration with artifact detection mechanisms is required to mitigate false positives from motion-related amplitude spikes. Classification performance exhibited nonlinear relationships with feature subset size across algorithms (Fig. 5). The Random Forest (RF) model demonstrated robust performance with minimal features, achieving 79.89% accuracy using only 35 descriptors—a 0.33% reduction compared to full-feature performance. This plateau effect indicated RF’s capacity to leverage complementary features early in the ranking sequence. Conversely, KNN required larger feature sets to maximize accuracy, peaking at 81.18% with all 54 features. The performance gap between RF and KNN narrowed from 11.5% (5-feature set) to 0.96% (full-feature set), suggesting that high-dimensional spaces better accommodate KNN’s distance-based mechanics. Classification performances using different number of mRMR ranking features using three machine learning classifiers: a accuracy, b f1-score, c precision, and d recall Support Vector Machine (SVM) accuracy improved monotonically from 54.2% (5 features) to 76.4% (54 features), indicating progressive hyperplane separability in expanded feature spaces. However, SVM consistently underperformed relative to other models, likely due to nonlinear interactions between ES features that challenge kernel space assumptions. Therefore, Random Forest (RF) demonstrates consistent performance stability under feature reduction, rendering it ideal for resource-constrained environments. KNN achieves superior recall (83%), which justifies its higher computational overhead in critical monitoring contexts where missed seizure detection entails severe consequences. Regarding SVM, its performance exhibits a pronounced enhancement with increased feature dimensionality, suggesting its potential as a robust classifier when additional features beyond the current 54 are incorporated. Meanwhile, we conducted a comparative analysis of studies using different datasets, as shown in Table 3. From the table, it can be seen that Random Forest (RF), Support Vector Machine (SVM), and K-Nearest Neighbors (KNN) are widely used for the detection of epileptic seizure EEG signals, with each classifier showing distinct performance characteristics depending on the feature type. SVM generally achieves high sensitivity when handling low-dimensional or single feature vectors, while RF performs stably with high-dimensional comprehensive features (time and frequency) and also provides feature importance analysis. KNN can serve as an auxiliary classifier or be used in combination under specific feature settings. On the other hand, most current studies on epileptic seizure detection rely on public datasets, such as CHB-MIT, EPILEPSIAE or BONN, which have the advantages of complete annotation and reproducibility but also exhibit certain limitations in specific research tasks, potentially affecting the generalizability of models in real clinical settings. Table 3Overview of studies on epileptic seizure detection using machine learning classifiers, including classifiers, features, performance scores, performance metrics, datasets, and authorsClassifier(s)Feature(s)Performance (%)Performance metricsDatasetAuthorsSVM, random forest, k-NNWDT98.4SensitivityBONNLy V.Tran et al. [20]Random forestTime and frequency93.8SensitivityEPILEPSLAEDonos et al. [21]Random forest, k-NNSpectral power80.87,47.45, 2.5/h,56.23Sensitivity, Precision, FPR, F-ScoreCHB-MITBirjandtalab et al. [22] Overview of studies on epileptic seizure detection using machine learning classifiers, including classifiers, features, performance scores, performance metrics, datasets, and authors Conclusion In this study, we developed a machine learning framework for epileptic spasm (ES) recognition through EEG classification. The results provide a classification benchmark on model and feature-performance correlation analysis, offering a promising tool for automated ES monitoring in clinical settings. The key contributions of this work are summarized as follows: In terms of classification accuracy, we confirm that time–frequency features combined with machine learning classifiers are effective for distinguishing ES EEG from background signals. The highest classification accuracy of 81.18%. In terms of classification accuracy, we confirm that time–frequency features combined with machine learning classifiers are effective for distinguishing ES EEG from background signals. The highest classification accuracy of 81.18%. We extracted 54 time–frequency domain features from ES EEG, and ranked the features using mRMR algorithm, among which Maximum, Average power (0.5-4 Hz), Root mean square(4-8 Hz) and Peak-to-peak(8-16 Hz) amplitude were the most salient features. The rest of the orders can be found in Table A1. We extracted 54 time–frequency domain features from ES EEG, and ranked the features using mRMR algorithm, among which Maximum, Average power (0.5-4 Hz), Root mean square(4-8 Hz) and Peak-to-peak(8-16 Hz) amplitude were the most salient features. The rest of the orders can be found in Table A1. Three machine learning algorithms were evaluated for classification using a reduced feature subset, exhibiting distinct performance profiles: K-Nearest Neighbors (KNN) demonstrated superior accuracy and recall rates, Random Forest (RF) maintained consistent performance stability under feature dimensionality reduction, and Support Vector Machine (SVM) showed a pronounced performance enhancement correlated with increased feature dimensionality. Three machine learning algorithms were evaluated for classification using a reduced feature subset, exhibiting distinct performance profiles: K-Nearest Neighbors (KNN) demonstrated superior accuracy and recall rates, Random Forest (RF) maintained consistent performance stability under feature dimensionality reduction, and Support Vector Machine (SVM) showed a pronounced performance enhancement correlated with increased feature dimensionality. While this study has yielded promising results, further work is needed to improve robustness and clinical applicability. First, the dataset can be further expanded to better enable the models to capture the characteristic patterns of epileptic spasms and improve their generalizability. In addition, patient-independent validation strategies, such as leave-one-patient-out cross-validation, may be explored to facilitate faster deployment in practical applications. Second, this study focused only on the applicability of basic models. With the rapid development of artificial intelligence, more advanced architectures with stronger feature extraction and recognition capabilities, such as Transformer-based models, could be applied to the automated detection of epileptic seizures. Finally, developing real-time monitoring systems integrated with portable devices could provide continuous patient surveillance and assist clinicians in timely diagnosis and intervention. Experimental setup Data acquisition Nine patients with ES confirmed by video-EEG were retrospectively identified at Shenzhen Children’s Hospital between 2018 and 2021. Continuous video-EEG (VEEG; Compumedics, Abbotsford, Victoria, Australia) monitoring was conducted for a minimum of 1 day. The research was approved by the ethics committee of Shenzhen Children’s Hospital. Electrodes positioned according to the international 10–20 system were used to record interictal and ictal epileptiform discharges via VEEG, with continuous monitoring throughout both daytime and nighttime at a sampling rate of 1024 Hz. Four additional surface electromyography (EMG) electrodes were placed on both deltoid muscles to identify the onset of spasms. In this study, a total of 19 EEG channels were employed, including Fp1, Fp2, F3, F4, C3, C4, P3, P4, O1, O2, F7, F8, T7, T8, P7, P8, Fz, Cz, and Pz. These channel configuration follows the international 10–20 system and was selected to ensure comprehensive cortical coverage. Such an arrangement allows the analysis to capture both generalized and focal features that are frequently observed in association with epileptic spasms. At least two experienced clinical epileptologists or neurophysiologists annotated seizure events by marking the onset and offset timestamps across 4–36 continuous segments per patient, capturing both ictal and interictal states. Demographic details and recording characteristics of the patients are summarized in Table 4. Table 4Demographic details of patients and collected Epileptic spasm EEG dataCase noGenderAgeNo. of seizuresRecording length (s)No. of recording segments1F1 year 6 months1843961222M10 months6374343F11 months100644874M10 months3597603365M2 year 4 months29601176F1 year 5 months4819264257F5 months343411958M3 months82126969F10 months25641916Total––189738,199128 Demographic details of patients and collected Epileptic spasm EEG data Data preprocessing The diagnosis of ES was confirmed based on the following criteria: (a) Each event was marked by a sudden contraction of the proximal limb and axial muscles lasting 1–3 s; (b) EEG patterns were consistent with ES in infants and young children. These patterns were characterized as slow-wave transients, which could occur either with or without superimposed fast activity, and/or as an attenuation of the background rhythm. (c) Time-locked EMG recordings from the deltoid muscles demonstrated a brief 300-500 ms crescendo-decrescendo pattern, often presenting with a diamond-shaped configuration (although not always) [23]. A typical ES EEG pattern can be seen in Fig. 6. An isolated typical epileptic spasm EEG trace. a: slow wave of medium to high amplitude superimposed by low-amplitude fast activity; b: spindle-like activity followed by the slow wave; c: postictal decremental activity An EEG dataset was created based on the labeling. First, the EEG data were divided into equal-length segments, each lasting 1 s, referred to as a window. Each window corresponds to the labels provided by the physicians, resulting in either a seizure or nonseizure label. The classification of each window was based on the proportion of seizure time to the total window time. Windows were classified as “seizure” if the seizure duration accounted for more than 10% of the total window length; otherwise, they were classified as “nonseizure,” as depicted in Fig. 7. This classification yielded a total of 6,775 seizure windows and 37,806 nonseizure windows. Definition of the EEG sliding window: W window length, L sliding width, D decision width The EEG characteristics of epileptic spasms show a certain degree of similarity across different patients. As shown in Fig. 8, the EEG recordings of one epileptic spasm event from Patient A and Patient C both contain slow waves coupled with fast rhythms, which serve as the primary criterion for determining whether the segment corresponds to an epileptic spasm. Seizure EEG waveforms from the same channel in patient A and patient C A total of 44,581 data window samples was obtained after the above data processing. The distribution of seizure samples for each patient is summarized in Table 5. To mitigate class imbalance, an equal number of nonseizure windows (6775) were randomly subsampled from the original 37,806 baseline segments. The final dataset (13,550 samples) was partitioned into training (80%) and testing (20%) subsets, preserving the original seizure/nonseizure ratio across splits. Table 5Number of seizure samples per patientPatientACDFIGLMNNo. of seizure samples15453091812896854407146152285 Number of seizure samples per patient EEG feature extraction A total of 54 features were extracted from the EEG signals, as shown in Table 6, spanning three domains: time–domain, frequency–domain, and time–frequency–domain. Time–frequency analysis methods have been demonstrated to be effective in identifying abnormal EEG signals [24]. Each domain captures distinct characteristics of the EEG signals, enabling comprehensive seizure pattern analysis. Table 6Extracted time and frequency features enrolled for the Epileptic spasm EEG analysisTimeMaximum, minimum, mean, standard, skewness, kurtosis, peak-to-peak amplitude, coeff variation, energy, average power, root mean square, nonlinear energy, approximate entropy, sample entropy, fuzzy entropy, hurst, Higuchi, Hjorth activity, Hjorth mobility, Hjorth complexityFrequencyEnergy-PSD, mean frequency, bandwidth, spectral edge frequency, spectral entropy, peak frequencyTime–frequencyMean of absolute value, peak to peak amplitude, energy, average power, root mean square, skewness, kurtosis in 4 frequency bands of delta (1–4 Hz), Theta (4–7), alpha (7–13 Hz), and beta (13–30 Hz) Extracted time and frequency features enrolled for the Epileptic spasm EEG analysis Time–domain analysis directly utilized raw voltage amplitudes to quantify temporal variations in the EEG signal. This approach provides intuitive insights into amplitude dynamics, such as abrupt changes during seizures. The key features included basic statistical measures (mean, minimum, maximum, skewness, kurtosis, and peak-to-peak amplitude), complexity metrics (Hjorth parameters, sample entropy, fuzzy entropy), and energy-related descriptors (signal energy, nonlinear energy). These features are widely adopted in biomedical signal processing due to their computational efficiency and clinical interpretability. Frequency-domain analysis focused on spectral properties derived from power spectral density (PSD) estimation. Using Welch’s method with a 1-s fast Fourier transform (FFT) window, we computed PSD to characterize signal power distribution across frequency bands. Extracted features encompassed total spectral energy, average power, root mean square (RMS), and band-specific metrics (delta band: 0.5–4 Hz, theta band: 4–8 Hz, alpha band: 8–13 Hz, beta band: 13–32 Hz). For each band, energy, entropy, mean frequency, bandwidth, spectral edge frequency (SEF), and peak frequency were calculated. Additionally, nonlinear measures such as approximate entropy and the Hurst exponent were included to capture signal irregularity and long-range dependencies. Figure 9 shows the power spectral density of a 1-s EEG segment from Patient A, visually illustrating the energy distribution across different sub-bands. Power spectral density of a 1-second seizure EEG segment from patient A To capture dynamic frequency-time relationships, we applied discrete wavelet transform [25] (DWT) using a 7-level filter bank with the Daubechies 1 (db1) mother wavelet as illustrated in Fig. 10. The decomposition process yielded two primary sets of coefficients: approximation coefficients (A7) and detail coefficients (D7–D5). The approximation coefficients (A7) represented the low-frequency components of the EEG signal, falling within the delta band (0.5–4 Hz). Conversely, the detail coefficients (D7–D5) captured the high-frequency components of the EEG signal, spanning from the theta to the beta bands (4–32 Hz). From each sub-band, statistical features (mean absolute value, standard deviation, skewness, kurtosis) and energy metrics (sub-band energy, relative spectral power) were extracted. This multi-resolution approach enhances sensitivity to transient seizure patterns that may be obscured in purely time or frequency-domain representations. Relationship between decomposition layer and frequency band In this study, we performed wavelet decomposition on single-channel EEG signals to extract brain activities across different frequency bands. Taking a 1-s EEG segment from Patient A as an example, we used the Daubechies 1 (db1) wavelet and decomposed the signal to the 7th level, resulting in multiple sub-bands. The frequency ranges of these sub-bands correspond to different EEG rhythms, as shown in Table 7. During epileptic seizures, the power spectral density of these sub-bands exhibits abnormal changes. Table 7Frequency bands and corresponding EEG rhythmsSud-bandsFrequency (Hz)EEG rhythmsD516–32Beta bandD68–16Alpha bandD74–8Theta bandA70–4Delta band Frequency bands and corresponding EEG rhythms Figure 11 presents the original EEG signal and its corresponding sub-band decomposition results, allowing a clear visualization of each frequency band. This approach enables independent analysis of brain activities across different frequency bands, laying the foundation for subsequent feature extraction. 1-second original seizure EEG signal sub-band decomposition results Feature selection In this study, we used the Minimum Redundancy Maximum Relevance (mRMR) algorithm for feature selection. The mRMR algorithm not only selects features based on their dependency on the sample class but also considers the relationships between features [26]. In this study, the variables in the extracted channel-based feature vectors are recorded based on the mRMR criterion. Suppose there is a dataset D with N samples and M features. The goal of feature ranking is to generate a new set S from an m-dimensional feature set F = [fi, i = 1,…, M]. Set S contains features that contribute to detecting epileptic spasms and is ranked accordingly. The number of features in S can be adjusted based on the feature quality. The Max-Dependency criterion uses mutual information as the dependency between features and the target class c to select features. Since maximizing dependency is difficult to achieve directly, the average mutual information between each feature fi and class c is used as an approximation of maximum dependency (Max-Relevance), defined as: where I is the mutual information function, fi is the i-th feature in F, and c is the class label vector. The mutual information between two random variables x and y is defined by their probability density functions p(x), p(y), and the joint probability density function px,y. Considering only the dependency would lead to high redundancy, the relationship between features also needs to be accounted for. The Min-Redundancy condition is based on the average mutual information between all pairs of features in S, and features with minimal redundancy are selected. The mathematical formulation is as follows: Two approaches are used in this study, including Mutual Information Quotient (MIQ) and Mutual Information Difference (MID), which are applied to discrete data in D and R. MID is used in this study. The final optimization is performed by: An Incremental Search Method is used to find the optimal solution. When selecting the m-th feature from the set, the formula for this can be written as: Experimental design Three machine learning architectures were implemented: Random Forest (RF) for ensemble-based decision trees, Support Vector Machine (SVM) with radial basis function (RBF) kernel for nonlinear separation, and K-Nearest Neighbors (KNN) for instance-based learning. We selected Support Vector Machine (SVM), Random Forest (RF), and k-Nearest Neighbors (KNN) as classifiers due to their proven effectiveness and widespread application in EEG-based epileptic seizure detection. SVM, as a maximum-margin classifier, exhibits strong generalization ability in high-dimensional feature spaces, making it well-suited for EEG signal classification [27]. RF, an ensemble learning method that constructs multiple decision trees, can capture complex nonlinear relationships and provides robustness when handling diverse EEG patterns [28]. KNN, a simple instance-based learning algorithm, is easy to implement and commonly used as a baseline in EEG studies [29]. These classifiers are not only stable and interpretable but also highly effective even with limited datasets, allowing us to focus on evaluating the discriminative power of the extracted features for epileptic spasms (ES) without the need to fine-tune a single complex model. Hyperparameter optimization employed grid. Due to the considerable variability in the number of seizure samples across patients and the relatively small overall dataset, fivefold cross-validation was ultimately employed to evaluate the effectiveness of the models. For the Random Forest (RF) classifier, the number of decision trees (n_estimators) and maximum tree depth (max_depth) were optimized. Preliminary tests indicated that increasing n_estimators beyond 500 yielded only marginal improvements in accuracy at a significant computational cost, while limiting max_depth to 30 prevented overfitting without sacrificing discriminative power. The SVM classifier utilized a radial basis function (RBF) kernel to handle nonlinear EEG data separability. Two critical hyperparameters were optimized, including the regularization parameter C and kernel coefficient gamma. A logarithmic search space (C: [10–3, 106]; gamma: [10–3, 103]) was explored to balance model complexity and generalization capability. In the KNN classifier, the optimal number of neighbors (K) and distance metric were determined. The Manhattan distance outperformed Euclidean distance in preliminary trials, likely due to its robustness to high-dimensional feature spaces. A K value of 2 achieved peak accuracy, although this configuration’s sensitivity to noise was mitigated through feature selection in subsequent experiments. Three sequential experiments were designed to evaluate classification efficacy: Firstly, we established baseline performance by training models on all 54 features without selection. This aimed to verify whether conventional time–frequency features could distinguish ES from nonseizure EEG. Grid search identified optimal hyperparameters for each classifier, with five-fold cross-validation preventing overoptimistic performance estimates. Secondly, we applied the Minimum Redundancy Maximum Relevance (mRMR) algorithm to rank features by their discriminative power. Mutual information quotient (MIQ) was used to maximize feature-class relevance while minimizing inter-feature redundancy. This step addressed the “curse of dimensionality” and identified parsimonious feature subsets. At last, we systematically evaluated classification performances against increasing feature subset sizes (1–54 features), using the mRMR-derived ranking. Model performance was assessed through four metrics: accuracy, precision, recall, and F1-score. The confusion matrix provided additional insights into false positive/negative trade-offs, which are critical given the clinical consequences of missed ES diagnoses. This allowed determination of the minimal feature set required for robust ES detection and revealed algorithm-specific responses to feature dimensionality. All experiments were implemented in Python 3.8 using PyTorch and Scikit-learn, with reproducibility ensured by fixed random seeds (numpy.random.seed = 42). Supplementary Information Supplementary material 1. Acknowledgements This research was funded by the National Natural Science Foundation of China (Grant No.52475185), Science and Technology Planning Project of Shenzhen (#JCYJ20230807093819039, #JCYJ20230807093815032), Guangdong High-level Hospital Construction Fund (LCYJ2022093, LCYJ2022075). Author contributions J.M.L. and W.X. wrote the main manuscript text. L.L. and Y.C. collect the raw data, Y.T.Z. and W.X. complete the academic rigor verification. J.M.L. and J.L.L. complete the data analysis. All authors reviewed the manuscript. Funding National Natural Science Foundation of China,Guangdong High-level Hospital Construction Fund,Science and Technology Planning Project of Shenzen Municipality. Data availability The EEG dataset used in this study is the property of Shenzhen Children’s Hospital and was provided under a strict data use agreement. This agreement explicitly prohibits the public sharing of either the raw or processed data. Consequently, the data are not available to the public in accordance with the terms of this agreement. Researchers interested in validating the findings or for collaborative research may request access to the data from the corresponding author subject to a data use agreement and approval from the relevant ethics committee. Declarations Ethics approval and consent to participate This study involved a retrospective analysis of medical data. The historical datasets used were fully anonymized, and the research protocol did not involve any interventional procedures. Therefore, institutional ethics approval was obtained in lieu of individual consent. The research strictly adhered to the principles of the Declaration of Helsinki and China’s “Ethical Review Measures for Biomedical Research Involving Human Subjects.” The study protocol was approved by the Medical Ethics Committee of Shenzhen Children’s Hospital (Approval No.: 202305802). Competing interests The authors declare no competing interests. Footnotes Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Supplementary Materials Supplementary material 1. Data Availability Statement The EEG dataset used in this study is the property of Shenzhen Children’s Hospital and was provided under a strict data use agreement. This agreement explicitly prohibits the public sharing of either the raw or processed data. Consequently, the data are not available to the public in accordance with the terms of this agreement. Researchers interested in validating the findings or for collaborative research may request access to the data from the corresponding author subject to a data use agreement and approval from the relevant ethics committee.