Lightweight dynamic comparison calculation-based dual-mode epilepsy prediction method
By constructing a dual-mode epilepsy prediction method with lightweight dynamic comparison calculation, the problem of signal redundant interference and high computational complexity in traditional epilepsy prediction is solved, efficient and accurate early warning of epilepsy, adapting to individual differences and dynamic noise interference, and improving the real-time and accuracy of the model.
Patent Information
- Application Number
- CN202510528756.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-05
AI Technical Summary
The existing epilepsy prediction methods cause signal redundancy interference due to full-channel calculation, high false alarm rate, high calculation complexity, poor real-time performance, and difficult to meet the needs of clinical applications.
The dual-mode epilepsy prediction method is adopted with lightweight dynamic comparison calculation. Through weight channel optimization, self-supervised training and cross-modal feature fusion, a lightweight convolutional network is built, key channels are dynamically selected, adaptive noise suppression and time domain alignment, and prediction performance index is designed to achieve efficient and accurate epilepsy prediction.
It significantly reduces the complexity of model calculation, improves the accuracy and robustness of epilepsy prediction, realizes efficient epilepsy seizure warning, adapts to individual differences and dynamic noise interference, and improves the real-time and accuracy of the model.
Smart Images

Figure CN120432181A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of medical signal processing and is a dual-mode epilepsy prediction method based on lightweight dynamic contrast calculation. Background Art
[0002] Epilepsy is a major clinical challenge among neurological diseases. The unpredictable nature of its attacks seriously threatens the safety of patients. Therefore, the development of reliable early warning technologies is of great significance. Existing prediction methods are based on multi-channel EEG signal analysis. Clinical EEG acquisition systems typically contain dozens of channels, but effective signals related to epilepsy prediction often only exist in local brain regions. The fixed input architecture results in a large amount of redundant data involved in the calculation, significantly affecting real-time performance. On the other hand, the bioelectric activity before an epileptic seizure often manifests as a complex feature of time domain waveform distortion, frequency band energy abnormalities, and dynamic reconstruction of brain networks. However, the current model's integration of multimodal information often remains at the shallow level of feature splicing, failing to achieve synergistic enhancement of cross-domain features. More importantly, the complex network structure used to improve prediction accuracy often consumes huge computing resources, making it difficult to meet the needs of clinical real-time monitoring, thus restricting its practical application value.
[0003] In the prior art, the Chinese patent publication number is "CN202111581428.6", and its name is "Multimodal-based epilepsy onset warning method and smart bracelet device". This method preprocesses and fuses multimodal signals, and inputs them into the epilepsy prediction model to obtain prediction results; when the result exceeds the preset threshold, the similarity between the multimodal signal and the baseline epilepsy attack signal is analyzed. If the similarity exceeds the preset value, it is determined to be in the early stage of epilepsy attack, and the signal is stored in the database to update the baseline signal. However, this method cannot adapt to individual differences and dynamic noise interference due to the fixed channel input mode, resulting in a high false alarm rate; in addition, during the model training stage, the method has high computational complexity and low real-time prediction accuracy, which limits its application effect. Summary of the Invention
[0004] (1) Technical problems solved
[0005] In response to the shortcomings of the existing technology, the present invention provides a dual-modal epilepsy prediction method based on lightweight dynamic contrast calculation, which solves the problem of signal redundancy interference caused by full-channel calculation in traditional epilepsy prediction methods; solves the problem of high missed detection rate caused by the lack of multimodal features, and the problem of poor real-time performance of complex models.
[0006] (2) Technical solution
[0007] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical solutions:
[0008] A lightweight dual-mode epilepsy prediction method based on dynamic contrast calculation, the method specifically comprising the following steps:
[0009] S1, based on the TUH public dataset, obtains EEG and ECG bimodal data with epileptic seizure precursor characteristics; this data is divided into dataset A for model training and dataset B for model validation, where dataset A is used to generate positive and negative labeled samples, and dataset B retains the original data structure for generalization evaluation;
[0010] S2, constructing a weighted channel optimization model, including designing a dynamic channel selection module, a noise suppression module, a time window normalization module, and a resampling alignment module; inputting the dataset A in step S1 into the weighted channel optimization model for multimodal signal enhancement preprocessing;
[0011] S3: Construct a lightweight convolutional feature enhancement network, including designing a dual-modal representation reinforcement learning model and a cross-modal coupling network (CMCNet); input the EEG and ECG data optimized in step S2 into the dual-modal representation reinforcement learning model for time series modeling and feature mining;
[0012] S4, self-supervised network training, design contrast loss function L cont And combine the evaluation index system to provide performance feedback, including the predictive effectiveness index PEI proposed by the present invention;
[0013] S5: Use the reserved validation set for initial performance evaluation, then fine-tune the model parameters based on the parameter set, iterating round by round to improve the model's prediction accuracy and robustness.
[0014] S6, model solidification and storage. After solidifying the model parameters, the remaining test data is used to evaluate its predictive ability and stability to generate the final epilepsy prediction model.
[0015] Furthermore, the weighted channel optimization model reduces redundant calculations through a dynamic channel selection module, improves the signal-to-noise ratio through an adaptive noise suppression module, unifies data distribution through a time window normalization module, and corrects timing inconsistencies through a time domain alignment module. This improves inference speed and signal quality, optimizes computing efficiency, and overcomes the bottlenecks of traditional models.
[0016] The dynamic channel selection module is used to dynamically screen key channels based on input features, retaining only the top 30% key channels, and adapting to the EEG signal characteristics of different individuals to generate sparse input;
[0017] The adaptive noise suppression module is used to filter and suppress noise on the signal output by the dynamic channel selection module, and reduce the environmental noise and artifact interference in the EEG signal through an adaptive filtering method while retaining the key frequency band information of the signal;
[0018] The time window normalization module is used to perform unified time window normalization on the dual-mode signal processed by the noise suppression module. The signal is segmented by setting a 12-second time window to ensure the consistency of the time dimension of the signal input and eliminate the distribution differences caused by different sampling frequencies and data segment lengths.
[0019] The time domain alignment module is used to resample the dual-mode signal output by the time window normalization module, resample the data of different signal channels through an interpolation algorithm, and align the multi-channel signals to the same time scale and sampling frequency;
[0020] Furthermore, the dual-modal representation reinforcement learning model achieves enhanced information interaction between modalities and data fusion optimization through a multi-layer feature fusion module, and reduces data redundancy and the computational complexity of high-dimensional features through a decision dimensionality reduction module, thereby breaking through the correlation bottleneck of multimodal data processing and improving the accuracy and robustness of epileptic seizure prediction.
[0021] The feature extraction module is divided into a bottom-level feature extraction module and a top-level feature extraction module. The EEG branch in the bottom-level feature extraction module uses short-time Fourier transform to extract the dynamic changes in the power of frequency components over time, locating the time point of power changes in the pre-epileptic period. The ECG branch extracts the RR interval time series and calculates the standard deviation. A sudden increase in the standard deviation indicates the imminence of an epileptic seizure. The EEG branch in the top-level feature extraction module uses wavelet transform to capture sharp waves, and the ECG branch calculates the LF / HF ratio. The LF / HF ratio usually increases significantly before an epileptic seizure. This hierarchical feature extraction maximizes the retention of the core information of each modal signal while avoiding the high-dimensional feature redundancy caused by a one-time calculation.
[0022] The multi-layer feature fusion module further fuses and strengthens the dual-mode features through the bottom-layer fusion module and the upper-layer fusion module to obtain enhanced feature representation.
[0023] The decision dimensionality reduction module, through the collaborative design of feature selection and dimensionality reduction, ultimately generates low-dimensional but highly discriminative features for the prediction of epileptic seizures.
[0024] Furthermore, the cross-modal coupling network is constructed using a convolutional network consisting of three main components: a dense encoder, a fusion layer, and a representation reconstructor. This network extracts and fuses efficient features from EEG and ECG data, enabling the learning of abstract features related to epilepsy and establishing a reliable seizure prediction system.
[0025] The dense encoder consists of convolutional layers and a dense network, which is used to extract preliminary features from EEG and ECG signals. The convolutional layers use 3×3 convolution kernels and 16 output channels to capture local features. The dense network enhances feature extraction through dense connections, allowing the output of each layer to serve as the input to the next layer, thereby improving the network's expressiveness and the depth of feature extraction.
[0026] The fusion layer is responsible for integrating the features of EEG and ECG, and extracting richer and more robust feature representations through weighted summation of feature maps to improve the generalization ability and prediction accuracy of the model;
[0027] The representation reconstructor consists of four convolutional layers, each with a 3×3 kernel and 64×64 output channels. Through layer-by-layer convolution operations, it gradually restores the spatial resolution of the feature map and ultimately outputs the prediction result. This is used to restore the spatial structure of the original data from the fused features, thereby achieving accurate prediction of epileptic seizures.
[0028] Furthermore, self-supervised learning network training completes feature learning through a small amount of labeled data, and adjusts parameters through backpropagation to accurately predict epileptic states.
[0029] Furthermore, contrastive loss was selected as the loss function kernel to train the model by capturing the difference features between pre-ictal signals and non-ictal state signals.
[0030] Furthermore, the construction of a predictive effectiveness index can measure whether the model has the ability to maintain stable predictions over long periods of time and across multiple data segments. The PEI indicator takes into account the epilepsy prediction model's ability to identify positive and negative samples, and therefore provides a better measure. The closer the PEI is to 1, the stronger the model's predictive ability; the closer the PEI is to 0, the weaker the model's predictive ability.
[0031] Furthermore, the adaptation sensitivity index is used to measure the model's ability to successfully detect positive examples in prediction. The number of samples that are actually positive examples and predicted as positive examples is one of the important indicators for evaluating model performance.
[0032] Furthermore, the specificity index is used to measure the model's ability to successfully exclude negative examples in prediction, and is also one of the important indicators for evaluating model performance.
[0033] (3) Beneficial effects
[0034] 1. By constructing a weight channel optimization model, the present invention cleverly combines dynamic channel weight selection, self-attention modeling, and spectral artifact removal mechanisms in the bimodal signal preprocessing stage, so that the bimodal signals are fully aligned in the time dimension, effectively solving the problems of signal asynchrony, truncation, and length inconsistency, and achieving efficient and accurate signal purification and dynamic screening of redundant or low-quality channels in multi-channel signals.
[0035] 2. This paper uses a multi-sequence feature capture module (MSCM) and a residual hierarchy module (DRM) to collaboratively model EEG and ECG feature representations, combined with ConvLSTM to enhance time series modeling capabilities, significantly improving epileptic signal recognition accuracy. The innovatively designed Cross-Modal Coupled Network (CMCNet) utilizes bimodal feature refinement and interaction to enhance the model's predictive performance while maintaining its lightweight design, achieving a prediction accuracy of 95.16% on the TUH dataset.
[0036] 3. The end-to-end self-supervised joint training model constructed by the present invention fully utilizes the semantic contrast relationship between positive and negative samples, realizes the pseudo-label generation process without relying on manual annotation, and significantly improves the learning ability of the model in unsupervised scenarios.
[0037] 4. The present invention designs the predicted loss (L cont ), optimize the similarity of positive sample features and suppress the correlation of negative samples, automatically learn the deep difference structure between epileptic seizure period and non-seizure period; design a comprehensive effectiveness index (PEI), integrate the effective prediction coverage C e , omission penalty P m and false positive penalty P f , providing a more reasonable evaluation standard for epilepsy prediction; in addition, the model parameters were reduced to 129KB after optimization, which is significantly better than similar models. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 Flowchart of a dual-modal epilepsy prediction method based on lightweight dynamic contrast calculation;
[0039] Figure 2 This is a working principle diagram of the weight channel optimization model of the present invention;
[0040] Figure 3 This is a working principle diagram of the lightweight convolutional feature enhancement model described in the present invention;
[0041] Figure 4 This is a schematic diagram of the multi-sequence feature capture module (MSCM) of the present invention;
[0042] Figure 5 Schematic diagram of the residual hierarchy module (DRM) of the present invention;
[0043] Figure 6This is a working principle diagram of the dual-state coupling model of the present invention;
[0044] Figure 7 A diagram of the neural network and training strategy framework for self-supervised learning according to the present invention;
[0045] Figure 8 A diagram comparing the results of the epileptic seizure prediction method of the present invention and existing methods; DETAILED DESCRIPTION
[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0047] Example:
[0048] like Figure 1 As shown, Example 1 of the present invention provides a flowchart of a dual-mode epilepsy prediction method based on lightweight dynamic contrast calculation, which specifically includes the following steps:
[0049] S1, based on the TUH public dataset, obtains EEG and ECG bimodal data containing epileptic seizure precursor features; the data is divided into dataset A for supervised learning and dataset B for model validation. Dataset A generates positive and negative labeled samples through feature engineering methods, while dataset B retains its original data structure for generalization evaluation;
[0050] S2, build a weighted channel optimization model: use the dynamic channel selection module designed by the present invention to calculate the characteristics of each channel in real time, and dynamically model the relationship between channels through Transformer to achieve the screening and weighting of key channels, such as Figure 2As shown in the figure, the bimodal signals of the training data are subjected to a sliding window Fourier transform to extract frequency domain features. The frequency domain filtering is completed using FFT to filter high-frequency components and low-frequency drift. Independent component analysis (ICA) is then used to separate noise components, and artifact components are automatically identified based on kurtosis and power spectrum features. For the retained channel signals, a self-attention mechanism is used to learn the global pattern of the noise. Time windows are set based on the physiological differences of the bimodal signals. The EEG signal is localized for mean and variance normalization, and the ECG signal is periodically normalized by adjusting the gain factor based on heart rate fluctuations. The EEG and ECG sampling points are then remapped using a unified time grid, ensuring that the two signals have the same length and number of sampling points on the same time axis. If the signal lengths are inconsistent during the alignment process (for example, some signals are missing or truncated), the module uses zero padding or cropping strategies to adjust the signal lengths to ensure that the two signals can be seamlessly combined within the time window.
[0051] S3, building a lightweight convolutional feature enhancement network: The design of the lightweight convolutional feature enhancement model includes the construction of a dual-modal representation reinforcement learning model and a cross-modal coupling network; Figure 3 As shown in the figure, the first step is to design a dual-modal representation reinforcement learning model; first, the S2-optimized dual-modal signals EEG and ECG are input into the hierarchical feature extraction module, the EEG branch passes through the multi-order feature capture module 1 (MSCM1) and the multi-order feature capture module 2 (MSCM2), and the ECG branch passes through the residual hierarchical module 1 (DRM1) and the residual hierarchical module 2 (DRM2) to obtain sub-features; the extracted features are then subjected to dual-mode fusion through a dual-state coupling network, and are output after passing through the decision dimensionality reduction module (DM) to obtain the enhanced final features.
[0052] Among them, such as Figure 4As shown, the MSCM first normalizes the input EEG signals to eliminate differences in signal amplitude. The normalized signals are then fed into a convolutional long short-term memory (ConvLSTM) network, which consists of three stacked layers of convolutional LSTM units, with 16, 32, and 64 units in each layer, respectively. Tanh activation is used to enhance nonlinear representation. Each ConvLSTM layer employs a convolution operation with a stride of 1×2, capturing both temporal information and local spatial features while significantly improving the modeling of epilepsy signals. After feature extraction, the data is further processed through two fully connected layers. The first fully connected layer contains 128 neurons and uses the ReLU activation function to ensure gradient flow. The second fully connected layer contains 64 neurons and uses the SoftMax activation function to map the outputs to different class probability distributions, thereby achieving the epilepsy prediction task. Finally, the features are converted to vector representations by a flattening layer and connected to the final fully connected layer for decision output. The hierarchical structure of the network ensures seamless connection from time series modeling to feature classification, thereby significantly improving the detection accuracy of epileptic signals.
[0053] like Figure 5 As shown, the DRM module input is first fed into a batch normalization layer to ensure zero mean and unit variance of the input data to reduce internal covariate shift. A one-dimensional convolutional layer extracts local features of the input signal, eliminating the influence of varying signal amplitudes and thus enhancing the model's adaptability and generalization to signals of varying intensities. Subsequently, a one-dimensional convolutional layer is introduced to capture local features of the input signal. Its convolution kernel size is 1×3, which helps extract correlations between adjacent time points while maintaining computational efficiency. The nonlinear activation function ReLU is then introduced to further enhance the model's expressive power, enabling it to learn more complex feature representations. Four residual blocks (ECRBs) are key components of the network architecture. Each ECRB is designed using a combination of skip connections and two branches. Downsampling values in the max pooling layer are used to normalize the output sample size. The output feature size is halved block by block, from 64 to 8, while the number of filters is doubled block by block, from 32 to 256. The regularization layer is used to reduce the risk of overfitting and further improve the generalization ability of the model. Finally, the flattening layer flattens the multi-dimensional feature map into a one-dimensional vector, which is then input into the fully connected layer for the final classification or regression task.
[0054] The second step is to build a cross-mode coupling network (CMCNet), such as Figure 6As shown in the figure, CMCNet consists of five parts: an input layer, a dense encoder, a fusion layer, a representation reconstructor, and an output layer. The feature maps filtered by the two modal networks serve as the input to the dense encoder, which consists of a convolutional layer and a dense network. The convolutional layer uses a 3×3 convolution kernel and 1×16 output channels to extract local features. This layer is able to capture local patterns and structures in EEG and ECG signals. The dense network enhances feature extraction capabilities through dense connections, allowing the output of each layer to serve as the input to the next layer. This improves the network's expressive power and the depth of feature extraction, allowing it to capture more complex features and enhance the network's adaptability to data from different modalities.
[0055] The fusion layer combines the feature vectors from the two modalities through weighted summation to achieve feature fusion. The specific formula is as follows:
[0056] F e =σ(W f F f +b f )
[0057] Among them, W f Is a weight matrix, which is used to transform the input feature F f Mapped to a new feature space, b f is a bias vector, σ(·) is the activation function, F e is the output feature.
[0058] The representation reconstructor consists of multiple convolutional layers, each with a 3×3 kernel size and a gradually decreasing number of output channels (64×64, 32×16, and 16×1). Through layer-by-layer convolution operations, the representation reconstructor gradually restores the spatial resolution of the feature map and recovers the spatial structure of the original data from the fused features, thereby achieving accurate prediction of epileptic seizures.
[0059] S4, self-supervised network training: The process of self-supervised training includes the selection and optimization of loss function, the formulation of training strategy and the design of performance evaluation indicators, such as Figure 7As shown; in the training stage, our working mode is end-to-end mode, the original signal dynamically selects important channels through the weight channel optimization model, and then the optimized signal is input into the dual-modal representation reinforcement learning model to obtain enhanced features, and then the features are fused through CMCNet to obtain feature positive samples. The negative samples are composed of arbitrary modal features of other samples in the same batch (such as EEG or ECG of other patients) or non-seizure features of the same patient in different time periods, so as to force the model to distinguish the pattern differences between seizure period and non-seizure period. At the same time, the Adam optimizer is used to speed up the convergence of the model to the optimal solution, and the output and feature negative samples are lost through the loss function. In the present invention, the network model selects noise contrast estimation (InfoNCE) as the loss function kernel, which effectively maximizes the similarity of positive sample pairs and suppresses the association of negative sample pairs. Under the action of the loss function, the network output is continuously constrained to the optimal model. The loss function L is designed for epileptic seizure prediction. cont , and add L2 regularization term to the loss function to generate a new loss function to maintain the complexity and generalization ability of the model. The specific formula is designed as follows:
[0060]
[0061] Among them, the temperature parameter τ controls the sharpness of the similarity distribution. A smaller τ will amplify the penalty strength of difficult negative samples. i,i Indicates the similarity of the positive sample pair, S i,j represents the cross-modal negative pair, and the specific formula is as follows:
[0062]
[0063] The contrast loss of the entire batch is the average of all sample losses, then:
[0064]
[0065] The Adam optimizer was used to accelerate the model's convergence to the optimal solution. An exponential decay strategy was employed to optimize the model's learning process and improve generalization performance on both the training and test sets. A new comprehensive performance index (PEI) was designed to directly reflect the model's accuracy in predicting epileptic seizures, providing an important reference for model improvement. The specific design formula is as follows:
[0066] PEI=C e -λ1P m -λ2P f
[0067] Among them, C e is the coverage of the model within the target prediction time window; P m is the omission penalty factor of the model, which refers to the proportion of attacks that fail to cover the target window; P fis the false alarm penalty factor of the model; the specific formula is designed as follows:
[0068] For the i-th epileptic seizure, let its actual occurrence time be If there is a prediction So that:
[0069] and It is recorded as a successful prediction, and the number of valid predictions is defined as:
[0070] in but:
[0071]
[0072] Among them, N c N is the number of epileptic seizures successfully predicted within the prediction time window (e.g., 30-60 minutes) before the onset of the seizure. t is the total number of epileptic seizures. C e →1: The prediction system covers almost all seizures, C e →0: The model is basically ineffective.
[0073]
[0074] Here, ω(·) is a penalty function that considers the unpredicted event closer to the onset time as a more severe penalty.
[0075] Define all prediction trigger times as For each If the corresponding prediction window fails to predict any real attack, that is: It is recorded as a false alarm, and the false alarm penalty factor P f The definition formula is as follows:
[0076]
[0077] Among them, N f is the number of false alarms, T t is the total duration. f The closer it is to 0, the fewer false positives there are.
[0078] S5, Model Validation and Optimization: Based on the trained initial epilepsy prediction model, the performance of the model is verified using the 20% data set reserved in step S1. Based on the evaluation results obtained in the validation phase, the remaining 20% of the data set is used to tune the model parameters. Through iterative network parameter updates, the model performance is enhanced, improving the accuracy and robustness of epilepsy seizure prediction.
[0079] All software programming was performed on the open-source PyTorch framework. Hardware training, testing, model tuning, and subsequent program modularization were performed on a single Nvidia GeForce RTX 4090 GPU computer. The loss function kernel used in this paper was InfoNCE. During network training, the number of multi-core processes was set to 4, the learning rate was set to 0.01, and the network was optimized using SGD gradient descent constraints with a batch size of 64. The network achieved stable convergence after 80 epochs.
[0080] S6, model solidification and saving: After the fine-tuning in step S5 is completed, the fine-tuned network parameters are solidified and the final epilepsy prediction model is saved; the model is tested again using the dataset with the remaining one-third of the data in step S1. The test data can be directly input into the trained end-to-end model to obtain the epilepsy seizure prediction score.
[0081] Among them, the implementation of convolution, normalization, activation function, noise suppression and sample elimination are algorithms well known to those skilled in the art, and the specific processes and methods can be found in corresponding textbooks or technical literature.
[0082] The weighted channel optimization model proposed in the present invention alleviates the signal redundancy interference problem caused by full-channel calculation in traditional epilepsy prediction methods, improves the pertinence of feature extraction and model calculation efficiency, and provides a new idea for achieving low-power, high-precision epilepsy prediction. The present invention designs a dual-mode epilepsy prediction method with lightweight dynamic contrast calculation, which integrates the key channel features after weight screening and the time dynamic change pattern. By constructing a multi-scale contrast mechanism, it effectively captures the subtle signs before epileptic seizures, and overcomes the shortcomings of traditional methods in feature robustness and time sensitivity. This method improves the model's adaptability to individual differences and cross-time period data by dynamically adjusting the weight matching and difference comparison between modalities. Under the same data set and evaluation criteria, through comparative analysis with existing mainstream prediction models, the results show that Figure 8 As shown in the figure, the method proposed in the present invention shows significant improvement in prediction accuracy, advance warning time and model stability, which further verifies the feasibility and superiority of the proposed method in practical application scenarios.
[0083] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A lightweight dual-mode epilepsy prediction method based on dynamic contrast calculation, characterized by: The steps include: S1, based on the TUH public dataset, obtains EEG and ECG bimodal data with epileptic seizure precursor characteristics; this data is divided into dataset A for model training and dataset B for model validation, where dataset A is used to generate positive and negative labeled samples, and dataset B retains the original data structure for generalization evaluation; S2, constructing a weighted channel optimization model, including designing a dynamic channel selection module, a noise suppression module, a time window normalization module, and a resampling alignment module; inputting the dataset A in step S1 into the weighted channel optimization model for multimodal signal enhancement preprocessing; S3, building a lightweight convolutional feature enhancement network, including designing a dual-modal representation reinforcement learning model and a cross-modal coupling network (CMCNet); Input the optimized EEG and ECG data in step S2 into the dual-modal representation reinforcement learning model for time series modeling and feature mining; S4, self-supervised network training, design contrast loss function L cont And combine the evaluation index system to provide performance feedback, including the predictive effectiveness index PEI proposed by the present invention; S5: Use the reserved validation set for initial performance evaluation, then fine-tune the model parameters based on the parameter set, iterating round by round to improve the model's prediction accuracy and robustness. S6, model solidification and storage. After solidifying the model parameters, the remaining test data is used to evaluate its predictive ability and stability to generate the final epilepsy prediction model.
2. The method according to claim 1, characterized in that In step S1, the dataset A is the first 4 / 5 records of the TUH dataset, and the dataset B is the last 1 / 5 records of the TUH dataset.
3. The method according to claim 1, characterized in that In step S2, the dynamic channel selection module implements key channel screening and weighting through real-time feature calculation and Transformer modeling relationship; The noise suppression module combines Fourier transform, FFT filtering and independent component analysis to separate noise and artifacts and optimize signal quality; The time window normalization module adjusts EEG gain and ECG amplitude by matching the difference between modalities; The resampling alignment module performs time axis mapping and uniform length processing on the asynchronous signal sequence to achieve modal alignment.
4. The method according to claim 1, wherein In step S3, the dual-modal representation reinforcement learning model includes EEG and ECG dual-branch feature extraction, the EEG branch passes through the multi-order feature capture module 1 (MSCM1) and the multi-order feature capture module 2 (MSCM2), and the ECG branch passes through the residual hierarchical module 1 (DRM1) and the residual hierarchical module 2 (DRM2) to obtain sub-features; the extracted features are then fused through the dual-modal coupling network, and output after passing through the decision dimensionality reduction module (DM) to obtain the enhanced final features; The multi-sequence feature capture module (MSCM) is characterized in that it is composed of three layers of convolutional gated recurrent units (ConvLSTM) stacked in sequence, and the number of units is set to 16, 32 and 64 respectively. This module adopts the Tanh activation function to enhance the nonlinear modeling capability. Each layer of ConvLSTM adopts an operation mode with a convolution kernel step size of 1×2, which can not only dynamically model the input time series, but also extract local spatial features at the same time. After feature extraction, the output result is processed by two densely connected neural network layers, where the first layer contains 128 neurons and uses the ReLU function to maintain the stability of gradient propagation; the second layer consists of 64 neurons and uses the Softmax activation function to output normalized category probabilities. The residual hierarchy module (DRM) includes a normalization layer, a single-dimensional convolution unit, a four-level nested residual calculation unit (ECRB), a regularization layer, and a flattening layer. The ECRB unit is designed with a dual-branch structure and a cross-layer connection method to improve feature propagation and residual information retention capabilities. During the downsampling process, each residual block extracts key features through maximum pooling and halves the output dimension layer by layer, from the initial 64 channels to 8 channels. At the same time, the number of convolution kernels doubles layer by layer, expanding from 32 to 256. A regularization strategy is embedded in the DRM to control the complexity of the model and reduce the risk of overfitting. Finally, the multi-channel output is flattened and converted into a one-dimensional vector for subsequent fully connected classification.
5. The method according to claim 1, wherein In step S3, the cross-modal coupling network (CMCNet) is divided into five parts: input layer, dense encoder, fusion layer, representation reconstructor and output layer; In the input layer, the features filtered by the two modal networks serve as the input of the dense encoder; The dense encoder consists of convolutional layers and a dense network, which are used to extract preliminary features from EEG and ECG signals. The convolutional layers use a 3×3 convolution kernel with 16 output channels to capture local features. The dense network uses dense connections to ensure that the output of each hidden layer is passed to all subsequent layers, forming a multi-path information flow, thereby improving the network's expressive power and the depth of feature extraction. The fusion layer is responsible for integrating the features of EEG and ECG, and extracting richer and more robust feature representations through weighted summation of feature maps to improve the generalization ability and prediction accuracy of the model; The representation reconstructor is composed of multiple stacked convolutional layers, each layer uses a 3×3 convolution kernel, and the output feature size is 64×64, gradually restoring the spatial distribution of the fused features in the previous step; thereby achieving accurate prediction of epileptic seizures.
6. The method according to claim 1, characterized in that In step S4, the contrast loss function L cont include: The noise contrast estimation (InfoNCE) is selected as the loss function kernel to effectively maximize the similarity of positive sample pairs and suppress the association of negative sample pairs. The contrast loss of the entire batch is the average of all sample losses, expressed as: in, is the loss value of the i-th sample, and B is the number of samples; It is expressed as follows: Among them, the degree parameter τ controls the sharpness of the similarity distribution. A smaller τ will amplify the penalty strength of difficult negative samples. i,i Indicates the similarity of the positive sample pair, S i,j represents the cross-modal negative pair, and the specific formula is as follows:
7. The method according to claim 1, characterized in that In step S4, the comprehensive effectiveness index (PEI) indicator is used to measure the recognition of positive and negative samples by the model. The closer the PEI is to 1, the stronger the prediction ability of the model is; the closer the PEI is to 0, the weaker the prediction ability of the model is. It is expressed as follows: PEI=C e -λ1P m -λ2P f Among them, C e is the coverage of the model within the target prediction time window; P m is the omission penalty factor of the model, which refers to the proportion of attacks that fail to cover the target window; P f is the false alarm penalty factor of the model; the specific formula is designed as follows: For the i-th epileptic seizure, let its actual occurrence time be If there is a prediction So that: and It is recorded as a successful prediction, and the number of valid predictions is defined as: in but: Among them, N c N is the number of epileptic seizures successfully predicted within the prediction time window (e.g., 30-60 minutes) before the onset of the seizure. t is the total number of epileptic seizures. C e →1: The prediction system covers almost all seizures, C e →0: The model is basically invalid; Where ω(·) is a penalty function that considers the unpredicted events closer to the onset time as more severe penalties; Define all prediction trigger times as For each If the corresponding prediction window fails to predict any real attack, that is: It is recorded as a false alarm, and the false alarm penalty factor P f The definition formula is as follows: Among them, N f is the number of false alarms, T t is the total duration. f The closer it is to 0, the fewer false positives there are.
Citation Information
Patent Citations
A multimodal epilepsy onset early warning method and a smart bracelet device
CN114176598B