Epileptic seizure prediction system based on subcutaneous implanted electrode and processing method

By combining subcutaneously implanted electrodes with the Transformer model, the problems of low signal quality and prediction efficiency in existing technologies are solved, enabling high signal-to-noise ratio signal acquisition and personalized epileptic seizure prediction, thus meeting the needs of long-term real-time monitoring.

CN121370082APending Publication Date: 2026-01-23RENJI HOSPITAL AFFILIATED TO SHANGHAI JIAO TONG UNIV SCHOOL OF MEDICINE +2
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511975103.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing technologies for predicting epileptic seizures suffer from problems such as poor signal acquisition quality, difficulty in long-term monitoring, low prediction algorithm efficiency, and insufficient personalization. In particular, scalp EEG signals are susceptible to noise interference, and implantable devices lack real-time prediction capabilities.

Method used

Subcutaneous implanted electrodes combined with the Transformer model are used for signal acquisition and preprocessing. Through multi-level feature encoding and personalized incremental learning, high-quality signal acquisition and personalized prediction are achieved.

Benefits of technology

It achieves high signal-to-noise ratio EEG signal acquisition, suppresses environmental noise, has real-time epileptic seizure prediction capability, and improves prediction accuracy through personalized adaptation to meet long-term monitoring needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121370082A_ABST
    Figure CN121370082A_ABST
Patent Text Reader

Abstract

The invention discloses an epileptic seizure prediction system based on a subcutaneous implanted electrode and a processing method. Comprising a signal acquisition module, a preprocessing module, a feature extraction module, a prediction analysis module and an early warning module. The signal acquisition module is used for acquiring high-quality electroencephalogram signals through an electrode implanted under the skull skin; the preprocessing module carries out filtering and noise reduction on the signal; the feature extraction module extracts time domain and frequency domain low-level features through a first coding unit, and converts the time domain and frequency domain low-level features into high-level features for representation by using a pre-trained Transform encoder; the prediction analysis module calculates an epileptic seizure risk probability value based on the high-level features; and the early warning module triggers local early warning when the probability value exceeds a threshold. According to the invention, through combination of innovative hardware implantation and an advanced algorithm, high-precision, high-robustness and personalized adaptive epileptic seizure prediction is realized, and an effective early warning time window is provided for a patient.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of biological signal processing, and in particular to a seizure prediction system based on subcutaneous implanted electrodes and a processing method. BACKGROUND

[0002] Epilepsy is a chronic neurological disease caused by abnormal synchronous firing of neurons in the brain, characterized by repeated seizures and suddenness. Therefore, being able to predict seizures several minutes to several hours in advance provides a valuable "early warning time window" for patients to take intervention measures, which has become an urgent need and core challenge in the field of clinical and scientific research.

[0003] At present, the monitoring and early warning of epilepsy mainly rely on the analysis of electroencephalogram signals. However, the existing technical solutions have significant limitations in signal acquisition, long-term monitoring, and prediction algorithms:

[0004] 1) Limitations of electroencephalogram signal acquisition method; The current mainstream electroencephalogram signal acquisition is usually through a helmet or electrode cap worn on the head to collect the electroencephalogram signal on the scalp. Although this solution is completely non-invasive and easy to deploy, the electroencephalogram signal on the scalp needs to pass through multiple layers of tissue such as the skull and scalp, resulting in severe signal attenuation, and is easily affected by physiological noise such as electromyogram and electrooculogram, as well as environmental power frequency interference, with extremely low signal-to-noise ratio. Moreover, the electrode paste is prone to dryness, leading to poor contact, heavy equipment, and poor patient comfort, making it difficult to achieve long-term and continuous daily monitoring, and only suitable for short-term diagnosis in hospitals.

[0005] 2) Limitations of existing implantable monitoring devices; In recent years, some subcutaneous implantation solutions have emerged as a compromise, such as the Minder implantable continuous electroencephalogram (EEG) monitoring system developed by Epiminder company, which is implanted under the scalp through minimally invasive surgery for long-term monitoring. This type of device proves the feasibility of subcutaneous monitoring. However, their functions mainly focus on data recording and transmission for subsequent analysis by doctors, and the core is "monitoring" rather than "real-time prediction". In terms of real-time, online intelligent prediction algorithm integration, especially how to utilize limited implant device computing resources to achieve high-precision, personalized seizure prediction, existing technologies have not yet provided mature and efficient solutions.

[0006] 3) Performance bottleneck of existing prediction algorithms; At the algorithm level, existing epilepsy prediction models rely mainly on traditional machine learning methods (such as support vector machines, decision trees) or shallow neural networks. These models do not incorporate large-scale electroencephalogram data into the construction of electroencephalogram models during construction, resulting in certain deficiencies in feature extraction of electroencephalogram signals and generalization of epilepsy prediction models, and current prediction models do not simultaneously combine intracranial and scalp electroencephalogram data for model construction. SUMMARY

[0007] In view of the deficiencies of the prior art, the present application provides a seizure prediction system based on subcutaneous implanted electrodes and a processing method, which overcomes the deficiencies of the prior art, balances between signal quality, model performance, personalized adaptation and privacy protection through the synergistic optimization of hardware implantation and software algorithm, and provides a reliable technical solution for accurate prediction of seizures.

[0008] To achieve the above object, the present application is realized by the following technical solutions:

[0009] A seizure prediction system based on subcutaneously implanted electrodes, comprising a signal acquisition module, a signal preprocessing module, a feature extraction module, a prediction analysis module and a warning module; The signal acquisition module comprises at least one subcutaneous electrode for acquiring intracranial electroencephalogram signals; The signal preprocessing module is in communication connection with the signal acquisition module, and is used for filtering and detrending the collected raw electroencephalogram signals; The feature extraction module is in communication connection with the signal preprocessing module, and is used for extracting features from the preprocessed electroencephalogram signals, the feature extraction module comprising a first encoding unit and a second encoding unit, the first encoding unit being used for extracting preset time domain features and frequency domain features from the preprocessed electroencephalogram signals and splicing to form a low-level feature vector; the second encoding unit being constructed based on a pre-trained Transformer model, and being used for receiving the low-level feature vector and encoding the low-level feature vector into a high-level feature representation containing context semantic information; The prediction analysis module is in communication connection with the feature extraction module, and is used for receiving the high-level feature representation, calculating and outputting a risk probability value representing seizures in a specific time period in the future; The warning module is in communication connection with the prediction analysis module, and is used for triggering a warning notification when the risk probability value exceeds a preset threshold; The signal acquisition module further comprises an implanted body shell and a wireless communication module, the implanted body shell being used for encapsulating the subcutaneous electrode and its related signal conditioning circuit, and the wireless communication module being integrated in the implanted body shell and being used for transmitting the collected electroencephalogram signals to an extracorporeal processing device; The implanted body shell is embedded in a groove formed by grinding the skull, and is mechanically fixed and electrically isolated by biocompatible fixing materials, the biocompatible fixing materials comprising biocompatible bone cement or a microporous structure coating with a bone integration promoting effect; The prediction analysis module comprises a multi-scale time series analysis module, a prediction head network and a probability calibration module; the multi-scale time series analysis module is used for processing electroencephalogram features from different time windows in parallel; the prediction head network integrates a time convolution layer and a lightweight attention mechanism, and is used for decoding the high-level feature representation and generating an initial probability; the probability calibration module adopts a temperature scaling technique to calibrate the initial probability, so as to output a calibrated risk probability value.

[0010] Preferably, the signal preprocessing module performs filtering processing at least including: using a 50Hz notch filter to suppress power frequency interference; and using a band-pass filter with a passband frequency of 0.5Hz to 1000Hz to filter out high-frequency noise and baseline drift.

[0011] Preferably, the time domain features extracted by the first encoding unit include maximum value, minimum value, variance, mean value and first-order differential sequence of the electroencephalogram signal. The frequency domain features extracted by the first encoding unit include power spectral density estimated by the Welch method, waveband power in the delta, theta, alpha, beta and gamma frequency bands, and power ratio features calculated based on the waveband power.

[0012] Preferably, the Transformer model in the second encoding unit is pre-trained through a self-supervised task of mask signal reconstruction on a large-scale unlabeled electroencephalogram dataset, wherein the mask proportion is 40% to 60%.

[0013] Preferably, the prediction analysis module further comprises a personalized adaptation module configured to fine-tune the prediction head network or part of the second encoder parameters on the user's local device using newly generated user data. The loss function of the fine-tuning process is composed of a standard classification loss and a knowledge distillation loss, and the knowledge distillation loss is used to constrain the output probability distribution of the fine-tuned model to be aligned with the output probability distribution of the original model before fine-tuning.

[0014] The application also discloses a brain electrical signal data processing method based on subcutaneous implanted electrodes, which is executed by a computing device and comprises the following steps:

[0015] Step S1: continuously collecting the brain electrical signals of a user through subcutaneously implanted subcutaneous electrodes;

[0016] Step S2: preprocessing the collected original brain electrical signals, including 50Hz notch filtering and 0.5Hz to 1000Hz band-pass filtering;

[0017] Step S3: extracting a low-level feature vector from the preprocessed signal, the low-level feature vector including time domain features and frequency domain features;

[0018] Step S4: converting the low-level feature vector into a high-level feature representation by using a pre-trained Transformer encoder;

[0019] Step S5: calculating a risk probability value of a seizure in a specific future time period by a prediction model based on the high-level feature representation;

[0020] Step S6: comparing the obtained risk probability value with a preset threshold, and triggering a local warning prompt if the threshold is exceeded.

[0021] Preferably, in step S5, the prediction model is a model that is personalized fine-tuned; the personalized fine-tuning specifically comprises fine-tuning a global prediction model by using local data of a user on a local device of the user and by using an incremental learning algorithm based on knowledge distillation.

[0022] Wherein, the loss function of the incremental learning algorithm based on knowledge distillation is is expressed as:

[0023]

[0024] Wherein, is a standard cross-entropy loss, wherein y is a true label of new data, is an output probability of the student model after a softmax function layer; is a scaling factor for balancing the numerical scale of the KL divergence term and the cross-entropy term; is a KL divergence, is a softened output of the teacher model, is a softened output of the student model; T is a temperature parameter, is a balance weight coefficient.

[0025] The application also discloses a computer readable storage medium, which stores a computer program, the computer program being executed to realize the steps of the electroencephalogram signal data processing method.

[0026] This invention provides a seizure prediction system and processing method based on subcutaneously implanted electrodes, offering the following advantages: The subcutaneous intracranial electrode implantation effectively attenuates signal attenuation and interference from the skull and scalp, resulting in intracranial EEG signals with a significantly better signal-to-noise ratio than scalp EEG. The signal preprocessing module further suppresses environmental noise and physiological artifacts through power frequency notch filtering and bandpass filtering in specific frequency bands, providing a high-quality, clean signal source for subsequent analysis. Furthermore, this invention employs a dual-cascaded feature encoder structure to map low-level features into a high-level feature space rich in contextual information. This feature representation exhibits stronger discriminative power and robustness to individual differences and noise interference. The prediction analysis module calculates the probability of future seizures using a prediction head network integrating multi-scale temporal modeling. To address physiological differences among patients, the system introduces a localized incremental learning mechanism based on knowledge distillation. This mechanism allows the prediction model to be continuously fine-tuned on the user's local device using individual data, achieving personalized adaptation. Furthermore, by employing a knowledge distillation loss function, the personalized model is constrained to maintain alignment between its output decisions and the original general model when adapting to new data. This effectively prevents overfitting to individual data and the loss of generalization ability to other cases. Through the collaborative optimization of hardware implantation and software algorithms, the entire system achieves a balance between signal quality, model performance, personalized adaptation, and privacy protection, providing a reliable technical solution for the accurate prediction of epileptic seizures. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in this invention or the prior art, the accompanying drawings used in the description of this invention or the prior art will be briefly introduced below.

[0028] Figure 1 A schematic block diagram of the prediction system of this invention;

[0029] Figure 2 Flowchart of the data processing method of the present invention;

[0030] Figure 3 The flowchart of step S5 in the data processing method of the present invention. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0032] Example 1, as Figure 1 As shown, this embodiment provides an epileptic seizure prediction system based on subcutaneous implanted electrodes, including a signal acquisition module 1, a signal preprocessing module 2, a feature extraction module 3, a prediction analysis module 4, and an early warning module 5;

[0033] The signal acquisition module 1 includes a plurality of subcutaneous electrodes made of biocompatible material (such as platinum-iridium alloy), which are packaged in a titanium alloy implant shell with good biocompatibility. Through minimally invasive surgery with precise positioning, a groove matching the shape of the implant shell is ground on the patient's skull (usually near the area of the epileptic lesion determined by clinical assessment), and the entire implant shell is embedded in the groove. The contact points of the subcutaneous electrodes are located between the outer plate of the skull and the scalp without penetrating the dura mater, thereby greatly reducing the risk of surgery while ensuring that the subcutaneous electrodes can effectively collect intracranial EEG signals. The fixation uses biocompatible bone cement (such as polymethyl methacrylate, PMMA), which can provide stable mechanical support and good electrical isolation after solidification. The implant shell integrates low-noise amplifiers, analog-to-digital converters, and a low-power Bluetooth chip. The collected analog EEG signals are amplified and digitized, and then transmitted wirelessly to an external device (such as a smartphone or a dedicated receiver) through Bluetooth.

[0034] The signal preprocessing module 2 runs in software form on the external device, and is in communication connection with the signal acquisition module 1, for receiving the raw EEG signals from the signal acquisition module 1.

[0035] After receiving the raw EEG signals, a 50Hz notch filter is first applied to the raw signals to attenuate the power frequency interference introduced by the environment. Then, a finite-length unit impulse response band-pass filter with a passband frequency of 0.5Hz to 1000Hz is used (for example, implemented using an FIR filter), with a high-pass cutoff of 0.5Hz to eliminate baseline drift and a low-pass cutoff of 1000Hz to suppress high-frequency noise and satisfy the Nyquist sampling theorem. In this embodiment, bidirectional filtering is used to eliminate phase distortion and ensure the accuracy of subsequent feature extraction. The clean signal after preprocessing (where C is the number of leads and N is the number of sampling points) is sent to the subsequent feature extraction module 3.

[0036] The feature extraction module 3 also runs on the external device, and is in communication connection with the signal preprocessing module 2, for extracting features from the preprocessed EEG signals. The feature extraction module 3 includes a first encoding unit 31 and a second encoding unit 32.

[0037] The first encoding unit 31 performs feature calculation on the preprocessed signal with a fixed time window. For each electrode channel signal within the window, the pre-set time domain features and frequency domain features are extracted and concatenated to form a low-level feature vector;

[0038] The time domain features include the maximum value, minimum value, variance, mean value, and first-order difference sequence of the EEG signal. The calculation method is as follows: in an analysis window with a time length of T = 2 seconds, the maximum value, minimum value, variance, mean value, and first-order difference sequence of each lead signal The following features are calculated:

[0039] Maximum value: ;

[0040] Minimum value: ;

[0041] Mean value: ;

[0042] Variance: ;

[0043] First-order difference absolute value mean: .

[0044] The frequency domain features include:

[0045] Perform Fourier transform on the signal to obtain the frequency spectrum and the frequency index ;

[0046] Apply the Welch method to calculate the power spectral density PSD(f) of the signal ;

[0047] Based on Simpson numerical integration, calculate the relative power of Delta (0.5-4Hz), Theta (4-8Hz), Alpha (8-13Hz), Beta (13-30Hz), and Gamma (30-100Hz) frequency bands , , , , ;

[0048] Calculate the power ratio feature: , , .

[0049] Finally, all the time domain and frequency domain feature vectors are spliced to form the low-level feature vector of the channel , and all the channel features are combined to form the final low-level feature representation .

[0050] The second encoding unit 32 uses a Transformer encoder as the backbone network. Through self-supervised learning in the pre-training stage, the model has the ability to deeply understand the electroencephalogram signal. The specific implementation is as follows:

[0051] Transformer key hyperparameters: 12 encoder layers, hidden layer dimension 200, 10 attention heads, and feedforward network dimension 800.

[0052] On a large-scale dataset containing over 10,000 hours of multi-center scalp and intracranial electroencephalogram, the model is pre-trained on a self-supervised mask reconstruction task with a mask ratio of 60%. Through the multi-head self-attention mechanism, the model can capture the long-range dependence and spatiotemporal dynamic patterns between multi-lead electroencephalogram signals, and learn electroencephalogram representations with high discriminability.

[0053] In practical applications, the pre-trained Transformer model is used as a feature encoder, and the low-level feature vector sequence (multiple time windows) output by the first encoding unit 31 is used as input. Through the powerful sequence modeling capability and cross-lead information integration advantage of the Transformer model, a high-level feature representation containing long-range dependence and global context information is output. This structure not only effectively models the global context relationship of the electroencephalogram signal, but also significantly improves the generalization performance of the model under limited labeled data through the prior knowledge obtained by pre-training.

[0054] The prediction analysis module 4 is in communication connection with the feature extraction module 3, and is used for calculating and outputting a risk probability value P representing a future seizure in a specific time period based on the high-level feature representation output by the second encoding unit 32; the prediction analysis module 4 includes a multi-scale time series analysis module, a prediction head network, and a probability calibration module, wherein:

[0055] The multi-scale time series analysis module internally maintains three time windows of different lengths (for example: 30 seconds, 5 minutes, and 1 hour) in parallel, and performs sliding average and feature recombination on the input features to capture patterns of different time scales from instantaneous mutations to long-term trends.

[0056] The prediction head network is composed of a lightweight multi-scale time series convolutional network. It processes features H of different time scales (for example, the current moment, the past 1 minute, and the past 5 minutes) in parallel, and then fuses these multi-scale information through a learnable gating mechanism to form a comprehensive feature . Through a fully connected layer and a Sigmoid activation function, an initial probability value between 0 and 1 is mapped.

[0057] The probability calibration module uses temperature scaling technology to calibrate the initial probability value. When calibrating, the temperature parameter T (T>0) is optimized on a reserved validation set, so that the confidence of the output risk probability value P and the actual accuracy are better matched, thereby providing more reliable clinical reference value.

[0058] In this embodiment, the prediction analysis module 4 further includes a personalized adaptation module, the personalized adaptation module runs on an extracorporeal device, and the personalized adaptation module adopts incremental learning based on knowledge distillation. The specific process is as follows:

[0059] 1) The initial model is a global model that has been pre-trained on a large scale and fine-tuned on a small amount of labeled data.

[0060] 2) As the user uses it, the locally accumulated electroencephalogram data (which has been labeled by the user or the doctor) reaches a certain amount, triggering fine-tuning.

[0061] 3) A student model (i.e., a personalized model) is trained on local data using the global model as a teacher. The loss function is:

[0062]

[0063] wherein, is a balance weight, with a value range of [0, 1], used to adjust the relative importance of the two types of losses. In this embodiment, 0.7. is the standard cross-entropy loss, used to measure the difference between the model's prediction and the true label of the new data; wherein y is the true label of the new data, is the output probability of the student model after the softmax function layer. is a scaling factor used to balance the numerical scale of the KL divergence term and the cross-entropy term to ensure gradient stability. is the Kullback-Leibler divergence, used to measure the difference between the output distribution of the teacher model and the student model. Specifically, . is the softened output of the teacher model, i.e., the probability distribution of the original global model at temperature T. is the softened output of the student model, i.e., the probability distribution of the personalized model being fine-tuned at temperature T. T is the temperature parameter, .

[0064] Through this loss function method, the new model ensures that it adapts to individual characteristics while retaining the original generalization knowledge, and all data is processed locally, protecting user privacy.

[0065] After fine-tuning is complete, the system automatically switches to the personalized model for subsequent prediction, thereby continuously improving the prediction accuracy for that user.

[0066] The warning module 5 is in communication connection with the prediction analysis module 4, for continuously monitoring the calibrated risk probability value P output by the prediction analysis module 4. And compare it with a configurable clinical threshold (such as 0.75). When the average value of this value in a continuous 2-minute window exceeds the preset threshold, it is determined to be a high-risk state. Subsequently, the warning module 5 immediately triggers a local warning. The warning forms include: displaying a red warning pop-up window on the mobile phone APP interface; emitting a continuous, urgent alarm sound; starting a strong vibration of the mobile phone, etc.

[0067] The early warning aims to prompt the patient to immediately transfer to a safe environment or take preset intervention measures. If the probability does not exceed the threshold value, the system continues to monitor, forming a closed loop of real-time monitoring-analysis-decision-early warning.

[0068] The present application fundamentally solves the contradiction between signal quality and implantation risk by subcutaneous intracranial implantable electrode mode. The subcutaneous electrode is precisely implanted in the cranial groove, and its position is closer to the brain tissue compared with the scalp surface electrode, effectively attenuating the attenuation and interference of tissues such as skull and scalp on the signal, thereby obtaining intracranial electroencephalogram signal with significantly better signal-to-noise ratio than scalp electroencephalogram. At the same time, this mode also avoids the great risk of craniotomy into the brain parenchyma, realizing the balance of low risk and high signal quality. The implant transmits data wirelessly through low-power Bluetooth, ensuring the feasibility of long-term and continuous monitoring. Subsequently, the signal preprocessing module 2 further suppresses environmental noise and physiological artifacts through power frequency notch and bandpass filtering of specific frequency bands, providing a high-quality clean signal source for subsequent analysis.

[0069] In addition, the present application adopts a two-stage cascaded feature encoder structure. Firstly, the first encoding unit 31 (low-level feature encoder) extracts classical time-domain (such as variance, first-order difference) and frequency-domain (such as relative power of each frequency band, power ratio) features from the preprocessed signal. These features provide a quantitative description of the signal in the traditional dimension. The second encoding unit 32 (high-level feature encoder) is based on the Transformer architecture and is pre-trained (such as the mask reconstruction task) in a self-supervised manner on large-scale unlabeled EEG data. This process enables the model to learn the inherent and universal spatiotemporal dynamic patterns and long-range dependencies in EEG signals, rather than relying solely on limited seizure-labeled data. In application, the pre-trained model serves as a powerful universal EEG signal interpreter, mapping low-level features to a high-level feature space that contains rich contextual information. This feature representation has stronger discriminability and robustness to individual differences and noise interference. The prediction analysis module 4 calculates the probability value of future seizures through a prediction head network that integrates multi-scale time series modeling (such as synchronous analysis of second-level and minute-level trends). To address physiological differences between different patients, the system introduces a localized incremental learning mechanism based on knowledge distillation. This mechanism allows the prediction model to continuously fine-tune on individual data on the user's local device, achieving personalized adaptation. Moreover, through the knowledge distillation loss function, the personalized model is constrained to keep its output decision aligned with the original universal model when adapting to new data, effectively preventing overfitting to individual data and losing the generalization ability to other cases. Finally, the warning module 5 triggers multi-modal alarms in a timely manner according to the dynamic comparison of the calibrated probability value and the preset threshold, guiding patients to take protective measures. Through the synergistic optimization of hardware implantation and software algorithm, the entire system balances between signal quality, model performance, personalized adaptation, and privacy protection, providing a reliable technical solution for precise prediction of seizures.

[0070] In an embodiment, as shown in Figures 2-3 The present application also discloses an EEG signal data processing method based on subcutaneous implanted electrodes. The method is executed by a computing program running on a special handheld device or a smartphone carried by the user, and cooperates with the subcutaneously implanted electrode module, and includes the following steps:

[0071] Step S1: EEG signal acquisition

[0072] The electroencephalogram signal is continuously collected by a pre-implanted electrode array under the skull of the user. The subcutaneous electrode is embedded in the skull groove through minimally invasive surgery, packaged with biocompatible materials, and fixed stably for a long time through a microporous structure that promotes bone integration; wherein the sampling frequency is set to 2000Hz to ensure that the brain electrical signal components in the 0-1000Hz frequency band can be completely captured. The original analog signal collected is amplified and analog-digital converted in the implanted body, and then wirelessly transmitted to the computing device through the low-power Bluetooth protocol.

[0073] Step S2: signal preprocessing

[0074] The received raw electroencephalogram signal is preprocessed on the computing device to improve signal quality. Specifically, it includes:

[0075] An IIR (infinite impulse response) or FIR (finite impulse response) notch filter with zero phase distortion is used, with a center frequency of 50Hz, to effectively suppress power frequency interference.

[0076] Subsequently, a FIR band-pass filter with zero phase offset is used, with a passband frequency range of 0.5Hz to 1000Hz. This step can filter out low-frequency baseline drift (<0.5Hz) caused by breathing, sweating, etc. and irrelevant high-frequency noise (>1000Hz), and retain the signal frequency band valuable for epilepsy prediction.

[0077] Step S3: low-level feature vector extraction

[0078] Low-level feature vectors are extracted from the preprocessed signal, including time domain features and frequency domain features.

[0079] Among them, the time domain feature extraction is to slice the preprocessed signal of each electrode channel according to the set time window (for example, 2 seconds). For the signal in each time window, calculate its time domain features, including the maximum value, minimum value, mean value, variance and first-order difference absolute value of the signal. These time domain features can reflect the basic statistical characteristics of the signal in the time domain, providing basic data for subsequent feature analysis.

[0080] The frequency domain feature extraction converts the time domain signal into a frequency domain representation through Fourier transform, and then calculates the power spectral density and relative power of each frequency band. Specifically, the Welch method is used to calculate the power spectral density to reduce the variance of the estimate. Based on the Simpson numerical integration technique, the relative power of the Delta, Theta, Alpha, Beta and Gamma bands is calculated, which are closely related to different functional states of the brain. In addition, the power ratio features between different frequency bands are also calculated, such as the power ratio of the Delta and Alpha bands, which can reveal the energy distribution of the signal between different frequency bands and help capture the frequency spectrum change pattern before the seizure.

[0081] Finally, the time domain features and frequency domain features extracted from each electrode channel are spliced to form a low-level feature vector for the channel. Then, the low-level feature vectors of all electrode channels are combined to construct a complete low-level feature representation, which provides input data for subsequent high-level feature extraction and prediction analysis.

[0082] Step S4: High-level feature representation conversion

[0083] The low-level feature vector sequence (multiple consecutive time windows) obtained in step S3 is input into a pre-trained Transformer encoder. The Transformer encoder has been pre-trained in a self-supervised manner on a large-scale unlabeled EEG dataset through a mask signal reconstruction task with a mask ratio of 60%. It has strong sequence modeling capability and can capture long-range dependencies and complex spatio-temporal dynamic patterns among multi-lead EEG signals.

[0084] The Transformer encoder performs deep processing on the input low-level feature vector sequence. Through the multi-head self-attention mechanism, the model can automatically capture the long-range dependencies and spatio-temporal dynamic patterns of EEG signals among different electrode channels, and map the low-level features to a high-level feature space containing rich context information. In this process, the multiple encoder layers of the Transformer encoder gradually abstract and refine the features. The setting of key hyperparameters such as hidden layer dimension, attention head and feedforward network dimension ensures that the model can learn a highly discriminative EEG representation, and finally outputs a high-level feature representation corresponding to the input sequence that contains rich context semantic information. This representation is a deep abstraction of the original signal and is more discriminative and robust than the low-level features.

[0085] Step S5: Seizure risk probability value calculation

[0086] The high-level feature representation obtained in step S4 is input into a prediction model (e.g., a light-weight fully connected neural network or a temporal convolutional network). The prediction model maps the high-level feature into a scalar value between 0 and 1, which represents the risk probability value of a specific physiological event (i.e., a seizure) occurring in a specific time period in the future (e.g., the next 5 minutes). The output of the prediction model is temperature scaled to ensure its accuracy and reliability.

[0087] In this step, the prediction model is a personalized fine-tuned model. The specific fine-tuning process is as follows:

[0088] 1) Initialization: When the user starts using the system, a global prediction model trained on large-scale labeled EEG data is loaded.

[0089] 2) Local data accumulation: During the local operation of the system, EEG data and seizure labels fed back by the user or doctor are continuously recorded to form a local dataset.

[0090] 3) When the local dataset reaches a certain size (e.g., contains 3 or more seizure records), fine-tuning is triggered on the user's local device. An incremental learning algorithm based on knowledge distillation is used, with the global prediction model as the teacher model, to train the student model (i.e., the personalized model) on the local dataset. The optimization goal is to minimize the following loss function:

[0091]

[0092] where, is the standard cross-entropy loss, is the KL divergence, and are the logits outputs of the global model and the student model, T is the temperature parameter (T=2), is the balance weight ( =0.7).

[0093] 4) After fine-tuning is completed, the system automatically switches the prediction model to the personalized model, which can better adapt to the current user's EEG feature pattern.

[0094] Step S6: Warning judgment and triggering

[0095] The real-time risk probability value calculated in step S5 is compared with a preset decision threshold (for example, 0.72). If the probability value (for example, the average value within 1 minute) continuously exceeds the threshold, it is determined as a high-risk state, and a local early warning prompt is triggered immediately. The early warning methods include but are not limited to: driving the mobile device to vibrate, playing a specific warning sound, and displaying warning information on the screen. If the probability value is below the threshold, the system returns to step S1 to continue data collection and processing in the next round, realizing closed-loop real-time monitoring.

[0096] By using the Transformer encoder pre-trained on large-scale EEG data, the method can automatically learn and extract deep and highly discriminative spatio-temporal feature representations from EEG signals. Compared with traditional manual feature extraction methods that rely on expert experience, this large model-based representation method can more comprehensively capture subtle changes and complex patterns of pre-seizure EEG activity, including nonlinear and long-range dependencies. In a clinical retrospective dataset validation involving multiple centers, the method achieved a prediction effect with sensitivity and specificity higher than 85% in more than 85% of test cases, significantly better than the baseline method based on support vector machines, random forests and other traditional machine learning models.

[0097] The method uses knowledge distillation-based incremental learning for personalized fine-tuning. This mechanism effectively addresses the core challenge of the huge individual differences in epileptic EEG patterns. By fine-tuning the global model on the user's local device using their own historical data, the personalized prediction model generated can accurately capture and adapt to the user's unique pre-seizure feature. The entire data processing pipeline, from signal preprocessing to feature extraction to model inference, is carefully optimized to complete a single prediction in seconds on mainstream mobile computing devices, meeting the real-time requirements of epilepsy prediction.

[0098] In summary, by combining subcutaneous signal acquisition, large model-based deep feature learning, and privacy-protected personalized incremental learning, the method not only achieves comprehensive improvements in prediction accuracy, robustness, and real-time performance at the technical level, but also provides a reliable, usable, and long-term trusted personalized risk management tool for epilepsy patients at the application level, addressing many long-standing pain points in existing technologies and making significant technical progress and having broad clinical application prospects.

[0099] In embodiment three, the application further discloses a computer-readable storage medium storing a computer program, wherein the computer-readable storage medium can be embodied in various physical forms, including but not limited to:

[0100] Built-in memory of mobile device: for example, flash memory chip (such as eMMC, UFS memory device) in smart phone or tablet computer, which is the most common and most preferred implementation.

[0101] Removable memory card: such as Micro SD card, SD card, etc. for program distribution and update.

[0102] Solid state drive or embedded multimedia card: used in dedicated handheld medical monitoring devices.

[0103] Read-only memory: in dedicated devices that need to be solidified, programs can be burned into ROM or EPROM.

[0104] And the computer readable storage medium is non-transient, that is, the program instructions are stored on it persistently, not temporarily as signal transmission.

[0105] The storage medium stores at least one computer program. The program contains machine instructions that can be loaded and executed by the processor of the device (such as the CPU / GPU of the mobile phone). When the processor executes these instructions, the subcutaneous implanted electrode-based electroencephalogram data processing method described in Embodiment II will be fully implemented.

[0106] Specifically, the program is configured to execute the following functional modules:

[0107] Preprocessing module: contains algorithm code for implementing 50Hz notch filtering and 0.5Hz to 1000Hz band-pass filtering.

[0108] Feature extraction module 3: contains code for calculating time domain features (maximum, minimum, variance, mean, first order difference) and frequency domain features (power of each frequency band and power ratio), as well as logic for splicing to form low-level feature vectors.

[0109] Model loading and inference module: contains code for loading pre-trained Transformer encoder and initial prediction model, as well as inference engine for performing forward propagation, converting low-level feature vectors to high-level feature representations, and finally calculating risk probability values.

[0110] Personalized adaptation module: contains code for implementing knowledge distillation-based incremental learning algorithm, including functions for calculating cross-entropy loss and KL divergence, as well as training loop logic for performing local model fine-tuning.

[0111] Warning module 5: contains code for continuously comparing risk probability values with preset thresholds, and invoking operating system APIs to trigger device vibration, sound or display alarms when conditions are met.

[0112] Taking a user's smartphone as an example, its workflow is as follows:

[0113] S001: Start and initialization: the user starts the dedicated application. The operating system loads the instructions of the program from the computer readable storage medium (the built-in flash memory of the phone) into the memory. The program is initialized and loads the Transformer model and global prediction model parameters that have been pre-installed in the storage of the phone.

[0114] S002: Real-time processing loop: the program enters the background service state.

[0115] S003: The program receives the brain electrical data packet from the subcutaneous implant through the Bluetooth interface of the phone.

[0116] S004: The processor executes the instructions of the preprocessing module and the feature extraction module 3 in the storage medium to process the data.

[0117] S005: Execute the instructions of the model loading and inference module, call the neural network API (such as AndroidNNAPI) or CPU of the phone for efficient calculation, and obtain the risk probability value.

[0118] S006: Execute the instructions of the early warning logic module to determine whether an alarm needs to be triggered.

[0119] In addition, when the phone is idle, the system may schedule the execution of the instructions of the personalized adaptation module. The module reads the historical data labeled by the user and stored locally on the phone, fine-tunes the prediction model according to the loss function described in Embodiment Two, and saves the optimized model parameters back to the internal storage space of the phone for use in the next real-time prediction.

[0120] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A seizure prediction system based on subcutaneous implanted electrodes, characterized by: The system comprises a signal acquisition module, a signal preprocessing module, a feature extraction module, a prediction analysis module and an early warning module. The signal acquisition module comprises at least one subcutaneous electrode for acquiring intracranial electroencephalogram signals. The signal preprocessing module is in communication connection with the signal acquisition module and is configured to filter and detrend the acquired raw electroencephalogram signals. The feature extraction module is in communication connection with the signal preprocessing module and is configured to extract features from the preprocessed electroencephalogram signals, the feature extraction module comprising a first encoding unit and a second encoding unit, the first encoding unit being configured to extract preset time-domain features and frequency-domain features from the preprocessed electroencephalogram signals and splice them to form a low-level feature vector, and the second encoding unit being configured to receive the low-level feature vector and encode the low-level feature vector into a high-level feature representation containing context semantic information based on a pre-trained Transformer model. The prediction analysis module is in communication connection with the feature extraction module and is configured to receive the high-level feature representation, calculate and output a risk probability value representing a future seizure in a specific time period. The early warning module is in communication connection with the prediction analysis module and is configured to trigger a warning notification when the risk probability value exceeds a preset threshold. The signal acquisition module further comprises an implant housing and a wireless communication module, the implant housing being configured to encapsulate the subcutaneous electrode and its associated signal conditioning circuit, and the wireless communication module being integrated in the implant housing and configured to transmit the acquired electroencephalogram signals to an extracorporeal processing device. The implant housing is embedded in a groove formed by grinding the skull and is mechanically fixed and electrically isolated by a biocompatible fixing material, the biocompatible fixing material comprising a biocompatible bone cement or a microporous structure coating with a bone integration promoting effect. The prediction analysis module comprises a multi-scale time series analysis module, a prediction head network and a probability calibration module, the multi-scale time series analysis module being configured to process electroencephalogram features from different time windows in parallel, the prediction head network being integrated with a time convolution layer and a lightweight attention mechanism and being configured to decode the high-level feature representation and generate an initial probability, and the probability calibration module being configured to calibrate the initial probability using a temperature scaling technique to output a calibrated risk probability value.

2. The seizure prediction system based on subcutaneous implanted electrodes of claim 1, wherein: The signal preprocessing module performs filtering processing, which at least comprises: using a 50Hz notch filter to suppress power frequency interference; and using a band-pass filter with a passband frequency of 0.5Hz to 1000Hz to filter out high-frequency noise and baseline drift.

3. The seizure prediction system based on subcutaneous implanted electrodes of claim 1, wherein: The time-domain features extracted by the first encoding unit include maximum value, minimum value, variance, mean value and first-order difference sequence of the electroencephalogram signals. The frequency-domain features extracted by the first encoding unit include power spectral density estimated by the Welch method, band power in the delta, theta, alpha, beta and gamma frequency bands, and power ratio features calculated based on the band power.

4. The seizure prediction system based on subcutaneous implanted electrodes of claim 1, wherein: The Transformer model in the second encoding unit is pre-trained on a large-scale unlabeled electroencephalogram dataset through a self-supervised task of mask signal reconstruction, wherein the mask proportion is 40% to 60%.

5. The seizure prediction system based on subcutaneous implanted electrodes of claim 1, wherein: The prediction analysis module further comprises a personalized adaptation module configured to fine-tune the prediction head network or part of the second encoder parameters on the user's local device using newly generated user data. The loss function of the fine-tuning process is composed of a standard classification loss and a knowledge distillation loss, which is used to constrain the output probability distribution of the fine-tuned model to be aligned with that of the original model before fine-tuning.

6. A brain electrical signal data processing method based on a subcutaneous implanted electrode, characterized by, The method is executed by a computing device, and characterized in that it comprises the following steps: Step S1: continuously collecting electroencephalogram signals of a user through subcutaneously implanted subcutaneous electrodes; Step S2: preprocessing the collected raw electroencephalogram signals, including 50Hz notch filtering and 0.5Hz to 1000Hz band-pass filtering; Step S3: extracting low-level feature vectors from the preprocessed signals, including time domain features and frequency domain features; Step S4: converting the low-level feature vectors into high-level feature representations using a pre-trained Transformer encoder; Step S5: calculating the risk probability value of a seizure in a specific future time period based on the high-level feature representations through a prediction model; Step S6: comparing the obtained risk probability value with a preset threshold, and if the threshold is exceeded, triggering a local warning prompt.

7. The electroencephalographic signal data processing method of claim 6, wherein: In step S5, the prediction model is a model that has been fine-tuned for personalization; the personalized fine-tuning specifically involves using the user's local data on the user's local device and fine-tuning the global prediction model using a knowledge distillation-based incremental learning algorithm; The loss function of the incremental learning algorithm based on knowledge distillation is represented as: ; wherein, is the standard cross-entropy loss, wherein y is the true label of the new data, is the output probability of the student model after the softmax function layer; is a scaling factor to balance the numerical scales of the KL divergence term and the cross-entropy term; is the KL divergence, is the softened output of the teacher model, is the softened output of the student model; T is the temperature parameter, is the balancing weight coefficient.

8. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed, implements the steps of the method of any one of claims 6 to 7.

Citation Information

Patent Citations

  • Electroencephalogram feature optimization and epileptic seizure detection method based on deep self-coding

    CN111387974A

  • Epileptic intracranial electroencephalography signal warning method based on deep convolutional attention network

    CN113786204A

  • SEEG epileptic wave detection method and system based on layered graph diffusion learning, and storage medium

    CN114938946A

  • Sample similarity knowledge distillation method and device based on multichannel electroencephalogram

    CN119721124A

  • System and apparatus for seizure detection from EEG signals

    US20140358025A1