Search

CN-121859164-B - CNN and KAN fused electroencephalogram signal classification method, device, equipment and storage medium

CN121859164BCN 121859164 BCN121859164 BCN 121859164BCN-121859164-B

Abstract

The application discloses an electroencephalogram signal classification method, device, equipment and storage medium fusing CNN and KAN, and relates to the technical field of artificial intelligence and neural networks, wherein the method comprises the following steps: constructing a feature extraction encoder based on the first convolution block, the second convolution block and the distribution adaptation layer, constructing a nonlinear classification decoder by using the KAN layer, and cascading the feature extraction encoder and the KAN layer to form an initial electroencephalogram classification model; the method comprises the steps of constructing a mixed data set containing source domain and target domain data, combining a two-stage migration learning strategy, a spline coefficient updating strategy and a mixed dynamic grid updating strategy, training an initial model to obtain a target electroencephalogram classification model, carrying out data enhancement on multi-channel electroencephalogram data to be classified, inputting the target electroencephalogram classification model, completing feature extraction, distribution alignment and nonlinear mapping, and outputting classification results. The application can realize high-precision and stable electroencephalogram signal classification under the conditions of high noise of the electroencephalogram signal, obvious individual difference and small sample.

Inventors

  • TAN PING
  • HAN WENJIE
  • ZHANG JIYUAN
  • HUANG YONG
  • ZHOU KAIJUN
  • WANG HAIJUN
  • ZHONG HAO

Assignees

  • 湖南工商大学

Dates

Publication Date
20260512
Application Date
20260313

Claims (8)

  1. 1. An electroencephalogram signal classification method fusing CNN and KAN, which is characterized by comprising the following steps: constructing a feature extraction encoder according to the first convolution block, the second convolution block and the distribution adaptation layer; constructing a nonlinear classification decoder according to a KAN layer, wherein the KAN layer comprises a plurality of learning activation function paths based on B-splines; Constructing an initial electroencephalogram classification model according to the feature extraction encoder and the nonlinear classification decoder; constructing a mixed data set containing source domain data and target domain data, and carrying out iterative training on the initial electroencephalogram classification model according to the mixed data set, a two-stage transfer learning strategy, a spline coefficient updating strategy based on regularized ridge regression and a mixed dynamic grid updating strategy to obtain a target electroencephalogram classification model; Carrying out band-pass filtering, channel level standardization and time segment replacement enhancement on multi-channel electroencephalogram data to be classified to obtain enhanced data; Performing feature extraction, distribution alignment and nonlinear mapping on the enhanced data through the target electroencephalogram classification model to obtain a classification result; The step of constructing a mixed data set containing source domain data and target domain data, and carrying out iterative training on the initial electroencephalogram classification model according to the mixed data set, a two-stage transfer learning strategy, a spline coefficient updating strategy based on regularized ridge regression and a mixed dynamic grid updating strategy to obtain a target electroencephalogram classification model comprises the following steps: acquiring electroencephalogram data of a plurality of source domains to be tested and electroencephalogram data of a target to be tested, and preprocessing and enhancing to obtain a mixed data set, wherein the mixed data set comprises the source domain data and the target domain data; According to a first preset learning rate, a first preset batch size and a first preset training round, carrying out full-parameter updating training on the initial electroencephalogram classification model according to the source domain data to obtain a pre-training model; freezing parameters except the distribution adaptation layer in the feature extraction encoder, and performing fine tuning training on the pre-training model according to the target domain data, a second preset learning rate, a second preset batch size and a second preset training round; in the fine tuning training process, the grid nodes of the KAN layer are adjusted through a mixed dynamic grid updating strategy at preset updating rounds at intervals; In each training batch, updating spline control coefficients of the KAN layer through a spline coefficient updating strategy based on regularized ridge regression; Stopping the fine tuning training through a premature stopping strategy to obtain a target electroencephalogram classification model; the step of updating the spline control coefficients of the KAN layer in each training batch by a spline coefficient updating strategy based on regularized ridge regression comprises the steps of: In each training batch, acquiring a current feature vector batch input to the KAN layer and a target output matrix corresponding to the training batch; calculating a B spline basis function activation matrix according to the current feature vector batch and the current grid node position; Constructing a least square objective function containing an L2 regularization term, wherein the least square objective function contains a fitting error term and a regularization term; solving a normal equation corresponding to the least square objective function to obtain an updated spline control coefficient, and applying the updated spline control coefficient to the KAN layer; The normal equation is expressed as follows: Wherein, the For the updated spline control coefficients, The matrix is activated for the B-spline basis function, Is a matrix Is to be used in the present invention, For the output matrix of the object(s), Is the regression coefficient of the preset ridge, Is an identity matrix.
  2. 2. The method of claim 1, wherein constructing a feature extraction encoder from the first convolution block, the second convolution block, and the distribution adaptation layer comprises: constructing a first convolution block according to the time convolution layer, the first batch normalization layer, the depth separable convolution layer, the second batch normalization layer, the first nonlinear activation layer and the first average pooling layer; constructing a second convolution block according to the separable convolution layer, the point-by-point convolution layer, the third batch normalization layer, the second nonlinear activation layer and the second average pooling layer; Taking a one-dimensional batch normalization layer as a distribution adaptation layer, and constructing a feature extraction encoder according to the first convolution block, the second convolution block and the distribution adaptation layer; the one-dimensional batch normalization layer is expressed as follows: , Wherein, the Refers to the feature vector after normalization processing, Refers to the affine transformed output feature vector, In order to input the feature vector(s), And The mean and variance of the current batch data are respectively, Is a small constant which is a small constant, And Is a learnable affine transformation parameter.
  3. 3. The method of claim 1, wherein the step of constructing a non-linear classification decoder from the KAN layer comprises: determining input dimensions and output dimensions of a KAN layer, wherein the input dimensions correspond to the output dimensions of the feature extraction encoder, and the output dimensions correspond to the number of categories of classification tasks; Defining an activation function between each input node and each output node in the KAN layer; the activation function is expressed as follows: Wherein, the As the weight of the base function, For the linear transformation term of the base, The weights are scaled for the spline, A spline nonlinear transformation term; the base linear transformation term is represented as follows: Wherein, the For the output of the base linear transformation term, In order to input the feature vector(s), The function is activated for Sigmoid, Is a natural constant; the spline nonlinear transformation term is expressed as follows: Wherein, the For the control coefficients of the spline, As a total number of basis functions, As the number of grid intervals, Is a B spline basis function; constructing a KAN layer based on the activation function, the base linear transformation term and the spline nonlinear transformation term; And adding an output bias term after the KAN layer to obtain the nonlinear classification decoder.
  4. 4. The method of claim 1, wherein the step of performing feature extraction, distribution alignment and nonlinear mapping on the enhanced data by the target electroencephalogram classification model to obtain classification results comprises: extracting features of the enhanced data through the first convolution block to obtain space-time joint features; Extracting features of the space-time joint features through the second convolution block to obtain high-level abstract features; carrying out distribution alignment on the high-level abstract features through the distribution adaptation layer to obtain feature vectors subjected to distribution alignment; Nonlinear mapping is carried out on the feature vectors aligned by distribution through the nonlinear classification decoder, so that class probability distribution is obtained; And taking the category with the highest probability in the category probability distribution as a classification result.
  5. 5. The method according to any one of claims 1 to 4, wherein the steps of bandpass filtering, channel level normalization and time segment substitution enhancement of the multi-channel electroencephalogram data to be classified, and obtaining enhancement data include: Carrying out band-pass filtering on multi-channel electroencephalogram data to be classified through a preset filter to obtain filtered data; Z-Score standardization is respectively carried out on each channel of the filtered data to obtain standardized data; Uniformly cutting the standardized data into sub-segments with preset segment numbers along a time axis; randomly generating an index arrangement sequence, and splicing the sub-fragments according to the sequence of the index arrangement sequence to obtain time fragment replacement data; And carrying out random time shift and Gaussian noise injection on the time slice replacement data to obtain enhancement data.
  6. 6. An electroencephalogram signal classification apparatus which fuses CNN and KAN, wherein the apparatus applies the electroencephalogram signal classification method which fuses CNN and KAN according to any one of claims 1 to 5, the apparatus comprising: the encoder construction module is used for constructing a feature extraction encoder according to the first convolution block, the second convolution block and the distribution adaptation layer; A decoder construction module for constructing a nonlinear classification decoder from a KAN layer comprising a plurality of B-spline based learnable activation function paths; The model construction module is used for constructing an initial electroencephalogram classification model according to the feature extraction encoder and the nonlinear classification decoder; The model training module is used for constructing a mixed data set containing source domain data and target domain data, and carrying out iterative training on the initial electroencephalogram classification model according to the mixed data set, a two-stage migration learning strategy, a spline coefficient updating strategy based on regularized ridge regression and a mixed dynamic grid updating strategy to obtain a target electroencephalogram classification model; The data enhancement module is used for carrying out band-pass filtering, channel-level standardization and time segment replacement enhancement on multi-channel electroencephalogram data to be classified to obtain enhancement data; And the classification prediction module is used for carrying out feature extraction, distribution alignment and nonlinear mapping on the enhanced data through the target electroencephalogram classification model to obtain a classification result.
  7. 7. An electroencephalogram signal classification apparatus fusing CNN and KAN, characterized in that the apparatus comprises a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the electroencephalogram signal classification method fusing CNN and KAN as claimed in any one of claims 1 to 5.
  8. 8. A storage medium, characterized in that the storage medium is a computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the steps of the method for classifying electroencephalogram signals fusing CNN and KAN according to any one of claims 1 to 5.

Description

CNN and KAN fused electroencephalogram signal classification method, device, equipment and storage medium Technical Field The application relates to the technical field of artificial intelligence and neural networks, in particular to an electroencephalogram signal classification method, device, equipment and storage medium for fusing CNN and KAN. Background Electroencephalogram (EEG) is widely applied to the fields of Brain-computer interfaces (Brain-Computer Interface, BCI), nerve rehabilitation, epilepsy detection, cognitive state monitoring and the like as an important bioelectric signal reflecting Brain nerve activity. Among them, EEG signal classification based on motor imagery (Motor Imagery, MI) is one of the core tasks of BCI systems, whose performance directly determines the efficiency and reliability of human-machine interaction. However, EEG signals have high dimensional, non-stationary, low signal to noise ratio etc. characteristics, and are significantly affected by individual physiological differences, environmental interference, acquisition equipment etc. factors, and extremely high requirements are placed on robustness and generalization ability of classification algorithms. Currently, convolutional neural networks (e.g., EEGNet, deepConvNet) are commonly used for feature extraction. While these networks are effective in extracting spatio-temporal features, at the end of the network, the features are typically mapped to class space using a standard full connectivity layer (MLP/DENSE LAYER). MLP (Multilayer Perceptron, multi-layer perceptron) is essentially a linear weighted combination of features (with fixed ReLU, etc. activation functions), with limited function approximation capabilities, difficulty in fully mining complex nonlinear relationships in deep features, and lack of interpretability. Because of the limited calibration time of BCI systems, it is often difficult to obtain large amounts of tagged training data from a single target user. Training the deep learning model directly on small sample data of the target user is extremely prone to overfitting. Although the historical data of other users can be used for auxiliary training, the source domain (other users) and the target domain (current users) are inconsistent in data distribution due to covariate offset (Covariate Shift), and the generalization performance of the direct hybrid training model on the target users is often poor, and even negative migration occurs. Therefore, how to realize high-precision and stable electroencephalogram classification is a problem to be solved under the conditions of high noise, remarkable individual difference and small sample of the electroencephalogram. Disclosure of Invention The application aims to provide an electroencephalogram signal classification method, device, equipment and storage medium fusing CNN and KAN, and aims to solve the technical problem of realizing high-precision and stable electroencephalogram signal classification under the conditions of high noise of electroencephalogram signals, obvious individual difference and small sample. In order to achieve the above purpose, the present application provides an electroencephalogram signal classification method for fusing CNN and KAN, the method comprising: constructing a feature extraction encoder according to the first convolution block, the second convolution block and the distribution adaptation layer; constructing a nonlinear classification decoder according to a KAN layer, wherein the KAN layer comprises a plurality of learning activation function paths based on B-splines; Constructing an initial electroencephalogram classification model according to the feature extraction encoder and the nonlinear classification decoder; constructing a mixed data set containing source domain data and target domain data, and carrying out iterative training on the initial electroencephalogram classification model according to the mixed data set, a two-stage transfer learning strategy, a spline coefficient updating strategy based on regularized ridge regression and a mixed dynamic grid updating strategy to obtain a target electroencephalogram classification model; Carrying out band-pass filtering, channel level standardization and time segment replacement enhancement on multi-channel electroencephalogram data to be classified to obtain enhanced data; and carrying out feature extraction, distribution alignment and nonlinear mapping on the enhanced data through the target electroencephalogram classification model to obtain a classification result. In addition, in order to achieve the above object, the present application further provides an electroencephalogram signal classification device for fusing CNN and KAN, the device comprising: the encoder construction module is used for constructing a feature extraction encoder according to the first convolution block, the second convolution block and the distribution adaptation layer; A decoder construc