Electroencephalogram signal classification and identification method and system, computer and storage medium
By constructing Riemann space, correcting the feature matrix and adopting nuclear mapping methods, the problem of low classification accuracy of EEG signals in the prior art is solved, and higher quality feature descriptions and more accurate classification and identification results are achieved.
Patent Information
- Application Number
- CN202510096435.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-02-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the accuracy of EEG signal classification is low, which is mainly due to the neglect of spatial correlation and nonlinear characteristics of EEG signal, resulting in incomplete feature information.
By calculating the covariance matrix of the EEG signal, a Riemann space is constructed, and the sample points are corrected using the Riemann distance sets the filter threshold. The kernel mapping method is used to convert the corrected feature matrix into an infinite-dimensional feature matrix, and the feature mapping process is performed to obtain a high-dimensional EEG signal feature matrix and input it to the classifier for classification processing.
This method can better characterize the complex geometric features of EEG signal data, remove noise and abnormal data, retain more valuable feature information for classification, and improve data quality and classification accuracy.
Smart Images

Figure CN119538080A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electroencephalogram (EEG) signal technology, and in particular to an EEG signal classification and recognition method, system, computer and storage medium. Background Art
[0002] Brain-computer interface refers to a direct connection between the human or animal brain and an external device to achieve information exchange between the brain and the device. Its mechanism of action is to bypass peripheral nerves and muscles and directly establish a new communication and control channel between the brain and the external device. It achieves information transmission and control by capturing brain signals and converting them into electrical signals.
[0003] In the existing technology, traditional EEG signal classification usually classifies and identifies the types of EEG signals by extracting time domain or frequency domain features, ignoring the spatial correlation and nonlinear characteristics of EEG signals, resulting in incomplete feature information and affecting classification accuracy. Summary of the invention
[0004] In view of the deficiencies in the prior art, the purpose of the present invention is to provide an EEG signal classification and recognition method, system, computer and storage medium, aiming to solve the technical problem of low classification accuracy in the prior art.
[0005] In order to achieve the above object, in a first aspect, the present invention provides: a method for classifying and identifying EEG signals, comprising the following steps: Acquire EEG signals, and calculate the covariance matrix corresponding to each of the EEG signals, wherein the EEG signals include a reference EEG signal at a previous acquisition time and a target EEG signal at a current acquisition time; Constructing a Riemann space based on the covariance matrix corresponding to the sample points corresponding to the target EEG signal and the reference points corresponding to the reference EEG signal respectively; A filtering threshold is set based on the Riemann distance corresponding to each of the reference points, so as to correct the sample points based on the filtering threshold to obtain a corrected feature matrix; The modified feature matrix is converted into an infinite-dimensional feature matrix by using a kernel mapping method, and the infinite-dimensional feature matrix is subjected to feature mapping processing to obtain a high-dimensional EEG signal feature matrix; The EEG signal feature matrix is input into a classifier for classification processing to output a prediction recognition result corresponding to the EEG signal.
[0006] According to one aspect of the above technical solution, the step of inputting the EEG signal feature matrix into a classifier for classification processing specifically includes: Build a classifier based on the nearest neighbor classification algorithm; In the offline training stage of the classifier, the Riemannian geometric center is calculated according to the label of each training sample, wherein the training samples include resting state samples and task state samples; All training samples are aligned to the reference matrix with the reference matrix corresponding to the resting state sample as the center, and then the Riemann distance of each training sample to the Riemann geometry center is calculated as the feature for classification; In the online detection stage of the classifier, the reference matrix is updated, and each of the EEG signal feature matrices is aligned to the reference matrix with the updated reference matrix as the center; Classification processing is performed on each EEG signal feature matrix based on the classifier.
[0007] According to one aspect of the above technical solution, the calculation expression of the Riemann geometric center of each training sample is: ; In the formula, is the Riemannian geometric center of the s-th training sample, is the i-th training sample, j is the number of training samples, is the weight value of the i-th training sample, for and The square of the Riemann distance between is the variable value of the center of Riemann geometry; The calculation expression of the reference matrix is: ; In the formula, is the reference matrix, is the Riemannian geometric center of the resting state sample; The calculation expression for classifying each EEG signal feature matrix based on the classifier is: ; ; is the category value of the EEG signal feature matrix output by the classifier, is the EEG signal feature matrix aligned with the updated reference matrix as the center, is the updated reference matrix, is the EEG signal feature matrix, is the Riemann distance between the EEG signal feature matrix aligned with the updated reference matrix as the center and the Riemannian geometric center of the s-th training sample.
[0008] According to one aspect of the above technical solution, a filtering threshold is set based on the Riemann distance corresponding to each of the reference points, and the sample points are corrected based on the filtering threshold. The step of obtaining a corrected feature matrix specifically includes: The filtering threshold is set based on the mean and standard deviation of the Riemann distance corresponding to each of the reference points: Selecting sample points whose Riemann distance between the reference point and the sample point is greater than the filtering threshold for correction to obtain a corrected feature matrix; The calculation expression of the filtering threshold is as follows: ; ; ; In the formula, is the filtering threshold, To correct the mean of the Riemann distance between the sample points and the reference points in the feature matrix, To correct the standard deviation of the Riemann distance between the sample point and the reference point in the feature matrix, To adapt the parameters, is the mean of the Riemann distances between the reference point and the initial reference point, is the standard deviation of the Riemann distance between the reference point and the initial reference point, and d is the Riemann distance between the sample point and the reference point in the modified feature matrix.
[0009] According to one aspect of the above technical solution, the step of converting the modified feature matrix into an infinite-dimensional feature matrix by using a kernel mapping method specifically includes: Based on the following calculation formula, the kernel mapping method is used to transform the modified feature matrix into an infinite-dimensional feature matrix through the kernel function: ; In the formula, is the covariance between two features in the infinite-dimensional feature matrix, is the sample size, is the kernel function of the infinite-dimensional mapping, To correct the characteristic elements in the characteristic matrix, is the transformation matrix and T is the transpose symbol.
[0010] According to one aspect of the above technical solution, the step of performing feature mapping processing on the infinite-dimensional feature matrix to obtain a high-dimensional EEG signal feature matrix specifically includes: Obtaining a kernel matrix of the infinite-dimensional feature matrix by kernel function calculation; The infinite-dimensional feature matrix is subjected to feature mapping processing based on the kernel matrix to obtain a high-dimensional electroencephalogram signal feature matrix.
[0011] According to one aspect of the above technical solution, the expression of the EEG signal feature matrix is: ; In the formula, is the covariance between two features in the EEG signal feature matrix, is the mapping transformation function, is the characteristic element in the infinite-dimensional characteristic matrix; The calculation expression of the mapping transformation function is: ; Where l is the number of eigenvectors, is a diagonal matrix composed of the first m largest eigenvalues in the infinite-dimensional feature matrix, m is the characteristic dimension value of the EEG signal feature matrix, and U is an m*l matrix composed of the eigenvectors corresponding to the eigenvalues. is the kernel function corresponding to the mapping transformation, x represents the feature vector that needs to be mapped and transformed, is the eigenvector of the feature point in the kernel matrix.
[0012] In a second aspect, the present invention provides an EEG signal classification and recognition system, comprising: An acquisition module, used to acquire EEG signals and calculate the covariance matrix corresponding to each of the EEG signals, wherein the EEG signals include a reference EEG signal at a previous acquisition time and a target EEG signal at a current acquisition time; A Riemann space module, used to construct a Riemann space based on the covariance matrix corresponding to the sample points corresponding to the target EEG signal and the reference points corresponding to the reference EEG signal; A correction module, used for setting a filtering threshold based on the Riemann distance corresponding to each of the reference points, so as to correct the sample points based on the filtering threshold to obtain a corrected feature matrix; A high-dimensional feature module, used for converting the modified feature matrix into an infinite-dimensional feature matrix by adopting a kernel mapping method, and performing feature mapping processing on the infinite-dimensional feature matrix to obtain a high-dimensional EEG signal feature matrix; The prediction module is used to input the EEG signal feature matrix into a classifier for classification processing to output the prediction recognition result corresponding to the EEG signal.
[0013] According to one aspect of the above technical solution, the prediction module is specifically used for: Build a classifier based on the nearest neighbor classification algorithm; In the offline training stage of the classifier, the Riemannian geometric center is calculated according to the label of each training sample, wherein the training samples include resting state samples and task state samples; All training samples are aligned to the reference matrix with the reference matrix corresponding to the resting state sample as the center, and then the Riemann distance of each training sample to the Riemann geometry center is calculated as the feature for classification; In the online detection stage of the classifier, the reference matrix is updated, and each of the EEG signal feature matrices is aligned to the reference matrix with the updated reference matrix as the center; Classification processing is performed on each EEG signal feature matrix based on the classifier.
[0014] According to one aspect of the above technical solution, the correction module is specifically used for: The filtering threshold is set based on the mean and standard deviation of the Riemann distance corresponding to each of the reference points: Selecting sample points whose Riemann distance between the reference point and the sample point is greater than the filtering threshold for correction to obtain a corrected feature matrix; The calculation expression of the filtering threshold is as follows: ; ; ; In the formula, is the filtering threshold, To correct the mean of the Riemann distance between the sample points and the reference points in the feature matrix, To correct the standard deviation of the Riemann distance between the sample point and the reference point in the feature matrix, To adapt the parameters, is the mean of the Riemann distances between the reference point and the initial reference point, is the standard deviation of the Riemann distance between the reference point and the initial reference point, and d is the Riemann distance between the sample point and the reference point in the modified feature matrix.
[0015] According to one aspect of the above technical solution, the high-dimensional feature module is specifically used for: Based on the following calculation formula, the kernel mapping method is used to transform the modified feature matrix into an infinite-dimensional feature matrix through the kernel function: ; In the formula, is the covariance between two features in the infinite-dimensional feature matrix, is the sample size, is the kernel function of the infinite-dimensional mapping, To correct the characteristic elements in the characteristic matrix, is the transformation matrix and T is the transpose symbol.
[0016] According to one aspect of the above technical solution, the high-dimensional feature module is further used to: obtain a kernel matrix of the infinite-dimensional feature matrix by kernel function calculation; The infinite-dimensional feature matrix is subjected to feature mapping processing based on the kernel matrix to obtain a high-dimensional electroencephalogram signal feature matrix.
[0017] In a third aspect, the present invention also provides a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for classifying and identifying EEG signals as described in the above technical solution is implemented.
[0018] In a fourth aspect, the present invention further provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the method for classifying and identifying EEG signals as described in the above technical solution is implemented.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: by constructing the Riemann space through the covariance matrix, the complex geometric features such as the manifold structure of the EEG signal data can be better characterized, and the real relationship between the data can be more accurately reflected. At the same time, the filtering threshold is set by using the Riemann distance corresponding to the reference point to correct the sample point, which can more effectively remove noise and abnormal data, retain feature information that is more valuable for classification, and improve data quality. The kernel mapping method is used to convert the corrected feature matrix into an infinite-dimensional feature matrix, and then feature mapping processing is performed to obtain a high-dimensional EEG signal feature matrix, which can enhance the feature expression ability and enable the features of the EEG signal to be described more comprehensively and accurately, thereby improving the accuracy of the prediction and recognition results. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flowchart of the method for classifying and identifying EEG signals in the first embodiment of the present invention; Figure 2 It is a structural block diagram of the EEG signal classification and recognition system in the second embodiment of the present invention; Figure 3 is a schematic diagram of the hardware structure of a computer in a third embodiment of the present invention; The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0021] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0022] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0024] Embodiment 1 See also Figure 1 , which is a flow chart of the method for classifying and identifying EEG signals in the first embodiment of the present invention. As shown in the figure, the method includes the following steps: Step S100, acquiring EEG signals, and calculating the covariance matrix corresponding to each of the EEG signals, wherein the EEG signals include a reference EEG signal at a previous acquisition time, and a target EEG signal at a current acquisition time.
[0025] Step S200, constructing a Riemann space based on the covariance matrix corresponding to the sample points corresponding to the target EEG signal and the reference points corresponding to the reference EEG signal. By constructing the Riemann space, the EEG signal is represented as a point on the Riemann manifold, and the nonlinear characteristics of the EEG signal can be expressed and classified by calculating the distance between different points.
[0026] Step S300, setting a filtering threshold based on the Riemann distance corresponding to each of the reference points, so as to correct the sample points based on the filtering threshold to obtain a corrected feature matrix.
[0027] Specifically, in this embodiment, the step of setting the filtering threshold based on the Riemann distance corresponding to each reference point to correct the sample point based on the filtering threshold to obtain the corrected feature matrix specifically includes: The filtering threshold is set based on the mean and standard deviation of the Riemann distance corresponding to each of the reference points: Selecting sample points whose Riemann distance between the reference point and the sample point is greater than the filtering threshold for correction to obtain a corrected feature matrix; The calculation expression of the filtering threshold is as follows: ; ; ; In the formula, is the filtering threshold, To correct the mean of the Riemann distance between the sample points and the reference points in the feature matrix, To correct the standard deviation of the Riemann distance between the sample point and the reference point in the feature matrix, To adapt the parameters, is the mean of the Riemann distances between the reference point and the initial reference point, is the standard deviation of the Riemann distance between the reference point and the initial reference point, and d is the Riemann distance between the sample point and the reference point in the modified feature matrix. The above-mentioned adaptation parameter is used to balance the stability of the filter threshold and the sensitivity to the new signal features. In this embodiment, its value is preferably 0.01. By using the EEG signal features obtained at the previous acquisition time to set the filter threshold to correct the sample points, abnormal data such as noise and artifacts can be more effectively removed, and feature information that is more valuable for classification can be retained, thereby improving classification accuracy.
[0028] Step S400: using a kernel mapping method to convert the corrected feature matrix into an infinite-dimensional feature matrix, performing feature mapping processing on the infinite-dimensional feature matrix to obtain a high-dimensional EEG signal feature matrix.
[0029] Specifically, in this embodiment, the step of converting the modified feature matrix into an infinite-dimensional feature matrix by using a kernel mapping method specifically includes: Based on the following calculation formula, the kernel mapping method is used to transform the modified feature matrix into an infinite-dimensional feature matrix through the kernel function: ; In the formula, is the covariance between two features in the infinite-dimensional feature matrix, is the sample size, is the kernel function of the infinite-dimensional mapping, To correct the characteristic elements in the characteristic matrix, is the transformation matrix and T is the transpose symbol.
[0030] The step of performing feature mapping processing on the infinite-dimensional feature matrix to obtain a high-dimensional EEG signal feature matrix specifically includes: Obtaining a kernel matrix of the infinite-dimensional feature matrix by kernel function calculation; The infinite-dimensional feature matrix is subjected to feature mapping processing based on the kernel matrix to obtain a high-dimensional electroencephalogram signal feature matrix.
[0031] The expression of the EEG signal feature matrix is: ; In the formula, is the covariance between two features in the EEG signal feature matrix, is the mapping transformation function, is the characteristic element in the infinite-dimensional characteristic matrix; The calculation expression of the mapping transformation function is: ; Where l is the number of eigenvectors, is a diagonal matrix composed of the first m largest eigenvalues in the infinite-dimensional feature matrix, m is the characteristic dimension value of the EEG signal feature matrix, and U is an m*l matrix composed of the eigenvectors corresponding to the eigenvalues. is the kernel function corresponding to the mapping transformation, x represents the feature vector that needs to be mapped and transformed, is the eigenvector of the feature point in the kernel matrix.
[0032] The kernel function of the infinite-dimensional mapping is mainly used to achieve the transition from a lower dimension (the dimension of the modified feature matrix) to an infinite dimension. It focuses on utilizing the nonlinear characteristics of the kernel function to expand the information contained in each sample point in the modified feature matrix in a more abstract infinite-dimensional space, thereby mining the potential feature relationship under the original finite dimension. In this embodiment, the kernel function of the infinite-dimensional mapping adopts a Gaussian kernel function, and its expression is: ; In the formula, u and v represent different sample indexes. Represents sample points , The Euclidean distance between is the bandwidth parameter of the Gaussian kernel function, and exp is an exponential function, which is a power function of a natural constant (approximately 2.71828).
[0033] The kernel function corresponding to the mapping transformation is used to extract the most valuable information for EEG signal classification from the infinite-dimensional feature matrix and convert it into high-dimensional features that can be effectively used by the classifier.
[0034] In this embodiment, the kernel function corresponding to the above mapping transformation adopts the following polynomial kernel function, which is expressed as follows: ; In the formula, Represents a sample point in infinite dimensional space and The inner product of , a is the inner product scaling parameter, c is a constant, and b is the degree of the polynomial.
[0035] Step S500: input the EEG signal feature matrix into a classifier for classification processing to output a prediction recognition result corresponding to the EEG signal.
[0036] Preferably, in this embodiment, the step of inputting the EEG signal feature matrix into a classifier for classification processing specifically includes: Step S510: construct a classifier based on the nearest neighbor classification algorithm. The principle of the nearest neighbor classification algorithm is to calculate the distance between the sample to be classified and the known category sample, and assign the sample to be classified to the category to which the nearest known category sample belongs.
[0037] Step S520, in the offline training stage of the classifier, the Riemann geometric center is calculated according to the label of each training sample, wherein the training samples include resting state samples and task state samples. The above-mentioned training samples refer to samples that have been classified, the labels refer to the identification of the category to which the training samples belong, and the resting state samples refer to the EEG signal samples collected when the individual is relaxed, quiet, and not performing specific cognitive tasks or physical movements. Task state samples are EEG signal samples collected when the individual performs specific cognitive tasks (such as memory tasks, attention concentration tasks, visual or auditory stimulation response tasks, etc.) or physical movements (such as finger movements, limb stretching, etc.).
[0038] Specifically, in this embodiment, the calculation expression of the Riemann geometric center of each training sample is: ; In the formula, is the Riemannian geometric center of the s-th training sample, is the i-th training sample, j is the number of training samples, is the weight value of the i-th training sample, for and The square of the Riemann distance between them is used to measure the distance between the training sample and the Riemannian geometry center. is the variable value of the Riemann center. The above weight value reflects the importance of each training sample corresponding to the data point in calculating the Riemann center. The larger the weight, the greater the influence of the corresponding data point on the position of the Riemann center. By finding a point as the Riemann center under the given training samples and their corresponding weights, the sum of the weighted Riemann distances from this center to each training sample is minimized.
[0039] Step S530, align all training samples to the reference matrix with the reference matrix corresponding to the resting state sample as the center, and then calculate the Riemann distance of each training sample to the Riemann geometric center as a feature for classification. Specifically, in this embodiment, s=0 represents a resting state sample, and s=1, 2, ..., S represents different types of task state samples.
[0040] The calculation expression of the above reference matrix is: ; In the formula, is the reference matrix, is the Riemannian geometric center of the resting state sample.
[0041] The calculation expression for classifying each EEG signal feature matrix based on the classifier is: ; ; is the category value of the EEG signal feature matrix output by the classifier, is the EEG signal feature matrix aligned with the updated reference matrix as the center, is the updated reference matrix, is the EEG signal feature matrix, is the Riemann distance between the EEG signal feature matrix aligned with the updated reference matrix as the center and the Riemannian geometric center of the s-th training sample.
[0042] Step S540: In the online detection stage of the classifier, the reference matrix is updated, and each of the EEG signal feature matrices is aligned to the reference matrix with the updated reference matrix as the center. (In this stage, it is a test sample). Combined with the resting state samples, the reference matrix is updated in the online detection stage to adapt to the changes in the new EEG signal data distribution and enable the classifier to better process the new data. After the update, each EEG signal feature matrix is aligned with the updated reference matrix as the center to ensure that the new data and the training data are processed in the same reference frame, so that the various features calculated based on the reference matrix are consistent and comparable.
[0043] Step S550: classify each EEG signal feature matrix based on the classifier.
[0044] In summary, the EEG signal classification and recognition method in the above-mentioned embodiment of the present invention constructs a Riemann space through the covariance matrix, which can better characterize complex geometric features such as the manifold structure of the EEG signal data, and more accurately reflect the true relationship between the data. At the same time, the Riemann distance corresponding to the reference point is used to set the filtering threshold to correct the sample point, which can more effectively remove noise and abnormal data, retain feature information that is more valuable for classification, and improve data quality. The kernel mapping method is used to convert the corrected feature matrix into an infinite-dimensional feature matrix, and then feature mapping processing is performed to obtain a high-dimensional EEG signal feature matrix, which can enhance the feature expression ability and enable the features of the EEG signal to be described more comprehensively and accurately, thereby improving the accuracy of the predicted recognition results.
[0045] Embodiment 2 The second embodiment of the present application also provides an EEG signal classification and recognition system, which is used to implement the embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the terms "module", "unit", "subunit", etc. can implement a combination of software and / or hardware of a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0046] like Figure 2 As shown, the system includes: an acquisition module 100, a Riemann space module 200, a correction module 300, a high-dimensional feature module 400 and a prediction module 500.
[0047] The acquisition module 100 is used to acquire EEG signals and calculate the covariance matrix corresponding to each of the EEG signals, wherein the EEG signals include a reference EEG signal at a previous acquisition time and a target EEG signal at a current acquisition time; The Riemann space module 200 is used to construct a Riemann space based on the sample points corresponding to the target EEG signal and the covariance matrix corresponding to the reference points corresponding to the reference EEG signal; The correction module 300 is used to set a filtering threshold based on the Riemann distance corresponding to each of the reference points, so as to correct the sample points based on the filtering threshold to obtain a corrected feature matrix; The high-dimensional feature module 400 is used to convert the modified feature matrix into an infinite-dimensional feature matrix by adopting a kernel mapping method, and perform feature mapping processing on the infinite-dimensional feature matrix to obtain a high-dimensional EEG signal feature matrix; The prediction module 500 is used to input the EEG signal feature matrix into a classifier for classification processing to output a prediction recognition result corresponding to the EEG signal.
[0048] Preferably, in this embodiment, the prediction module 500 is specifically used for: Build a classifier based on the nearest neighbor classification algorithm; In the offline training stage of the classifier, the Riemannian geometric center is calculated according to the label of each training sample, wherein the training samples include resting state samples and task state samples; All training samples are aligned to the reference matrix with the reference matrix corresponding to the resting state sample as the center, and then the Riemann distance of each training sample to the Riemann geometry center is calculated as the feature for classification; In the online detection stage of the classifier, the reference matrix is updated, and each of the EEG signal feature matrices is aligned to the reference matrix with the updated reference matrix as the center; Classification processing is performed on each EEG signal feature matrix based on the classifier.
[0049] Preferably, in this embodiment, the correction module 300 is specifically used for: The filtering threshold is set based on the mean and standard deviation of the Riemann distance corresponding to each of the reference points: Selecting sample points whose Riemann distance between the reference point and the sample point is greater than the filtering threshold for correction to obtain a corrected feature matrix; The calculation expression of the filtering threshold is as follows: ; ; ; In the formula, is the filtering threshold, To correct the mean of the Riemann distance between the sample points and the reference points in the feature matrix, To correct the standard deviation of the Riemann distance between the sample point and the reference point in the feature matrix, To adapt the parameters, is the mean of the Riemann distances between the reference point and the initial reference point, is the standard deviation of the Riemann distance between the reference point and the initial reference point, and d is the Riemann distance between the sample point and the reference point in the modified feature matrix.
[0050] Preferably, in this embodiment, the high-dimensional feature module 400 is specifically used for: Based on the following calculation formula, the kernel mapping method is used to transform the modified feature matrix into an infinite-dimensional feature matrix through the kernel function: ; In the formula, is the covariance between two features in the infinite-dimensional feature matrix, is the sample size, is the kernel function of the infinite-dimensional mapping, To correct the characteristic elements in the characteristic matrix, is the transformation matrix and T is the transpose symbol.
[0051] Preferably, in this embodiment, the high-dimensional feature module 400 is further used for: Obtaining a kernel matrix of the infinite-dimensional feature matrix by kernel function calculation; The infinite-dimensional feature matrix is subjected to feature mapping processing based on the kernel matrix to obtain a high-dimensional electroencephalogram signal feature matrix.
[0052] It should be noted that each module can be a functional module or a program module, and can be implemented by software or hardware. For modules implemented by hardware, each module can be located in the same processor; or each module can be located in different processors in any combination.
[0053] Embodiment 3 A third embodiment of the present application provides a computer, which may include a processor 81 and a memory 82 storing computer program commands.
[0054] Specifically, the processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0055] Among them, the memory 82 may include a large-capacity memory for data or commands. By way of example and not limitation, the memory 82 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 82 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 82 may be inside or outside the data processing device. In a specific embodiment, the memory 82 is a non-volatile memory. In a specific embodiment, the memory 82 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0056] The memory 82 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program commands executed by the processor 81 .
[0057] The processor 81 reads and executes the computer program commands stored in the memory 82 to implement any one of the EEG signal classification and recognition methods in the above embodiments.
[0058] In some embodiments, the computer may further include a communication interface 83 and a bus 80. Figure 3 As shown, the processor 81, the memory 82, and the communication interface 83 are connected via a bus 80 and communicate with each other.
[0059] The communication interface 83 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 83 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0060] The bus 80 includes hardware, software or both, and couples the components of the computer to each other. The bus 80 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 80 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 80 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0061] Embodiment 4 The fourth embodiment of the present application provides a readable storage medium having computer program commands stored thereon; when the computer program commands are executed by a processor, any one of the EEG signal classification and recognition methods in the above embodiments is implemented.
[0062] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0063] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for classifying and identifying electroencephalogram signals, characterized in that: The following steps are involved: Acquire EEG signals, and calculate the covariance matrix corresponding to each of the EEG signals, wherein the EEG signals include a reference EEG signal at a previous acquisition time and a target EEG signal at a current acquisition time; Constructing a Riemann space based on the covariance matrix corresponding to the sample points corresponding to the target EEG signal and the reference points corresponding to the reference EEG signal respectively; A filtering threshold is set based on the Riemann distance corresponding to each of the reference points, so as to correct the sample points based on the filtering threshold to obtain a corrected feature matrix; The modified feature matrix is converted into an infinite-dimensional feature matrix by using a kernel mapping method, and the infinite-dimensional feature matrix is subjected to feature mapping processing to obtain a high-dimensional EEG signal feature matrix; The EEG signal feature matrix is input into a classifier for classification processing to output a prediction recognition result corresponding to the EEG signal.
2. The method for classifying and identifying EEG signals according to claim 1, characterized in that: The step of inputting the EEG signal feature matrix into a classifier for classification processing specifically includes: Build a classifier based on the nearest neighbor classification algorithm; In the offline training stage of the classifier, the Riemannian geometric center is calculated according to the label of each training sample, wherein the training samples include resting state samples and task state samples; All training samples are aligned to the reference matrix with the reference matrix corresponding to the resting state sample as the center, and then the Riemann distance of each training sample to the Riemann geometry center is calculated as the feature for classification; In the online detection stage of the classifier, the reference matrix is updated, and each of the EEG signal feature matrices is aligned to the reference matrix with the updated reference matrix as the center; Classification processing is performed on each EEG signal feature matrix based on the classifier.
3. The method for classifying and identifying EEG signals according to claim 2, characterized in that: The calculation expression of the Riemann geometric center of each training sample is: ; In the formula, is the Riemannian geometric center of the s-th training sample, is the i-th training sample, j is the number of training samples, is the weight value of the i-th training sample, for and The square of the Riemann distance between is the variable value of the center of Riemann geometry; The calculation expression of the reference matrix is: ; In the formula, is the reference matrix, is the Riemannian geometric center of the resting state sample; The calculation expression for classifying each EEG signal feature matrix based on the classifier is: ; ; is the category value of the EEG signal feature matrix output by the classifier, is the EEG signal feature matrix aligned with the updated reference matrix as the center, is the updated reference matrix, is the EEG signal feature matrix, is the Riemann distance between the EEG signal feature matrix aligned with the updated reference matrix as the center and the Riemannian geometric center of the s-th training sample.
4. The method for classifying and identifying EEG signals according to claim 1, characterized in that: The step of setting a filtering threshold based on the Riemann distance corresponding to each of the reference points, and correcting the sample points based on the filtering threshold to obtain a corrected feature matrix specifically includes: The filtering threshold is set based on the mean and standard deviation of the Riemann distance corresponding to each of the reference points: Selecting sample points whose Riemann distance between the reference point and the sample point is greater than the filtering threshold for correction to obtain a corrected feature matrix; The calculation expression of the filtering threshold is as follows: ; ; ; In the formula, is the filtering threshold, To correct the mean of the Riemann distance between the sample points and the reference points in the feature matrix, To correct the standard deviation of the Riemann distance between the sample point and the reference point in the feature matrix, To adapt the parameters, is the mean of the Riemann distances between the reference point and the initial reference point, is the standard deviation of the Riemann distance between the reference point and the initial reference point, and d is the Riemann distance between the sample point and the reference point in the modified feature matrix.
5. The method for classifying and identifying EEG signals according to claim 1, characterized in that: The steps of converting the modified characteristic matrix into an infinite-dimensional characteristic matrix by using a kernel mapping method specifically include: Based on the following calculation formula, the kernel mapping method is used to transform the modified feature matrix into an infinite-dimensional feature matrix through the kernel function: ; In the formula, is the covariance between two features in the infinite-dimensional feature matrix, is the sample size, is the kernel function of the infinite-dimensional mapping, To correct the characteristic elements in the characteristic matrix, is the transformation matrix and T is the transpose symbol.
6. The method for classifying and identifying EEG signals according to claim 5, characterized in that: The step of performing feature mapping processing on the infinite-dimensional feature matrix to obtain a high-dimensional EEG signal feature matrix specifically includes: Obtaining a kernel matrix of the infinite-dimensional feature matrix by kernel function calculation; The infinite-dimensional feature matrix is subjected to feature mapping processing based on the kernel matrix to obtain a high-dimensional electroencephalogram signal feature matrix.
7. The method for classifying and identifying EEG signals according to claim 6, characterized in that: The expression of the EEG signal feature matrix is: ; In the formula, is the covariance between two features in the EEG signal feature matrix, is the mapping transformation function, is the characteristic element in the infinite-dimensional characteristic matrix; The calculation expression of the mapping transformation function is: ; Where l is the number of eigenvectors, is a diagonal matrix composed of the first m largest eigenvalues in the infinite-dimensional feature matrix, m is the characteristic dimension value of the EEG signal feature matrix, and U is an m*l matrix composed of the eigenvectors corresponding to the eigenvalues. is the kernel function corresponding to the mapping transformation, x represents the feature vector that needs to be mapped and transformed, is the eigenvector of the feature point in the kernel matrix.
8. An EEG signal classification and recognition system, characterized in that: include: An acquisition module, used to acquire EEG signals and calculate the covariance matrix corresponding to each of the EEG signals, wherein the EEG signals include a reference EEG signal at a previous acquisition time and a target EEG signal at a current acquisition time; A Riemann space module, used to construct a Riemann space based on the covariance matrix corresponding to the sample points corresponding to the target EEG signal and the reference points corresponding to the reference EEG signal; A correction module, used for setting a filtering threshold based on the Riemann distance corresponding to each of the reference points, so as to correct the sample points based on the filtering threshold to obtain a corrected feature matrix; A high-dimensional feature module, used for converting the modified feature matrix into an infinite-dimensional feature matrix by adopting a kernel mapping method, and performing feature mapping processing on the infinite-dimensional feature matrix to obtain a high-dimensional EEG signal feature matrix; The prediction module is used to input the EEG signal feature matrix into a classifier for classification processing to output the prediction recognition result corresponding to the EEG signal.
9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for classifying and identifying electroencephalogram signals according to any one of claims 1 to 7 is implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for classifying and identifying electroencephalogram signals as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Emotion recognition method and device, electronic equipment and storage medium
CN116687406A