Electrocardiogram and determination learning based pre-seizure prediction method and system

By constructing an electrocardiographic dynamics model using a discrete high-gain observer and deterministic learning theory, the problem of insufficient analysis of signal changes before an epileptic seizure is solved, accurate prediction of signal mutations before an epileptic seizure is achieved, and clinical management is supported.

CN119326376BActive Publication Date: 2025-10-21HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411384355.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-10-21
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

Existing technologies are insufficient in analyzing changes in ECG signals before an epileptic seizure, making it difficult to accurately predict the suddenness and unpredictability of epileptic seizures. In particular, patients with generalized tonic-clonic seizures face a high risk of sudden death from epilepsy.

Method used

A radial basis function neural network is constructed using a discrete high-gain observer and deterministic learning theory. By preprocessing the ECG signals, building a pattern library and designing a dynamic estimator, the dynamic changes of the ECG signals are captured and signal mutations before epileptic seizures are identified.

Benefits of technology

Accurately capture sudden changes in ECG signals within 10 minutes (mostly within 5 minutes) before an epileptic seizure, providing important reference for clinicians and optimizing patient management and intervention strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119326376B_ABST
    Figure CN119326376B_ABST
Patent Text Reader

Abstract

The application discloses a pre-ictal prediction method and system based on electrocardiogram and deterministic learning, and the steps are as follows: 1. Preprocessing the electrocardiogram data of pre-ictal and dividing into three normal groups and one symptom group; 2. For the original electrocardiogram signals of different groups, the discrete high-gain observer is used to obtain the electrocardiogram state, and the neural network is constructed according to the deterministic learning theory, the dynamics mode of the electrocardiogram is extracted, and the standardized initial mode library is saved; 3. Based on the dynamic estimator, specific judgment rules and mutation prompt signals are designed, which are used for comparing the differences between the electrocardiogram state of the original electrocardiogram signal and the different electrocardiogram state modes in the mode library, outputting the point-to-point signal change graph, and establishing the test of the mutation prompt signal; 4. The modes in different groups are combined for experiment, and the result difference of different mode selection is analyzed and visualized. The application well depicts the change of the electrocardiogram signal before the seizure, and the accurate time node of the mutation can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of analysis of electrocardiogram (ECG) signal changes before an epileptic seizure, and relates to visualization and analysis of ECG signal changes before an epileptic seizure using a discrete high-gain observer and deterministic learning theory. Background Art

[0002] Epilepsy is a neurological disorder that affects approximately 50 million people worldwide. Due to the sudden and unpredictable nature of epilepsy, it often disrupts patients' lives, employment, and social interactions. In particular, patients with uncontrolled generalized tonic-clonic seizures (GTCS), a type of epileptic seizure, face a higher risk of sudden death from epilepsy. Studies have shown that changes in the autonomic nervous system during epileptic seizures also affect electrocardiogram (ECG) signals. Heart rate variability (HRV) is currently widely used to analyze ECG changes before and after an epileptic seizure, and a large body of literature has shown significant differences in ECG signals before and during an epileptic seizure. However, research on the evolution of ECG signals before an epileptic seizure remains insufficient. Whether there are mutations in the ECG signal before an epileptic seizure is a question worth exploring.

[0003] As a typical nonlinear system, the heart has inherent nonlinear dynamics that deserve in-depth analysis in addition to HRV characteristics. Deterministic learning theory performs well in identifying recursive nonlinear systems with unknown dynamics, and can effectively obtain the internal dynamics of ECG. At the same time, dynamic pattern recognition methods for unknown system dynamics are widely used in fault detection, but there has been no relevant research in the field of ECG change analysis before an epileptic seizure. Based on a discrete high-gain observer and deterministic learning theory, the present invention deeply explores the changes in electrocardiographic dynamics before an epileptic seizure, and finds that the ECG signal has mutation signals before an epileptic seizure, which provides a new research perspective and method for the field of epilepsy analysis, and also provides important reference information for clinicians. The present invention can also accurately capture the exact time of the mutation signal, which helps to optimize the management and intervention strategies for patients. Summary of the Invention

[0004] The present invention provides a method and system for predicting the early stage of epileptic seizures based on electrocardiogram and deterministic learning, especially a study on analyzing the electrocardiogram changes before epileptic seizures from the perspective of electrocardiographic dynamics, which helps to solve the specific application problems of epileptic seizures in clinical practice.

[0005] The technical solutions adopted by the present invention to solve the technical problems are as follows:

[0006] Step 1: Pre-processing the ECG data of the pre-epilepsy attack period and dividing them into three normal groups and one symptom group; the pre-epilepsy attack period is the period from 20 minutes before the onset of the epilepsy attack to the onset of the attack;

[0007] Step 2: For different groups of original ECG signals, a discrete high-gain observer is used to obtain the ECG state, and a neural network is constructed based on deterministic learning theory to extract the ECG dynamic pattern. Finally, the patterns are uniformly saved to form a standardized initial pattern library.

[0008] Step 3: Based on the dynamic estimator, a specific judgment rule and mutation prompt signal are designed to compare the ECG state of the original ECG signal with the different ECG state patterns in the pattern library, and output a point-to-point signal change graph. Then, a verification link is established to ensure the accuracy of the mutation prompt signal.

[0009] Step 4: Randomly select any one ECG state pattern from each of the four groups of patterns for combined experiments, and analyze the differences in the changes in visualized ECG signals when selecting different ECG state patterns; select different attack data of the same case to build a pattern library for repeated experiments, analyze the commonality and specificity of the experimental results, and thus develop an exclusive pattern library for each case data.

[0010] Furthermore, the specific implementation of step 1 is as follows:

[0011] 1-1. Prepare original ECG data: For patients with at least two seizures and an interval greater than one hour between seizures, obtain ECG data from 20 minutes before the onset to the end of the seizure.

[0012] 1-2. Preprocess the raw ECG signal using multiple filters: first, a 50Hz notch filter is used to remove power frequency interference, then a median filter is used to remove baseline drift, and then a 1-70Hz bandpass filter is used to remove interference from the EMG signal and noise; finally, normalization is performed.

[0013] 1-3. The preprocessed data were divided into three normal groups and one seizure sign group; the normal groups corresponded to the time periods 15-20 minutes, 10-15 minutes, and 5-10 minutes before the seizure, respectively, while the seizure sign group corresponded to the time period 0-5 minutes before the seizure;

[0014] 1-4. Each group is divided into five 1-minute segments as ECG analysis units.

[0015] Furthermore, the specific implementation of step 2 is as follows:

[0016] 2-1. For each group of ECG analysis units, a discrete high-gain observer is used to estimate the ECG state; the observer is defined as:

[0017]

[0018] Among them, x(k) is the original single-lead ECG data, is the ECG state estimated by the observer, O(k) is the state vector of the observer; A d ,Bd ,C d ,D d is the designed observer parameter; k represents the kth moment;

[0019] 2-2. Normalize the ECG state estimated by the observer and combine it with the original ECG signal to form a two-dimensional signal;

[0020] 2-3. Based on deterministic learning theory, a radial basis function neural network was constructed for two-dimensional signals to identify the intrinsic dynamics of the ECG. The ECG dynamics obtained by the network were stored as constants in an initial pattern library, resulting in three groups of normal patterns and one group of seizure sign patterns. Each group contained five patterns, for a total of 25 patterns across the four groups.

[0021] Furthermore, the specific implementation of step 3 is as follows:

[0022] Prepare a new set of ECG data as test data. This data comes from the same patient before and after the attack. Use a high-gain observer to obtain the ECG state of the test data and normalize it.

[0023] 3-2. Select one pattern from each of the four groups and compare the ECG state of the test data with the four selected patterns using a dynamic estimator. The difference is expressed as the residual The smaller the mean residual norm, the higher the similarity between the test data and the pattern. represents the ECG states of the four modes at time k;

[0024] 3-3. Input the ECG state of the test data into the dynamic estimator and compare the average residual norm of the test data with that of the four patterns. Record the moment when the residual between the test data and the seizure symptom pattern is lower than the residual between all the normal patterns and the test data. This moment is the signal mutation moment.

[0025] The normal pattern refers to the ECG state of a pattern randomly selected from the normal group;

[0026] The seizure symptom pattern refers to the electrocardiographic state of a pattern randomly selected from the seizure symptom group;

[0027] 3-4. Create a mutation signal to indicate changes in the ECG signal before an epileptic seizure. When the residual corresponding to any normal pattern is lower than that of the seizure symptom pattern, the mutation signal is 0. The mutation signal becomes 1 only when the residual corresponding to the seizure symptom pattern is lower than the residuals of all normal patterns.

[0028] 3-5. Establish a mutation signal verification mechanism; for mutation signals caused by residual changes due to transient ECG abnormal fluctuations, use the verification mechanism to determine whether the previous mutation signal is a false alarm;

[0029] 3-6. Experiment with other episodes of the same case sequentially, and output a point-to-point residual change graph and a mutation signal prompt graph with the test data;

[0030] Furthermore, the verification mechanism of steps 3-5 is specifically verified as follows:

[0031] The moment when the mutation prompt signal first changes to 1 is taken as the initial mutation point. Then, as time progresses, it is determined whether the mutation prompt signal changes to 0, that is, the residual of the seizure symptom pattern is higher than the residual of at least one normal pattern. If not, the initial mutation point is maintained. If so, the ratio of the time when the mutation prompt signal changes to 0 to the time from the current moment to the initial mutation point is calculated. If the ratio is greater than or equal to 0.5, it indicates that the mutation prompt signal is a false alarm and a new mutation point needs to be found. If the ratio is less than 0.5, it indicates that it is only a short-term residual fluctuation that does not affect the mutation point. The mutation point after this test is the final signal mutation point.

[0032] Furthermore, the specific implementation of step 4 is as follows: select a pattern from each group of patterns, Different combinations;

[0033] Furthermore, the present invention also provides an epileptic seizure pre-prediction system based on electrocardiogram and deterministic learning, which specifically includes the following modules:

[0034] Preprocessing module: pre-processes the ECG data before the onset of epileptic seizures and divides them into three normal groups and one seizure sign group;

[0035] Pattern library construction module: For different groups of original ECG signals, a discrete high-gain observer is used to obtain the ECG state, and a radial basis function neural network is constructed based on deterministic learning theory to extract the ECG dynamic pattern. Finally, the model is uniformly saved to form a standardized initial pattern library.

[0036] Residual Identification Module: Based on the dynamic estimator, specific judgment rules and mutation prompt signals are designed to compare the ECG state of the original ECG signal with the different ECG state patterns in the pattern library, and output a point-to-point signal change graph. Then, a verification process is established to ensure the accuracy of the mutation prompt signal.

[0037] Combination analysis module: Randomly select any one ECG state pattern from each of the four groups of patterns for combination experiments, and analyze the differences in the changes in visualized ECG signals when selecting different ECG state patterns; select different attack data of the same case to build a pattern library for repeated experiments, analyze the commonality and specificity of the experimental results, and thus develop an exclusive pattern library for each case data.

[0038] The beneficial effects of the present invention are as follows:

[0039] 1. The analysis of the ECG changes before an epileptic seizure proved that there was a sudden change in the ECG signal before an epileptic seizure.

[0040] 2. Analyze from the perspective of electrocardiographic dynamics, not limited to the commonly used HRV characteristics. It is proved that electrocardiographic dynamics can well characterize the changes in ECG signals before epileptic seizures.

[0041] 3. The method based on discrete high-gain observer and deterministic learning theory can obtain the signal indicating ECG mutation within 10 minutes before the onset (most of them within 5 minutes before the onset) and obtain the precise time node of the mutation.

[0042] 4. A pattern library dedicated to each case of data can be developed for clinical ECG diagnosis, assisting doctors in obtaining the patient's ECG mutation status in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 Flowchart of an example of the present invention.

[0044] Figure 2 Schematic diagram of radial basis function neural network identification of cardiac electrodynamics.

[0045] Figure 3 Schematic diagram of the residual results and mutation prompt signals of normal test data.

[0046] Figure 4 Schematic diagram of residual results and mutation prompt signals for special test data. DETAILED DESCRIPTION

[0047] Here, the specific embodiments of the present invention are described in detail with reference to the accompanying drawings.

[0048] Figure 1 The relevant steps of the method for studying the early stage of epileptic seizures based on electrocardiogram and deterministic learning have been described in detail in the invention content, that is, the technical solution of the present invention mainly includes the following steps:

[0049] Step 1: Pre-processing the ECG data of the pre-epilepsy attack period and dividing them into three normal groups and one symptom group; the pre-epilepsy attack period is the period from 20 minutes before the onset of the epilepsy attack to the onset of the attack;

[0050] Step 2: For different groups of original ECG signals, a discrete high-gain observer is used to obtain the ECG state, and a neural network is constructed based on deterministic learning theory to extract the ECG dynamic pattern. Finally, the patterns are uniformly saved to form a standardized initial pattern library.

[0051] Step 3: Based on the dynamic estimator, a specific judgment rule and mutation prompt signal are designed to compare the ECG state of the original ECG signal with the different ECG state patterns in the pattern library, and output a point-to-point signal change graph. Then, a verification link is established to ensure the accuracy of the mutation prompt signal.

[0052] Step 4: Randomly select any one ECG state pattern from each of the four groups of patterns for combined experiments, and analyze the differences in the changes in visualized ECG signals when selecting different ECG state patterns; select different attack data of the same case to build a pattern library for repeated experiments, analyze the commonality and specificity of the experimental results, and thus develop an exclusive pattern library for each case data.

[0053] The specific implementation of step 1 is as follows:

[0054] 1-1. Prepare original ECG data: For patients with at least two seizures and an interval greater than one hour between seizures, obtain ECG data from 20 minutes before the onset to the end of the seizure.

[0055] 1-2. Preprocess the raw ECG signal using multiple filters: first, a 50Hz notch filter is used to remove power frequency interference, then a median filter is used to remove baseline drift, and then a 1-70Hz bandpass filter is used to remove interference from the EMG signal and noise; finally, normalization is performed.

[0056] 1-3. The preprocessed data were divided into three normal groups and one seizure sign group; the normal groups corresponded to the time periods 15-20 minutes, 10-15 minutes, and 5-10 minutes before the seizure, respectively, while the seizure sign group corresponded to the time period 0-5 minutes before the seizure;

[0057] 1-4. Each group is divided into five 1-minute segments as ECG analysis units.

[0058] The specific operations of step 2 are as follows:

[0059] 2-1. For the ECG signal with a sampling frequency of 1000 Hz, the ECG unit y in each group r (k), use a discrete high-gain observer to estimate the ECG state. The observer is defined as: Where x(k) is the original single-lead ECG data, is the ECG state estimated by the observer, and O(k) is the state vector of the observer. Among the high-gain observer discretization methods, the bilinear transformation method has a small observation error and can effectively guarantee the stability of mapping the continuous-time transfer function to the discrete-time transfer function. Therefore, according to the bilinear transformation method,

[0060] A d =(I+(α / 2)A o )(I-(α / 2)Ao ) -1 , B d =α(I-(α / 2)A o ) -1 H o ,

[0061] C d =D -1 (I-(α / 2)A o ) -1 , D d =(α / 2)C d H, A o =A-HC, α=T / ε.

[0062] Here, T=1000HZ is the sampling frequency of the original ECG. Settings:

[0063]

[0064] 2-2. Normalize the ECG state estimated by the observer and combine it with the original ECG signal to form a two-dimensional signal.

[0065] 2-3. Based on deterministic learning theory, a radial basis function neural network identifier is constructed for the two-dimensional signal composed of the original ECG and ECG state to extract the electrocardiographic dynamics. A radial basis function neural network is a neural network that uses a radial basis function as an activation function. Its output is a linear combination of the network input and the radial basis function. The network model structure is as follows:

[0066]

[0067] in, is the regression vector of the radial basis function, is the ECG state of the input network, W=[w1,w2,…,w N ] T is the weight vector of the network, and N is the number of neurons. In deterministic learning, the radial basis function is a Gaussian function, and its expression is as follows:

[0068]

[0069] Among them, σ i (i=1,…,N) is the position of the neuron identifier in the network, and η is the effective interval of the identifier. As long as the appropriate identifier position and the spacing between adjacent identifiers are deployed, for any neural network, when N is large enough, the signal trajectory in the local range can be accurately identified. Specifically, the dimension of the network is set to two dimensions, and the network boundary, the spacing between adjacent identifiers, the effective interval of the identifier and other parameters are set according to the boundary of the two-dimensional ECG signal to ensure that the deployed network identifier can fully cover the two-dimensional ECG signal, such as Figure 2 As shown. Based on deterministic learning theory, each identifier can accurately identify nearby sampled signals under the condition of continuous excitation (PE). The identifier formula is as follows:

[0070]

[0071] Among them, χ m (k) represents the state of the mth identifier at the kth moment, β is the design gain of the identifier, T is the sampling frequency, is the constructed radial basis function neural network, where is the weight of the network at the kth moment, is the regression vector of the network. The weight update law is:

[0072]

[0073] Where δ is the update gain. The electrocardiographic dynamics obtained by the network are expressed in the form of constant network weights. Saved in the initial pattern library, three groups of normal patterns and one group of seizure symptom patterns are obtained, and each group contains 5 pattern units.

[0074] The specific operations of step 3 are as follows:

[0075] Prepare a new set of ECG data as test data. This data is from the beginning to the end of another seizure in the same patient. Use the same high-gain observer to obtain the ECG state of the test data.

[0076] 3-2. Select one pattern from each of the four groups of patterns and construct a discrete dynamic estimator to compare the test data with the four patterns. Each pattern can construct a corresponding dynamic estimator, as shown in the following formula:

[0077]

[0078] in, represents the state of the mth dynamic estimator at the kth moment, represents the state of the test data, γ is the design gain of the estimator, is the constant network weight previously saved in the pattern library, is the calculated network regression vector. The difference between the test data and the four models can be expressed as residuals. Expression, finally expressed as the average residual norm, the formula is as follows:

[0079]

[0080] Among them, T eThe design parameters are preferably the period or multiple of the ECG state. If conditions permit, T e The larger the value, the smoother the residual graph trajectory generated. Since the average period of the ECG signal is 600ms, it is set to 12000 here.

[0081] 3-3. A smaller norm of the average residual generated by the dynamic estimator indicates a higher similarity between the test data and the corresponding pattern. Therefore, we focus on the changes in the residuals between the test data and the seizure symptom pattern. The signal mutation point is when the residual of the test data with the seizure symptom pattern is lower than its residuals with all normal patterns.

[0082] 3-4. Create a mutation signal. When the residual corresponding to any normal pattern is lower than that of the seizure symptom pattern, the mutation signal is 0; if and only if the residual corresponding to the seizure symptom pattern is lower than the residuals of all normal patterns, the mutation signal becomes 1. Input the test data from 5 minutes before the seizure to the end of the seizure into the dynamic estimator, and visualize the test data and the average residual norm of the four patterns, as shown in the figure below. Figure 3 As shown in the figure, it is clear that before 197763ms, the residuals between the test data and the normal pattern are lower than the residuals between the test data and the seizure symptom pattern. However, after 197763ms, the residuals between the test data and the seizure symptom pattern are lower than the residuals between the test data and the normal pattern, indicating that from this point on, the similarity between the test data and the seizure symptom pattern is the highest. Therefore, 197763ms (3.296 minutes, or 1.704 minutes before the seizure) is the ECG signal mutation point.

[0083] 3-5. Establish a mutation signal detection mechanism. Since the ECG signal is a time series signal with periodic fluctuations and will be disturbed by external factors such as body movement and emotional fluctuations, the calculated residual will fluctuate accordingly. In order to ensure the accuracy of the mutation prompt signal and prevent the occurrence of signal mutations caused by residual changes due to short-term abnormal ECG fluctuations, special case judgment rules are added to determine whether the previous mutation prompt signal is a false alarm. The moment the mutation prompt signal changes to 1 is used as the initial mutation point. As time goes on, determine whether there is a situation where the signal changes to 0 (the residual of the symptom mode is higher than the residual of at least one normal mode). If not, the initial mutation point is maintained. If so, start calculating the ratio of the time it takes for the signal to change to 0 to the time from the current moment to the mutation point. Assuming the ratio is greater than or equal to 0.5, it means that the mutation prompt signal is a false alarm, and then look for a new mutation point. Assuming the ratio is less than 0.5, it means that it is only a short-term residual fluctuation that does not affect the mutation point. The mutation point after layer-by-layer testing is the final signal mutation point. Figure 4As shown, the initial warning signal was issued at 195134ms, but from 202208 to 204077ms, perhaps due to daily activities, the residual of the seizure symptom pattern briefly exceeded the residual of normal mode 1. However, compared with the time when the mutation prompt signal was issued, the proportion of this recovery time was less than 0.5, so the initial mutation point continued to be maintained.

[0084] 3-6. Experiments were conducted one by one on the data of 7 patients with a total of 29 episodes. 7 episodes were used to build a dedicated pattern library for each case, and the remaining 22 episodes were used for testing. The results are shown in Table 1.

[0085] Table 1 Display of signal mutation points for each data

[0086] serial number Number of attacks Signal mutation point (minutes) 1 3 1.57 / 1.08 2 4 4.29 / 3.95 / 1.19 3 7 3.13 / 3.3 / 4.68 / 2.61 / 2.08 / 4.46 4 4 1.47 / 3.75 / 1.12 5 2 1.03 6 2 6.69 7 7 2.61 / 1.70 / 6.04 / 0.8 / 1.82 / 4.27

[0087] The table above shows that each test case in each seizure had a sudden change in the ECG signal before the onset of each attack, and the signal change time was within 10 minutes before the onset, and most of them were within 5 minutes before the onset of the onset. This proves that the present invention can effectively capture the sudden change in the ECG signal before the onset of epileptic seizures and provide a precise signal prompt at the time.

[0088] The specific operations of step 4 are as follows:

[0089] 4-1. The key point of the present invention lies in the selection of patterns. Whether the selection of different patterns will affect the capture of mutation signals or the capture time of mutation signals is a question worth exploring. In the pattern library constructed in step 2, each of the four groups of patterns contains 5 patterns. Selecting a pattern from each group of patterns can have Different combinations were used. Patterns were numbered 1-20 based on their distance from the onset time, i.e., 15-20 minutes before the onset were numbered 1-5, and 5 minutes before the onset were numbered 15-20. The results for case 7 are presented and analyzed in detail. Experiments were conducted on the same test data using randomly selected patterns from different groups. The results are shown in Table 2.

[0090] Table 2 Results of different mode combinations

[0091]

[0092]

[0093] As can be seen from Table 2, the signal mutation point for each test was within 5 minutes before the onset. Different pattern combinations produced slightly different results for capturing the signal mutation point for the same test data, with the difference within 1 minute.

[0094] 4-2. A further question arises: what differences and commonalities can be found when constructing a pattern library for different episodes and testing for mutation signals using other episodes? A pattern library was constructed for each of the seven episodes in the seventh case data set, and used to test the remaining six episodes. As many combinations as possible with signal mutations were recorded, and the most frequent combinations were identified and listed in Table 3.

[0095] Table 3 Test results of different pattern combinations at different times

[0096]

[0097]

[0098] Depend on Figure 3 It can be seen that for the same pattern library, different attack test data have different signal mutation times. For pattern libraries constructed from different attack times, the mutation signal times captured using the same test data vary within milliseconds. This demonstrates that when it comes to capturing mutation signals, regardless of which attack data is used to construct the pattern library, and regardless of the combination of these, the results are not significantly different.

[0099] 4-3. Construct a unique pattern library for each case. There are 625 different combinations, but testing all of them would be extremely time-consuming. Therefore, it is necessary to find combinations specific to each case. Table 3 shows that three combinations occur frequently: 1; 10; 15; 17, 5; 10; 14; 20, and 5; 7; 14; 19. Accurately capturing the mutation signal before the onset of an attack is a meaningful result. Therefore, for this case, regardless of which attack is selected for training, selecting these three pattern combinations during testing will yield signal mutation points within 10 minutes (except for the second attack). Examining the original ECG signal for this case, the second attack occurred around 1:00 AM. Compared to the other attacks, the ECG amplitude of this attack was smaller and more stable. This may be the reason why the second attack's pattern selection is difficult and different, but this is a rare case.

Claims

1. A method for predicting the early stages of an epileptic seizure based on electrocardiogram and deterministic learning, characterized by: Step 1: Pre-process the ECG data before the onset of epileptic seizures and divide them into three normal groups and one symptom group; the pre-onset period is the period from 20 minutes before the onset of epilepsy to the onset of the seizure; the normal group corresponds to the time periods of 15-20 minutes, 10-15 minutes, and 5-10 minutes before the onset of the seizure, respectively, while the symptom group corresponds to the time period of 0-5 minutes before the onset of the seizure; Step 2: For different groups of original ECG signals, a discrete high-gain observer is used to obtain the ECG state, and a neural network is constructed based on deterministic learning theory to extract the ECG dynamic pattern. Finally, the patterns are uniformly saved to form a standardized initial pattern library. Step 3: Based on the dynamic estimator, a specific judgment rule and mutation prompt signal are designed to compare the ECG state of the original ECG signal with the different ECG state patterns in the pattern library, and output a point-to-point signal change graph. Then, a verification link is established to ensure the accuracy of the mutation prompt signal. Step 4: Randomly select any one ECG state pattern from each of the four groups of patterns for combined experiment. We also analyzed the selection of different ECG state patterns and the differences in the changes of visualized ECG signals. We selected data from different episodes of the same case to construct a pattern library for repeated experiments, analyzed the commonalities and specificities of the experimental results, and thus developed a unique pattern library for each case data. The specific implementation of step 3 is as follows: Prepare a new set of ECG data as test data. This data comes from the same patient before and after the attack. Use a high-gain observer to obtain the ECG state of the test data and normalize it. 3-2. Select one pattern from each of the four groups and compare the ECG state of the test data with the four selected patterns using a dynamic estimator. The difference is expressed as the residual Expression, finally expressed as the mean residual norm; represents the ECG states of the four modes at time k; 3-3. Input the ECG state of the test data into the dynamic estimator and compare the average residual norm of the test data with that of the four patterns. Record the moment when the residual between the test data and the seizure symptom pattern is lower than the residual between all the normal patterns and the test data. This moment is the signal mutation moment. The normal pattern refers to the ECG state of a pattern randomly selected from the normal group; The seizure symptom pattern refers to the electrocardiographic state of a pattern randomly selected from the seizure symptom group; 3-4. Develop a mutation signal to demonstrate changes in ECG signals before an epileptic seizure; details are as follows: When the residual corresponding to any normal pattern is lower than that of the seizure symptom pattern, the mutation prompt signal is 0; if and only if the residual corresponding to the seizure symptom pattern is lower than the residuals of all normal patterns, the mutation prompt signal becomes 1; 3-5. Establish a mutation signal verification mechanism; for mutation signals caused by residual changes due to transient ECG abnormal fluctuations, use the verification mechanism to determine whether the previous mutation signal is a false alarm; 3-6. Experiment with other episodes of the same case in sequence, and output a point-to-point residual change graph and a mutation signal prompt graph with the test data.

2. The method for predicting the early stage of epileptic seizures based on electrocardiogram and deterministic learning according to claim 1, wherein the specific implementation of step 1 is as follows: 1-1. Prepare original ECG data: For patients with at least two seizures and an interval greater than one hour between seizures, obtain ECG data from 20 minutes before the onset to the end of the seizure. 1-2. Preprocess the raw ECG signal using multiple filters: first, a 50Hz notch filter is used to remove power frequency interference, then a median filter is used to remove baseline drift, and then a 1-70Hz bandpass filter is used to remove interference from the EMG signal and noise; finally, normalization is performed. 1-3. Each group is divided into five 1-minute segments as ECG analysis units.

3. The method for predicting the pre-epilepsy attack based on electrocardiogram and deterministic learning according to claim 2, wherein the specific implementation of step 2 is as follows: 2-1. For each group of ECG analysis units, a discrete high-gain observer is used to estimate the ECG state; the observer is defined as: in, x(k) is the original single-lead ECG data, is the ECG state estimated by the observer, O(k) is the state vector of the observer; A d ,B d ,C d ,D d is the designed observer parameter; k represents the kth moment; 2-2. Normalize the ECG state estimated by the observer and combine it with the original ECG signal to form a two-dimensional signal; 2-3. Based on deterministic learning theory, a radial basis function neural network was constructed for two-dimensional signals to identify the intrinsic dynamics of the ECG. The ECG dynamics obtained by the network were stored as constants in an initial pattern library, resulting in three groups of normal patterns and one group of seizure sign patterns. Each group contained five patterns, for a total of 25 patterns across the four groups.

4. The method for predicting the early stage of epileptic seizure based on electrocardiogram and deterministic learning according to claim 1, characterized in that: The specific inspection mechanism of steps 3-5 is as follows: The moment when the mutation prompt signal first changes to 1 is taken as the initial mutation point. Then, as time progresses, it is determined whether the mutation prompt signal changes to 0, that is, the residual of the seizure symptom pattern is higher than the residual of at least one normal pattern. If not, the initial mutation point is maintained. If so, the ratio of the time when the mutation prompt signal changes to 0 to the time from the current moment to the initial mutation point is calculated. If the ratio is greater than or equal to 0.5, it indicates that the mutation prompt signal is a false alarm and a new mutation point needs to be found. If the ratio is less than 0.5, it indicates that it is only a short-term residual fluctuation and does not affect the mutation point. The mutation point after this test is the final signal mutation point.

5. The method for predicting the pre-epilepsy attack based on electrocardiogram and deterministic learning according to claim 1, wherein the specific implementation of step 4 is as follows: a pattern is selected from each group of patterns, Different combinations.

6. An epileptic seizure pre-prediction system based on electrocardiogram and deterministic learning, characterized by: The system is used to implement the method according to claim 1, and the system includes the following modules: Preprocessing module: pre-processes the ECG data before the onset of epileptic seizures and divides them into three normal groups and one seizure sign group; Pattern library construction module: For different groups of original ECG signals, a discrete high-gain observer is used to obtain the ECG state, and a radial basis function neural network is constructed based on deterministic learning theory to extract the ECG dynamic pattern. Finally, the model is uniformly saved to form a standardized initial pattern library. Residual Identification Module: Based on the dynamic estimator, specific judgment rules and mutation prompt signals are designed to compare the ECG state of the original ECG signal with the different ECG state patterns in the pattern library, and output a point-to-point signal change graph. Then, a verification process is established to ensure the accuracy of the mutation prompt signal. Combination analysis module: Randomly select any one ECG state pattern from each of the four groups of patterns for combination experiments, and analyze the differences in the changes in visualized ECG signals when selecting different ECG state patterns; select different attack data of the same case to build a pattern library for repeated experiments, analyze the commonality and specificity of the experimental results, and thus develop an exclusive pattern library for each case data.