Electroencephalogram signal processing method for epilepsy prejudgment
Through the combination of Bayesian method and support vector machine, the time-frequency characteristics of EEG signals are extracted, and the problem of insufficient sensitivity and specificity of epilepsy warning in the prior art is solved, and more accurate and real-time epilepsy warning is achieved. Improves the quality of life and safety of patients.
Patent Information
- Application Number
- CN202411354778.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-03
AI Technical Summary
The existing EEG signal analysis methods have insufficient sensitivity and specificity in early warning of epilepsy seizures, resulting in false alarms and missed reports, making it difficult to achieve real-time monitoring and accurate early warnings, which limits its application in clinical practice.
The Bayesian method is used to divide the EEG signal into a stationary data segment, extract time-frequency features, and train and classify them through support vector machines to achieve epilepsy early warning. The specific steps include debaseline, denoising and de-article processing, de-explaining the EEG signal using an AR model, calculating information entropy, setting the sample feature sampling interval, splicing time-frequency features, and finally predicting epilepsy through the support vector machine.
It significantly improves the accuracy and real-time nature of epilepsy warnings, can make early warnings before epilepsy, improves the timeliness of medical intervention, reduces the harm caused by epilepsy, and provides a safer and more convenient living environment.
Smart Images

Figure CN119249083A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of nonlinear physiological signal processing, and specifically provides an electroencephalogram signal processing method for epilepsy prediction. Background Art
[0002] Epilepsy is a common chronic neurological disease characterized by abnormal discharges of neurons in the brain, leading to recurrent epileptic seizures; more than 50 million people worldwide are affected by this disease, which not only has a serious impact on the quality of life of patients, but also imposes a huge psychological and economic burden on patients and their families. Epilepsy attacks are often unpredictable, which makes it difficult for patients to plan daily activities and increases the risk of accidental injuries; therefore, developing a method that can provide early warning of epileptic seizures is crucial to improving patients' quality of life.
[0003] Currently, electroencephalogram (EEG) is the main tool for monitoring and diagnosing epilepsy. By analyzing EEG signals, doctors can identify abnormal patterns of brain electrical activity; however, existing EEG analysis methods have limitations in real-time monitoring and warning of epileptic seizures, mainly because they rely on manual interpretation or complex algorithms, which often require a lot of computing resources and expertise. The complexity and individual differences of EEG signals make the development of automated epileptic seizure warning systems challenging. In addition, existing systems often lack sufficient sensitivity and specificity, resulting in false positives and false negatives, which limits their application in clinical practice. In order to improve the quality of life and safety of patients with epilepsy, it is urgent to develop an efficient, accurate and user-friendly EEG signal processing method that can analyze EEG data in real time and accurately predict epileptic seizures, allowing patients and caregivers to take preventive measures. Summary of the invention
[0004] The purpose of the present invention is to provide an EEG signal processing method for epilepsy prediction, which uses advanced signal processing methods and machine learning algorithms to improve the accuracy and real-time nature of epilepsy attack warning, thereby providing a safer and more convenient living environment for epilepsy patients.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] A method for processing electroencephalogram (EEG) signals for epilepsy prediction, comprising the following steps:
[0007] S1, the collected EEG signals are processed in turn to remove baseline, noise and artifacts;
[0008] S2. Using the Bayesian method, the nonlinear and non-steady-state EEG signal is divided into several data segments, so that the signal in each data segment presents a stationary feature, and the time-frequency feature of each data segment of each EEG signal is calculated;
[0009] S3, setting a sample feature sampling interval on the EEG signal, extracting the time-frequency features of the EEG signal at each sample feature sampling point, and splicing the time-frequency features in sequence according to the electrode number sequence and time sequence to obtain the sample features of the EEG signal;
[0010] S4. The sample features of EEG signals are trained and classified through the support vector machine method to realize epilepsy prediction and alarm.
[0011] Furthermore, the specific process of step S1 is as follows:
[0012] S11, placing a specified number N of scalp electrodes on the outside of the patient's brain to collect EEG signals;
[0013] S12. For each EEG signal collected by the scalp electrode, first, the signal mean is subtracted from the EEG signal to complete the baseline removal process; then, the baseline-removed signal is band-pass filtered to complete the noise removal process; finally, the artifact removal process is performed.
[0014] Furthermore, the specific process of step S2 is:
[0015] S21, for the i-th, i=1, 2, ..., N EEG signals, starting from time t=0, calculate the remaining time length as n=T tol -t,T tol is the total duration of the signal;
[0016] S22, applying a window of length L=M to the EEG signal to extract a sub-time series s, where M is a preset window length;
[0017] S23, estimating the energy distribution of the sub-time series s;
[0018] The sub-time series s is described by the AR model, and the model is equivalently expressed as:
[0019] y t =x t +∈ t , x t =fθ t ,θ t =Gθ t-1 +w t
[0020] f=(1,0,…,0)′
[0021]
[0022] Among them, y t represents the observed value of the EEG signal, x t represents the underlying process in the signal; ∈ t is the observation error, w t Represents the state error θ t is the state vector, θ t =(x t , x t-1 , …, x t-p+1) ′; G represents the state evolution matrix, p is the order of the AR model, φ j is the j-th order regression coefficient, t=1,2,…,T tol , j = 1, 2, ..., p;
[0023] The dynamic linear model with discount factor is used to estimate the parameters of the AR model, and the state evolution matrix G at the current time t is obtained by solving it; the complex eigenvalue of the state evolution matrix G is further calculated: ε k represents the modulus of the kth eigenvalue, ω k Represents the rotation angle of the kth eigenvalue; further calculate the energy distribution of the sub-time series s:
[0024]
[0025] Among them, A t,k represents the instantaneous amplitude of the kth eigenvalue, ω represents the rotation angle, δ(ω,ω k ) represents the Kronecker delta function, when ω=ω k The function value is 1 when , and 0 otherwise;
[0026] S24. Calculate the information entropy H(p, L) of the model according to the energy distribution of the sub-time series s:
[0027]
[0028] S25, sequentially adjust the window length L = 2M, 3M, ..., Repeat steps S23 to S24;
[0029] S26, sequentially adjust the order of the AR model p=2, 4, ... p max , p max represents the maximum allowed model order, and repeats steps S23 to S25;
[0030] S27. Take the minimum value of information entropy H(p, L) to obtain the corresponding model order p o and window length L o , we get the window length L starting from time t oThe data segment is regarded as the local stable segment s i,1 ;
[0031] S28, at time t+L o +1 is the new starting point, the remaining time length is updated, and steps S22 to S27 are repeated to obtain all local stable segments. Among them, R i The number of local stable segments obtained for the i-th electrode signal;
[0032] S29, obtaining the time-frequency characteristics of the signal component in the local stable segment; for the rth stable segment s of the i-th electrode signal i,r , r=1,2,...,R i , the corresponding model order is p (i,r) , regression coefficient vector Substitute the regression coefficients into the matrix G to obtain the complex eigenvalues of G Assuming that the sampling interval of the EEG signal is Δt, the angular frequency of the kth component signal is Convert to frequency Therefore, the frequency vector of the rth stationary segment of the ith electrode signal is obtained as as time-frequency features.
[0033] Furthermore, the specific process of step S3 is as follows:
[0034] For the EEG signal of each electrode, set the same sample feature sampling points: (ΔT, 2ΔT, ..., HΔT), T tol is the total duration of the signal, ΔT is the sample feature sampling interval;
[0035] For the hth sample feature sampling point of the EEG signal of the ith electrode, h = 1, 2, ..., H, if the hth sample feature sampling point belongs to the rth stable segment of the ith electrode signal, then the corresponding time-frequency feature f is extracted. (i,r) ; For the hth sample feature sampling point, the time-frequency feature f (i,r) Sequentially concatenate to obtain the time-frequency feature f of the hth sample feature sampling point h ; Then, in chronological order, the time-frequency features f h Sequentially concatenate to obtain sample features f sample .
[0036] Furthermore, in step S3, during the feature concatenation process, the time-frequency feature f is filled with zeros. (i,r) Pad to the same length P, where P is the maximum length of a single time-frequency feature.
[0037] Furthermore, the specific process of step S4 is as follows:
[0038] S41, extracting sample features of the EEG signals of the patient in the pre-ictal period as positive samples, extracting sample features of the EEG signals of the patient in the interictal period as negative samples, and sending them to a support vector machine for training to obtain a trained support vector machine model;
[0039] S42. Collect the patient's current EEG signal, extract the corresponding sample features, and send them to the trained support vector machine model. The model outputs an estimated category, and sends a warning signal when the output category is a positive category.
[0040] Based on the above technical solution, the beneficial effects of the present invention are:
[0041] The present invention provides an electroencephalogram (EEG) signal processing method for epilepsy prediction. By introducing Bayesian estimation and time-frequency analysis methods, the present invention can more accurately analyze the time evolution process of the main frequency components in the electroencephalogram (EEG) signal, not only taking into account the dynamic change characteristics of the signal, but also effectively processing the nonlinear and non-steady-state characteristics of the electroencephalogram (EEG) signal through the Bayesian method, so as to more accurately capture the specific time-frequency characteristics before the epileptic seizure; these characteristics, as an important basis for determining epileptic seizures, significantly improve the accuracy of early warning. Traditional epilepsy detection methods often rely on the signal characteristics after the epileptic seizure for analysis, while the present invention can provide early warning before the epileptic seizure by real-time monitoring of the time-frequency changes of the electroencephalogram (EEG) signal. This real-time analysis capability enables doctors or patients' families to take measures in advance to avoid or reduce the damage caused by epileptic seizures, thereby improving the timeliness of medical intervention. In summary, the present invention can be applied to the analysis of electroencephalogram (EEG) signals of epileptic patients. For clinicians, it provides a new method to monitor and predict epileptic seizures, which helps to formulate more effective treatment plans. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic flow chart of the electroencephalogram (EEG) signal processing method for epilepsy prediction provided by the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and beneficial effects of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0044] This embodiment provides a method for processing electroencephalogram signals for epilepsy prediction, the process of which is as follows: Figure 1 As shown, the specific steps include:
[0045] S1, the collected EEG signals are processed in turn to remove baseline, noise and artifacts;
[0046] S11. Place a specified number N of scalp electrodes on the outside of the patient's brain. The electrodes are non-immersible electrodes.
[0047] S12, for each EEG signal collected by scalp electrode i (i=1, 2, ..., N), first, subtract the signal mean from the EEG signal to complete the baseline removal process; then, perform a bandpass filter from 1 Hz to 60 Hz on the baseline-removed signal to complete the noise removal process; finally, perform an artifact removal process;
[0048] S2. Using the Bayesian method, the nonlinear and non-steady-state EEG signal is divided into several data segments, so that the signal in each data segment presents a stationary characteristic, and the time-frequency characteristics of each data segment of each EEG signal are calculated;
[0049] S21, for the i-th, i=1, 2, ..., N electrode signals, starting from time t=0, calculate the remaining time length as n=T tol -t,T tol is the total duration of the signal;
[0050] S22, applying a window of length L=M to the EEG signal to extract a sub-time series s, where M is a preset window length;
[0051] S23. Estimate the energy distribution of the sub-time series s; assume that s is described by a p-order AR(p) model:
[0052]
[0053] Among them, y t represents the observed value of the EEG signal, ρ is the order of the AR model, is the observation error, φ j is the j-th order regression coefficient, t=1,2,…,T tol , j = 1, 2, ..., p;
[0054] The AR(p) model can be expressed as an equivalent dynamic linear model:
[0055] y t =x t +∈ t , x t =fθ t ,θ t =Gθ t-1 +w t
[0056] Among them, x t represents the potential process in the signal, ∈ t is the observation error, f = (1, 0, ..., 0) ′, the superscript “′” indicates transposition, θ t =(x t , x t-1 , …, x t-p+1 )′ is the state vector, w trepresents the state error, G represents the state evolution matrix;
[0057]
[0058] Furthermore, the parameters of the AR(p) model are estimated using a dynamic linear model with a discount factor, and the model is rewritten as the following equivalent model:
[0059]
[0060] Among them, f t =(x t-1 , x t-2 , …, x t-p )′,θ=(φ 1 ,φ 2 ,…,φ p )′, the superscript “′” indicates transposition; x t Represents the underlying process in the signal;
[0061] The process of estimating parameters using sampling is as follows:
[0062]
[0063] a t =m t-1 , R t =C t-1
[0064] m t =a t +A t e t , C t =(s t / s t-1 )(R t -A t A′ t q t )
[0065] A t =R t f t / q t
[0066] q t =f′ t R t f t +s t-1
[0067]
[0068] Among them, D t ={D t-1 ,y t} indicates information, Denotes the degree of freedom as n t-1 Student's distribution (student'st-distribution), σ represents the discount factor;
[0069] Get the m at the current time t t and C t Afterwards, according to Sampling θ, thus obtaining the state evolution matrix G;
[0070] Each eigenvalue of the state evolution matrix G represents a frequency component of the EEG signal. Assuming p is an even number, the matrix G has p / 2 pairs of conjugated complex eigenvalues; if p is an odd number, the matrix G has p / 2 pairs of conjugated complex eigenvalues and 1 real eigenvalue; the sum of the frequency components corresponding to a pair of conjugated eigenvalues is still a real component, and since the EEG signal removes the baseline, there is no real component corresponding to the real eigenvalue in the current signal. Therefore, the order p of the AR model can be set to be always an even number; let the p / 2 pair of conjugated complex eigenvalues of the matrix G be Among them, ε k represents the modulus of the kth eigenvalue, ω k represents the rotation angle of the kth eigenvalue;
[0071] The kth eigenvalue Written in plural form γ t,k =a+bi, then the instantaneous amplitude of the component is The components themselves can be considered as signals Its instantaneous power spectrum is:
[0072]
[0073] Where ω represents the rotation angle, δ(ω,ω k ) represents the Kronecker delta function, when ω=ω k The function value is 1 when s is less than s, and 0 otherwise; calculate the energy distribution of the sub-time series s:
[0074]
[0075] S24. Calculate the information entropy H(p, L) of the model according to the energy distribution of the sub-time series s:
[0076]
[0077] S25, sequentially adjust the window length L = 2M, 3M, ..., Repeat steps S23 to S24;
[0078] S26, sequentially adjust the order of the AR model p=2, 4, ... pma x , pma x represents the maximum allowed model order, and repeats steps S23 to S25;
[0079] S27. Take the minimum value of information entropy H(p, L) to obtain the corresponding model order p o and window length L o , we get the window length L starting from time t o AR(p o ) The data segment described by the model is regarded as a local stationary segment s i,1 ;
[0080] S28, at time t+L o +1 is the new starting point, the remaining time length is updated, and steps S22 to S27 are repeated to obtain all local stable segments. Among them, R i The number of local stable segments obtained for the i-th electrode signal;
[0081] S29, obtaining the time-frequency characteristics of the signal component in the local stable segment; for the rth stable segment s of the i-th electrode signal i,r , r=1,2,...,R i , the corresponding model order is p (i,r) , regression coefficient vector Substitute the regression coefficients into the matrix G to obtain the complex eigenvalues of G Assuming that the sampling interval of the EEG signal is Δt, the angular frequency of the kth component signal is Convert to frequency Therefore, the frequency vector of the rth stationary segment of the ith electrode signal is obtained as That is the time-frequency feature;
[0082] S3, setting a sample feature sampling interval ΔT on the EEG signal, extracting the time-frequency features of the EEG signal at each sample feature sampling point, and splicing the time-frequency features in sequence according to the electrode number sequence and time sequence to obtain the sample features of the EEG signal;
[0083] For each electrode’s EEG signal, the sample feature sampling points are (ΔT, 2ΔT, ..., HΔT). For the hth sample feature sampling point of the EEG signal of the ith electrode, h = 1, 2, ..., H, if the hth sample feature sampling point belongs to the rth stable segment of the ith electrode signal, the corresponding time-frequency feature f (i,r) ; For the hth sample feature sampling point, the time-frequency feature f (i,r) Sequentially concatenate to obtain the time-frequency feature f of the hth sample feature sampling pointh ; Then, in chronological order, the time-frequency features f h Sequentially concatenate to obtain sample features f sample , thus, for a patient’s EEG signal measured once, a sample feature f is obtained sample ;
[0084] In the feature splicing process, since the number of frequency components of the time-frequency feature of each electrode signal at the same sample feature sampling point is different, the time-frequency feature f is filled with 0. (i,r) Fill with length P, where P is the maximum length of a single time-frequency feature;
[0085] S4. Train and classify the sample features of EEG signals through the support vector machine method to complete epilepsy prediction;
[0086] S41, extracting sample features of the EEG signals of the patient in the pre-ictal period as positive samples, extracting sample features of the EEG signals of the patient in the interictal period as negative samples, and sending them to a support vector machine for training to obtain a trained support vector machine model;
[0087] S42. Collect the patient's current EEG signal, extract the corresponding sample features, and send them to the trained support vector machine model. The model outputs an estimated category. When the output category is a positive category, a warning signal is issued, indicating that the patient's epileptic symptoms may occur.
[0088] The above description is only a specific implementation mode of the present invention. Any feature disclosed in this specification, unless otherwise stated, can be replaced by other alternative features that are equivalent or have similar purposes; all the disclosed features, or all the steps in the methods or processes, except for mutually exclusive features and / or steps, can be combined in any way.
Claims
1. A method for processing electroencephalogram signals for epilepsy prediction, characterized in that: The following steps are involved: S1, the collected EEG signals are processed in turn to remove baseline, noise and artifacts; S2. Using the Bayesian method, the nonlinear and non-steady-state EEG signal is divided into several data segments, so that the signal in each data segment presents a stationary feature, and the time-frequency feature of each data segment of each EEG signal is calculated; S3, setting a sample feature sampling interval on the EEG signal, extracting the time-frequency features of the EEG signal at each sample feature sampling point, and splicing the time-frequency features in sequence according to the electrode number sequence and time sequence to obtain the sample features of the EEG signal; S4. The sample features of EEG signals are trained and classified through the support vector machine method to realize epilepsy prediction and alarm.
2. The method for processing electroencephalogram signals for epilepsy prediction according to claim 1, characterized in that: The specific process of step S1 is: S11, placing a specified number N of scalp electrodes on the outside of the patient's brain to collect EEG signals; S12. For each EEG signal collected by the scalp electrode, first, the signal mean is subtracted from the EEG signal to complete the baseline removal process; then, the baseline-removed signal is band-pass filtered to complete the noise removal process; finally, the artifact removal process is performed.
3. The method for processing electroencephalogram signals for epilepsy prediction according to claim 1, characterized in that: The specific process of step S2 is: S21, for the i-th, i=1, 2, ..., N-th EEG signal, starting from time t=0, calculate the remaining time length as n=T tol -t,T tol is the total duration of the signal; S22, applying a window of length L=M to the EEG signal to extract a sub-time series s, where M is a preset window length; S23, estimating the energy distribution of the sub-time series s; The sub-time series s is described by the AR model, and the model is equivalently expressed as: y t =x t +∈ t ,X t =fθ t ,i t =Gθ t-1 +W t f=(1,0,…,0)′ Among them, y t represents the observed value of the EEG signal, x t represents the underlying process in the signal; ∈ t is the observation error, w t Represents the state error θ t is the state vector, θ t =(x t ,x t-1 ,2,x t-p+1 )′; G represents the state evolution matrix, p is the order of the AR model, φ j is the regression coefficient of the jth order, t=1,2,…,T tol , j = 1, 2, ..., p; The dynamic linear model with discount factor is used to estimate the parameters of the AR model, and the state evolution matrix G at the current time t is obtained by solving it; the complex eigenvalue of the state evolution matrix G is further calculated: ε k represents the modulus of the kth eigenvalue, ω k Represents the rotation angle of the kth eigenvalue; further calculate the energy distribution of the sub-time series s: Among them, A t,k represents the instantaneous amplitude of the kth eigenvalue, ω represents the rotation angle, δ(ω,ω k ) represents the Kroneckerdelta function, when ω=ω k The function value is 1 when , and 0 otherwise; S24. Calculate the information entropy H(p,L) of the model based on the energy distribution of the sub-time series s: S25, adjust the window length in sequence Repeat steps S23 to S24; S26, sequentially adjust the order of the AR model p = 2, 4, ... p max , p max represents the maximum allowed model order, and repeats steps S23 to S25; S27. Take the minimum value of information entropy H(p,L) and get the corresponding model order p o and window length L o , we get the window length L starting from time t o The data segment is regarded as the local stable segment s i,1 ; S28, at time t+L o +1 is the new starting point, the remaining time length is updated, and steps S22 to S27 are repeated to obtain all local stable segments. Among them, R i The number of local stable segments obtained for the i-th electrode signal; S29, obtaining the time-frequency characteristics of the signal component in the local stable segment; for the rth stable segment s of the i-th electrode signal i,r ,r=1,2,…,R i , the corresponding model order is p (i,r) , regression coefficient vector Substitute the regression coefficients into the matrix G to obtain the complex eigenvalues of G Assuming that the sampling interval of the EEG signal is Δt, the angular frequency of the kth component signal is Convert to frequency Therefore, the frequency vector of the rth stationary segment of the ith electrode signal is obtained as as time-frequency features.
4. The electroencephalogram signal processing method for epilepsy prediction according to claim 1, characterized in that: The specific process of step S3 is: For the EEG signal of each electrode, set the same sample feature sampling points: (ΔT, 2ΔT, …, HΔT), T tol is the total duration of the signal, ΔT is the sample feature sampling interval; For the hth sample feature sampling point of the EEG signal of the ith electrode, h = 1, 2, ..., H, if the hth sample feature sampling point belongs to the rth stable segment of the ith electrode signal, then the corresponding time-frequency feature f is extracted. (i,r) ; For the hth sample feature sampling point, the time-frequency feature f (i,r) Sequentially concatenate to obtain the time-frequency feature f of the hth sample feature sampling point h ; Then, in chronological order, the time-frequency features f h Sequentially concatenate to obtain sample features f sample .
5. The method for processing electroencephalogram signals for epilepsy prediction according to claim 4, characterized in that: In step S3, during the feature concatenation process, the time-frequency feature f is filled with zeros. (i,r) Pad to the same length P, where P is the maximum length of a single time-frequency feature.
6. The method for processing electroencephalogram signals for epilepsy prediction according to claim 1, characterized in that: The specific process of step S4 is: S41, extracting sample features of the EEG signals of the patient in the pre-ictal period as positive samples, extracting sample features of the EEG signals of the patient in the interictal period as negative samples, and sending them to a support vector machine for training to obtain a trained support vector machine model; S42. Collect the patient's current EEG signal, extract the corresponding sample features, and send them to the trained support vector machine model. The model outputs an estimated category, and sends a warning signal when the output category is a positive category.
