Epilepsy detection method based on Riemannian manifold
By applying multi-scale Riemann geometry and multi-scale convolutional neural network methods based on Riemann manifold in epilepsy diagnosis, the problem of large time spent on epilepsy diagnosis and poor detection effect in the prior art is solved, and more efficient and accurate epilepsy detection is achieved.
Patent Information
- Application Number
- CN202510109871.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has problems in the diagnosis of epilepsy that it consumes a lot of time, relies on doctors’ subjective judgment, poor detection results, and inability to fully demonstrate the airspace characteristics of EEG signals.
The epilepsy detection method based on Riemann manifold-based multi-scale Riemann geometry and multi-scale convolutional neural network is used to construct the covariance matrix through phase space reconstruction technology, and the feature matrix distribution is optimized using the GFFDA algorithm, and the convolutional neural network combined with attention mechanism is used to detect epilepsy signals.
This method reduces the number of parameters and calculation costs, improves the accuracy and efficiency of detection, can more comprehensively analyze brain activity status, and enhances the ability to recognize epilepsy.
Smart Images

Figure CN119939355A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of biomedical signals, and in particular relates to an epilepsy detection method based on Riemann manifold. Background Art
[0002] Epilepsy is a very common neurological disease, mainly caused by sudden abnormal discharges of brain neurons. The manifestations of epilepsy are rich and varied. The most typical one is that the patient will lose consciousness without any signs, and the whole body and limbs will twitch violently and uncontrollably, and foam will come out of the mouth. However, there are also relatively milder seizures such as short-term absence seizures, in which the patient may have dull eyes and no response to the outside world, or only local muscles will twitch rapidly.
[0003] In the diagnosis of epilepsy, electroencephalogram (EEG) is a crucial basis, which clearly reflects the state of the brain. However, in current clinical diagnosis and treatment, doctors can only rely on visual inspection of patients' EEG recording signals in most cases. This traditional inspection method has many defects. On the one hand, the inspection process is extremely time-consuming, which may cause the diagnosis of the disease to miss the best time. On the other hand, the results of visual inspection depend to a large extent on the doctor's subjective judgment and personal experience. In this way, the accuracy and stability of the diagnosis results are difficult to be effectively guaranteed. At present, most of the literature is based on the extraction of limited features of EEG signals or the use of machine learning algorithms, but such methods are time-consuming and have poor detection effects, and cannot fully represent the spatial characteristics of EEG signals.
[0004] At present, most scholars design related solutions mainly based on multi-channel EEG signals, either manually extracting effective features or using deep neural networks. For example, statistical features such as sample entropy and fractal dimension are obtained through wavelet decomposition and empirical mode decomposition, or feature models are constructed based on signal and label information with the help of convolutional neural networks and recurrent neural networks. However, these methods have obvious shortcomings. They are time-consuming and labor-intensive, difficult to operate, and cannot fully display the spatial characteristics of EEG signals.
[0005] In recent years, the use of Riemannian manifold geometry tools to analyze and process EEG signals has gradually become a research hotspot. The covariance matrix, as a form that reflects the second-order statistical characteristics of the signal, is a symmetric positive definite matrix in the Riemannian manifold space. Therefore, with the help of Riemannian geometry tools, we can deeply study EEG signal sequences and explore the potential structural information in high-dimensional space. In 2021, Gao Yuntu and others first used wavelet packet transform to extract time-frequency domain information and construct an enhanced symmetric positive definite matrix. Then they used the affine invariant Riemannian metric to design a bilinear dimensionality reduction algorithm to reduce the sample dimension, and then performed tangent space mapping on the reduced symmetric positive definite matrix. Finally, they used a support vector machine to complete emotion monitoring. This method can also be analogous to epilepsy monitoring. However, this method has problems including: the affine invariant Riemannian metric is computationally inefficient and prone to overfitting, which greatly reduces the accuracy of epilepsy monitoring. Summary of the invention
[0006] In order to solve the above problems, the present invention proposes an epilepsy detection method based on Riemann manifold. The operation of the present invention reduces the number of parameters and the computational cost. At the same time, the current epilepsy detection method based on multi-scale Riemannian geometry and multi-scale convolutional neural network is relatively less particular. Compared with the traditional signal processing combined with classifier algorithm, this method is more promising and efficient. Specifically, it includes the following steps:
[0007] S01. Collect multi-channel EEG signals through EEG equipment, collect different EEG signals according to the three human states of the subjects, and obtain corresponding label information;
[0008] S02, using a sliding window method for the EEG signal of each channel to expand and obtain individual EEG signal data;
[0009] S03 constructs a recognizable covariance matrix based on EEG signal data using phase space reconstruction technology;
[0010] S04, using GFFDA algorithm to make SPD matrices of the same category more clustered and SPD matrices of different categories farther apart;
[0011] S05. Obtaining the spatiotemporal characteristics corresponding to the three human body states through the covariance matrix;
[0012] S06, inputting n EEG signal data into a convolutional neural network with an attention mechanism to extract features corresponding to the three human body states;
[0013] S07. Connect the features extracted by the two methods and input them into the fully connected layer to complete epileptic signal detection through the attention mechanism.
[0014] As a preferred embodiment of the present invention, in S01, the three human body states include a normal period, an inter-onset period and an onset period.
[0015] As a preferred embodiment of the present invention, in S02, the window length l and the step length s are set to obtain the start and end positions of the time window in the original signal T, and the start position index is
[0016] s×(n-1),
[0017] Then the end position index is s×(n-1)+1, n=1,2,3,…,
[0018] Where n = 1, 2, 3, ... is the window index, and the original signal T is divided into T1, T2, T3, ..., T n , at this time, the step size s is set to half the window length, that is,
[0019] s = 1 / 2,
[0020] Enables scaling of data while reducing overall computational workload.
[0021] As a preferred embodiment of the present invention, in S03, the covariance matrix feature describes the information of the separability of brain states, and is located in a high-dimensional symmetric positive definite matrix space. The covariance operation is performed on the new signal sample to obtain a symmetric positive definite matrix, which is expressed as
[0022]
[0023] Where N is the EEG signal in the ith channel. Figure 1 The length of the time period, X=(X1,X2,…,X c ) is a multivariate phase space reconstruction.
[0024] As a preferred embodiment of the present invention, in S04, the covariance matrix of the filtered EEG is obtained by the PSR method, which is used as a feature descriptor, and the GFFDA algorithm is used to enhance the class-related information, and the irrelevant information of the SPD matrix in the Riemann manifold is discarded. The SPD matrix in the Riemann manifold is obtained as follows:
[0025]
[0026] in is the SPD matrix in the Riemannian manifold. is the discriminant feature vector reconstructed in the vector space, C m is the Riemannian geometric mean, which is the symmetric positive definite matrix that minimizes the sum of squared Riemann geodesic distances over all symmetric positive definite (SPD) matrices.
[0027] As a preferred implementation of the present invention, in S05, the characteristics corresponding to the three human body states of normal period, inter-onset period and onset period are obtained through the covariance matrix.
[0028] As a preferred embodiment of the present invention, in S06, the steps of extracting the features corresponding to the three human body states are as follows:
[0029] S061. Through the Reshape layer, the time window T n Rearrange the dimensions and change the original data dimensions from (1, C, S) to (C, 1, S), where C is the number of channels and S is the number of sampling points that matches the input size of the time window and channel convolution;
[0030] S062, use F1=44 1×1 channel conversion layers to increase the data dimension and obtain the spatial characteristics of the EEG signal, and then use the batch normalization layer to further stabilize the data distribution and accelerate model training. Then input the feature map into the multi-scale time convolution layer;
[0031] S063. Use m convolution kernels of different sizes to further extract the spatial and temporal features of EEG signals of different frequencies, input them into the BN layer for splicing, and through the attention mechanism, obtain a multi-dimensional EEG feature map with attention weights.
[0032] As a preferred embodiment of the present invention, in S07, the spatiotemporal features extracted from the window created by the two methods are connected and input into the fully connected layer, and finally the epilepsy signal detection is completed through the attention mechanism.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention combines the covariance matrix of multi-channel EEG epilepsy signals to characterize the state of the brain with a multi-scale convolutional neural network. In constructing the covariance matrix, PSR (phase space reconstruction) constructs an effective feature descriptor to extract high-dimensional feature information, which can construct high-dimensional data from a one-dimensional EEG and extract its intrinsic and hidden intrinsic dynamic feature information, which helps to analyze the state of brain activity more comprehensively and in-depth, and increases the information dimension that can be used for analysis. The GFFDA algorithm optimizes the distribution of the feature matrix. In the Riemann manifold, the SPD matrices of the same category are more clustered, and the SPD matrices of different categories are farther apart, which improves the classification accuracy. At the same time, multi-scale Riemannian geometry is used to solve the two problems of operating frequency change and noise interference to the greatest extent; a multi-scale convolutional neural network is used to minimize the impact of noise and extreme values on the signal. The combination of the two results in a more accurate detection model.
[0035] The specific implementation modes of the present invention are further described in detail below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In the attached picture:
[0037] Figure 1 A flow chart of an epilepsy detection method based on Riemann manifold of the present invention;
[0038] Figure 2 is an overall flow chart of an epilepsy detection method based on Riemann manifold of the present invention;
[0039] Figure 3 It is a multi-scale Riemannian geometry direction flow chart of an epilepsy detection method based on Riemannian manifold of the present invention;
[0040] Figure 4 It is a multi-scale convolutional neural network directional flow chart of an epilepsy detection method based on Riemann manifold of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The following embodiments are used to illustrate the present invention.
[0042] Example 1
[0043] like Figure 1-Figure 4 As shown, an epilepsy detection method based on Riemann manifold of the present invention comprises the following steps:
[0044] S01. Collect multi-channel EEG signals through EEG equipment, collect different EEG signals according to the three human states of the subjects, and obtain corresponding label information;
[0045] The three human body states include normal period, inter-illness period and onset period.
[0046] S02, using a sliding window method for the EEG signal of each channel to expand and obtain individual EEG signal data;
[0047] The sliding window method is used for the EEG signal of each channel to expand the EEG signal data. Based on the EEG signal data, the phase space reconstruction (PSR) technology is used to construct a covariance matrix with recognition. The specific steps include:
[0048] By setting the window length and step size, we can get the start and end positions of the time window in the original signal. The start position index is
[0049] s×(n-1),
[0050] Then the end position index is s×(n-1)+1, n=1,2,3,…,
[0051] Where n = 1, 2, 3, ... is the window index, and the original signal T is divided into T1, T2, T3, ..., T n, at this time, the step size s is set to half the window length, that is,
[0052] s = 1 / 2,
[0053] Enables scaling of data while reducing overall computational workload.
[0054] S03 constructs a recognizable covariance matrix based on EEG signal data using phase space reconstruction technology;
[0055] The specific construction steps are as follows:
[0056] N is the EEG signal in the ith channel Figure 1 The length of the period. Assume:
[0057] X i =[a i,1 a i,2 a a,3 …a i,N ] T ,
[0058] Where i = 1, 2, 3, ..., c, representing the vector of the EEG during this period.
[0059] L is the total number of state vectors in phase space. m is the embedding dimension. d is the time delay.
[0060] L = N-(m-1)d,
[0061] set up:
[0062] X i,j =[a i,j a i,j+d …a i,j+(m-1)d ] T for i=1,2,…,c,j=1,2,…,L,
[0063] represents an m-dimensional phase space state vector, where two consecutive vectors are related by a unit delay. Here, each EEG segment is mapped to a higher-dimensional phase space state vector by embedding dimension m and time delay d. The transformation between two consecutive vectors characterizes the nonlinear dynamic characteristic information of the EEG segment in the sympathetic nervous system.
[0064] set up:
[0065] X i =[x i,1 x i,2 …x i,L ] T for i=1,2,…,c and
[0066] X=[X1,X2,…,X2],
[0067] X=[X1,X2,…,X c ] is a multivariate phase space reconstruction. The covariance matrix features describe the information of the separability of brain states and are located in a high-dimensional symmetric positive definite matrix space. The covariance operation is performed on the new signal sample to obtain a symmetric positive definite matrix, which is expressed as
[0068]
[0069] This is a single channel EEG or multi-channel EEG Figure 1 The spatial covariance matrix of the time period. The covariance matrices are in the symmetric positive definite (SPD) matrix space. They are also in the Riemannian manifold and are used as feature descriptors to describe single channel EEG or multi-channel EEG for epileptic seizure classification.
[0070] S04, using GFFDA algorithm to make SPD matrices of the same category more clustered and SPD matrices of different categories farther apart;
[0071] The specific steps include:
[0072] S041、Set is a vector in the vector space defined by the covariance matrix constructed based on the jth period of the i-th type of EEG, N i is the total number of EEG periods of the ith type, μ i is the mean of these vectors in the i-th class, K is the total number of classes, μ
[0073] is the mean of these mean vectors. Let Z ω and Z b They are the intra-class discrete matrix and inter-class discrete matrix of these vectors respectively. They are defined as:
[0074]
[0075] S042. Let W∈R n(n+1) / 2×K is the transformation matrix. T Z b W and w T Z w W is related to the inter-class discrete matrix and the intra-class discrete matrix respectively. Obviously, it is more inclined to maximize the norm of the inter-class discrete matrix and minimize the norm of the intra-class discrete matrix. Therefore, the goal of Fisher Linear Discriminant Analysis (Fisher LDA) is to find W so that (W w Z w W) -1 With w T Z b The norm of the product W is the smallest. Assume:
[0076]
[0077] Now the design of W becomes: find the minimum value of J(W) within the range of W:
[0078]
[0079] S043, through The solution to this optimization problem can be easily found by performing eigendecomposition. Then, the discriminative eigenvectors can be calculated. Let A be the reconstruction matrix, which is obtained by minimizing the following least squares loss function:
[0080]
[0081] It can be proved that:
[0082] A=W(W T W) -1 ,
[0083] S044. Use A to reconstruct the n(n+1) / 2 dimensional vector. Assume:
[0084]
[0085] is the discriminant feature vector reconstructed in the vector space. Assume:
[0086]
[0087] is a matrix in the tangent space. Finally, they are projected back to the symmetric positive definite (SPD) matrix in the Riemann manifold. That is:
[0088]
[0089] S05. Obtaining the spatiotemporal characteristics corresponding to the three human body states through the covariance matrix;
[0090] S06, inputting n EEG signal data into a convolutional neural network with an attention mechanism to extract features corresponding to the three human body states;
[0091] S061. Through the Reshape layer, the time window T n Rearrange the dimensions and change the original data dimensions from (1, C, S)
[0092] Change to (C, 1, S), where C = 22 is the number of channels and S = 750 is the number of sampling points in the time window that matches the input size of the channel convolution.
[0093] S062. Use F1=44 1×1 channels to increase the data dimension and obtain the spatial characteristics of the EEG signal. Then use the BN layer to further stabilize the data distribution and accelerate model training. Then input the feature map into the multi-scale temporal convolution layer.
[0094] S063. Use m convolution kernels of different sizes to further extract the spatial and temporal features of EEG signals of different frequencies, and input them into the BN layer for splicing and through the attention mechanism.
[0095] S07. Connect the features extracted by the two methods and input them into the fully connected layer to complete epileptic signal detection through the attention mechanism.
[0096] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0097] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0098] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0099] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0100] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0101] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0102] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0103] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
[0104] The above is only a preferred implementation case of the present disclosure. Although the present disclosure is described in conjunction with the accompanying drawings, the purpose is not to limit the present disclosure. For those skilled in the art, the present disclosure may have various changes and modifications. Any modification, replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for detecting epilepsy based on Riemannian manifold, characterized in that: The following steps are involved: S01. Collect multi-channel EEG signals through EEG equipment, collect different EEG signals according to the three human states of the subjects, and obtain corresponding label information; S02, using a sliding window method for the EEG signal of each channel to expand and obtain individual EEG signal data; S03. Based on the EEG signal data, a phase space reconstruction technique is used to construct a covariance matrix with recognition; S04, using GFFDA algorithm to make SPD matrices of the same category more clustered and SPD matrices of different categories farther apart; S05. Obtaining the spatiotemporal characteristics corresponding to the three human body states through the covariance matrix; S06, inputting n EEG signal data into a convolutional neural network with an attention mechanism to extract features corresponding to the three human body states; S07. Connect the features extracted by the two methods and input them into the fully connected layer to complete epileptic signal detection through the attention mechanism.
2. The epilepsy detection method based on Riemann manifold according to claim 1, characterized in that: In S01, the three human body states include normal period, inter-onset period and onset period.
3. The epilepsy detection method based on Riemann manifold according to claim 1, characterized in that: In S02, the window length l and the step length s are set to obtain the start and end positions of the time window in the original signal T, and the start position index is s×(n-1). Then the end position index is s×(n-1)+1, n=1,2,3,…, Where n = 1, 2, 3, ... is the window index, and the original signal T is divided into T1, T2, T3, ..., T n , at this time, the step size s is set to half the window length, that is, s=l / 2, Enables scaling of data while reducing overall computational workload.
4. The epilepsy detection method based on Riemann manifold according to claim 1, characterized in that: In S03, the covariance matrix feature describes the information of the separability of brain states and is located in a high-dimensional symmetric positive definite matrix space. The covariance operation is performed on the new signal sample to obtain a symmetric positive definite matrix, which is expressed as Where N is the length of one period of EEG in the ith channel, X = (X1, X2, ..., X c ) is a multivariate phase space reconstruction.
5. The epilepsy detection method based on Riemann manifold according to claim 1, characterized in that: In S04, the covariance matrix of the filtered EEG is obtained by the PSR method, which is used as a feature descriptor, and the GFFDA algorithm is used to enhance class-related information and discard irrelevant information of the SPD matrix in the Riemann manifold. The SPD matrix in the Riemann manifold is obtained as follows: in is the SPD matrix in the Riemannian manifold. is the discriminant feature vector reconstructed in the vector space, C m is the Riemannian geometric mean, which is the symmetric positive definite matrix that minimizes the sum of squared Riemann geodesic distances over all symmetric positive definite (SPD) matrices.
6. The epilepsy detection method based on Riemann manifold according to claim 1, characterized in that: In S05, the features corresponding to the three human body states of normal period, inter-onset period and onset period are obtained through the covariance matrix.
7. The epilepsy detection method based on Riemann manifold according to claim 1, characterized in that: In S06, the steps of extracting the features corresponding to the three human body states are as follows: S061. Through the Reshape layer, the time window T n Rearrange the dimensions and change the original data dimensions from (1, C, S) to (C, 1, S), where C is the number of channels and S is the number of sampling points that matches the input size of the time window and channel convolution; S062, use F1=44 1×1 channel conversion layers to increase the data dimension and obtain the spatial characteristics of the EEG signal, and then use the batch normalization layer to further stabilize the data distribution and accelerate model training. Then input the feature map into the multi-scale time convolution layer; S063. Use m convolution kernels of different sizes to further extract the spatial and temporal features of EEG signals of different frequencies, input them into the BN layer for splicing, and through the attention mechanism, obtain a multi-dimensional EEG feature map with attention weights.
8. The epilepsy detection method based on Riemann manifold according to claim 1, characterized in that: In S07, the spatiotemporal features extracted from the window created by the two methods are connected and input into the fully connected layer, and finally the epilepsy signal detection is completed through the attention mechanism.
Citation Information
Patent Citations
Epileptic seizure prediction method based on dynamic multi-scale space-time attention network
CN119055256A