Method and device for processing EEG signals based on memristor two-dimensional collaborative learning architecture
Through the EEG signal processing method based on the memristor two-dimensional collaborative learning architecture, the accuracy and robustness of EEG signal emotion recognition are improved by using memristor hardware perturbation modeling and quantitative perception training, and the problem of insufficient adaptability of traditional methods in hardware perturbation environments is solved, and it is suitable for intelligent learning of memristor hardware platforms.
Patent Information
- Application Number
- CN202510864547.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-06-26
AI Technical Summary
The existing EEG signal processing methods lack generalization capabilities when facing different individuals and emotionally inducing conditions. The traditional convolutional neural network training method is sensitive to hardware perturbation, resulting in limited adaptability and robustness of the model in a low-precision dynamic perturbation environment. It fails to fully utilize hardware perturbation as a forward learning driver, and fails to simulate the brain information processing mechanism, making it difficult to achieve global adaptation.
The memristor-based two-dimensional collaborative learning architecture is adopted, and the frequency-time two-dimensional feature map is constructed through short-time Fourier transform, combined with memristor hardware perturbation modeling and quantitative perception training, the collaboration between local feature learning and global evolution optimization is achieved. The memristor hardware perturbation is used as the source of population variation, and optimization strategies are constructed to form a closed-loop process of local learning and global evolution.
It improves the accuracy and robustness of EEG signal emotion recognition, enhances adaptability, and can achieve stable learning in a low-precision dynamic disturbance environment, improving the adaptability and resource utilization efficiency on the memristor hardware platform.
Smart Images

Figure CN120372364B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for processing electroencephalogram (EEG) signals based on a memristor two-dimensional collaborative learning architecture. Background Art
[0002] With the rapid development of artificial intelligence (AI), the field of EEG signal processing is facing new opportunities and challenges. As an important physiological signal reflecting brain activity, EEG signals contain rich information and can be used in a wide range of applications, including emotion recognition, disease diagnosis, and brain-computer interfaces. However, traditional EEG signal processing methods face numerous limitations and struggle to meet the growing demand for these applications.
[0003] Existing machine learning-based EEG signal processing models are mostly trained and optimized on specific datasets, lacking the ability to generalize across different individuals and under different emotion-inducing conditions. When faced with new data or scenarios, model performance often degrades significantly, limiting their practical application. Furthermore, traditional convolutional neural network training methods are sensitive to inherent hardware non-idealities (such as weight quantization errors, write-read variations, and conductance fluctuations). These physical-layer perturbations accumulate during training, leading to unstable convergence and performance degradation. While existing compensation strategies can mitigate the impact of hardware errors to a certain extent, they often require the introduction of complex error correction circuits or algorithmic modules, significantly increasing system complexity and resource overhead. Consequently, traditional convolutional neural network training methods fail to fully utilize hardware perturbations as a positive learning driver. Most hardware-aware training methods treat hardware perturbations as negative factors and address them through compensation, avoidance, or masking. This approach ignores the inherent randomness and variability of hardware perturbations and fails to tap into their potential functional value in the learning process. Therefore, existing methods have limited adaptability and robustness in low-precision and dynamic disturbance environments, and are unable to support long-term stable learning in edge scenarios.
[0004] Furthermore, most existing EEG signal processing methods fail to fully leverage the brain's own information processing mechanisms. While the brain possesses efficient and adaptive capabilities when processing information such as emotions, traditional methods fail to effectively mimic these biological mechanisms. They are limited to a single optimization dimension, relying on gradient descent learning of a single model parameter. They lack a synergistic mechanism between local learning and global adaptation, making it difficult to achieve global adaptation in highly perturbed and resource-constrained hardware environments. Consequently, the processing differs significantly from the brain's natural processing methods, making it difficult to achieve brain-level intelligent processing capabilities. Summary of the Invention
[0005] The present invention provides a method and device for processing EEG signals based on a memristor two-dimensional collaborative learning architecture, aiming to solve at least one of the technical problems existing in the prior art.
[0006] The technical solution of the present invention is a method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture, which includes:
[0007] Importing multi-channel EEG signals from an EEG emotion dataset, performing short-time Fourier transform on the EEG signals, splicing by channels, and preprocessing by segments to construct a frequency-time two-dimensional feature map;
[0008] Inputting the frequency-time two-dimensional feature map into a local feature learning module of the horizontal dimension of a memristor two-dimensional collaborative learning architecture, wherein the local feature learning module of the horizontal dimension simulates the hierarchical perception mechanism of the mammalian visual cortex based on a convolutional neural network, extracts multi-level spatial features of the frequency-time two-dimensional feature map through the hierarchical perception mechanism, and determines the emotion category corresponding to the EEG signal based on the spatial features;
[0009] A population variation mechanism is derived based on the physical perturbation modeling of memristor hardware during the weight writing and reading process, and the population variation mechanism provides a source of variation for individuals in the population.
[0010] Inputting the individual variation sources of the population into the global evolutionary optimization module of the longitudinal dimension of the memristor two-dimensional collaborative learning architecture to increase memristor hardware perturbations, utilizing the individual variation and adaptive selection induced by the memristor hardware perturbations to construct an optimization strategy, and using the optimization strategy to evaluate and select the fittest emotion categories corresponding to the EEG signals to screen out optimal EEG emotion category recognition results;
[0011] The optimal EEG signal emotion category recognition result is fed back to the local feature learning module of the horizontal dimension of the memristor two-dimensional collaborative learning architecture, forming a closed-loop process of local learning and global evolutionary collaborative iteration.
[0012] According to some embodiments of the present invention, the hierarchical perception mechanism includes four convolutional layers, a pooling layer, three fully connected layers, and an output layer. Extracting multi-level spatial features of the frequency-time two-dimensional feature map through the hierarchical perception mechanism and determining the emotion category corresponding to the EEG signal based on the spatial features include:
[0013] Performing convolution stacking processing on the frequency-time two-dimensional feature map through four convolution layers to perform feature learning and feature extraction on the frequency-time two-dimensional feature map to obtain convolution features;
[0014] Inputting the frequency-time two-dimensional feature map into the pooling layer for maximum pooling processing to reduce the spatial dimension;
[0015] The convolutional features are flattened and sequentially input into three fully connected layers. Global features are obtained by connecting and weighting the neurons in the fully connected layers. The probability of the frequency-time two-dimensional feature map belonging to each category is determined based on the global features.
[0016] The output layer outputs the positive emotional state and its corresponding probability, the neutral emotional state and its corresponding probability, and the negative emotional state and its corresponding probability.
[0017] According to some embodiments of the present invention, the method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture further includes:
[0018] Mapping each convolutional neural network of the local feature learning module in the horizontal dimension to a logical partition in the memristor crossbar array to perform local feature extraction and feature learning, and updating the convolution kernel weights and fully connected layer weights in the convolutional neural network based on a quantization-aware backpropagation mechanism to achieve local autonomous learning of the local feature learning module in the horizontal dimension;
[0019] A random initialization training strategy is adopted, and a quantization-aware training method is introduced. Weight quantization constraints are introduced into the training process of the memristor two-dimensional collaborative learning architecture, achieving end-to-end training and integrating the characteristics of memristor hardware.
[0020] According to some embodiments of the present invention, the random initialization training strategy is adopted, and the quantization-aware training method is introduced. In the training process of the memristor two-dimensional collaborative learning architecture, weight quantization constraints are introduced to achieve end-to-end training and integrate the characteristics of memristor hardware. The following methods are included:
[0021] Randomly initialize the weights of the convolutional neural network;
[0022] During the training process of the memristor two-dimensional collaborative learning architecture, a symmetrical and uniform quantization strategy is used to dynamically quantize the weight parameters of each individual convolutional neural network.
[0023] The weights are scaled according to their maximum absolute value, rounded, and translated to the non-negative conductance range of the memristor hardware.
[0024] According to some embodiments of the present invention, the dynamic quantization of the weight parameters of each convolutional neural network individual using a symmetrical and uniform quantization strategy includes:
[0025] During the training process of the memristor two-dimensional collaborative learning architecture, symmetric uniform quantization is applied to the weight parameters of each convolutional neural network individual. The quantization process is expressed as:
[0026] ,
[0027] Among them, W i quant is the quantized weight matrix of the i-th convolutional neural network individual, W i is the weight parameter of each convolutional neural network individual, b is the number of quantization bits, S i =max(|W i |) is the maximum absolute value of the weights in the i-th convolutional neural network individual, which is used as a scaling factor;
[0028] Each frequency-time two-dimensional feature map is processed using a symmetrical uniform quantization method. The quantization process is expressed as:
[0029] ,
[0030] Where Δ is the quantization step size, Δ=max(|X|) / α, α is the half-level parameter, and X is the frequency-time two-dimensional feature map;
[0031] Each quantized frequency-time two-dimensional feature map is processed by padding and sliding window expansion to construct an input matrix for convolution calculation. The expression of the input matrix is:
[0032] ,
[0033] Among them, X patch The input matrix of the frequency-time two-dimensional feature map after convolution is k×M, which is used as the input matrix for matrix multiplication with the convolution kernel weight matrix. is a real matrix of dimension 𝑘×𝑀, indicating that all elements of the input matrix are real numbers. Unfold(·) is to expand the padded image into a two-dimensional matrix in a sliding window manner, and each column is a convolution receptive field. Pad(·) is to perform an edge padding operation on the quantized frequency-time two-dimensional feature map to maintain or control the spatial size of the frequency-time two-dimensional feature map. quant is the quantized frequency-time two-dimensional feature map, k is the size of the convolution kernel after flattening, and M is the total number of sliding windows determined by the resolution of the frequency-time two-dimensional feature map.
[0034] According to some embodiments of the present invention, the physical disturbance includes conductance fluctuation and programming variability. The population variation mechanism is obtained by modeling the physical disturbance of the memristor hardware during the weight writing and reading process. The variation sources of the population individuals provided by the population variation mechanism include:
[0035] Based on the conductance fluctuations and programming variability of memristive hardware during weight writing and reading, we model the population variation mechanism to provide the source of variation for individuals in the population.
[0036] Additive Gaussian noise is injected into the quantized weight matrix of the i-th convolutional neural network as the variation source of the memristor hardware to obtain the variation weight matrix after the disturbance is added. The variation weight matrix after the disturbance is expressed as:
[0037] ,
[0038] Among them, W i mut-G is the variation weight matrix after adding disturbance, W i quant is the quantized weight matrix of the i-th convolutional neural network individual, ΔW i is the disturbance caused by the memristor hardware, 𝜎 𝑡 is the standard deviation of the disturbance in the current t-th round of training, (0,σ t 2 ) means the mean is 0 and the variance is 𝜎 t 2 Gaussian distribution, 𝜎 𝑡 is the disturbance intensity;
[0039] The disturbance intensity is dynamically adjusted according to the exponential decay law, and the formula for the disturbance intensity is:
[0040] ,
[0041] Among them, 𝜎0 is the standard deviation of the initial disturbance, 𝜎 𝑇 is the final perturbation standard deviation, T is the total number of training rounds, and t is the current round;
[0042] The physical characteristics of the memristor hardware during the actual programming process are obtained according to the variation weight matrix after the disturbance is added.
[0043] According to some embodiments of the present invention, inputting the source of variation of the individuals in the population into the global evolutionary optimization module of the longitudinal dimension of the memristor two-dimensional collaborative learning architecture to increase the memristor hardware perturbation includes:
[0044] The mutation sources of the individuals in the population are input into the global evolutionary optimization module of the vertical dimension of the memristor two-dimensional collaborative learning architecture. In the weight programming phase, the random perturbations caused by the memristor hardware are injected into the quantized weights of each convolutional neural network individual to generate the mutation population of the current round. The weight of the ith convolutional neural network individual after mutation in the mutation population is calculated as:
[0045] ,
[0046] Among them, W i mut is the weight matrix of the i-th convolutional neural network individual after mutation, Wi quant is the quantized weight of the convolutional neural network, ⊙ is the element-by-element multiplication, M i is the variation mask, ΔW i Perturbations caused by memristive hardware;
[0047] In the current training batch (X patch ,y), the cross entropy loss is used to calculate the classification error to evaluate the performance of each variant individual. The formula for calculating the classification error using the cross entropy loss is:
[0048] ,
[0049] in, is the loss value of the i-th convolutional neural network individual in the t-th round of training, is the cross entropy loss function, which is used for loss evaluation in multi-classification tasks, f(·) is the forward propagation function, and X patch is the frequency-time two-dimensional feature map matrix after convolution, and y is the true label corresponding to the current training sample;
[0050] The loss value of the i-th convolutional neural network individual in the t-th round of training is encoded in the form of a one-hot vector:
[0051] ,
[0052] in, is the loss value of the i-th convolutional neural network individual in the t-th round of training, C is the number of classification categories, y C is the one-hot label of category C, Y i (t) is the output logits of the i-th convolutional neural network individual, exp(·) is the exponential function used for softmax calculation;
[0053] The impact of the memristor hardware disturbance is determined according to the loss value of the i-th convolutional neural network individual in the t-th round of training.
[0054] According to some embodiments of the present invention, constructing an optimization strategy using individual variation and adaptive selection caused by the memristor hardware perturbation includes:
[0055] In the current mutant population, the convolutional neural network individual with the smallest loss value is selected as the parent generation, and the index of the best individual in the current training round is determined based on the parent generation. The expression of the index of the best individual is:
[0056] ,
[0057] Among them, i ∗is the index of the best individual in the current training round, is the cross entropy loss of the i-th convolutional neural network individual, and argmin is the index corresponding to the minimum value;
[0058] Perform local learning on the selected parent convolutional neural network individuals and perform parameter update operations through the back propagation mechanism. The parameter update operation expression is:
[0059] ,
[0060] in, is the weight of the parent convolutional neural network individual in the current round, 𝜂 is the learning rate, is the gradient of the corresponding loss function, Update the weight;
[0061] Synchronously copy the updated parent weights to all other convolutional neural network individuals to initialize the population for the next training round:
[0062] .
[0063] in, is the initial weight of the i-th convolutional neural network individual in the t+1 round, is the updated weight of the parent convolutional neural network individual after the last round of training, Indicates that all convolutional neural network individuals except the parent are updated synchronously;
[0064] Build an optimization strategy by synchronously updating and continuously evolving all convolutional neural network individuals.
[0065] The technical solution of the present invention also relates to a computer device, comprising a memory and a processor, wherein the processor implements the above method when executing a computer program stored in the memory.
[0066] The technical solution of the present invention further relates to a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions implement the above-mentioned method when executed by a processor.
[0067] The EEG signal processing method and device based on a memristor two-dimensional collaborative learning architecture provided by the embodiments of the present invention have at least one of the following advantages or beneficial effects: Multi-channel EEG signals are imported from a public EEG emotion dataset and subjected to a short-time Fourier transform (SFT). The SFT can simultaneously analyze the frequency components and temporal variations of the signals, thereby converting the EEG signals from the time domain into a frequency-time two-dimensional feature representation; EEG signals from different channels are spliced together to form a comprehensive feature map, preserving information from different brain regions; the feature map is divided into multiple small blocks for easy subsequent processing and analysis; and through these preprocessing steps, a frequency-time two-dimensional feature map is constructed, providing basic data for subsequent emotion recognition. The preprocessed frequency-time two-dimensional feature map is input into the horizontal dimension local feature learning module of the memristor two-dimensional collaborative learning architecture. This horizontal dimension local feature learning module uses a convolutional neural network to simulate the hierarchical perception mechanism of the mammalian visual cortex and gradually extracts multi-level spatial features from the feature map through convolutional and pooling layers. The convolutional neural network can automatically learn local features in the frequency-time two-dimensional feature map, such as the distribution of frequency components and changes in time series. Based on the extracted multi-level spatial features, the emotion category (e.g., positive, neutral, negative, etc.) corresponding to the EEG signal is determined. Physical perturbations to the memristor hardware during weight writing and reading are modeled as a population mechanism variation. This perturbation mechanism provides a source of variation for individuals in the population, which increases population diversity and provides a foundation for global optimization. The individual variation sources are fed into the global evolutionary optimization module in the vertical dimension of the memristor two-dimensional collaborative learning architecture. The perturbation characteristics of the memristor hardware are leveraged to further increase individual variation. An optimization strategy is constructed based on the individual variation and adaptive selection induced by the memristor hardware perturbations. This optimization strategy performs adaptive selection, evaluates the emotion category corresponding to the EEG signal, and selects the fittest. Ultimately, the output of the individual with the highest fitness is selected as the optimal emotion category recognition result. Finally, the optimal emotion category recognition result is fed back to the local feature learning module in the horizontal dimension, forming a closed-loop process of collaborative iterative local learning and global evolution. Through continuous iterative optimization, the accuracy and robustness of emotion recognition are improved.
[0068] In addition, additional aspects and advantages of the present invention will be set forth in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 This is a general flow chart of a method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture provided by an embodiment of the present invention;
[0070] Figure 2This is a detailed flow chart of step S1100 in the method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture provided by an embodiment of the present invention;
[0071] Figure 3 This is a detailed flow chart of step S1160 in the method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture provided by an embodiment of the present invention;
[0072] Figure 4 is a schematic diagram of the test accuracy of different training strategies provided by an embodiment of the present invention;
[0073] Figure 5 is a schematic diagram of training loss curves for different training strategies provided by an embodiment of the present invention;
[0074] Figure 6 This is a schematic diagram of adaptive selection of population-level evolutionary dynamics based on a memristor two-dimensional collaborative learning architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0075] The following will provide a clear and complete description of the concept, specific structure and technical effects of the present invention in conjunction with the embodiments and drawings to fully understand the purpose, scheme and effects of the present invention.
[0076] It should be noted that, unless otherwise specified, when a feature is referred to as being "fixed" or "connected" to another feature, it may be directly fixed or connected to the other feature, or it may be indirectly fixed or connected to the other feature. The singular forms "a", "the" and "the" used herein are also intended to include the plural forms, unless the context clearly indicates otherwise. In addition, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art. The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the invention. The term "and / or" used herein includes any combination of one or more of the related listed items.
[0077] It should be understood that, although the present invention may adopt the terms first, second, third etc. to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish the elements of the same type from each other. For example, without departing from the scope of the present invention, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element. The use of any and all examples or exemplary language ("for example", "such as" etc.) provided herein is only intended to better illustrate embodiments of the present invention, and unless otherwise required, will not impose limitations on the scope of the present invention.
[0078] Existing machine learning-based EEG signal processing models are mostly trained and optimized on specific datasets, lacking the ability to generalize across different individuals and under different emotion-inducing conditions. When faced with new data or scenarios, model performance often degrades significantly, limiting their practical application. Furthermore, traditional convolutional neural network training methods are sensitive to inherent hardware non-idealities (such as weight quantization errors, write-read variations, and conductance fluctuations). These physical-layer perturbations accumulate during training, leading to unstable convergence and performance degradation. While existing compensation strategies can mitigate the impact of hardware errors to a certain extent, they often require the introduction of complex error correction circuits or algorithmic modules, significantly increasing system complexity and resource overhead. Consequently, traditional convolutional neural network training methods fail to fully utilize hardware perturbations as a positive learning driver. Most hardware-aware training methods treat hardware perturbations as negative factors and address them through compensation, avoidance, or masking. This approach ignores the inherent randomness and variability of hardware perturbations and fails to tap into their potential functional value in the learning process. Therefore, existing methods have limited adaptability and robustness in low-precision and dynamic disturbance environments, and are unable to support long-term stable learning in edge scenarios.
[0079] Furthermore, most existing EEG signal processing methods fail to fully leverage the brain's own information processing mechanisms. While the brain possesses efficient and adaptive capabilities when processing information such as emotions, traditional methods fail to effectively mimic these biological mechanisms. They are limited to a single optimization dimension, relying on gradient descent learning of a single model parameter. They lack a synergistic mechanism between local learning and global adaptation, making it difficult to achieve global adaptation in highly perturbed and resource-constrained hardware environments. Consequently, the processing differs significantly from the brain's natural processing methods, making it difficult to achieve brain-level intelligent processing capabilities.
[0080] Based on this, an embodiment of the present invention provides a method and device for processing EEG signals based on a memristor two-dimensional collaborative learning architecture. Through a two-dimensional collaborative approach of horizontal local feature learning and vertical global evolutionary optimization, the adaptability and robustness of convolutional neural networks in a memristor hardware environment are effectively improved. Through quantized perceptual training and memristor hardware conductance mapping, combined with the intrinsic perturbation modeling and perturbation-driven evolution of memristor hardware, a population mechanism variation is modeled based on the intrinsic physical perturbation of memristor hardware. Through this perturbation mechanism, a source of variation is provided for individuals in the population. The source of variation can increase the diversity of the population, provide a basis for global optimization, and realize an adaptive learning process that conforms to the physical characteristics of the hardware and precision constraints. By simultaneously carrying out local back-propagation learning and global population evolutionary screening, the memristor two-dimensional collaborative learning architecture is promoted to achieve stable convergence and performance improvement in a dynamic perturbation environment.
[0081] Reference Figure 1 As shown, Figure 1This is a general flow chart of a method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture provided by an embodiment of the present invention. The method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture includes but is not limited to steps S1000 to S1400. Specifically,
[0082] S1000: Import multi-channel EEG signals from the EEG emotion dataset, perform short-time Fourier transform on the EEG signals, perform channel-by-channel concatenation, and segment-by-segment preprocessing to construct a frequency-time two-dimensional feature map.
[0083] S1100: Input the frequency-time 2D feature map into the horizontal dimension local feature learning module of the memristor 2D collaborative learning architecture. The horizontal dimension local feature learning module simulates the hierarchical perception mechanism of the mammalian visual cortex based on a convolutional neural network. Through this hierarchical perception mechanism, it extracts multi-level spatial features of the frequency-time 2D feature map and determines the emotion category corresponding to the EEG signal based on the spatial features.
[0084] S1200: Based on the physical perturbation modeling of memristor hardware during weight writing and reading, a population variation mechanism is derived, which provides a source of variation for individuals in the population.
[0085] S1300: Inputting the individual variation sources of the population into the global evolutionary optimization module of the vertical dimension of the memristor two-dimensional collaborative learning architecture to increase the memristor hardware perturbation. Utilizing the individual variation and adaptive selection induced by the memristor hardware perturbation, an optimization strategy is constructed. The emotion categories corresponding to the EEG signals are evaluated and the fittest are selected using the optimization strategy to screen out the optimal EEG emotion category recognition results.
[0086] S1400: Feedback the optimal EEG signal emotion category recognition result to the local feature learning module in the horizontal dimension of the memristor two-dimensional collaborative learning architecture, forming a closed-loop process of local learning and global evolutionary collaborative iteration.
[0087] In some embodiments of the present invention, a method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture includes: reading multi-channel EEG signals from a publicly available emotional EEG signal dataset (such as the SEED dataset), which reflects the neural activity of different brain regions during a subject's emotion-inducing task, thereby facilitating accurate identification of emotional states. Short-time Fourier transform (SFT) can simultaneously analyze the frequency components and temporal variations of the signal. Performing SFT on the EEG signal can convert the EEG signal from the time domain into a two-dimensional frequency-time feature representation; splicing EEG signals from different channels together to form a comprehensive feature map that retains information from different brain regions; dividing the feature map into multiple small blocks for ease of subsequent processing and analysis; and constructing a two-dimensional frequency-time feature map through these preprocessing steps, providing basic data for subsequent emotion recognition.
[0088] The preprocessed frequency-time 2D feature map is fed into the horizontal dimension local feature learning module of the memristor 2D collaborative learning architecture. This module, based on a convolutional neural network, mimics the hierarchical perception mechanism of the mammalian visual cortex. Through convolutional and pooling layers, it gradually extracts multi-level spatial features from the feature map. The convolutional neural network automatically learns local features in the frequency-time 2D feature map, such as the distribution of frequency components and changes in time series. Based on these extracted multi-level spatial features, the emotion category (e.g., positive, neutral, negative, etc.) corresponding to the EEG signal is determined.
[0089] The memristor hardware experiences physical perturbations during weight writing and reading. These inherent perturbations are modeled as a population mechanism variation. This perturbation mechanism provides a source of variation for individuals in the population, which increases population diversity and provides a foundation for global optimization. The individual variation sources are fed into the global evolutionary optimization module in the vertical dimension of the memristor two-dimensional collaborative learning architecture. The perturbation characteristics of the memristor hardware are leveraged to further increase individual variation. An optimization strategy is constructed based on the individual variation and adaptive selection induced by the memristor hardware perturbations. Adaptive selection is performed using an evolutionary algorithm (such as a genetic algorithm). The emotion categories corresponding to the EEG signals are evaluated and the fittest are selected. Ultimately, the output of the individual with the highest fitness is selected as the optimal emotion category recognition result. Finally, the optimal emotion category recognition result is fed back to the local feature learning module in the horizontal dimension, forming a closed-loop process of collaborative iterative local learning and global evolution. Through continuous iterative optimization, the accuracy and robustness of emotion recognition are improved.
[0090] In one embodiment of the present invention, multi-channel EEG signals are read from a public emotional EEG signal dataset (such as the SEED dataset), and the EEG signals are first subjected to a local feature learning module in the horizontal dimension of a memristive two-dimensional collaborative learning architecture to extract multi-level features. Each convolutional neural network individual runs on memristive hardware, and memristive hardware perturbations are introduced during the memristive two-dimensional collaborative learning architecture process. Subsequently, the perturbed convolutional neural network individuals are subjected to performance evaluation and fittest selection through a global evolution module in the vertical dimension of the memristive two-dimensional collaborative learning architecture. The global evolution module draws on the Darwinian evolution mechanism to construct an optimization strategy based on evolutionary programming. It utilizes the individual variation and adaptive selection process caused by the memristive hardware perturbations to continuously screen out the convolutional neural network individuals with the best performance, and uses the emotion category output by the optimal convolutional neural network individual as the optimal emotion category recognition result. Afterwards, the selected optimal emotion category recognition result and the optimal convolutional neural network individual are fed back to the local learning module in the horizontal dimension of the memristive two-dimensional collaborative learning architecture, forming a closed-loop process of collaborative iteration of local learning and global evolution. The memristor 2D collaborative learning architecture improves the adaptability, robustness, and energy efficiency of neural networks in the presence of memristor hardware disturbances through a dual collaboration of horizontal local feature learning and vertical global adaptive evolution. Multiple convolutional neural network individuals in the population are collaboratively optimized during the evolutionary process, achieving adaptive convergence of the globally optimal memristor 2D collaborative learning architecture through iterative updates.
[0091] It should be noted that memristive hardware is a memristive computing-in-memory (CIM) system. Memristive CIM hardware has the advantages of high parallelism, low power consumption, and high integration, making it suitable for building the next generation of efficient and compact intelligent reasoning systems. The method for processing EEG signals based on a memristive two-dimensional collaborative learning architecture provided in an embodiment of the present invention is a neural network training and deployment method for a memristive CIM hardware platform, belonging to the intersection of brain-like intelligence, neuromorphic computing, intelligent learning of edge computing devices, and cross-species bionic intelligent mechanism applications. In particular, the method for processing EEG signals based on a memristive two-dimensional collaborative learning architecture proposed in the present invention is suitable for a two-dimensional collaborative adaptive learning architecture based on memristive hardware in a low-precision perturbation environment, and can improve the robustness and energy efficiency of intelligent systems on resource-constrained platforms.
[0092] Reference Figure 2 As shown, Figure 2 This is a detailed flow chart of step S1100 in the method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture provided by an embodiment of the present invention, including but not limited to steps S1110 to S1140. Specifically,
[0093] Step S1110: performing convolution stacking processing on the frequency-time two-dimensional feature map through four convolutional layers to perform feature learning and feature extraction on the frequency-time two-dimensional feature map to obtain convolution features;
[0094] Step S1120: Input the frequency-time two-dimensional feature map into the pooling layer for maximum pooling processing to reduce the spatial dimension;
[0095] Step S1130: Flatten the convolutional features and input them into three fully connected layers in sequence. Global features are obtained by connecting and weighting the neurons in the fully connected layers. The probability of the frequency-time two-dimensional feature map belonging to each category is determined based on the global features.
[0096] Step S1140: Output the positive emotional state and its corresponding probability, the neutral emotional state and its corresponding probability, and the negative emotional state and its corresponding probability through the output layer.
[0097] In some embodiments of the present invention, in the horizontal local feature learning dimension, the local feature learning module simulates the hierarchical perception mechanism of the mammalian visual cortex based on a convolutional neural network, extracts multi-level spatial features of the frequency-time two-dimensional feature map through the hierarchical perception mechanism, and judges the emotion category corresponding to the EEG signal based on the spatial features. Specifically, the hierarchical perception mechanism consists of four convolutional layers. The first convolution kernel size is 5×5, the input channel is 8, and the output channel is 64; the second and third convolution layers use 4×4 convolution kernels, and the number of output channels is 128 and 256 respectively; the fourth convolution layer is a bottleneck convolution layer, using a 1×1 convolution kernel and 64 output channels; all convolution layers use the ReLU activation function. The frequency-time two-dimensional feature map is convolutionally stacked by four convolution layers. Multi-layer convolution stacking can capture features of different scales and provide rich information for subsequent classification. After the convolution stacking, the frequency-time two-dimensional feature map is input to the pooling layer, and a 2×2 pooling layer is applied to perform a maximum pooling operation to reduce the spatial dimension, thereby reducing computational complexity while retaining important features. The convolutional features are flattened and sequentially fed into three fully-connected layers with dimensions of 960→512, 512→128, and 128→3, respectively. Global features are generated through the connections and weight calculations between neurons in the fully-connected layers. Each fully-connected layer performs complex nonlinear transformations on the input features to learn higher-level feature representations. Based on the global features, the probability of the frequency-time 2D feature map belonging to each category is determined. The output of the last fully-connected layer is a probability distribution representing the probability of the frequency-time 2D feature map belonging to each category. Finally, the output layer outputs three emotion states: positive (positive) and its corresponding probability, neutral (neutral) and its corresponding probability, and negative (negative) and its corresponding probability. Classification prediction is performed using the Softmax activation function. Each probability value represents the confidence level that the input frequency-time 2D feature map belongs to a particular emotion category.
[0098] Through the combination of convolutional layers, pooling layers and fully connected layers, feature learning and emotion category recognition of frequency-time two-dimensional feature maps are achieved. When processing EEG signal emotion recognition tasks, it can effectively extract features and accurately classify them, with high practicality and accuracy.
[0099] In some embodiments of the present invention, the method for processing EEG signals based on the memristor two-dimensional collaborative learning architecture further includes but is not limited to steps S1150 to S1160. Specifically,
[0100] S1150: Mapping each convolutional neural network of the local feature learning module in the horizontal dimension to a logical partition in the memristor crossbar array to perform local feature extraction and feature learning, and updating the parameters of the convolution kernel weights and the fully connected layer weights in the convolutional neural network based on a quantization-aware backpropagation mechanism to achieve local autonomous learning of the local feature learning module in the horizontal dimension;
[0101] S1160: Adopting a random initialization training strategy and introducing a quantization-aware training method, we introduce weight quantization constraints during the training of a memristor two-dimensional collaborative learning architecture, achieving end-to-end training and integrating the characteristics of memristor hardware.
[0102] In some embodiments of the present invention, each convolutional neural network of the local feature learning module in the horizontal dimension is mapped to a logical partition in the memristor crossbar array. It can be understood that
[0103] A memristive crossbar array is a structure that arranges multiple memristive hardware components in a matrix. This structure enables efficient matrix operations and is particularly suitable for weight storage and computation in neural networks. Memristive hardware is a new type of non-volatile memory device with integrated storage and computation capabilities. The memristive crossbar array is divided into multiple logical partitions, each corresponding to a convolutional layer or kernel, used to store and compute the weights and activations of the convolutional layer. Leveraging the integrated storage and computation capabilities of memristive hardware, convolution operations are accelerated, improving model efficiency. During local feature extraction and learning, each logical partition is responsible for local feature extraction, enabling multi-level feature learning of frequency-time two-dimensional feature maps. A quantization-aware mechanism is introduced during training to simulate the quantization characteristics of memristive hardware in practice. Quantization-aware training simulates these quantization characteristics during training, enabling the model to adapt to hardware limitations during training. During backpropagation, gradients are quantized and the quantized weights are updated simultaneously. This mechanism ensures that the actual performance of the model on the memristive hardware is consistent with the performance during training. Through quantized perception training, it is possible to better adapt to the characteristics of memristive hardware and reduce performance loss during memristive hardware implementation; and each logical partition can independently perform feature learning and parameter updates to achieve local autonomous learning.
[0104] At the beginning of training, a random initialization strategy is used to randomly initialize the weights of the convolutional neural network. Random initialization can break the symmetry of the weights and prevent all neurons from learning the same features at the beginning of training. Proper random initialization can accelerate the convergence of the convolutional neural network and learn richer feature representations.
[0105] During training, the weights of the convolutional neural network are quantized to conform to the storage and computational characteristics of memristor hardware. Memristor weights can typically only be stored with limited precision, so quantization is necessary to simulate this hardware characteristic. By introducing weight quantization constraints during the training phase, the characteristics of memristor hardware are taken into account, fully leveraging the integrated storage and computation capabilities of memristors while adapting to the quantization limitations of the hardware. This enables end-to-end optimization from training to hardware deployment, reducing the optimization effort required during memristor hardware implementation. By integrating the characteristics of memristor hardware, the efficiency and accuracy of convolutional neural networks running on memristor hardware are improved.
[0106] The convolutional neural network is mapped to a memristor crossbar array, and the trainable parameters such as the convolution kernel weights and the fully connected layer weights in the convolutional neural network are updated through a quantization-aware backpropagation mechanism to achieve local autonomous learning and fully utilize the advantages of memristor hardware. At the same time, through quantization-aware training and weight quantization constraints, the efficient implementation and performance optimization of the convolutional neural network on memristor hardware are ensured.
[0107] Reference Figure 3 As shown, Figure 3 This is a detailed flow chart of step S1160 in the method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture provided by an embodiment of the present invention. Step S1160 includes but is not limited to steps S1161 to S1163. Specifically,
[0108] S1161: Randomly initialize the weights of the convolutional neural network;
[0109] S1162: During the training of a memristor 2D collaborative learning architecture, a symmetric and uniform quantization strategy is used to dynamically quantize the weight parameters of each convolutional neural network.
[0110] S1163: Scaling is performed according to the maximum absolute value of the weight, rounding the scaled weight, and shifting the weight to the non-negative conductance range of the memristor hardware.
[0111] In some embodiments of the present invention, the design of the weight quantization and mapping process of the convolutional neural network includes: first, the weights of the convolutional neural network are generated by random initialization at the beginning of training, without relying on any pre-training model. During the training process of the memristor two-dimensional collaborative learning architecture, a symmetrical and uniform quantization strategy is used to dynamically quantize the weight parameters of each individual convolutional neural network, that is, the weights are scaled according to the maximum absolute value, and then the scaled weights are rounded and translated to the non-negative conductance range of the memristor hardware. This quantization process is continuously applied during training, so that the convolutional neural network can adapt to the quantization error in real time and improve its robustness under the deployment of memristor hardware. The memristor hardware used in the embodiment of the present invention is based on the TiN / HfOx / TaOy / TiN material system and is prepared by a compatible CMOS process. This material system is widely used in experimental-level memristor hardware.
[0112] Based on the weight quantization and mapping of the convolutional neural network described above, in the horizontal dimension of the two-dimensional collaborative learning architecture proposed in the embodiments of the present invention, each convolutional neural network individual is deployed on a 128×576 memristor crossbar array partition. For larger convolutional neural networks, multiple memristor crossbar arrays can be used to accommodate all weight parameters. To adapt to the limited storage precision of the memristors, symmetric uniform quantization is applied to the weight parameters of each convolutional neural network individual during training.
[0113] The process of dynamically quantizing the weight parameters of each convolutional neural network individual using a symmetrical and uniform quantization strategy in step S1162 includes but is not limited to the following steps:
[0114] During the training process of the memristor two-dimensional collaborative learning architecture, symmetric uniform quantization is applied to the weight parameters of each convolutional neural network individual. The quantization process is expressed as:
[0115] ,
[0116] Among them, W i quant is the quantized weight matrix of the i-th convolutional neural network individual, W i is the weight parameter of each convolutional neural network individual, b is the number of quantization bits, S i =max(|W i |) is the maximum absolute value of the weights in the i-th convolutional neural network individual, which is used as a scaling factor;
[0117] Each frequency-time two-dimensional feature map is processed using a symmetrical uniform quantization method. The quantization process is expressed as:
[0118] ,
[0119] Where Δ is the quantization step size, Δ=max(|X|) / α, α is the half-level parameter, and X is the frequency-time two-dimensional feature map;
[0120] In an embodiment of the present invention, the memristive crossbar array supports 4-bit (15-level) storage precision, achieving a good balance between programming stability, energy efficiency and brain-like computing requirements. The present invention adopts 15-level conductance precision to reflect the actual capabilities of mainstream memristive crossbar arrays and verify the effectiveness and robustness of the proposed two-dimensional collaborative learning architecture under real hardware constraints.
[0121] It should be noted that b represents the number of quantization bits, which is set to b=4 in the embodiment of the present invention, corresponding to 15-level conductance accuracy; Δ is the quantization step size, whose value is determined by the half-level parameter α, that is, Δ=max(|X|) / α; in the embodiment of the present invention, the input frequency-time two-dimensional feature map is uniformly quantized to 4-bit accuracy, corresponding to α=4.
[0122] Each quantized frequency-time two-dimensional feature map is processed by padding and sliding window expansion to construct the input matrix for convolution calculation. The expression of the input matrix is:
[0123] ,
[0124] Among them, X patch The input matrix of the frequency-time two-dimensional feature map after convolution is k×M, which is used as the input matrix for matrix multiplication with the convolution kernel weight matrix. is a real matrix of dimension 𝑘×𝑀, indicating that all elements of the input matrix are real numbers. Unfold(·) unfolds the padded image into a two-dimensional matrix using a sliding window method, with each column representing a convolution receptive field. Pad(·) pads the edges of the quantized frequency-time 2D feature map to maintain or control its spatial size. Xquant represents the quantized frequency-time 2D feature map, k is the convolution kernel size after flattening, and M is the total number of sliding windows, determined by the resolution of the frequency-time 2D feature map. For example, when the input frequency-time 2D feature map is 28×28, zero padding is used to maintain spatial resolution. The convolution kernel size is set to k=9 (corresponding to a 3×3 kernel), resulting in M=784 sliding windows. These parameters can be flexibly adjusted based on different datasets or task characteristics.
[0125] In some embodiments of the present invention, the method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture further includes: deploying multi-layer convolution calculations on a memristor crossbar array, specifically,
[0126] The first layer of convolutional computation deployed on the memristor crossbar array is expressed as:
[0127] ,
[0128] Among them, f ReLU (·) is the ReLU activation function, defined as f(x)=max(0, x), which acts on the multiplication result element by element to introduce nonlinearity. G1 ⊤ Represents the weight matrix transpose of the first convolutional layer, which is used for matrix multiplication of the memristor crossbar array. Similarly, the second convolutional layer is calculated as:
[0129] ,
[0130] Among them, G2 ⊤ The weight matrix transpose of the second convolutional layer is also used for matrix multiplication of the memristor crossbar array. For the fully connected layer, the convolutional layer output is flattened and the calculation process is as follows:
[0131] ,
[0132] ,
[0133] Among them, Y fc1 is the output feature vector of the first fully connected layer, Y fc2 is the output feature vector of the second fully connected layer, G fc1 ⊤ is the transpose of the weight matrix of the first fully connected layer, G fc2 ⊤ is the transpose of the weight matrix of the second fully connected layer, f Softmax The Softmax activation function is used to normalize the logits vector into a probability distribution. Using the FashionMNIST dataset as an example, the first and second convolutional layers are configured with 20 and 40 output channels, respectively, a 3×3 kernel size, and a stride of 1. The fully connected layer maps 320 input neurons to 100 hidden neurons, ultimately outputting neurons corresponding to 10 categories, meeting the 10-category classification requirement of FashionMNIST. The weights of all convolutional and fully connected layers are uniformly quantized to 4-bit precision.
[0134] During the training of each convolutional neural network, the scaling factor Si is dynamically updated according to the maximum value of the current weight. The number of convolutional layers, the number of neurons in the fully connected layer, and their structural parameters can be flexibly configured according to the task scenario. This layered mapping and quantization strategy ensures the effective deployment of the complete convolutional neural network on the memristor crossbar array. At the same time, hardware feature constraints are embedded in the training process, improving the final inference performance and hardware friendliness.
[0135] In some embodiments of the present invention, during the hardware deployment process of the memristor two-dimensional collaborative learning architecture, the memristor hardware will inevitably produce physical layer errors, such as conductance fluctuations and programming variability, during the weight writing and reading stages. These intrinsic physical perturbations caused by the hardware are usually regarded as performance bottlenecks in hardware deployment. However, the embodiments of the present invention innovatively introduce these intrinsic physical perturbations into the longitudinal evolutionary learning dimension and model them as injected perturbations of individual parameters. Specifically, the random perturbations generated during the programming of the memristor hardware weights are regarded as the source of driving individual-level variation, thereby promoting population diversity and adaptive evolution in the entire global learning process.
[0136] In step S1200 of the method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture, a population variation mechanism is obtained based on the physical perturbation modeling of the memristor hardware during the weight writing and reading process, and a variation source of the population individuals is provided through the population variation mechanism, including but not limited to the following steps:
[0137] First, we model the conductance fluctuations and programming variability of memristive hardware during weight writing and reading to derive the population variation mechanism, which provides the source of variation for individuals in the population.
[0138] Additive Gaussian noise is injected into the quantized weight matrix of the i-th convolutional neural network as the mutation source of the memristor hardware to obtain the mutated weight matrix after the perturbation. The expression of the mutated weight matrix after the perturbation is:
[0139] ,
[0140] Among them, W i mut-G is the variation weight matrix after adding disturbance, W i quant is the quantized weight matrix of the i-th convolutional neural network individual, ΔW i is the disturbance caused by the memristor hardware, 𝜎 𝑡 is the standard deviation of the disturbance in the current t-th round of training, (0,σ t 2 ) means the mean is 0 and the variance is 𝜎 t 2 Gaussian distribution, 𝜎 𝑡 is the disturbance intensity;
[0141] Among them, the disturbance intensity is dynamically adjusted according to the exponential decay law. The formula for the disturbance intensity is:
[0142] ,
[0143] Among them, 𝜎0 is the standard deviation of the initial disturbance, 𝜎 𝑇is the final perturbation standard deviation, T is the total number of training rounds, and t is the current round;
[0144] The physical characteristics of the memristor hardware during the actual programming process are obtained based on the variation weight matrix after adding disturbance.
[0145] This dynamic decay strategy reflects the physical characteristics of memristive hardware during the actual programming process. In the initial programming stage, due to unstable conductive channel formation or large matching errors of memristive hardware, the write and read variability is large. As the number of programming times increases, the conductivity state of the memristive hardware gradually stabilizes. For example, the initial perturbation strength is set to 𝜎0=0.1, and it eventually decays to 𝜎 𝑇 =2×10 −5 , determined based on actual memristor hardware measurement results.
[0146] In the memristor two-dimensional collaborative learning architecture proposed in this embodiment of the present invention, the local feature learning process and the global adaptive evolutionary learning process are carried out simultaneously. Specifically, in the horizontal dimension (local feature learning), multiple convolutional neural network individuals are deployed on 128×576 memristor crossbar array partitions to perform feature extraction and local learning. In the vertical dimension (global evolutionary optimization), all convolutional neural network individuals form a population to perform the evolutionary learning process. For larger convolutional neural networks, multiple memristor crossbar arrays can be deployed in combination to accommodate the complete weight parameters. Therefore, based on the perturbation modeling described above, the evolutionary learning process in the vertical dimension of the memristor two-dimensional collaborative learning architecture proposed in this embodiment of the present invention is iteratively executed within each training round.
[0147] In some embodiments of the present invention, in a method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture, step S1300 of inputting the source of variation of individuals in a population into a global evolutionary optimization module in the longitudinal dimension of the memristor two-dimensional collaborative learning architecture to increase memristor hardware perturbations includes, but is not limited to, the following steps:
[0148] The mutation sources of the population individuals are input into the global evolutionary optimization module of the vertical dimension of the memristor two-dimensional collaborative learning architecture. In the weight programming phase, the random perturbations caused by the memristor hardware are injected into the quantized weights of each convolutional neural network individual to generate the mutation population of the current round. The weight of the ith convolutional neural network individual after mutation in the mutation population is calculated as:
[0149] ,
[0150] Among them, W i mut is the weight matrix of the i-th convolutional neural network individual after mutation, W i quant is the quantized weight of the convolutional neural network, ⊙ is the element-by-element multiplication, M iis the variation mask, ΔW i Perturbations caused by memristive hardware;
[0151] In the embodiment of the present invention, M i The mutation mask follows the Bernoulli distribution Mi∼Bernoulli(pt), where pt is the mutation ratio of the current training round, and it also gradually decreases according to the same exponential decay law as 𝜎𝑡. For example, in the FashionMNIST deployment, pt gradually decays from an initial value of 1 to 0.001, achieving a smooth transition from high-frequency mutation to low-frequency fine-tuning.
[0152] In the current training batch (X patch , y), the cross entropy loss is used to calculate the classification error to evaluate the performance of each variant individual. The formula for calculating the classification error using the cross entropy loss is:
[0153] ,
[0154] in, is the loss value of the i-th convolutional neural network individual in the t-th round of training, is the cross entropy loss function, which is used for loss evaluation in multi-classification tasks, f(·) is the forward propagation function, and X patch is the frequency-time two-dimensional feature map matrix after convolution (a patch set consisting of a sliding window), and y is the true label corresponding to the current training sample;
[0155] The loss value of the i-th convolutional neural network individual in the t-th round of training is encoded in the form of a one-hot vector:
[0156] ,
[0157] in, is the loss value of the i-th convolutional neural network individual in the t-th round of training, C is the number of classification categories (in FashionMNIST, C=10), y C is the one-hot label of category C (i.e., category C is 1 and the rest are 0), Y i (t) is the output logits of the i-th convolutional neural network individual, exp(·) is the exponential function used for softmax calculation;
[0158] The impact of memristor hardware perturbation is determined based on the loss value of the i-th convolutional neural network individual in the t-th round of training.
[0159] In some embodiments of the present invention, step S1300 in the method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture further includes but is not limited to the following steps:
[0160] In the current mutant population, the convolutional neural network individual with the smallest loss value is selected as the parent generation. The index of the best individual in the current training round is determined based on the parent generation. The expression of the index of the best individual is:
[0161] ,
[0162] Among them, i ∗ is the index of the best individual in the current training round, is the cross entropy loss of the i-th convolutional neural network individual, and argmin is the index corresponding to the minimum value;
[0163] Perform local learning on the selected parent convolutional neural network individuals and perform parameter update operations through the back propagation mechanism. The parameter update operation expression is:
[0164] ,
[0165] in, is the weight of the parent convolutional neural network individual in the current round, 𝜂 is the learning rate, is the gradient of the corresponding loss function, Update the weight;
[0166] In the embodiment of the present invention, the Adam optimizer is used, and the initial learning rate is 𝜂=10 −3 , and gradually decay to a minimum of 10 according to the training progress −5 (Implemented by the ReduceLROnPlateau scheduler).
[0167] Synchronously copy the updated parent weights to all other convolutional neural network individuals to initialize the population for the next training round:
[0168] .
[0169] in, is the initial weight of the i-th convolutional neural network individual in the t+1 round, is the updated weight of the parent convolutional neural network individual after the last round of training, Indicates that all convolutional neural network individuals except the parent are updated synchronously;
[0170] Build an optimization strategy by synchronously updating and continuously evolving all convolutional neural network individuals.
[0171] Based on an optimization strategy, the optimal individuals are continuously selected through the process of individual variation and adaptive selection induced by memristive hardware perturbations. Multiple convolutional neural network individuals within the population are collaboratively optimized during the evolutionary process, achieving adaptive convergence to a global optimal model through iterative updates. This enhances the evolutionary adaptability and resilience of convolutional neural networks in the presence of memristive hardware perturbations.
[0172] In some embodiments of the present invention, in the vertical global evolutionary optimization dimension, an evolutionary population containing N=10 convolutional neural network individuals is maintained, which are deployed in multiple 128×576-sized memristive crossbar arrays in the same way. The quantized weights of each convolutional neural network individual are injected with noise from the memristive hardware perturbation in each round of training to achieve population-level variation. In order to more realistically simulate the application scenario where the conductivity state of the memristive crossbar array is unstable under frequent reading and writing conditions, the experiment of the embodiment of the present invention adopts a stronger hardware perturbation configuration to better reflect the device fluctuation characteristics commonly found in compact, low-power neuromorphic systems. Specifically, the perturbation intensity 𝜎 t The mutation ratio p is gradually decayed from the initial 0.1 to 0.001 in an exponential manner (100 rounds of training in total). t It also decays from the initial 1 to 0.001 to simulate the process of the memristor crossbar array gradually becoming stable during frequent reading and writing.
[0173] The experimental design compared three different training strategies, which are defined as follows.
[0174] (1) QAT (Quantization-Aware Training): A standard quantization-aware training method, where the network weights are all 4-bit accurate, but no perturbations from hardware perturbations are introduced;
[0175] (2) QAT-Dis (Disturbance): Based on QAT, additional disturbances caused by the non-ideality of memristor hardware are introduced to simulate the randomness of the memristor hardware programming process and enhance the adaptability to hardware fluctuations;
[0176] (3) QAT-Dis-2D: Based on the memristor two-dimensional collaborative learning architecture proposed in this paper, hardware perturbations are modeled as sources of evolutionary variation, and robust optimization is performed under the collaborative mechanism of local feature learning and global evolutionary selection.
[0177] Reference Figure 4 and Figure 5As shown, all three training strategies showed convergence trends over 100 training rounds, but there were significant differences in convergence speed and robustness. The QAT-Dis strategy, due to its lack of adaptability to hardware perturbations, experienced significant fluctuations during training and ultimately achieved lower accuracy. The QAT baseline method was relatively stable during training, but encountered a performance bottleneck in the early stages. In contrast, the QAT-Dis-2D strategy, based on the proposed memristor two-dimensional collaborative learning architecture, exhibited good convergence behavior, with a smooth loss decrease and higher test accuracy. This demonstrates that through the synergistic effect of vertical evolutionary selection and horizontal weight fine-tuning, the population is able to gradually absorb intrinsic perturbations and evolve hardware-robust solutions. In terms of quantitative metrics, the QAT-Dis-2D strategy, based on the proposed memristor two-dimensional collaborative learning architecture, achieved an average accuracy of 80.10% on the test set with a standard deviation of 1.89, outperforming the QAT baseline (79.52% ± 0.95) and the QAT-Dis strategy (76.54% ± 1.68). Although its variance was slightly higher, this reflects its evolution-driven exploration capability and sensitivity to hardware perturbations. In general, the strategy based on the memristor two-dimensional collaborative learning architecture of the present invention shows good adaptability in noise interference and resource-constrained environments.
[0178] In the embodiment of the present invention, the population evolution process of the QAT-Dis-2D strategy based on the memristor two-dimensional collaborative learning architecture is further visualized and analyzed. Figure 6 As shown, with memristive hardware perturbations, the early population maintains high diversity, supporting extensive exploration. As training progresses, through vertical variation and screening, the best-performing individuals are identified and continuously refined through horizontal learning, ultimately achieving progressive convergence to a low-loss region. This result demonstrates that even in complex scenarios such as EEG signal processing, the proposed memristive two-dimensional collaborative learning architecture can effectively leverage memristive hardware perturbations as an evolutionary driver, achieving a stable and adaptive learning process.
[0179] Therefore, the memristor two-dimensional collaborative learning architecture and its hardware deployment strategy proposed in the present invention can still achieve adaptive and robust learning under the continuous existence of hardware disturbances, showing good effectiveness and edge AI deployment application potential, and is expected to be used in typical scenarios such as human-computer interaction for emotion perception. In summary, the embodiment of the present invention proposes a method and device for processing EEG signals based on a memristor two-dimensional collaborative learning architecture, which systematically integrates the local feature perception mechanism of the mammalian visual cortex and the Darwinian evolution mechanism of biological populations, and effectively improves the adaptability and robustness of convolutional neural networks in the memristor CIM hardware environment through a two-dimensional collaborative approach of horizontal local feature learning and vertical global evolutionary optimization. Through quantitative perception training and memristor hardware conductance mapping, combined with memristor hardware intrinsic disturbance modeling and disturbance-driven evolution, an adaptive learning process that conforms to the physical characteristics and precision constraints of the hardware is constructed. Local backpropagation learning and global population evolution screening are carried out simultaneously to promote the memristor two-dimensional collaborative learning architecture to achieve stable convergence and performance improvement in a dynamic disturbance environment. The embodiments of the present invention can give full play to the high parallelism and energy efficiency advantages of the memristor CIM hardware array, have good hardware adaptability, edge deployment potential and bio-inspired intelligent system scalability, and have good application value and promotion prospects.
[0180] It should be appreciated that the method steps in the embodiments of the present invention can be implemented or executed by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, for this purpose, the program can be run on a programmed application-specific integrated circuit.
[0181] Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that collectively executes on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that can be executed by one or more processors.
[0182] Further, the methods can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, RAM, ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. In addition, the machine-readable code, or portions thereof, can be transmitted over a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention can also include the computer itself.
[0183] The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data that is stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data is a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on a display.
[0184] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the aforementioned embodiments. As long as the technical effects of the present invention are achieved by the same means, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention. Within the scope of protection of the present invention, various modifications and variations of the technical solutions and / or implementation methods are possible.
Claims
1. A method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture, characterized in that: include: Importing multi-channel EEG signals from an EEG emotion dataset, performing short-time Fourier transform on the EEG signals, splicing by channels, and preprocessing by segments to construct a frequency-time two-dimensional feature map; Inputting the frequency-time two-dimensional feature map into a local feature learning module of the horizontal dimension of a memristor two-dimensional collaborative learning architecture, wherein the local feature learning module of the horizontal dimension simulates the hierarchical perception mechanism of the mammalian visual cortex based on a convolutional neural network, extracts multi-level spatial features of the frequency-time two-dimensional feature map through the hierarchical perception mechanism, and determines the emotion category corresponding to the EEG signal based on the spatial features; A population variation mechanism is derived based on the physical perturbation modeling of memristor hardware during the weight writing and reading process, and the population variation mechanism provides a source of variation for individuals in the population. Inputting the individual variation sources of the population into the global evolutionary optimization module of the longitudinal dimension of the memristor two-dimensional collaborative learning architecture to increase memristor hardware perturbations, utilizing the individual variation and adaptive selection induced by the memristor hardware perturbations to construct an optimization strategy, and using the optimization strategy to evaluate and select the fittest emotion categories corresponding to the EEG signals to screen out optimal EEG emotion category recognition results; The optimal EEG signal emotion category recognition result is fed back to the local feature learning module of the horizontal dimension of the memristor two-dimensional collaborative learning architecture, forming a closed-loop process of local learning and global evolutionary collaborative iteration.
2. The method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture according to claim 1, characterized in that: The hierarchical perception mechanism includes four convolutional layers, a pooling layer, three fully connected layers, and an output layer. The multi-level spatial features of the frequency-time two-dimensional feature map are extracted by the hierarchical perception mechanism, and the emotion category corresponding to the EEG signal is determined based on the spatial features, including: Performing convolution stacking processing on the frequency-time two-dimensional feature map through four convolution layers to perform feature learning and feature extraction on the frequency-time two-dimensional feature map to obtain convolution features; Inputting the frequency-time two-dimensional feature map into the pooling layer for maximum pooling processing to reduce the spatial dimension; The convolutional features are flattened and sequentially input into three fully connected layers. Global features are obtained by connecting and weighting the neurons in the fully connected layers. The probability of the frequency-time two-dimensional feature map belonging to each category is determined based on the global features. The output layer outputs the positive emotional state and its corresponding probability, the neutral emotional state and its corresponding probability, and the negative emotional state and its corresponding probability.
3. The method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture according to claim 1, characterized in that: Also includes: Mapping each convolutional neural network of the local feature learning module of the horizontal dimension to a logical partition in the memristor crossbar array to perform local feature extraction and feature learning, and updating the convolution kernel weights and fully connected layer weights in the convolutional neural network based on a quantization-aware backpropagation mechanism to achieve local autonomous learning of the local feature learning module of the horizontal dimension; A random initialization training strategy is adopted, and a quantization-aware training method is introduced. Weight quantization constraints are introduced into the training process of the memristor two-dimensional collaborative learning architecture, achieving end-to-end training and integrating the characteristics of memristor hardware.
4. The method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture according to claim 3, characterized in that: The random initialization training strategy is adopted, and a quantization-aware training method is introduced. Weight quantization constraints are introduced during the training process of the memristor two-dimensional collaborative learning architecture, achieving end-to-end training and integrating memristor hardware features, including: Randomly initialize the weights of the convolutional neural network; During the training process of the memristor two-dimensional collaborative learning architecture, a symmetrical and uniform quantization strategy is used to dynamically quantize the weight parameters of each individual convolutional neural network. The weights are scaled according to their maximum absolute value, rounded, and translated to the non-negative conductance range of the memristor hardware.
5. The method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture according to claim 4, characterized in that: The symmetrical and uniform quantization strategy is used to dynamically quantize the weight parameters of each convolutional neural network individual, including: During the training process of the memristor two-dimensional collaborative learning architecture, symmetric uniform quantization is applied to the weight parameters of each convolutional neural network individual. The quantization process is expressed as: , Among them, W i quant is the quantized weight matrix of the i-th convolutional neural network individual, W i is the weight parameter of each convolutional neural network individual, b is the number of quantization bits, S i =max(|W i |) is the maximum absolute value of the weights in the i-th convolutional neural network individual, which is used as a scaling factor; Each frequency-time two-dimensional feature map is processed using a symmetrical uniform quantization method. The quantization process is expressed as: , Where Δ is the quantization step size, Δ=max(|X|) / α, α is the half-level parameter, and X is the frequency-time two-dimensional feature map; Each quantized frequency-time two-dimensional feature map is processed by padding and sliding window expansion to construct an input matrix for convolution calculation. The expression of the input matrix is: , Among them, X patch The input matrix of the frequency-time two-dimensional feature map after convolution is k×M, which is used as the input matrix for matrix multiplication with the convolution kernel weight matrix. is a real matrix of dimension k×M, indicating that all elements of the input matrix are real numbers. Unfold(·) is to expand the padded image into a two-dimensional matrix in a sliding window manner, and each column is a convolution receptive field. Pad(·) is to perform an edge padding operation on the quantized frequency-time two-dimensional feature map to maintain or control the spatial size of the frequency-time two-dimensional feature map. quant is the quantized frequency-time two-dimensional feature map, k is the size of the convolution kernel after flattening, and M is the total number of sliding windows determined by the resolution of the frequency-time two-dimensional feature map.
6. The method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture according to claim 5, characterized in that: The physical disturbances include conductance fluctuations and programming variability. The population variation mechanism is obtained by modeling the physical disturbances of the memristor hardware during the weight writing and reading process. The sources of variation of the individuals in the population provided by the population variation mechanism include: Based on the conductance fluctuations and programming variability of memristive hardware during weight writing and reading, we model the population variation mechanism to provide the source of variation for individuals in the population. Additive Gaussian noise is injected into the quantized weight matrix of the i-th convolutional neural network as the variation source of the memristor hardware to obtain the variation weight matrix after the disturbance is added. The variation weight matrix after the disturbance is expressed as: , Among them, W i mut-G is the variation weight matrix after adding disturbance, W i quant is the quantized weight matrix of the i-th convolutional neural network individual, ΔW i is the disturbance caused by the memristor hardware, is the standard deviation of the disturbance in the current t-th round of training, The mean is 0 and the variance is Gaussian distribution, is the disturbance intensity; The disturbance intensity is dynamically adjusted according to the exponential decay law, and the formula for the disturbance intensity is: , in, is the standard deviation of the initial disturbance, is the final perturbation standard deviation, T is the total number of training rounds, and t is the current round; The physical characteristics of the memristor hardware during the actual programming process are obtained according to the variation weight matrix after the disturbance is added.
7. The method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture according to claim 1, characterized in that: Inputting the variation sources of the individuals in the population into the global evolutionary optimization module of the longitudinal dimension of the memristor two-dimensional collaborative learning architecture to increase the memristor hardware perturbation includes: The mutation sources of the individuals in the population are input into the global evolutionary optimization module of the vertical dimension of the memristor two-dimensional collaborative learning architecture. In the weight programming phase, the random perturbations caused by the memristor hardware are injected into the quantized weights of each convolutional neural network individual to generate the mutation population of the current round. The weight of the ith convolutional neural network individual after mutation in the mutation population is calculated as: , Among them, W i mut is the weight matrix of the i-th convolutional neural network individual after mutation, W i quant is the quantized weight of the convolutional neural network, ⊙ is the element-by-element multiplication, M i is the variation mask, ΔW i Perturbations caused by memristive hardware; In the current training batch (X patch ,y), the cross entropy loss is used to calculate the classification error to evaluate the performance of each variant individual. The formula for calculating the classification error using the cross entropy loss is: , in, is the loss value of the i-th convolutional neural network individual in the t-th round of training, is the cross entropy loss function, which is used for loss evaluation in multi-classification tasks, f(·) is the forward propagation function, and X patch is the frequency-time two-dimensional feature map matrix after convolution, and y is the true label corresponding to the current training sample; The loss value of the i-th convolutional neural network individual in the t-th round of training is encoded in the form of a one-hot vector: , in, is the loss value of the i-th convolutional neural network individual in the t-th round of training, C is the number of classification categories, y C is the one-hot label of category C, Y i (t) is the output logits of the i-th convolutional neural network individual, exp(·) is the exponential function used for softmax calculation; The impact of the memristor hardware disturbance is determined according to the loss value of the i-th convolutional neural network individual in the t-th round of training.
8. The method for processing EEG signals based on a memristor two-dimensional collaborative learning architecture according to claim 7, characterized in that: The optimization strategy constructed by utilizing individual variation and adaptive selection caused by the memristor hardware disturbance includes: In the current mutant population, the convolutional neural network individual with the smallest loss value is selected as the parent generation, and the index of the best individual in the current training round is determined based on the parent generation. The expression of the index of the best individual is: , in, is the index of the best individual in the current training round, is the cross entropy loss of the i-th convolutional neural network individual, and argmin is the index corresponding to the minimum value; Perform local learning on the selected parent convolutional neural network individuals and perform parameter update operations through the back propagation mechanism. The parameter update operation expression is: , in, is the weight of the parent convolutional neural network individual in the current round, is the learning rate, is the gradient of the corresponding loss function, Update the weight; Synchronously copy the updated parent weights to all other convolutional neural network individuals to initialize the population for the next training round: , in, is the initial weight of the i-th convolutional neural network individual in the t+1 round, is the updated weight of the parent convolutional neural network individual after the last round of training, Indicates that all convolutional neural network individuals except the parent are updated synchronously; Build an optimization strategy by synchronously updating and continuously evolving all convolutional neural network individuals.
9. A computer device comprising a memory and a processor, characterized in that: The method according to any one of claims 1 to 8 is implemented when the processor executes the computer program stored in the memory.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Electronic nose gas classification method based on memristor cell neural network
CN112433028A
Neuromorphic processing devices
US20160379110A1