Search

CN-121980345-A - Weight quantification sharing SNN-based motor imagery classification method and system

CN121980345ACN 121980345 ACN121980345 ACN 121980345ACN-121980345-A

Abstract

The invention discloses a motor imagery classification method and a motor imagery classification system based on weight quantification sharing SNN. And constructing an ANN based on the neural network architecture, training the ANN by using the preprocessed electroencephalogram data set, and obtaining pre-training weight and activation value distribution. And then carrying out quantization processing on the pre-training weight and the activation value through quantization perception training to construct a quantization ANN. And finally, based on the SNN and the quantized ANN, carrying out joint training through sharing the weight, and outputting a classification result through the SNN after joint training to realize motor imagery classification. The SNN obtained by conversion in the invention has the characteristics of high performance and low reasoning cost, and can accurately and rapidly realize the motor imagery classification task.

Inventors

  • MENG MING
  • SUN WEIHAO
  • GAO YUNYUAN
  • WANG TING
  • XI XUGANG

Assignees

  • 杭州电子科技大学

Dates

Publication Date
20260505
Application Date
20260120

Claims (6)

  1. 1. The motor imagery classification method based on the weight quantification sharing SNN is characterized by comprising the following steps of: Step 1, preprocessing an original electroencephalogram data set, and selecting a neural network architecture; Step 2, constructing a pulse neural network SNN based on the selected neural network architecture, wherein the pulse neurons adopt SRIF to synchronously reduce the cutting error and the asynchronous error; Step 3, constructing an ANN based on the selected neural network architecture, and training the ANN by utilizing the preprocessed electroencephalogram data set to acquire pre-training weight and activation value distribution; Step 4, carrying out quantization processing on the pre-training weight and the activation value through quantization perception training, reserving the counter-propagation capability of the quantized network, constructing a quantized ANN, and aligning the pulse neuron activation value representation; and 5, based on the SNN and the quantized ANN, carrying out combined training of the quantized ANN and the SNN through sharing weights, and outputting a classification result through the SNN after the combined training to realize motor imagery classification.
  2. 2. The motor imagery classification method based on the weight-based shared SNN according to claim 1, wherein the step 2 is specifically implemented as: step 2-1 in the first stage pulse issuing calculation, a preset time step Initial value of time membrane potential Taking and setting the threshold value of the impulse neuron to be minimum Is a half of the number of (a), Representing the first stage of pulse delivery, calculating the first stage Presynaptic membrane potential of layers Postsynaptic membrane potential Pulse output : In the formula, Is the first Layer weight, b l-1 is the first Layer bias; step 2-2, adopting the following pulse release information of accumulated preamble time steps to restrict negative pulse release, and calculating to obtain the first step Layer(s) Time of day historical membrane potential : Wherein the initial value ; Step 2-3, based on the first stage pulsing and the historical membrane potential information, in the second stage pulsing, the first stage residual membrane potential is measured And (3) inheriting, correcting a clipping error caused by clipping a pulse neuron threshold value and an asynchronous error caused by pulse emission time sequence, and outputting a final pulse: In the formula, Representing the second phase of the pulse delivery, , And Respectively the first Layer pulse neurons presynaptic membrane potential, postsynaptic membrane potential and final pulse output, Is the total time step.
  3. 3. The motor imagery classification method based on the weight quantification sharing SNN according to claim 2, wherein in the step 3, an ANN is constructed based on a selected neural network architecture, wherein nonlinear activation adopts a ReLU alignment pulse neuron nonlinear operation, the ANN is trained by utilizing a preprocessed electroencephalogram data set, and an optimization target is classified cross entropy loss, so that a pre-training weight and activation value distribution is obtained.
  4. 4. The motor imagery classification method based on the weight-based shared SNN according to claim 3, wherein the step 4 is specifically implemented as follows: Step 4-1, discretizing the activation values of each layer of the ANN by adopting uniform quantization, and limiting the quantization range to be Wherein To quantize the number of bits, get the first Layer number Activation value after individual neuron quantization The method comprises the following steps: In the middle of Is the first A clipping threshold for a layer; Is the first Layer number The raw activation values of the individual neurons; And Rounding and clipping operations, respectively; step 4-2, the ANN weight is expressed as the power sum of two to obtain the quantized product Layer number Individual neurons Layer number Weights between neurons The method comprises the following steps: In the formula, A number of powers of two, i.e., the number of bits quantized; For the size coefficients for adjusting each power of two term.
  5. 5. The motor imagery classification method based on the weight-based shared SNN according to claim 4, wherein the step 5 is specifically implemented as follows: Based on the constructed SNN and the quantized ANN, carrying out combined training of the quantized ANN and the SNN to obtain final SNN, wherein the SNN shares the quantized ANN weight before forward propagation to ensure the characterization consistency of the SNN and the quantized ANN weight, and carries out pulse issuing based on SRIF neurons in the forward reasoning process to output a classification result, and the SNN classification cross entropy loss is taken as an optimization target, and the sharing weight is updated through the microness of the quantized ANN to enable the SNN to gradually adapt to the space-time characteristics of the electroencephalogram signals to obtain the final SNN for realizing imagination classification.
  6. 6. A motor imagery classification system based on weighting and sharing SNN for implementing the motor imagery classification method according to any one of claims 1 to 5, characterized by comprising the following modules: The data processing module is used for preprocessing an original electroencephalogram data set and selecting a neural network architecture; The impulse neural network construction module is used for constructing an impulse neural network SNN based on the selected neural network architecture, wherein the impulse neural network adopts SRIF to synchronously reduce the clipping error and the asynchronous error; The quantitative ANN construction module is used for constructing an ANN based on the selected neural network architecture, training the ANN by utilizing the preprocessed electroencephalogram data set, acquiring pre-training weight and activation value distribution, carrying out quantization processing on the pre-training weight and activation value through quantization perception training, reserving counter-propagation capacity of the quantized network, constructing a quantitative ANN, and aligning pulse neuron activation value representation; and the motor imagery classification output module is used for carrying out combined training of the quantized ANN and the SNN based on the SNN and the quantized ANN through sharing weights, outputting a classification result through the SNN after the combined training, and realizing motor imagery classification.

Description

Weight quantification sharing SNN-based motor imagery classification method and system Technical Field The invention belongs to the technical field of neural networks and brains, relates to a Motor Imagery (MI) classification method by converting an Artificial Neural Network (ANN) into a pulse neural network (SNN), and particularly relates to a motor imagery classification method and a motor imagery classification system for a self-rectification pulse neural network based on weight quantification sharing, which are used for converting a trained ANN into a SNN with high performance and low reasoning cost with low error, and accurately and rapidly completing MI classification tasks. Background The development of deep learning technology promotes the wide application of ANN in various fields, especially in MI classification tasks of brain-computer interfaces, and the ANN provides key technical support for analyzing movement intention information in brain-computer signals by virtue of strong characteristic fitting capability. However, the current MI classification ANN has the defects of huge parameter quantity, high computational complexity and low reasoning speed, and severely limits the actual deployment and popularization of the MI classification ANN in portable and wearable embedded brain-computer interface devices. The SNN is used as a third-generation artificial neural network, the information coding and transmission mechanism deeply references the pulse release characteristics of biological neurons, and a discretized pulse sequence is used as a core information carrier, so that the SNN has the advantages of natural low energy consumption and event-driven calculation, can be efficiently adapted to neuromorphic hardware such as Intel Loihi and Truenorth, and provides a potential solution path for breaking through the hardware deployment bottleneck of a motor imagery classification model. However, SNN still faces a core technical challenge in the floor application of motor imagery classification tasks, wherein the SNN is limited by the discretized nature of pulse signals, gradient information in a model training process is difficult to directly calculate, and a mature back propagation algorithm in the traditional ANN cannot be directly migrated and applied, so that the SNN is a key factor for restricting the wide application of the SNN in MI classification tasks. The traditional SNN training method is mainly divided into two types, namely a direct training method based on a substituted gradient, a micro-function is used for approximating a pulse gradient, but the problems of inaccurate gradient estimation, unstable training and high calculation cost exist, and a conversion method from ANN to SNN is used for migrating the weight of the pre-trained ANN to SNN by utilizing the functional equivalence of a ReLU activation function and an integral issuing (INTEGRATE-and-Fire, IF) neuron and combining training efficiency and model performance. However, the conversion process has two key errors caused by impulse neurons, namely clipping errors and asynchronous errors, and the direct conversion of the ANN into SNN results in that the converted SNN is only a simulation of the original ANN, and the ANN is difficult to align in performance. In the prior art, the traditional impulse neuron information such as IF and LIF has limited characterization capability, is difficult to effectively reduce conversion errors, and meanwhile, lacks a collaborative optimization mechanism to enable SNN to mine own advantages on the basis of inheriting ANN performance. Therefore, there is a need to design a novel impulse neuron structure and training framework for performing an ANN-to-SNN conversion with low error, and to achieve MI classification with high performance and low inference cost. Disclosure of Invention Aiming at the problem, the invention provides a motor imagery classification method and a motor imagery classification system based on weight quantification sharing SNN aiming at the defect of SNN performance loss caused by the problem of pulse neuron errors in the conversion process of ANN to SNN, and the ANN-to-SNN method which fuses self-correction integral issuing (SELF RECTIFYING INTEGRATE-and-Fire, SRIF) neurons and training frames based on weight quantification sharing (Weighted Quantization Sharing, WQS) is used for realizing high-performance and low-reasoning cost motor imagery classification. In one aspect of the invention, a motor imagery classification method based on weight quantification sharing SNN is provided, which specifically comprises the following steps: step 1, preprocessing such as filtering, window cutting and the like is carried out on an original electroencephalogram data set to obtain preprocessed data, and a neural network architecture is selected; and 2, constructing SNN based on the selected neural network architecture, wherein the impulse neuron adopts SRIF to synchronously reduce clipping error