Epileptic seizure prediction method based on space-time attention dynamic pulse neural network
By constructing a spatiotemporal attention dynamic spiking neural network and employing sparse compression coding, spatiotemporal structure mapping, and multi-scale channel attention mechanisms, the problems of insufficient temporal dynamics and spatial redundancy processing in existing methods are solved, achieving high-precision epileptic seizure prediction and improved stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-10
AI Technical Summary
Existing methods for predicting epileptic seizures based on spiking neural networks suffer from insufficient temporal dynamism, inadequate handling of spatial redundancy in multi-channel EEG signals, and low predictive robustness, making it difficult to effectively capture information in the pre-seizure phase and uncover key interaction patterns.
A spatiotemporal attention-based dynamic spiking neural network is constructed. It employs sparse compression coding, spatiotemporal structured pulse mapping, multi-scale spatiotemporal channel attention mechanism, and pulse similarity coupling strategy. High-precision prediction is achieved by fusing sparse pulse sequences, spatiotemporal pulse sequences, and multi-scale time-space-channel attention features, combined with residual spiking neural network training.
It improves the accuracy, stability, and interpretability of epileptic seizure prediction, enhances the accuracy of capturing weak abnormalities in the pre-seizure phase, reduces noise interference, and improves the model's adaptability and predictive ability.
Smart Images

Figure CN121839082A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of epilepsy seizure prediction technology, and in particular to an epilepsy seizure prediction method based on a spatiotemporal attention dynamic spiking neural network. Background Technology
[0002] Epilepsy is a chronic central nervous system disorder caused by abnormal neuronal discharges in the brain, characterized by its sudden onset, recurrence, and difficulty in treatment. During an epileptic seizure, complex coupling and synchronous discharge behaviors exist between different brain regions, resulting in significant temporal nonlinear dynamics and multi-channel spatial correlations in the electroencephalogram (EEG). Therefore, features in EEG signals related to epileptic seizures are often implicit in complex temporal variations, spatial distributions, and multi-channel synergistic patterns, requiring modeling methods with spatiotemporal analytical capabilities for effective characterization.
[0003] In recent years, epilepsy prediction methods based on spiking neural networks (SNNs) have attracted attention. These methods use pulse sequences as information carriers, simulating the firing pulse process of biological neurons through membrane potential accumulation and triggering mechanisms, offering the advantage of event-driven approaches. Existing SNN methods generally employ direct encoding to convert continuous EEG signals into pulse sequences, mapping the amplitude of the continuous signal to a pulse at each time step and repeating this process across multiple time steps. However, existing direct encoding methods repeat similar pulse patterns across consecutive time steps, are sensitive to amplitude changes but insensitive to dynamic patterns, and struggle to fully reflect the gradually evolving non-stationary temporal characteristics of EEG signals in the pre-ictal phase, resulting in insufficient information capture capabilities for the pre-ictal phase. Furthermore, traditional methods often employ homogeneous processing strategies for multi-channel EEG signals, assigning equal weights to each channel for encoding and inputting into the network, lacking differentiated modeling for functional connectivity and coordinated firing patterns across different brain regions, making it difficult to uncover potential important interactions and key channel combinations.
[0004] To address the aforementioned problems, this invention proposes a method for predicting epileptic seizures based on a spatiotemporal attentional dynamic spiking neural network. This method integrates sparse compressed coding, spatiotemporal structural pulse mapping, multi-scale spatiotemporal channel attention mechanisms, and pulse similarity coupling strategies. Starting from the spatiotemporal firing characteristics of neurons, it establishes a spiking neural network to achieve spatiotemporal dynamic modeling of EEG signals and epilepsy prediction. Summary of the Invention
[0005] The main objective of this invention is to provide a method for predicting epileptic seizures based on a spatiotemporal attention dynamic spiking neural network. Addressing the shortcomings of existing direct encoding methods, such as insufficient temporal dynamism, inadequate handling of spatial redundancy in multi-channel EEG signals, and low prediction robustness, this invention constructs a method that integrates sparse discharge compression coding, spatiotemporal structure pulse mapping, multi-scale spatiotemporal channel attention mechanisms, and pulse similarity coupling strategies. This enables deep modeling of the implicit spatiotemporal features in EEG signals, thereby improving the accuracy, stability, and interpretability of epileptic seizure prediction.
[0006] Technical solution
[0007] To achieve the above objectives, the present invention provides a method for predicting epileptic seizures based on a spatiotemporal attention dynamic spiking neural network, characterized by comprising the following steps:
[0008] S1. Preprocessing Module: Collects EEG signals from epilepsy patients and divides them into pre-ictal and interictal EEG data segments based on annotation information. Preprocessing of these EEG data segments involves bandpass filtering to remove noise, electromyography (EMG), and electrooculography (EOG) interference components. A sliding window segmentation is performed according to a preset event window length to obtain noise-suppressed time-window EEG signals. These time-window signals are then used as input for subsequent pulse coding and spatiotemporal feature modeling.
[0009] S2. A method for predicting epileptic seizures based on a spatiotemporal attention dynamic spiking neural network is used to predict epileptic seizures, specifically including:
[0010] 1. Generating sparse pulse sequences based on sparse compression methods:
[0011] Based on the sparse compression coding method, a sawtooth carrier signal is generated based on the pulse width modulation mechanism, and a sparse representation dictionary is constructed in combination with compressed sensing theory to perform sparsification processing on the carrier signal, thereby obtaining a sparse pulse sequence that reflects the change in partial discharge intensity.
[0012] 2. Generating spatiotemporal pulse sequences based on spatiotemporal structure pulse mapping method:
[0013] Based on the spatiotemporal structure pulse mapping method, a convolutional normalization layer is used to extract basic features. The results are then input into a leak-integral-fire spiking neuron, and this process is repeated at multiple time steps to generate a pulse with both temporal and spatial dimensions.
[0014] 3. Generating temporal-spatial-channel attention features based on a multi-scale spatiotemporal channel attention method:
[0015] Based on the multi-scale spatiotemporal channel attention method, the time dimension is weighted by the time dimension attention, the long-short time dependence of EEG signals is extracted by the long-short time dependence method, the spatial-channel synergistic relationship is captured by the space-channel module, and the above-mentioned multiple attention features are fused to obtain the time-space-channel attention features.
[0016] 4. Generating spatiotemporal attention pulse features based on a pulse similarity coupling smoothing method:
[0017] Based on the pulse similarity coupling smoothing method, the similarity between sparse pulse sequences, spatiotemporal pulse sequences and time-space-channel attention features is used to couple the three. Combined with an average sliding filter with a reasonable window size and type, the fusion result is temporally smoothed to generate a spatiotemporal attention pulse sequence with spatiotemporal attention characteristics.
[0018] 5. Residual Spike Neural Network: A spiking neural network is built based on the residual structure. Spatiotemporal backpropagation and gradient substitution are used to input the spatiotemporal attention pulse sequence into the spiking neural network to decode the pulse sequence and train it to achieve high-precision epileptic seizure prediction.
[0019] In a preferred embodiment, the above method includes:
[0020] The preprocessing module performs filtering, artifact removal, and time window segmentation on the collected EEG signals.
[0021] Sparse pulse sequences, spatiotemporal pulse sequences, and multi-scale time-space-channel attention features are generated based on sparse discharge compression coding, spatiotemporal structure pulse mapping, and multi-scale spatiotemporal channel joint attention feature module.
[0022] Spatiotemporal attention pulse sequences are obtained by coupling sparse pulse sequences, spatiotemporal pulse sequences, and multi-scale time-space-channel attention features using the pulse similarity coupling smoothing method;
[0023] A spiking neural network is constructed based on the residual structure. The training adopts the backpropagation algorithm and the alternative gradient. The spatiotemporal attention pulse sequence is input into the spiking neural network to represent the spatiotemporal attention pulse sequence, so as to achieve high-precision epileptic seizure prediction.
[0024] Compared with existing technologies, this invention has the following advantages: The pulse representation framework enhances spatiotemporal modeling capabilities. By constructing a modeling framework of sparse compression coding, spatiotemporal structure pulse mapping, and multi-scale spatiotemporal channel joint attention, it jointly represents EEG signals from the perspectives of partial discharge sparsity, global spatiotemporal structure, and multi-scale attention features, effectively overcoming the shortcomings of traditional single direct coding methods, such as weak temporal sensitivity and insufficient spatial dependency modeling. Pulse width modulation and overcomplete dictionary sparse decomposition map continuous EEG signals into sparse discharge pulse sequences, enhancing the model's response to sudden abnormal discharge regions and improving the accuracy of capturing weak abnormalities in the pre-ictal period. Through temporal dimension attention, channel length short-term dependence, and spatial-channel collaborative attention methods, it obtains temporal-spatial-channel joint attention features, enabling the model to adaptively highlight key time periods, key channels, and key spatial patterns related to epilepsy, reducing the interference of irrelevant noise on prediction results and improving the model's predictive ability. This invention employs a pulse similarity-driven coupling fusion strategy to perform differentiated weighted fusion of sparse pulse sequences, spatiotemporal pulse sequences, and attention features. A mean-sliding filter is then used for temporal smoothing, taking into account transient discharge anomalies and improving the stability and robustness of predictions. This method preserves the accumulation and triggering mechanism of neuronal membrane potential at the spiking neuron level; simultaneously, it provides a novel technical path and implementation method for epileptic seizure prediction and neural signal analysis. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart illustrating the overall process of the epileptic seizure prediction method based on a spatiotemporal attention dynamic spiking neural network according to the present invention.
[0027] Figure 2 This is a schematic diagram of the spiking neural network model of the present invention;
[0028] Figure 3 This is a schematic diagram of the epileptic seizure prediction method based on a spatiotemporal attention dynamic spiking neural network according to the present invention;
[0029] Figure 4 This is a schematic diagram of the spiking neural network structure based on residual structure of the present invention. Detailed Implementation
[0030] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the following embodiments are only used to illustrate the present invention and are not intended to limit the present invention.
[0031] Example 1:
[0032] like Figure 1 As shown, this invention discloses a method for predicting epileptic seizures based on a spatiotemporal attention dynamic spiking neural network, comprising data preprocessing, sparse compression coding, spatiotemporal structure mapping, multi-scale time-space-channel attention, pulse similarity coupling smoothing, and residual spiking neural network construction, wherein:
[0033] Preprocessing module: Collects EEG signals and preprocesses them, including filtering and sliding window segmentation, to obtain purified time-window EEG signals;
[0034] Sparse pulse sequences and spatiotemporal pulse sequences are generated based on sparse compression coding and spatiotemporal structure pulse mapping. Temporal-spatial-channel features are extracted through a multi-scale spatiotemporal channel attention module.
[0035] Spatiotemporal attention pulse sequences are generated by fusing sparse pulse sequences, spatiotemporal pulse sequences, and multi-scale time-space-channel features based on the pulse similarity smooth coupling method.
[0036] Residual Spike Neural Network Construction: A spiking neural network is constructed based on the residual structure. Spatiotemporal backpropagation and substitution gradient are used to input the fused spatiotemporal attention pulse sequence into the spiking neural network to decode the pulse representation, thereby achieving high-precision epilepsy prediction.
[0037] Example 2: Spatiotemporal Structure Pulse Mapping Method
[0038] In step S2, the pulse sequence based on the spatiotemporal dynamic characteristics of neuronal pulse firing is as follows:
[0039] S21. Obtaining spatiotemporal pulse sequences based on spatiotemporal structure pulse mapping
[0040] S211. The input signal is processed by a convolutional normalization layer, and the result is directly fed into the spiking neuron model to obtain a pulse sequence with time characteristics, wherein:
[0041] Convolutional normalization layer:
[0042] P t,n =BN(Conv(W n ,X t,n-1 ))
[0043] Where t = 1, 2, ..., T, X t,n-1 For the original input signal, W nHere are the learnable parameters of the network, and conv and BN represent convolution and normalization, respectively.
[0044] S212. After the convolution-normalization layer, the signal is fed into the spiking neuron based on the Leaky Integrate-and-Fire (LIF) model. The Euler method is used to transform it into an iterative expression, generating a spatiotemporal pulse sequence with spatiotemporal structure, as shown in the following expression:
[0045] U t,n =H t-1,n +O t,n
[0046] S t,n =Θ(U t,n -V th )
[0047] H t,n =τU t,n ·(1-S t,n )+V rest S t,n
[0048] In the formula, τ is the time constant, and Θ() represents the Heaviside function, which is triggered when the membrane potential U exceeds the trigger threshold V. th When the neuron triggers an event, H represents the membrane potential after the event. If no pulse is generated, H is equal to τU; otherwise, the membrane potential is reset to V. rest .
[0049] Through the above process, the present invention maps the convolutional feature space structure into a pulse sequence on a time series while maintaining the feature space structure, thus forming a spatiotemporal structure pulse mapping.
[0050] Example 3: Sparse Compression Coding Method
[0051] In step S2, a sparse compression coding method is constructed to obtain a sparse pulse sequence, as follows:
[0052] S22. Construct sparse pulse coding to obtain sparse pulse sequences.
[0053] S221. A sawtooth wave signal is generated based on a pulse width modulation (PWM) mechanism. This sawtooth carrier signal is then sparsified using a sparse representation dictionary derived from compressed sensing theory to generate a sparse pulse sequence. Specifically:
[0054] Generating sawtooth carrier signals based on pulse width frequency modulation mechanism:
[0055]
[0056] Where t = 1, 2, ..., T, f sThe carrier frequency depends on the sampling frequency of the original EEG signal X(t);
[0057] S222. Construct a sparse representation dictionary and perform sparsification processing on the sawtooth carrier signal. Construct an overcomplete dictionary F using a sparse decomposition algorithm. The formula is as follows:
[0058]
[0059] in, For orthonormal basis, These are the large coefficients after orthogonal basis decomposition. Further, the sparsified carrier signal is obtained, and compared with the original signal to obtain a sparse coded pulse sequence:
[0060]
[0061] Where is the orthonormal basis, and is the large coefficient after the orthonormal basis decomposition. Through the above sparse discharge compression coding, the present invention effectively suppresses redundant information.
[0062] Example 4: Multi-scale spatiotemporal channel attention method
[0063] In step S2, the generation of multi-scale spatiotemporal attention features includes:
[0064] S23, Multi-scale Spatiotemporal Attention Feature Method
[0065] S231, Temporal dimension attention features: Establish the temporal relationship of the input signal, and compress the spatial channel features into... Then, pooling is used to calculate the maximum and average values of the remaining three dimensions of the input. A shared MLP network then transforms the features after average pooling and max pooling into a time weight vector. The mathematical expression of the entire process can be described as follows:
[0066]
[0067] in, Here, r represents the network weights, and r represents the time reduction factor.
[0068] S232. Channel length-time dependence: The long-time dependence features of EEG signals are obtained using convolution operators. The process can be described as follows:
[0069] Y ADS (X)=σ(Conv(mean(F t (X))))
[0070] Where σ(·) represents the Sigmoid function, Y t (X) represents time weighting information.
[0071] S233, Spatial-Channel Attention Feature: At each time step, a spatial-channel weight matrix is generated through a shared 2D convolution K. It can be described as:
[0072]
[0073] Where Y ST (·) represents the function operation for spatial channel attention, W i,j K represents the learnable parameters, and K is the size of the two-dimensional convolution kernel.
[0074] S234. The temporal weight vector and spatial channel matrix are gated and fused using the Hadmard product to obtain the temporal-spatial-channel attention feature, the mathematical expression of which is:
[0075] Y cntro (X)=σ(Y ADS (X)⊙(Y ST (X)))
[0076] Where σ(·) is the Hadmard product.
[0077] Through the above methods, this invention achieves joint attention feature modeling of EEG signals in the temporal, spatial, and channel dimensions.
[0078] Example 5: Construction of Pulse Similarity Coupled Smoothing and Residual Pulse Neural Network
[0079] S24, Pulse Similarity Coupling Smoothing Method
[0080] In step S24, based on the similarity concept, sparse pulse sequences, spatiotemporal pulse sequences, and time-space-channel attention features are coupled, and an average sliding filter with a reasonably selected window size and type is used to generate a spatiotemporal attention pulse sequence. The calculation formula is as follows:
[0081]
[0082]
[0083] S25. Construction of Residual Spike Neural Network
[0084] In step S25, the spatiotemporal attention pulse sequence spiking neural network is trained and updated. The epileptic seizure prediction module adopts a multi-layer residual pulse structure, and its residual pulse modules are added to the forward pulse branch through short-circuit connections. The parameters are optimized using the spatiotemporal backpropagation algorithm, and the non-differentiability problem of spiking neurons is solved by combining the alternative gradient method.
[0085] Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and are not intended to limit it. Those skilled in the art can make various modifications or equivalent substitutions without departing from the spirit and scope of the present invention, and all such modifications or substitutions should fall within the protection scope of the present invention.
Claims
1. A method for predicting epileptic seizures based on a spatiotemporal attention dynamic spiking neural network is proposed, characterized in that, The method includes: The preprocessing module collects EEG signals, preprocesses the EEG signals, and obtains purified time-window EEG data. The pulse sequence generation module processes time-window EEG data based on sparse compression coding, spatiotemporal structure pulse mapping, and multi-scale spatiotemporal channel attention methods to obtain sparse pulse sequences, spatiotemporal pulse sequences, and multi-scale spatiotemporal channel attention features. Based on the pulse similarity smooth coupling method, sparse pulse sequences, spatiotemporal pulse sequences and multi-scale spatiotemporal channel attention features are coupled to obtain spatiotemporal attention pulse sequences; A residual spiking neural network was constructed, and a spatiotemporal attention pulse sequence was input into the spiking neural network to train the network, so as to achieve high-precision prediction of epileptic seizures.
2. The method for predicting epileptic seizures using a spatiotemporal attention dynamic spiking neural network according to claim 1, characterized in that, The sparse compression coding method includes: Construct a sawtooth carrier signal corresponding to the EEG signal within the stated time window: Where t = 1, 2, ..., T, f s The carrier frequency depends on the sampling frequency of the EEG X(t) within the time window; Construct a sparse representation dictionary, perform sparse decomposition on the sawtooth carrier signal, and generate a sparse pulse sequence: in, For orthonormal basis, The coefficients are those obtained after orthogonal basis decomposition. Further, Y(t) obtained from the sparsified carrier signal is compared with the time-windowed EEG to obtain the sparse coded pulse sequence O. sparse .
3. The method for predicting epileptic seizures using a spatiotemporal attention dynamic spiking neural network according to claim 1, characterized in that, The spatiotemporal structure pulse mapping method includes: The time-window EEG data is processed using a convolutional normalization layer for convolution and normalization. P t,n =BN(Conv(W n ,X t,n-1 )) Where t = 1, 2, ..., T are the time step indices, and X t,n-1 For time-window EEG, W n represents the learnable parameters of the convolutional layer, and conv and BN represent convolution and normalization, respectively. Based on the classic spiking neuron model, the membrane potential is accumulated for the information after convolution and normalization at each time step, thereby forming the spatiotemporal pulse sequence S(t) across multiple time steps: U t,n =H t-1,n +O t,n S t,n =Θ(U t,n -V th ) H t,n =τU t,n ·(1-S t,n )+V rest S t,n Where τ is the time constant, and Θ(·) represents the Heaviside function, which is triggered when the membrane potential U exceeds the trigger threshold V. th When the neuron triggers a pulse, H represents the membrane potential after the triggering event. If no pulse is generated, H is equal to τU; otherwise, the membrane potential resets to V. rest .
4. The method for predicting epileptic seizures using a spatiotemporal attention dynamic spiking neural network according to claim 1, characterized in that, The multi-scale spatiotemporal channel attention method includes: The input features are subjected to global average pooling and max pooling in the time dimension using temporal feature attention, and temporal weight information is generated through a shared multilayer perceptron. in, is the weight, and r represents the time reduction factor. Channel-long-term dependence features are obtained by performing convolution and downsampling operations along the channel direction to acquire EEG long-term dependence information, and channel weights are obtained through a non-linear activation function. Y ADS (X)=σ(Conv(mean(Y t (X)))) Where σ(·) represents the sigmoid function, Y t (X) represents time weighting information. Spatial-channel attention features are generated by processing the input temporal EEG data in both spatial and channel dimensions using two-dimensional convolution. Where Y ST (·) represents the function operation for spatial channel attention, W i,j K represents the learnable parameters, and K is the size of the two-dimensional convolution kernel. The temporal-spatial-channel attention features are obtained by fusing temporal weight information and spatial-channel features using the Hadamard product: AND cntro (X)=σ(Y ADS (X)⊙(Y ST (X))) Where σ(·) represents the Hadamard product.
5. The method for predicting epileptic seizures using a spatiotemporal attention dynamic spiking neural network according to claim 1, characterized in that, The pulse similarity coupling smoothing method is as follows: Based on the similarity concept, the sparse pulse sequence, the spatiotemporal pulse sequence, and the time-space-channel attention feature are coupled to obtain the coupled pulse sequence: The fused pulse sequence is temporally smoothed using an average sliding filter to generate the spatiotemporal attention pulse sequence.
6. The method for predicting epileptic seizures using a spatiotemporal attention dynamic spiking neural network according to claim 1, characterized in that, The residual spiking neural network includes: A multi-layer residual pulse network structure is provided, comprising multiple cascaded residual pulse modules. Each residual pulse module performs pulse convolution operation and membrane potential update on the input pulse sequence to extract spatiotemporal features related to epilepsy. Residual connections are used to short-circuit and add the input pulse sequence to the output of the forward pulse transform, thereby increasing the network depth while mitigating the gradient vanishing problem. Specifically, the output of the residual pulse module is used to extract spatiotemporal EEG features at different scales. Spatiotemporal backpropagation and alternative gradients are used for training to address the issue that gradients cannot be directly backpropagated due to the non-differentiability of the spiking neuron function, thus achieving high-precision epileptic seizure prediction.
Citation Information
Cited By
Pulse defocusing area detection method based on spatio-temporal information interaction
CN122090063A