An epilepsy seizure prediction method based on post-auricular cortical electroencephalogram signals

By employing a preprocessing method involving 4-channel bipolar lead acquisition behind the ear and multi-domain feature fusion, combined with adaptive statistical feature selection and cross-validation training, the problems of complex equipment, noise interference, and model overfitting in existing technologies are solved. This achieves high-precision, low-power epilepsy seizure prediction, which is suitable for daily applications in wearable devices.

CN122478465APending Publication Date: 2026-07-31NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING UNIV OF POSTS & TELECOMM
Filing Date
2026-06-16
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing methods for predicting epileptic seizures based on postauricular cortical EEG suffer from problems such as complex equipment, high power consumption, severe noise interference, limited feature extraction, lack of stable feature selection mechanism, and model overfitting, which restricts their application in lightweight and everyday use scenarios.

Method used

A single-mode acquisition scheme with 4-channel bipolar leads behind the ear is adopted. The signal preprocessing is combined with RLS adaptive filtering and sym6 wavelet 7-layer hierarchical threshold denoising. An 11-class multi-domain fusion feature system is constructed. The system complexity and power consumption are reduced and the prediction performance is improved by adaptive statistical feature screening mechanism and nested five-fold cross-validation training strategy.

Benefits of technology

High-precision epileptic seizure prediction was achieved under conditions with fewer channels, reducing system complexity by approximately 89% to 98% and power consumption by approximately 85% to 90%, thereby improving the feasibility and real-time performance of the prediction method in wearable devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122478465A_ABST
    Figure CN122478465A_ABST
Patent Text Reader

Abstract

This invention provides a method for predicting epileptic seizures based on postauricular cortical EEG signals, comprising the following steps: (1) EEG signal acquisition, (2) signal preprocessing, (3) sample construction, (4) feature extraction, (5) feature significance analysis, and (6) classification model construction. The prediction method of this invention can achieve high-precision epilepsy prediction without the need for multimodal physiological signal fusion, using only four channels of postauricular EEG signals. The feature system has statistical significance and physiological interpretability, significantly reducing the complexity of signal acquisition, system complexity, and system power consumption, and is suitable for long-term monitoring applications of wearable epilepsy early warning devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of biomedical signal processing and intelligent health monitoring technology, and in particular to a method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals. Background Technology

[0002] Epilepsy is a chronic neurological disorder caused by abnormal synchronous discharge of neurons in the brain, characterized by sudden onset and recurrent seizures. Because epileptic seizures are difficult to predict, patients are in a state of high anxiety and safety risk for extended periods. Therefore, reliable identification of the pre-seizure state is of significant clinical importance. Electroencephalography (EEG), as an important means of reflecting brain electrical activity, is widely used in epilepsy seizure prediction research. Existing epilepsy prediction methods mainly rely on multi-lead scalp EEG (scalpEEG) systems, typically employing an international 10–20 electrode system with more than 20 electrodes for whole-brain coverage. However, this type of system has the following shortcomings: (1) complex equipment, unsuitable for long-term wear; (2) numerous channels, high power consumption; (3) high acquisition cost; and (4) difficult to apply in home and mobile settings.

[0003] To address these issues, postauricular cortical electroencephalography (PEE) has gradually become an important research direction for wearable monitoring in recent years. However, existing methods for predicting epileptic seizures based on PEE still have the following key technical shortcomings:

[0004] (1) The system relies on the fusion of multiple physiological signals (EEG+ECG+PPG) or multiple leads of EEG system, which increases the complexity of the system, resulting in complex equipment, high power consumption and wearable burden, which limits its promotion in lightweight and daily use scenarios.

[0005] (2) The EEG signal is severely affected by noise, especially the postauricular cortical EEG, which is easily affected by power frequency interference, electromyography interference and environmental noise, resulting in serious contamination of the extracted original signal and affecting the subsequent processing.

[0006] (3) The feature extraction methods are limited and lack multi-domain fusion analysis. EEG signals are inherently non-stationary due to significant changes over time; the nervous system is highly complex and exhibits nonlinear dynamic characteristics; and behavior varies significantly across different time scales, exhibiting multi-scale characteristics. However, existing technologies only target single-domain features or a few domain features, which cannot comprehensively characterize the dynamic changes of EEG signals and are insensitive to subtle changes before epileptic seizures, thus limiting predictive performance.

[0007] (4) Lack of a stable feature selection mechanism. In the existing technology, feature selection usually adopts fixed experience selection or simple correlation analysis, which has problems such as not considering the differences between individuals, being unable to dynamically select high-quality features, and lacking a statistical significance verification mechanism. Ultimately, irrelevant or redundant features are introduced, the feature space dimension is too high, and the classifier performance is reduced.

[0008] (5) The evaluation methods for classification models are not standardized and there is a risk of overfitting. In terms of model construction, existing methods generally have problems such as not using nested cross-validation and using the same dataset for hyperparameter tuning and model evaluation, which leads to data leakage, overestimation of the model's generalization ability, and other adverse results such as high training performance but decreased testing performance.

[0009] Therefore, there is still a lack of effective technical solutions for achieving stable and high-precision epilepsy prediction under the condition of limited-channel postauricular cortical EEG. Summary of the Invention

[0010] In view of the shortcomings of the existing technology, the purpose of this invention is:

[0011] (1) To address the high complexity of multi-lead or multimodal EEG systems, this invention proposes a four-channel bipolar lead single-modal acquisition scheme behind the ear, reducing the number of channels to 75%~87.5% and significantly reducing the amount of data acquired. At the same time, signal effectiveness is ensured through reasonable electrode layout, enabling the acquisition of epilepsy-related EEG information even with fewer channels.

[0012] (2) To address the severe noise interference in the postauricular cortical EEG signal, this invention proposes a composite preprocessing scheme combining RLS adaptive filtering and sym6 wavelet 7-layer hierarchical threshold denoising. This scheme adaptively suppresses non-stationary EMG interference and separates noise from effective signals at multiple scales. Compared to single filtering methods, this method improves the signal-to-noise ratio by 20% to 40% and significantly enhances the stability of effective features.

[0013] (3) To address the problem of insufficient feature expression ability, this invention constructs a 44-dimensional feature system with 11 multi-domain fusions, including power spectral entropy in the frequency domain, which reflects the transformation of brain electrical rhythm from ordered to disordered, and the concentration of spectrum distribution in the pre-epilepsy stage; wavelet θ energy in the time-frequency domain, which is related to abnormal discharge activity in the temporal lobe; time-frequency energy ratio in the time-frequency domain, i.e., the ratio of δ-band energy to β-band energy, which reflects the enhancement of abnormal slow waves and the suppression of normal rhythm; sample entropy in nonlinear dynamics features, which describes the phenomenon of decreased complexity of brain electrical signals; maximum Lyapunov exponent in nonlinear dynamics features, which reflects the transition of the brain electrical system from a stable to a chaotic state; and multi-scale arrangement entropy in multi-scale entropy, which characterizes the changes in the synchronicity of neuronal populations at different time scales.

[0014] (4) Addressing the issues of feature selection and model overfitting; This invention proposes an adaptive statistical feature selection mechanism that automatically selects either Student's t-test or Welch's t-test through homogeneity of variance testing, and combines FDR multiple correction and Cohen's d effect size constraints to achieve accurate selection of epilepsy-related EEG features. This effectively avoids the introduction of redundant features while ensuring statistical significance, thus improving feature discrimination ability and model generalization performance. Furthermore, a nested five-fold cross-validation training strategy is introduced to optimize feature dimensions and significantly reduce the risk of overfitting.

[0015] In summary, this invention constructs a composite preprocessing scheme and a multidimensional feature fusion method suitable for few-channel EEG signals, and combines an adaptive statistical feature screening mechanism and a nested five-fold cross-validation training strategy. While ensuring low computational complexity, it reduces system complexity by approximately 89% to 98% and system power consumption by approximately 85% to 90%, achieving effective extraction and stable identification of EEG signal features before epileptic seizures. This improves the feasibility and real-time performance of epileptic seizure prediction methods in wearable devices.

[0016] To achieve the above objectives, the present invention adopts the following technical solution: a method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals, comprising the following steps:

[0017] (1) EEG signal acquisition: raw EEG signals from the postauricular cortex are acquired and bipolar lead channels are constructed, including four channels of EEG signals formed by T7, T8, P7 and P8 electrodes;

[0018] (2) Signal preprocessing: The raw EEG signal is preprocessed, including:

[0019] ①Notch filtering is used to remove power frequency interference;

[0020] ② Adaptive filtering based on the recursive least squares (RLS) algorithm;

[0021] ③ Hierarchical threshold denoising based on wavelet decomposition;

[0022] The preprocessing adopts a cascaded structure of "RLS adaptive filtering and wavelet hierarchical threshold denoising" to first suppress non-stationary noise and then perform multi-scale decomposition.

[0023] (3) Sample construction: Construct samples before epileptic seizures and samples in normal state, and use a sliding time window to segment the data;

[0024] (4) Feature extraction: Multi-domain features are extracted based on the denoised EEG signal. The features consist of frequency domain features, time-frequency domain features, nonlinear dynamic features and multi-scale features, including: power spectral entropy, wavelet θ energy, time-frequency energy ratio, sample entropy, Lyapunov exponent and multi-scale permutation entropy. The multi-scale features are calculated using a preset scale set.

[0025] (5) Feature significance analysis: The features are screened based on statistical significance analysis. The screening includes the selection of the t-test method based on the homogeneity of variance test, combined with FDR correction and effect size constraints.

[0026] (6) Classification model construction: The selected features are input into the support vector machine (SVM), the K-nearest neighbor classifier (KNN), and the ensemble learning classification model to achieve the prediction of the state before the epileptic seizure.

[0027] As a further improvement of the present invention, in step (1), all raw EEG signals from the postauricular cortex are collected at a sampling frequency of 256Hz, and a 16-bit analog-to-digital converter is used to convert the collected analog signals into digital signals for storage; four electrode positions located in the postauricular cortex are selected to form bipolar leads: T7-P7, T8-P8, P7-T7, and P8-T8.

[0028] As a further improvement of the present invention, the notch filtering in step (2) uses a 59-61Hz notch filter to remove power frequency interference. The specific steps are as follows:

[0029] 1) Adaptive filtering is performed using the Recursive Least Squares (RLS) algorithm. First, the filter weight vector, covariance matrix, and error sequence are initialized. The initial value of the covariance matrix P(0) is determined by the preset regularization parameter δ=0.01, as shown in the following formula: Then, using the bandpass-filtered reference signal as the input vector, the filter is recursively updated. At each time step, the filter output value is first calculated and compared with the notch-filtered EEG signal to obtain the error signal. Subsequently, the gain vector is calculated using the recursive least squares algorithm, and the filter weights are updated, along with the covariance matrix. Through continuous iterative updates, the filter weights gradually converge, thereby effectively estimating and eliminating noise components. The specific calculation steps are as follows:

[0030] A. Initialize parameters: weight vector Initial value of covariance matrix ;

[0031] Where the initial value of the covariance matrix P(0) represents the initial measure of the uncertainty of the filter in weight estimation, the regularization parameter δ controls the convergence speed and stability, and I represents the identity matrix;

[0032] B. For each time step k, perform the following steps:

[0033] Constructing a reference signal: This refers to the main signal after removing power frequency interference. High-frequency bandpass filtering is performed to extract electromyographic interference as a reference signal: Where Bandpass represents a bandpass filter, f represents the filter frequency, and the main signal... The sum of effective EEG signals and noise signals;

[0034] Construct the input vector: , where M represents the filter order and T represents the vector transpose;

[0035] For each time k, the output result at time k-1 is used as the new data input, and the output is calculated using the parameters at time k-1. Then the error is calculated, the parameters are updated, the result is output, and then the process proceeds to the next time k+1.

[0036] Filter output: ;

[0037] Error signal: ;

[0038] Calculate the gain vector using the recursive least squares algorithm. and the filter weights Perform an update, and simultaneously update the covariance matrix. ;

[0039] Gain vector calculation: ;

[0040] Weights: ;

[0041] Covariance matrix: ,in For numerically stable terms, Forgetting factor;

[0042] Output result: ;

[0043] The forgetting factor λ of the RLS filter ranges from 0.99 to 0.999;

[0044] 2) After RLS adaptive filtering, wavelet hierarchical adaptive thresholding denoising is used. The specific process is as follows:

[0045] A. Wavelet Decomposition: The symmetric wavelet basis function sym6 is selected to perform multi-scale decomposition on the RLS-filtered signal. The decomposition level is set to 7 levels to obtain a set of wavelet coefficients. Including approximation coefficients Detail coefficients at various scales (i=1,2,...,7); layers 1–3 are high-frequency layers, and layers 4–7 are low-frequency layers;

[0046] In the discrete wavelet transform, the wavelet basis function sym6 is connected to the filter bank through a two-scale equation. The scaling function corresponding to wavelet basis function sym6 is: The corresponding mother wavelet function is Through the dual-scale equation and The low-pass filter coefficients can be obtained. and high-pass filter coefficients ; and Using a set of orthogonal filter coefficients, perform discrete wavelet decomposition of the signal;

[0047] The decomposition of the i-th layer can be extracted using approximation coefficients. and detail coefficient extraction We obtain, where k represents translation, i.e., time position. Represents the approximation coefficients of the (i-1)th layer. Represents the approximation coefficients of the i-th layer. The i-th level detail coefficients are represented by n-2k, where n-2k represents a 2x downsampling operation.

[0048] The final set of coefficients is obtained as follows: ,in , These are the highest frequency information and the lower frequency details, namely the detail coefficients of layer 1 and layer 7; It is the smoothest low-frequency trend, i.e., the 7th layer approximation coefficient;

[0049] B. Layered Threshold Setting: A segmented threshold strategy is adopted based on the signal characteristics of different frequency layers; layers 1-3 correspond to rapidly changing components and high-frequency oscillations, and smaller thresholds are set accordingly. Layers 4-7 correspond to slowly changing components and noise interference, so a larger threshold is set for them. ;in This represents the standard deviation of the detail coefficients at the i-th level. This represents the threshold value for the i-th layer;

[0050] C. Thresholding function processing: Thresholding is performed on the detail coefficients of each layer:

[0051] For the detail coefficients of layers 1-3, a soft thresholding function is used:

[0052] Where sign(∙) is the sign function, Let k represent the detail coefficient at level i, and k represent the time index position of the current detail coefficient at this scale. This represents the k-th coefficient value in the i-th level detail coefficient sequence after thresholding.

[0053] For detail coefficients at layers 4-7, a hard thresholding function is used:

[0054] ;

[0055] D. Signal reconstruction: Reconstructing the processed detail coefficients... and approximation coefficients Wavelet reconstruction is performed to obtain the denoised EEG signal; according to wavelet multiresolution analysis theory, the reconstruction process can be expressed as follows: ,in Both are reconstruction filters;

[0056] Refactoring through recursive layer-by-layer: ; ...

[0057] The final result is the reconstructed signal, i.e., the denoised signal. .

[0058] As a further improvement of the present invention, the filter parameters selected in step (2) include a filter order M of 2, a forgetting factor λ = 0.995, and an initial covariance matrix parameter δ = 0.01.

[0059] As a further improvement of the present invention, in step (3), the data segmentation divides the EEG signal data of the postauricular cortex of each subject into two types of signals, namely S-type and N-type signals. S-type signals are signals that will have epileptic seizures after a predetermined time period, and N-type signals are signals that will not have epileptic seizures after a predetermined time period. The epilepsy prediction interval is set to 40 minutes, that is, 40 minutes before the start of the epileptic seizure. The time 10 minutes before the start of the prediction interval is marked as S-type signal. At the same time, a continuous 3 hours without any epileptic seizures is searched, and 10 minutes of the time is selected and recorded as N-type signal. The EEG signal of a complete acquisition unit is the signal acquired continuously for 10 minutes. A sliding window with a length of 10 seconds is set for the acquired signal. Each acquisition unit is divided into 60 continuous signals with a duration of 10 seconds. Each 10-second signal is a sample, and each sample has no overlapping parts.

[0060] As a further improvement to the present invention, the power spectral entropy, wavelet θ energy, time-frequency energy ratio, sample entropy, Lyapunov exponent, and multi-scale permutation entropy in step (4) are specifically implemented as follows: 1) The calculation steps for the power spectral entropy are as follows:

[0061] A. Estimating the power spectrum using the periodogram method: Where x(n) represents the original discrete EEG signal, and N represents the signal length. This represents the k-th discrete frequency point. This represents the power spectral density at the corresponding frequency, where j represents the imaginary unit. It is a complex exponential function, representing frequency. The sinusoidal component;

[0062] B. To calculate the information entropy, the power spectrum needs to be normalized to a probability distribution form:

[0063] ,in Normalized power spectrum;

[0064] C. Using Shannon's information entropy formula, the power spectral entropy is obtained:

[0065] psdE is the power spectral entropy;

[0066] 2) The wavelet θ energy is the sum of energy in the wavelet domain for the 4–7 Hz frequency band. The calculation steps are as follows:

[0067] A. Obtaining time-frequency coefficients using Continuous Wavelet Transform (CWT) :

[0068] Where a represents the scale parameter, which is inversely proportional to the frequency; b represents the time shift parameter. For input signal, For Morlet mother wavelet, * denotes complex conjugation;

[0069] To facilitate the analysis of EEG frequency band features, this invention adopts a frequency-time representation. , Where f represents frequency and t represents time. This represents the mother wavelet function after scaling and translation at frequency f and time t. This application selects the Morlet wavelet as the mother wavelet function.

[0070] B. Selection Wave frequency band 4–7 Hz: ;

[0071] C. Average over the time dimension t, and calculate... Average energy per frequency band:

[0072] ;

[0073] 3) The time-frequency energy ratio (δ / β) is calculated using wavelet analysis to determine the ratio of 1–4Hz wave energy to 13–30Hz wave energy, with logarithmic smoothing. The calculation steps are as follows:

[0074] A. Regarding brainwave signals Time-frequency coefficients are obtained using CWT continuous wavelet transform. :

[0075] ;

[0076] B. Calculate 1–4 Hz Wave energy and 13–30 Hz Wave energy:

[0077] , ;

[0078] C. Logarithmic compression of energy ratio:

[0079] ,in , is a stable term;

[0080] 4) The steps for calculating the sample entropy are as follows:

[0081] A. Phase Space Reconstruction: Given a one-dimensional time series Construct a vector sequence with embedding dimension m. , where N is the sequence length;

[0082] B. Definition of distance between vectors: The distance between any two vectors is defined using the Chebyshev maximum norm:

[0083] ,in and Let i and j represent any two vector sequences of length i and j respectively, k represents the vector offset changing from 0 to m-1, i+k represents the index after moving k positions from position i, and j+k is similar;

[0084] C. Similarity pattern determination: Set a threshold r, i.e., similarity tolerance; if the condition is met... If the two patterns match, then the two patterns are considered to be "matched".

[0085] D. Matching probability calculation: For each vector Calculate its matching probability:

[0086] ,

[0087] For all We can obtain the average probability over the m dimensions by averaging: Then the average probability in dimension m+1 is ;

[0088] E. Calculate sample entropy: ;

[0089] 5) The Lyapunov index is calculated based on the Rosenstein improved algorithm. The calculation steps are as follows:

[0090] A. Phase space reconstruction:

[0091] Given a one-dimensional signal Phase space reconstruction is performed using the delayed coordinate method to construct the embedding vector. :

[0092] ;

[0093] The reconstruction matrix is ​​obtained:

[0094] ;

[0095] Where m is the embedding dimension. For time delay;

[0096] B. Find the nearest neighbor vector:

[0097] In phase space, for each state point vector Find the nearest neighbor. ,satisfy Minimum, and requires , The time separation window is usually set to 1 second, which requires that the two points are independent in time to avoid autocorrelation affecting the results;

[0098] C. Calculate the divergence trajectory:

[0099] For each pair of neighboring vectors, calculate the trajectory divergence at each time step k: ;

[0100] Calculate the average divergence over all trajectories: , where M is the number of valid trajectory pairs;

[0101] D. Estimation of the maximum Lyapunov index:

[0102] Logarithmic curve of distance between trajectories The change of time step k can usually be divided into three stages: the initial stage, the exponential divergence stage, and the saturation stage. The exponential divergence stage is characterized by an approximately exponential increase in the distance between trajectories, which is the effective range for estimating the Lyapunov exponent. Therefore, the maximum Lyapunov exponent is estimated in the exponential divergence stage.

[0103] Take the logarithm of the average trajectory divergence : In the logarithmic curve Select an approximately linear interval above And perform least-squares linear fitting within this interval: The slope of the fitted line This is the maximum Lyapunov index.

[0104] 6) The multi-scale permutation entropy combines coarse-graining processing with the permutation entropy method, and its calculation steps are as follows:

[0105] A. Coarse-graining:

[0106] For the original sequence Divide into new sequences at scale s:

[0107] ;

[0108] Where s is the scale factor, and N is the length of the original sequence. : Length of the coarse-grained sequence;

[0109] B. Phase space reconstruction: For each scale sequence By embedding dimension m, delay time Reconstruct the embedding vector:

[0110] ;

[0111] C. Pattern Recognition: For The elements are sorted to obtain the arrangement pattern: argsort indicates index sorting;

[0112] D. Probability Distribution Construction: Calculate the probability of each permutation pattern occurring, and let the probability of the nth pattern occurring be... ,So ;

[0113] E. Calculate and normalize the permutation entropy H(s) at scale s:

[0114] ;

[0115] in To prevent the logarithm of zero from being a very small constant, This represents the normalized permutation entropy;

[0116] F. Multiscale permutation entropy: Selecting a set of scales: ; Calculate the permutation entropy for multiple scales s∈S.

[0117] As a further improvement of the present invention, the specific steps of the statistical significance analysis in step (5) are as follows:

[0118] A. Automatic determination of homogeneity of variance: For each feature, use a two-sample F-test to test whether the variances of the two classes of samples are equal, testing the null hypothesis that "the variances are equal";

[0119] B. Adaptive selection of t-test method based on variance results: If the features satisfy homogeneity of variance, use the standard Student's t-test; if not, use Welch's t-test, which is more robust to cases with unequal variances.

[0120] C. Calculate the effect size. Cohen's d:

[0121] In addition to the significance p-value, Cohen's d is further introduced to measure the discriminative effect of the features:

[0122] ;

[0123] in The mean of the two samples is denoted as . denoted as the standard deviation of the two groups of samples. This represents the pooled standard deviation;

[0124] D. Correction for multiple hypothesis testing:

[0125] To control the accumulation of false positives caused by multiple testing, FDR correction was used to adjust all p-values;

[0126] The FDR correction algorithm is as follows:

[0127] Let the original p-values ​​be sorted in ascending order as follows: Then find the largest k such that:

[0128] ;

[0129] Then the first k p-values ​​can all be considered significant, meaning that control is achieved. .

[0130] The screening criteria were: after FDR correction, p < 0.05 and |Cohen's d| > 0.5.

[0131] As a further improvement of the present invention, the classification model in step (6) adopts a lightweight classification model, including 12 classifiers from three major categories: Support Vector Machine (SVM), K-Nearest Neighbor (KNN) classifier, and ensemble learning model. A 10-second 4-channel postauricular cortical EEG signal is considered as a sample, and each sample has 44 features. For any patient, all samples and features constitute the training data used to train the 12 classification models. Nested five-fold cross-validation is used for model training and parameter optimization. The inner cross-validation optimizes the classifier hyperparameters, and the outer cross-validation evaluates the model. Nested cross-validation avoids data leakage, prevents overfitting, and provides unbiased performance estimation. Model performance evaluation metrics include accuracy, sensitivity, specificity, and AUC. The training process is as follows: ① The outer layer divides the training set and the test set; ② The inner cross-validation selects the optimal parameters; ③ The model is trained on the training set; ④ The model performance is evaluated on the test set.

[0132] The method described in this invention is applied to a wearable EEG acquisition device in the postauricular region for real-time prediction of epileptic seizures in everyday environments; the method is deployed in a low-power embedded system to achieve continuous EEG acquisition and online prediction.

[0133] The experimental procedure, feature extraction method, and classification model described in this invention all have clear parameter settings and calculation steps, and can repeatedly obtain consistent results under the same data conditions, thereby ensuring the repeatability and reliability of the method.

[0134] Compared with the prior art, the beneficial effects of the present invention include:

[0135] 1. Prediction can be completed using only 4 postauricular channels. Traditional multi-channel EEG methods typically use 16-32 channels, with accuracy rates mostly below 90%. The method of this invention achieves a prediction accuracy rate of over 90%, maintaining high accuracy even with fewer channels.

[0136] 2. No need to fuse ECG, PPG and other multimodal signals. Multimodal signal fusion methods usually fuse multiple physiological signals, which can increase the amount of information, but the system is complex and data synchronization is difficult. However, the present invention can predict the performance of multimodal methods with only the postauricular cortical EEG.

[0137] 3. Reduce system complexity and power consumption:

[0138] Traditional epilepsy prediction methods are typically based on multi-channel EEG, generally 16–32 channels. The computational cost of feature extraction is linearly related to the number of channels. Let C be the computational cost of features per unit time for a single channel, then the total computational cost of a traditional multi-channel EEG system is: Where N is the number of channels, the computational complexity of the 4-channel scheme is: When N=16, the computational load is reduced by the following percentage: Similarly, when N=32, the computational load is reduced by the following percentage: Therefore, this invention adopts a four-channel EEG scheme based on the postauricular cortex, which reduces the computational load by approximately 75% to 87.5% in terms of channel dimensions, while the prediction accuracy decreases by no more than 3%.

[0139] Regarding feature dimensions, traditional methods typically employ 100-300 dimensions, while this invention retains 44 high-discrimination features through multi-domain fusion and feature selection mechanisms. Let the computational complexity of a single feature be k, then the computational cost of traditional features is: , The computational cost of the 44-dimensional features in this invention is: Therefore, the reduction in computational cost due to the feature dimension is: ,exist Within the range of values, the computational complexity of the features designed in this invention is reduced by approximately 56% to 85% compared to traditional methods.

[0140] Taking into account both the reduction in the number of channels and the compression of feature dimensions, the overall computational complexity of the system can be expressed as: The complexity reduction ratio is: Substitute N and In extreme cases, the overall computational complexity can be reduced by approximately 89% to 98%.

[0141] In terms of power consumption, the reduction in power consumption of the signal processing system mainly comes from the following aspects: a significant decrease in the number of feature calculations, reducing CPU operations; smaller data volume in fewer channels, reducing storage access; and the elimination of complex deep model inference. Power consumption is directly proportional to the amount of computation, therefore, this invention can theoretically achieve a power consumption reduction of approximately 85% to 90%.

[0142] Furthermore, since this invention does not require complex deep learning model inference and only uses a lightweight classification model, it further reduces the load on the processing unit, thereby improving the system's battery life and the feasibility of wearable applications.

[0143] 4. The feature system constructed in this invention has synergistic advantages in terms of statistical significance and physiological interpretability. Addressing the problem in existing technologies where feature selection relies on a single p-value and easily introduces redundant features, this invention adaptively selects either Student's t-test or Welch's t-test through homogeneity of variance testing, and combines FDR correction to control the false positive rate. Simultaneously, it introduces Cohen's d effect size to constrain the feature's discriminative ability, thereby achieving a dual screening mechanism of "statistical significance + actual discriminative ability," effectively preventing the selection of features that are "statistically significant but lack actual discriminative ability." Furthermore, the features selected in this invention all have a clear physiological basis, capable of characterizing the evolution of pre-seizure EEG signals from complex disorder to abnormal synchronization from multiple perspectives, including frequency domain, time-frequency domain, nonlinear dynamics, and multi-scale features, thus enhancing the model's interpretability and clinical application value.

[0144] 5. This invention is particularly suitable for wearable EEG acquisition devices in the postauricular region, enabling long-term continuous monitoring and prediction of epileptic seizures in a home environment. It features low power consumption, low complexity, and high real-time performance, and can be deployed in low-power embedded processing units to achieve real-time signal processing and online prediction. This provides new insights into epilepsy treatment and brings hope to epilepsy patients, making it of great significance. Attached Figure Description

[0145] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Wherein:

[0146] Figure 1 This is a schematic diagram of the electrode arrangement for the signal acquisition step in an embodiment of the present invention; wherein yellow T7, T8, P7, and P8 are acquisition electrodes, GND is the ground electrode, and Ref is the reference electrode.

[0147] Figure 2 A comparison of the time-domain waveforms of the signal before and after the signal preprocessing step;

[0148] Figure 3 This is a schematic diagram of Class S signals in the signal classification step of an embodiment of the present invention;

[0149] Figure 4 This is a schematic diagram of N types of signals in the signal classification step of an embodiment of the present invention;

[0150] Figure 5 This is a schematic diagram of the adaptive t-test method for feature significance analysis. Detailed Implementation

[0151] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0152] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0153] This specification provides the operational steps of the methods described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or device products, the methods shown in the embodiments or drawings can be executed sequentially or in parallel.

[0154] The technical solution of this invention is as follows: This invention provides a method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals, and the specific steps are as follows:

[0155] 1. EEG Signal Acquisition: The postauricular cortical EEG signal data used in this embodiment is derived from clinically collected data. The acquisition device is a 19-channel scalp EEG acquisition system – Nanjing Weisi Medical EEG acquisition device, with a sampling frequency of 256Hz and a quantization precision of 16 bits. All data are from clinically diagnosed epilepsy patients, totaling 13 subjects, including various seizure types (SPS, CPS, GTCS). During data acquisition, all subjects completed EEG recordings in a relatively quiet environment to ensure stable signal quality. A standard electrode arrangement system was used to acquire the raw EEG signals, and relevant channels in the postauricular region (T7, T8, P7, P8) were further selected to construct the postauricular bipolar lead signals required for this invention, namely "T7-P7", "T8-P8", "P7-T7", and "P8-T8". The specific acquisition electrode positions are shown in the attached figure. Figure 1As shown in Table 1. Table 1 details the specific information of the subjects:

[0156]

[0157] The patients in the table experienced three types of seizures: simple partial seizures (SPS), complex partial seizures (CPS), and generalized tonic-clonic seizures (GTCS).

[0158] 2. Signal Preprocessing: The raw EEG signal is preprocessed. This process is implemented in Matlab. The following steps are performed sequentially:

[0159] (1) Notch filtering: A 59–61Hz notch filter is used to remove the power frequency interference at 60Hz in the signal.

[0160] (2) RLS Adaptive Filtering: Adaptive filtering is performed using the Recursive Least Squares (RLS) algorithm. The selected filter parameters include a filter order M of 2, a forgetting factor λ = 0.995, and an initial covariance matrix parameter δ = 0.01. This step is used to suppress non-stationary noise and artifact interference. Specifically, a bandpass filter is designed based on the effective frequency range of the signal, with a low cutoff frequency set to 30Hz and a high cutoff frequency automatically limited to 95% of the Nyquist frequency based on the sampling frequency. A reference signal mainly containing electromyographic interference components is obtained through bandpass filtering. Based on this, a second-order RLS adaptive filter with a forgetting factor of 0.995 is constructed. First, the filter weight vector, covariance matrix, and error sequence are initialized. The initial value P(0) of the covariance matrix is ​​determined by the preset parameter δ = 0.01, as shown in the following formula: Then, using the bandpass-filtered reference signal as the input vector, the filter is recursively updated. At each time step, the filter output value is first calculated and compared with the notch-filtered EEG signal to obtain the error signal. Subsequently, the gain vector is calculated using the recursive least squares algorithm, and the filter weights are updated, along with the covariance matrix. Through continuous iterative updates, the filter weights gradually converge, thereby effectively estimating and eliminating noise components. The specific calculation steps are as follows:

[0161] A. Initialize parameters: weight vector Initial value of covariance matrix ;

[0162] Where the initial value of the covariance matrix P(0) represents the initial measure of the uncertainty of the filter in weight estimation, the regularization parameter δ controls the convergence speed and stability, and I represents the identity matrix;

[0163] B. For each time step k, perform the following steps:

[0164] Constructing a reference signal: This refers to the main signal after removing power frequency interference. High-frequency bandpass filtering is performed to extract electromyographic interference as a reference signal: Where Bandpass represents a bandpass filter, f represents the filter frequency, and the main signal... The sum of effective EEG signals and noise signals;

[0165] Construct the input vector: , where M represents the filter order and T represents the vector transpose;

[0166] For each time k, the output result at time k-1 is used as the new data input, and the output is calculated using the parameters at time k-1. Then the error is calculated, the parameters are updated, the result is output, and then the process proceeds to the next time k+1.

[0167] Filter output: ;

[0168] Error signal: ;

[0169] Calculate the gain vector using the recursive least squares algorithm. and the filter weights Perform an update, and simultaneously update the covariance matrix. ;

[0170] Gain vector calculation: ;

[0171] Weights: ;

[0172] Covariance matrix: ,in For numerically stable terms, Forgetting factor;

[0173] Output result: .

[0174] In this invention, the filter order M is set to 2. This is because electromyographic interference and environmental noise in EEG signals typically have a short-term correlation, but the correlation length is relatively short. A lower-order filter can effectively characterize the noise. When the order is too high, overfitting is easily introduced, increasing the computational burden and hindering wearable device implementation. Therefore, this invention selects an order of 2 as the preferred solution, ensuring both denoising effectiveness and real-time performance and stability. The forgetting factor λ = 0.995 is selected based on the following: Although EEG signals are non-stationary, they change relatively slowly within a short time window (e.g., 10 seconds), thus requiring a larger forgetting factor to maintain the stability of historical information. In the field of biosignal processing, λ is typically set between 0.99 and 0.999. When λ is close to 1, the filter has good stability but a slow response to sudden changes; when λ is small, the filter is sensitive to new data but easily affected by noise. Therefore, setting λ = 0.995 achieves a good balance between stability and dynamic tracking capability, resulting in optimal denoising effect and signal fidelity. The initial covariance matrix parameter δ=0.01 is selected based on the following: a smaller δ corresponds to a larger initial covariance matrix, which enables the filter to have a faster convergence speed in the initial stage, which is conducive to quickly adapting to the characteristics of EEG signals. Moreover, the noise in EEG signals is complex and uncertain, and a smaller δ helps to enhance the filter's ability to adapt to noise changes.

[0175] The rationale for selecting a bandpass filter above 30Hz to extract EMG interference as the reference signal is as follows: EEG signals are mainly concentrated in the 0.5-30Hz range, while EMG interference is mainly distributed above 30Hz. The signal extracted by the bandpass filter is highly correlated with noisy EMG signals but has a low correlation with EEG signals; therefore, this signal was selected as the reference signal. Furthermore, compared to traditional external reference signals, it requires no additional sensors and utilizes the signal itself to construct the reference, improving system integration. Therefore, RLS can learn noise characteristics and achieve effective noise reduction.

[0176] Compared to the LMS (Least Mean Squares) adaptive filtering algorithm, the RLS adaptive filtering algorithm has the advantages of faster convergence speed and higher computational accuracy; stronger adaptability to non-stationary signals, more sensitivity to new data, and rapid tracking of signal changes; smaller steady-state error, and can achieve a better solution by minimizing the weighted least squares error; and stronger noise resistance, using the statistical information of the input signal to more effectively suppress related noise, especially suitable for suppressing complex electromyographic interference in the postauricular cortical EEG signal.

[0177] (3) To further improve the signal-to-noise ratio of EEG signals, wavelet hierarchical adaptive threshold denoising was employed after RLS adaptive filtering to enhance the preservation of pathological information through a hierarchical threshold strategy. The specific process is as follows:

[0178] A. Wavelet Decomposition: The symmetric wavelet basis function sym6 is selected to perform multi-scale decomposition on the RLS-filtered signal. The decomposition level is set to 7 levels to obtain a set of wavelet coefficients. Including approximation coefficients Detail coefficients at various scales (i=1,2,...,7); layers 1–3 are high-frequency layers, and layers 4–7 are low-frequency layers.

[0179] In the discrete wavelet transform, the wavelet basis function sym6 is connected to the filter bank through a two-scale equation. The scaling function corresponding to wavelet basis function sym6 is: The corresponding mother wavelet function is Through the dual-scale equation and The low-pass filter coefficients can be obtained. and high-pass filter coefficients ; and Given a set of orthogonal filter coefficients, perform discrete wavelet decomposition of the signal.

[0180] The decomposition of the i-th layer can be extracted using approximation coefficients. and detail coefficient extraction We obtain, where k represents translation, i.e., time position. Represents the approximation coefficients of the (i-1)th layer. Represents the approximation coefficients of the i-th layer. Let n represent the detail coefficients of the i-th layer, where n-2k represents a 2x downsampling operation.

[0181] The final set of coefficients is obtained as follows: ,in , These are the highest frequency information and the lower frequency details, namely the detail coefficients of layer 1 and layer 7. It is the smoothest low-frequency trend, i.e., the 7th layer approximation coefficient.

[0182] B. Layered Threshold Setting: A segmented threshold strategy is adopted based on the signal characteristics of different frequency layers. Layers 1-3 correspond to rapidly changing components and high-frequency oscillations; to avoid excessive suppression of useful information, a smaller threshold is set. Layers 4-7 correspond to slowly changing components and noise interference; a larger threshold is set to enhance denoising capabilities. .in This represents the standard deviation of the detail coefficients at the i-th level. This represents the threshold of the i-th layer.

[0183] C. Thresholding function processing: Thresholding is performed on the detail coefficients of each layer:

[0184] For the detail coefficients of layers 1-3, a soft thresholding function is used:

[0185] Where sign(∙) is the sign function, Let k represent the detail coefficient at level i, and k represent the time index position of the current detail coefficient at this scale. This represents the k-th coefficient value in the i-th level detail coefficient sequence after thresholding.

[0186] For detail coefficients at layers 4-7, a hard thresholding function is used:

[0187] .

[0188] D. Signal reconstruction: Reconstructing the processed detail coefficients... and approximation coefficients Wavelet reconstruction is performed to obtain the denoised EEG signal. According to wavelet multiresolution analysis theory, the reconstruction process can be expressed as follows: ,in Both are reconstruction filters.

[0189] Refactoring through recursive layer-by-layer: ; ... Finally, the reconstructed signal is obtained, which is the denoised signal. .

[0190] This invention selects the symmetric wavelet basis function sym6 for signal decomposition because the sym6 wavelet has good approximate symmetry, which can effectively reduce phase distortion during signal reconstruction. EEG signals are sensitive to temporal changes, and using a wavelet basis function with good symmetry helps maintain the temporal structure of epilepsy-related features. The sym6 wavelet has a moderate support length and vanishing moment, achieving a balance between the time and frequency domains, making it suitable for analyzing typical non-stationary signals like EEG signals. Compared to lower-order wavelets (such as sym2 and sym3), sym6 can more accurately characterize the detailed changes in EEG signals; compared to higher-order wavelets (such as sym8 and above), it avoids the loss of detail caused by excessive smoothing. The selection of a 7-layer decomposition is based on the signal sampling rate of 256Hz in this invention. The principle of wavelet multi-scale decomposition is that the first layer corresponds to the highest frequency band, and the frequency decreases with each layer. The 7-layer decomposition can cover the main EEG frequency bands from high to low frequencies, including... This ensures that features across different frequency bands can be effectively extracted. The soft thresholding function is continuous and can avoid signal abrupt changes, making it suitable for high-frequency detail preservation; therefore, it is used in the high-frequency layer. The hard thresholding function preserves large-amplitude signals and can strongly suppress low-frequency noise; therefore, it is used in the low-frequency layer.

[0191] The preprocessed signal retains the effective structural information of the EEG while suppressing unstructured noise in different frequency bands, resulting in a high signal-to-noise ratio and feature fidelity. Specific waveform diagrams before and after preprocessing are attached. Figure 2 As shown, the difference in effect before and after preprocessing is obvious.

[0192] 3. Sample Construction: The epileptic prediction interval SPH was defined as the 40 minutes preceding the onset of a seizure. The 10 minutes preceding the start of SPH were selected as the pre-seizure sample (S class), and the 10 minutes remaining after the seizure were selected as the control, i.e., the normal sample (N class). Figure 3 As shown in Figure 4, for a given patient, n segments of S-class signals and n segments of N-class signals (n≥2) are identified. A 10-second sliding window is used for each type of signal, with no overlap between windows, and each 10-second segment is analyzed as a single sample. (See attached figure.) Figure 3 As shown, the S-type signal exhibits significant signal fluctuations during a single epileptic seizure; as shown in the attached figure. Figure 4 As shown, Class N signals exhibit relatively random or smooth behavior. This process was implemented using Matlab and the EEGLAB toolbox.

[0193] 4. Feature Extraction: To comprehensively characterize the multidimensional dynamic characteristics of postauricular cortical EEG signals, this invention extracts features from multi-channel EEG signals within each time window, constructing a low-dimensional and highly discriminative feature vector. This invention categorizes 11 features into four main types: frequency domain, time-frequency domain, nonlinear dynamic features, and multi-scale features. These include power spectral entropy in the frequency domain, wavelet θ energy and time-frequency energy ratio features in the time-frequency domain, sample entropy and the maximum Lyapunov exponent in nonlinear dynamic features, and multi-scale permutation entropy (six scales: 1, 3, 10, 11, 13, and 15) in multi-scale entropy. This invention uses 4-channel postauricular cortical EEG signals as input, extracting 11 features from each channel, ultimately forming a 4-channel × 11-feature = 44-dimensional feature vector. This feature vector serves as the input for subsequent training and classification. All feature extraction algorithms are implemented in Matlab.

[0194] (1) Frequency Domain Features: Power Spectral Entropy, used to describe the dispersion of the spectral distribution. The significance of power spectral entropy is to measure the uniformity of the energy distribution of a signal in the frequency domain. When the energy distribution is uniform, the information complexity is high and the entropy value is large; when the energy is concentrated in a few frequency bands, the information complexity is low and the entropy value decreases. Before an epileptic seizure, the abnormal synchronous discharge of brain neurons is enhanced, and the spectral energy is concentrated in specific frequency bands, which leads to a significant decrease in power spectral entropy. It can effectively characterize the dynamic process of the EEG signal changing from "disorder" to "order" before an epileptic seizure, thereby improving the feature discrimination ability. The calculation steps of the power spectral entropy are as follows:

[0195] A. Estimating the power spectrum using the periodogram method: Where x(n) represents the original discrete EEG signal, and N represents the signal length. This represents the k-th discrete frequency point. This represents the power spectral density at the corresponding frequency, where j represents the imaginary unit. It is a complex exponential function, representing frequency. The sinusoidal component.

[0196] B. To calculate the information entropy, the power spectrum needs to be normalized to a probability distribution form:

[0197] ,in This is the normalized power spectrum.

[0198] C. Using Shannon's information entropy formula, the power spectral entropy is obtained:

[0199] psdE is the power spectral entropy.

[0200] The selection criteria for the periodogram method are as follows: This method is simple to calculate, suitable for real-time processing, does not require complex parameter settings, and is applicable to short EEG segments (10-second window).

[0201] (2) Time-frequency domain features: Wavelet θ energy. The θ-band energy features are extracted through continuous wavelet transform, converting the time-frequency information of the EEG signal into a stable energy index. This effectively reflects abnormal changes in EEG activity before an epileptic seizure and improves feature discrimination ability. The calculation steps are as follows:

[0202] A. Obtaining time-frequency coefficients using Continuous Wavelet Transform (CWT) :

[0203] Where a represents the scale parameter, which is inversely proportional to the frequency; b represents the time shift parameter. For input signal, For Morlet mother wavelet, * denotes complex conjugation.

[0204] To facilitate the analysis of EEG frequency band features, this invention adopts a frequency-time representation. , Where f represents frequency and t represents time. This represents the mother wavelet function after scaling and translation at frequency f and time t. This application selects the Morlet wavelet as the mother wavelet function.

[0205] B. Selection Wave frequency band 4–7 Hz: ;

[0206] C. Average over the time dimension t, and calculate... Average energy per frequency band:

[0207] .

[0208] The selection criteria for continuous wavelet transform are as follows: EEG signals exhibit significant non-stationarity, and traditional Fourier transform only provides frequency domain information, failing to reflect time-domain variations. Continuous wavelet transform possesses excellent time-frequency localization capabilities and multi-scale analysis capabilities, making it suitable for detecting sudden EEG events, such as epileptic discharges. The selection criteria for Morlet wavelet are as follows: Morlet wavelet has good frequency resolution, suitable for narrowband theta wave analysis; it possesses a Gaussian-modulated sinusoidal structure, matching the morphology of EEG oscillation signals; and it maintains a good balance between the time and frequency domains, making it widely used in EEG time-frequency analysis.

[0209] (3) Time-frequency domain features: Time-frequency energy ratio (δ / β). The δ and β frequency band energies were extracted using continuous wavelet transform, and a logarithmic energy ratio feature was constructed. This achieved a joint characterization of epilepsy-related slow wave enhancement and normal activity inhibition, improving the feature's discriminative ability and robustness. The calculation steps are as follows:

[0210] A. Regarding brainwave signals Time-frequency coefficients are obtained using CWT continuous wavelet transform. :

[0211] ;

[0212] B. Calculate 1–4 Hz Wave energy and 13–30 Hz Wave energy:

[0213] , ;

[0214] C. Logarithmic compression of energy ratio:

[0215] ,in , is a stable term.

[0216] The theoretical basis for selecting this feature is as follows: delta waves are closely related to slow-wave activity in epilepsy, and an energy increase occurs before an epileptic seizure; beta waves reflect normal cortical activity, and an energy decrease occurs before an epileptic seizure. Therefore, an energy ratio is constructed to enhance abnormal contrast and improve feature stability. Since EEG energy can vary significantly, introducing a logarithmic transformation is beneficial for subsequent classification processing and avoids the impact of extreme values ​​on model training. In practice, this may lead to… In order to avoid numerical divergence, ɛ is introduced to maintain continuity.

[0217] (4) Nonlinear dynamic characteristics: Sample entropy. Sample entropy can quantify the complexity of EEG signals, effectively characterizing the evolution of neuronal activity from "complex disorder" to "synchronous order" before an epileptic seizure, and improving feature discrimination ability. Its calculation steps are as follows:

[0218] A. Phase Space Reconstruction: Given a one-dimensional time series Construct a vector sequence with embedding dimension m. , where N is the sequence length.

[0219] B. Definition of distance between vectors: The distance between any two vectors is defined using the Chebyshev maximum norm:

[0220] ,in and Let i and j represent any two vector sequences of length i and j respectively. k represents the vector offset changing from 0 to m-1. i+k represents the index after moving k positions from position i. The same applies to j+k.

[0221] C. Similarity pattern determination: Set a threshold r, i.e., similarity tolerance; if the condition is met... If the two patterns match, then the two patterns are considered to be "matched".

[0222] D. Matching probability calculation: For each vector Calculate its matching probability:

[0223] ,

[0224] For all We can obtain the average probability over the m dimensions by averaging: Then the average probability in dimension m+1 is .

[0225] E. Calculate sample entropy: .

[0226] This invention selects an embedding dimension m of 2 because this setting balances computational complexity and statistical stability. When m=1, the discriminative power of sample entropy is weak; while when m>2, the data requirement increases significantly, therefore m=2 is the optimal choice. Similarity tolerance , In this invention, r is taken as 0.15 times the standard deviation, which can ensure the stability of matching statistics and avoid too many or too few matches.

[0227] (5) Nonlinear dynamic characteristics: The maximum Lyapunov exponent based on the Rosenstein improved algorithm can effectively characterize the transition of the nervous system from a chaotic state to a synchronous and ordered state before an epileptic seizure, improving the predictive model's ability to identify the pre-seizure state. The calculation steps for this characteristic are as follows:

[0228] A. Phase space reconstruction:

[0229] Given a one-dimensional signal Phase space reconstruction is performed using the delayed coordinate method to construct the embedding vector. :

[0230] ;

[0231] The reconstruction matrix is ​​obtained:

[0232] ;

[0233] Where m is the embedding dimension. This is a time delay.

[0234] B. Find the nearest neighbor vector:

[0235] In phase space, for each state point vector Find the nearest neighbor. ,satisfy Minimum, and requires , The time separation window is usually set to 1 second, which requires that the two points are independent in time to avoid autocorrelation affecting the results;

[0236] C. Calculate the divergence trajectory:

[0237] For each pair of neighboring vectors, calculate the trajectory divergence at each time step k: .

[0238] Calculate the average divergence over all trajectories: , where M is the number of valid trajectory pairs.

[0239] D. Estimation of the maximum Lyapunov index:

[0240] Logarithmic curve of distance between trajectories The change of time step k can usually be divided into three stages: the initial stage, the exponential divergence stage, and the saturation stage. The exponential divergence stage is characterized by an approximately exponential increase in the distance between trajectories, which is the effective range for estimating the Lyapunov exponent. Therefore, the maximum Lyapunov exponent is estimated in the exponential divergence stage.

[0241] Take the logarithm of the average trajectory divergence : In the logarithmic curve Select an approximately linear interval above And perform least-squares linear fitting within this interval: The slope of the fitted line This is the maximum Lyapunov index.

[0242] The improved Rosenstein algorithm used in this invention is applicable to short time series (i.e., a 10-second window), exhibits strong robustness to noise, and has low computational complexity. Trajectory divergence exhibits exponential growth in the initial stage and saturation in the later stage; therefore, a fitting interval of 10%-50% is selected to avoid nonlinear distortion. An embedding dimension of m=6 is chosen because EEG signals are complex nonlinear systems, and m=6 can better unfold the dynamic structure, avoiding insufficient information due to too low a dimension or data sparsity due to too high a dimension. =4, ensuring independence between dimensions, corresponding to a 15.6 ms delay based on the sampling rate. Maximum iteration steps maxiter=100, combined with a 10-second window, 100 points correspond to 0.4 seconds, sufficient to observe exponential divergence and avoid late-stage saturation. Minimum time separation. The interval is 1 second to avoid adjacent points being mistakenly identified as nearest neighbors in terms of time.

[0243] (6) Multi-scale entropy: Multi-scale permutation entropy combines coarse-graining processing with permutation entropy methods, calculating it separately at predefined scales, treating the permutation entropy at each scale as an independent feature dimension. Multi-scale permutation entropy selects a set of discontinuous scales: This scale combination is not uniformly or continuously selected, but rather optimized for the multi-scale characteristics of epileptic EEG signals. Specifically: scales 1 and 3 are used to characterize the rapid dynamic changes in epileptic discharges; scale 10 is used to extract the most discriminative mesoscale features; and scales 11, 13, and 15 are used to reflect the slowly varying structures of the EEG signals. Compared to continuous scale selection, the scale combination described in this invention can effectively reduce feature redundancy, improve feature independence, and enhance model stability and predictive performance. The calculation steps are as follows:

[0244] A. Coarse-graining:

[0245] For the original sequence Divide into new sequences at scale s:

[0246] ;

[0247] Where s is the scale factor, and N is the length of the original sequence. : Length of the coarse-grained sequence.

[0248] B. Phase space reconstruction: For each scale sequence By embedding dimension m, delay time Reconstruct the embedding vector:

[0249] ;

[0250] C. Pattern Recognition: For The elements are sorted to obtain the arrangement pattern: argsort indicates index sorting.

[0251] D. Probability Distribution Construction: Calculate the probability of each permutation pattern occurring, and let the probability of the nth pattern occurring be... ,So .

[0252] E. Calculate and normalize the permutation entropy H(s) at scale s:

[0253] ;

[0254] in To prevent the logarithm of zero from being a very small constant, This represents the normalized permutation entropy.

[0255] F. Multiscale permutation entropy: Selecting a set of scales: ; Calculate the permutation entropy for multiple scales s∈S.

[0256] The reason for setting the embedding dimension m=4 is as follows: when m=3, the feature discrimination ability is weak; when m>5, the number of patterns is too large, resulting in m! explosion. Therefore, m=4 is chosen after balancing stability and resolution. Time delay The selection criteria are as follows: the sampling rate of 256Hz for EEG signals is relatively high, and adjacent points already contain sufficient information; in order to control the sampling interval, the time delay is used. The scale is set to 1. At a small scale of s=1~3, the permutation entropy reflects the finest dynamic information of the signal, with concentrated energy and dramatic changes. s=10 is the scale that most clearly distinguishes the differences between normal and abnormal EEG, with significant changes in entropy values. At a slightly larger scale of s=11~15, the entropy value still has discriminative power and can reflect mid-frequency dynamic characteristics. When s>20, the entropy value tends to stabilize, the discriminative power is significantly weakened, and the influence of noise increases. Setting continuous dense scales (such as 4, 5, 6...) will introduce problems such as large computational load, strong correlation, and high redundancy. To avoid the risks of high-dimensional collinearity and overfitting, this invention does not set continuous scales. To avoid redundancy, low discriminative power, and noise interference, this invention excludes continuous intermediate scales 5~9 and scales greater than 20. Considering the above, scales 1 and 3 are selected to detect rapid activity changes in epileptic discharges; scale 10 is retained as the most discriminative scale; scales 11, 13, and 15 are extended and retained to extract chronic brain dynamic structures and enhance the model's coverage of EEG features at different frequencies.

[0257] 5. Feature Significance Analysis: An adaptive statistical significance analysis mechanism is employed, including: homogeneity of variance test, adaptive t-test (Student or Welch), Cohen's d calculation of effect size, and FDR correction. This algorithm is implemented in Matlab, and the specific steps are as follows:

[0258] A. Automatic determination of homogeneity of variance: For each feature, use a two-sample F-test to test whether the variances of the two classes of samples are equal, testing the null hypothesis that "the variances are equal";

[0259] B. Adaptive selection of t-test method based on variance results: If the features satisfy homogeneity of variance, use the standard Student's t-test; if not, use Welch's t-test, which is more robust to cases with unequal variances.

[0260] C. Calculate the effect size. Cohen's d:

[0261] In addition to the significance p-value, Cohen's d is further introduced to measure the discriminative effect of the features:

[0262] ;

[0263] in The mean of the two samples is denoted as . denoted as the standard deviation of the two groups of samples. This represents the pooled standard deviation;

[0264] D. Correction for multiple hypothesis testing:

[0265] To control the accumulation of false positives caused by multiple testing, this application uses FDR (False Discovery Rate) correction to adjust all p-values.

[0266] FDR correction is a method to control the false discovery rate, meaning that the expected proportion of false rejections among all rejected null hypotheses does not exceed [a certain percentage]. Its core algorithm was proposed by Benjamini and Hochberg. The correction algorithm (Benjamini–Hochberg, BH) is as follows:

[0267] Let the original p-values ​​be sorted in ascending order as follows: Then find the largest k such that:

[0268] ;

[0269] Then the first k p-values ​​can all be considered significant (i.e., controlled for). ).

[0270] Appendix Figure 5The diagram shows the flowchart of the adaptive t-test method for feature significance analysis.

[0271] The selection criteria were: after FDR correction, p < 0.05 and |Cohen's d| > 0.5. The final results showed that 11 features demonstrated discriminative effectiveness for the vast majority of patients, meaning all 11 feature classes were effective. The 44-dimensional feature vector was then input into the classification model.

[0272] 6. Classification model construction:

[0273] The selected features are input into the classification model for training and prediction. All training and prediction algorithms are implemented in Matlab. This invention employs lightweight classification models, including Support Vector Machine (SVM), K-Nearest Neighbor (KNN) classifier, and ensemble learning models. A 10-second 4-channel postauricular cortical EEG signal is considered as a sample, resulting in 44 features per sample. For any patient, all samples and features constitute the training data used to train 12 classification models. Nested five-fold cross-validation is used for model training and parameter optimization. The inner cross-validation optimizes the classifier hyperparameters, while the outer cross-validation evaluates the model. Nested cross-validation avoids data leakage, prevents overfitting, and provides unbiased performance estimation. Model performance evaluation metrics include accuracy, sensitivity, specificity, and AUC. The training process is as follows: ① The outer layer divides the training and test sets; ② The inner cross-validation selects the optimal parameters; ③ The model is trained on the training set; ④ The model performance is evaluated on the test set.

[0274] This invention evaluates the classification performance of various classifiers in an epilepsy prediction task. Classification evaluation metrics for 13 patients under 12 classifiers are shown in Tables 2, 3, and 4. All experiments were conducted under the same data partitioning conditions to ensure fairness and reproducibility. Classification performance metrics included accuracy, sensitivity, specificity, and area under the patient operating characteristic curve (AUC). These metrics were obtained by averaging the results for all patients, and the standard deviation was calculated to assess model stability. The average accuracy of the two classes of postauricular cortical EEG data under the three major classifiers (SVM, KNN, and ensemble learning model) was 91.90%, 90.94%, and 91.59%, respectively, all above 90%. Table 3 shows the average sensitivity and average specificity (i.e., the average of all sub-classifiers within that major class for that patient) calculated for each patient under each major classifier. Table 4 shows the average AUC for each patient under each major classifier. The "Average" row at the bottom of Tables 2 and 3 represents the average values ​​of all patients' indicators under a specific classifier (i.e., the average of data from all patients in that column). The results show average sensitivities of 91.65%, 90.98%, and 91.63%, all above 90%; average specificities of 92.13%, 90.90%, and 91.56%; and AUC values ​​of 0.94, 0.94, and 0.95. These results indicate that all 11 features demonstrate significant discriminative power across various classifiers.

[0275] Table 2. Accuracy of each patient under each classifier;

[0276]

[0277] Table 3. Mean sensitivity and mean specificity of each patient under the three major classifiers;

[0278]

[0279] Table 4. Mean AUC for each patient under the three major classifiers;

[0280]

[0281] In addition, this method is applicable to the following scenarios:

[0282] 1. Long-term home monitoring. Designed for the daily lives of epilepsy patients, this invention enables long-term continuous EEG data acquisition, automatic pre-seizure warnings, and eliminates the need for a specialized medical environment. The warning device is suitable for nighttime sleep monitoring and daily activity detection.

[0283] 2. Mobile Health Device. This invention can be integrated into a mobile health system, supporting telemedicine and intelligent health management, enabling real-time signal processing, local early warning or remote transmission, and linkage with mobile phones or cloud platforms.

[0284] 3. Hardware Adaptation Scheme for Wearable Epilepsy Early Warning Device. This invention employs a four-electrode arrangement in the postauricular region, using flexible electrodes such as Ag or AgCl materials, and a hook-type structure to fit the skin behind the ear. For signal acquisition and front-end circuitry, a low-noise amplifier (LNA), an analog front-end (AFE) chip, and a high-resolution ADC are used. This scheme features high input impedance, high common-mode rejection ratio, and can acquire... This invention acquires weak EEG signals from the postauricular cortex. On the reverse side of the low-power processing unit, the algorithm can be deployed on a low-power embedded chip, such as an ARM Cortex-M series processor or a low-power DSP chip. This solution matches computing power and supports low-power mode, meeting the needs of real-time data processing and prediction. For the data transmission module, Bluetooth Low Energy or Wi-Fi is used for real-time data transmission and information interaction with mobile phones or the cloud. The power management module uses a lithium battery and a power management chip for dynamic power management and on-demand wake-up of the processing unit. The overall device workflow is as follows: ① Acquisition of postauricular cortical EEG signals; ② Amplification and analog-to-digital conversion by the front-end circuit; ③ Execution by the embedded processing unit: noise reduction, feature extraction, and classification; ④ Output of prediction results; ⑤ Triggering alerts or data upload.

[0285] The epilepsy seizure prediction method proposed in this invention can be effectively integrated into ear-worn wearable devices. Through the use of few-channel EEG acquisition and low-complexity algorithm design, it can achieve long-term home monitoring and real-time early warning. While ensuring prediction performance, it can significantly reduce system power consumption and has good prospects for industrial application.

[0286] The principles and implementation methods of this invention have been illustrated by specific embodiments. The description of the embodiments above is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals, characterized in that, Includes the following steps: (1) EEG signal acquisition: raw EEG signals from the postauricular cortex are acquired and bipolar lead channels are constructed, including four channels of EEG signals formed by T7, T8, P7 and P8 electrodes; (2) Signal preprocessing: The raw EEG signal is preprocessed, including: ①Notch filtering is used to remove power frequency interference; ② Adaptive filtering based on the recursive least squares (RLS) algorithm; ③ Hierarchical threshold denoising based on wavelet decomposition; The preprocessing adopts a cascaded structure of RLS adaptive filtering and wavelet hierarchical threshold denoising to suppress non-stationary noise before performing multi-scale decomposition. (3) Sample construction: Construct samples before epileptic seizures and samples in normal state, and use a sliding time window to segment the data; (4) Feature extraction: Multi-domain features are extracted based on the denoised EEG signal. The features consist of frequency domain features, time-frequency domain features, nonlinear dynamic features and multi-scale features, including: power spectral entropy, wavelet θ energy, time-frequency energy ratio, sample entropy, Lyapunov exponent and multi-scale permutation entropy. The multi-scale features are calculated using a preset scale set. (5) Feature significance analysis: The features are screened based on statistical significance analysis. The screening includes the selection of the t-test method based on the homogeneity of variance test, combined with FDR correction and effect size constraints. (6) Classification model construction: The selected features are input into the support vector machine (SVM), the K-nearest neighbor classifier (KNN), and the ensemble learning classification model to achieve the prediction of the state before the epileptic seizure.

2. The method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals according to claim 1, characterized in that: In step (1), all raw EEG signals from the postauricular cortex are collected at a sampling frequency of 256Hz. A 16-bit analog-to-digital converter is used to convert the collected analog signals into digital signals for storage. Four electrode positions located in the postauricular cortex are selected to form bipolar leads: T7-P7, T8-P8, P7-T7, and P8-T8.

3. The method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals according to claim 1, characterized in that: The notch filtering in step (2) uses a 59-61Hz notch filter to remove power frequency interference. The specific steps are as follows: 1) Adaptive filtering is performed using the recursive least squares (RLS) algorithm. First, the filter weight vector, covariance matrix, and error sequence are initialized, where the initial value of the covariance matrix P(0) is determined by preset parameters. Then, the filter is recursively updated using the reference signal after bandpass filtering as the input vector. At each time step, the filter output value is first calculated and compared with the notch-filtered EEG signal to obtain the error signal. Then, the gain vector is calculated using the recursive least squares algorithm, and the filter weights and covariance matrix are updated. Through continuous iterative updates, the filter weights gradually converge, thereby effectively estimating and eliminating noise components. The specific calculation steps are as follows: A. Initialize parameters: weight vector Initial value of covariance matrix ; Where the initial value of the covariance matrix P(0) represents the initial measure of the uncertainty of the filter in weight estimation, the regularization parameter δ controls the convergence speed and stability, and I represents the identity matrix; B. For each time k, perform the following steps: Constructing a reference signal: This refers to the main signal after removing power frequency interference. High-frequency bandpass filtering is performed to extract electromyographic interference as a reference signal: Where Bandpass represents a bandpass filter, f represents the filter frequency, and the main signal... The sum of effective EEG signals and noise signals; Construct the input vector: , where M represents the filter order and T represents the vector transpose; For each time k, the output result at time k-1 is used as the new data input, and the output is calculated using the parameters at time k-1. Then the error is calculated, the parameters are updated, the result is output, and then the process proceeds to the next time k+1. Filter output: ; Error signal: ; Calculate the gain vector using the recursive least squares algorithm. and the filter weights Perform an update, and simultaneously update the covariance matrix. ; Gain vector calculation: ; Weights: ; Covariance matrix: ,in For numerically stable terms, Forgetting factor; Output result: ; The forgetting factor λ of the RLS filter ranges from 0.99 to 0.999; 2) After RLS adaptive filtering, wavelet hierarchical adaptive threshold denoising is used. The specific process is as follows: A. Wavelet Decomposition: The symmetric wavelet basis function sym6 is selected to perform multi-scale decomposition on the RLS-filtered signal. The decomposition level is set to 7 levels to obtain a set of wavelet coefficients. Including approximation coefficients Detail coefficients at various scales i=1,2,...,7; layers 1–3 are high-frequency layers, and layers 4–7 are low-frequency layers; In the discrete wavelet transform, the wavelet basis function sym6 is connected to the filter bank through a two-scale equation. The scaling function corresponding to wavelet basis function sym6 is: The corresponding mother wavelet function is Through the dual-scale equation and The low-pass filter coefficients can be obtained. and high-pass filter coefficients ; and Using a set of orthogonal filter coefficients, perform discrete wavelet decomposition of the signal; The decomposition of the i-th layer can be extracted using approximation coefficients. and detail coefficient extraction We obtain, where k represents translation, i.e., time position. Represents the approximation coefficients of the (i-1)th layer. Represents the approximation coefficients of the i-th layer. The i-th level detail coefficients are represented by n-2k, where n-2k represents a 2x downsampling operation. The final set of coefficients is obtained as follows: ,in , These are the highest frequency information and the lower frequency details, namely the detail coefficients of layer 1 and layer 7; It is the smoothest low-frequency trend, i.e., the 7th layer approximation coefficient; B. Layered Threshold Setting: A segmented threshold strategy is adopted based on the signal characteristics of different frequency layers; layers 1-3 correspond to rapidly changing components and high-frequency oscillations, and smaller thresholds are set accordingly. Layers 4-7 correspond to slowly changing components and noise interference, so a larger threshold is set for them. ;in This represents the standard deviation of the detail coefficients at the i-th level. This represents the threshold value for the i-th layer. C. Thresholding function processing: Thresholding is performed on the detail coefficients of each layer: For the detail coefficients of layers 1-3, a soft thresholding function is used: Where sign(∙) is the sign function, Let k represent the detail coefficient at level i, and k represent the time index position of the current detail coefficient at this scale. This represents the k-th coefficient value in the i-th level detail coefficient sequence after thresholding. For detail coefficients at layers 4-7, a hard thresholding function is used: ; D. Signal reconstruction: Reconstructing the processed detail coefficients... and approximation coefficients Wavelet reconstruction is performed to obtain the denoised EEG signal; according to wavelet multiresolution analysis theory, the reconstruction process can be expressed as follows: ,in Both are reconstruction filters; Refactoring through recursive layer-by-layer: ; ... The final result is the reconstructed signal, i.e., the denoised signal. .

4. The method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals according to claim 3, characterized in that: The notch filter selected in step (2) includes a filter order M of 2, a forgetting factor λ = 0.995, and an initial covariance matrix parameter δ = 0.

01.

5. The method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals according to claim 1, characterized in that: In step (3), the data segmentation divides the EEG signal data of the postauricular cortex of each subject into two types of signals, namely S-type and N-type signals. S-type signals are signals that will cause epileptic seizures after a predetermined time period, and N-type signals are signals that will not cause epileptic seizures after a predetermined time period. The epilepsy prediction interval is set to 40 minutes, that is, 40 minutes before the onset of epileptic seizures. The time 10 minutes before the start of the prediction interval is marked as S-type signal. At the same time, a continuous 3 hours without any epileptic seizures is searched, and 10 minutes of the time is selected and marked as N-type signal. The EEG signal of a complete acquisition unit is the signal acquired continuously for 10 minutes. A sliding window with a length of 10 seconds is set for the acquired signal. Each acquisition unit is divided into 60 continuous signals with a duration of 10 seconds. Every 10 seconds of signal is a sample, and each sample has no overlapping parts.

6. The method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals according to claim 1, characterized in that: In step (4), the power spectral entropy, wavelet θ energy, time-frequency energy ratio, sample entropy, Lyapunov exponent, and multi-scale permutation entropy are calculated using the following specific steps: 1) The calculation steps for the power spectral entropy are as follows: A. Estimating the power spectrum using the periodogram method: Where x(n) represents the original discrete EEG signal, and N represents the signal length. This represents the k-th discrete frequency point. This represents the power spectral density at the corresponding frequency, where j represents the imaginary unit. It is a complex exponential function, representing frequency. The sinusoidal component; B. To calculate the information entropy, the power spectrum needs to be normalized to a probability distribution form: ,in Normalized power spectrum; C. Using Shannon's information entropy formula, the power spectral entropy is obtained: psdE is the power spectral entropy; 2) The wavelet The energy is the sum of energy in the 4–7 Hz frequency band in the wavelet domain. The calculation steps are as follows: A. Obtaining time-frequency coefficients using Continuous Wavelet Transform (CWT) : Where a represents the scale parameter, which is inversely proportional to the frequency; b represents the time shift parameter. For input signal, For Morlet mother wavelet, * denotes complex conjugation; To facilitate the analysis of EEG frequency band features, a frequency-time representation is adopted. , Where f represents frequency and t represents time. This represents the mother wavelet function after scaling and translation at frequency f and time t; the Morlet wavelet is selected as the mother wavelet function. B. Selection Wave frequency band 4–7 Hz: ; C. Average over the time dimension t, and calculate... Average energy per frequency band: ; 3) The time-frequency energy ratio mentioned is calculated using wavelet analysis to compare the energy of the 1–4Hz delta wave with that of the 13–30Hz wave. The ratio of wave energies is logarithmically smoothed. The calculation steps are as follows: A. Regarding brainwave signals Time-frequency coefficients are obtained using CWT continuous wavelet transform. : ; B. Calculate 1–4 Hz Wave energy and 13–30 Hz Wave energy: , ; C. Logarithmic compression of energy ratio: ,in , is a stable term; 4) The steps for calculating the sample entropy are as follows: A. Phase Space Reconstruction: Given a one-dimensional time series Construct a vector sequence with embedding dimension m. , where N is the sequence length; B. Definition of distance between vectors: The distance between any two vectors is defined using the Chebyshev maximum norm: ,in and Let i and j represent any two vector sequences of length i and j respectively, k represents the vector offset changing from 0 to m-1, i+k represents the index after moving k positions from position i, and j+k is similar; C. Similarity pattern determination: Set a threshold r, i.e., similarity tolerance; if the condition is met... If the two patterns match, then the two patterns are considered to be "matched". D. Matching probability calculation: For each vector Calculate its matching probability: , For all We can obtain the average probability over the m dimensions by averaging: Then the average probability in dimension m+1 is ; E. Calculate sample entropy: ; 5) The Lyapunov index is calculated based on the Rosenstein improved algorithm. The calculation steps are as follows: A. Phase space reconstruction: Given a one-dimensional signal Phase space reconstruction is performed using the delayed coordinate method to construct the embedding vector. : ; The reconstructed matrix is ​​obtained: ; Where m is the embedding dimension. For time delay; B. Find the nearest neighbor vector: In phase space, for each state point vector Find the nearest neighbor. ,satisfy Minimum, and requires , The time separation window is usually set to 1 second, which requires that the two points are independent in time to avoid autocorrelation affecting the results; C. Calculate the divergence trajectory: For each pair of neighboring vectors, calculate the trajectory divergence at each time step k: ; Calculate the average divergence over all trajectories: , where M is the number of valid trajectory pairs; D. Estimation of the maximum Lyapunov index: Logarithmic curve of distance between trajectories The change with time step k can usually be divided into three stages: the initial stage, the exponential divergence stage, and the saturation stage. The exponential divergence stage is characterized by an approximately exponential increase in the distance between trajectories, which is the effective range for estimating the Lyapunov exponent. Therefore, the maximum Lyapunov exponent is estimated in the exponential divergence stage. Take the logarithm of the average trajectory divergence : In the logarithmic curve Select an approximately linear interval above And perform least-squares linear fitting within this interval: The slope of the fitted line That is, the maximum Lyapunov index; 6) The multi-scale permutation entropy combines coarse-graining processing with the permutation entropy method, and its calculation steps are as follows: A. Coarsening treatment: For the original sequence Divide into new sequences at scale s: ; Where s is the scale factor, and N is the length of the original sequence. : Length of the coarse-grained sequence; B. Phase space reconstruction: For each scale sequence By embedding dimension m, delay time Reconstruct the embedding vector: ; C. Pattern Recognition: For The elements are sorted to obtain the arrangement pattern: argsort indicates index sorting; D. Probability Distribution Construction: Calculate the probability of each permutation pattern occurring, and let the probability of the nth pattern occurring be... ,So ; E. Calculate and normalize the permutation entropy H(s) at scale s: ; in To prevent the logarithm of zero from being a very small constant, This represents the normalized permutation entropy; F. Multiscale permutation entropy: Selecting a set of scales: ; Calculate the permutation entropy for multiple scales s∈S.

7. The method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals according to claim 1, characterized in that: The statistical significance analysis in step (5) follows these steps: A. Automatic determination of homogeneity of variance: For each feature, use a two-sample F-test to test whether the variances of the two classes of samples are equal, testing the null hypothesis that "the variances are equal"; B. Adaptive selection of t-test method based on variance results: If the features satisfy homogeneity of variance, use the standard Student's t-test; if not, use Welch's t-test, which is more robust to cases with unequal variances. C. Calculate the effect size. Cohen's d: In addition to the significance p-value, Cohen's d is further introduced to measure the discriminative effect of the features: ; in The mean of the two samples is denoted as . The standard deviation of the two groups of samples; This represents the pooled standard deviation; D. Correction for multiple hypothesis testing: To control the accumulation of false positives caused by multiple testing, FDR correction was used to adjust all p-values; The FDR correction algorithm is as follows: Let the original p-values ​​be sorted in ascending order as follows: Then find the largest k such that: ; Then the first k p-values ​​can all be considered significant, meaning that control is achieved. ; The screening criteria were: after FDR correction, p < 0.05 and |Cohen's d| > 0.

5.

8. The method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals according to claim 1, characterized in that: The classification model in step (6) adopts a lightweight classification model, including 12 classifiers from three major categories: Support Vector Machine (SVM), K-Nearest Neighbor (KNN) classifier, and ensemble learning model. A 10-second 4-channel postauricular cortical EEG signal is considered as a sample, and each sample has 44 features. For any patient, all samples and features constitute the training data used to train the 12 classification models. Nested five-fold cross-validation is used for model training and parameter optimization. The inner cross-validation is used to optimize the classifier hyperparameters, and the outer cross-validation is used to evaluate the model. The training process is as follows: ① The outer layer is divided into training and test sets; ② Select the optimal parameters for inner cross-validation; ③ Train the model on the training set; ④ Evaluate the model performance on the test set.

9. The method for predicting epileptic seizures based on postauricular cortical electroencephalogram (EEG) signals according to claim 1, characterized in that: The method is applied to a wearable EEG acquisition device in the postauricular region for real-time prediction of epileptic seizures in everyday environments; the method is deployed in a low-power embedded system to achieve continuous EEG acquisition and online prediction.