Attention mechanism-based multi-channel spike potential classification method and related device
Through the multi-channel spike potential classification method based on the attention mechanism, using data enhancement and Five-Head Attention module to extract features, the problem of inaccurate multi-channel spike potential classification in the existing technology and being sensitive to noise is solved, and high accuracy is achieved. classification, reducing resource requirements.
Patent Information
- Application Number
- PCT/CN2023/084575
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-17
- Filing Date
- 2023-03-29
- Publication Date
- 2024-09-26
AI Technical Summary
The existing multi-channel spike potential classification algorithm cannot accurately classify the large-scale electrode data collected, and is sensitive to noise and interference. It requires a large amount of annotated data and computing resources, and the signal classification error rate is high for signals with similar shapes but small time differences. The classification effect is poor when the signal-to-noise ratio is low or there are overlapping signals.
A multi-channel spike potential classification method based on the attention mechanism is used to obtain multi-channel electrical signals through electrodes for amplification and demodulation processing, band-pass filtering to find spike potentials, and data enhancement processing. Five types of enhanced data are used to train the neural network model. The Five-Head Attention module is used to extract features to achieve rapid classification of newly collected signals.
It improves the classification accuracy of multi-channel spike potentials, reduces the sensitivity to noise and interference, reduces the demand for annotated data and computing resources, and improves the ability to classify signals with similar shapes but small time differences.
Smart Images

Figure CN2023084575_26092024_PF_FP
Abstract
Description
A multi-channel spike potential classification method based on attention mechanism and related equipment Technical Field
[0001] The present invention relates to the field of brain neuroscience technology, and in particular to a multi-channel spike potential classification method, system, terminal and computer-readable storage medium based on an attention mechanism. Background Art
[0002] Nerve impulses (action potentials) are generated by biological neurons. The temporal sequence of multiple action potentials is called a "pulse train." The process by which nerve cells emit action potentials or nerve impulses is called "neuronal firing."
[0003] When neurons are stimulated, they generate electrical signals called action potentials, or spikes. Spike sorting involves correctly assigning a spike to the neuron that generated it, as multiple neurons in the brain emit electrical signals at different times. These signals are picked up by electrodes. This process is called spike sorting.
[0004] Existing technologies for spike classification are divided into two categories: using supervised algorithms to classify multi-channel spikes and using unsupervised algorithms to classify multi-channel spikes. The supervised algorithm for multi-channel spike classification requires labeling the multi-channel spikes, which means that before putting them into model training, it is already known which multi-channel spikes belong to the same category and which multi-channel spikes do not. The disadvantage is that it requires a large amount of labeled data, which wastes a lot of manpower and material resources, and is sensitive to noise and interference. Unsupervised algorithm: As the name suggests, it does not require labeling of multi-channel spikes. During model training, it is not known which multi-channel spikes belong to the same category. The model extracts features by itself and then clusters them using kmeans. In addition, existing spike classification methods based on deep learning require a large amount of labeled data and computing resources, and are sensitive to noise and interference. Multi-channel spike detection and classification algorithms based on information compensation between multiple channels have a high classification error rate for spike signals with similar shapes but small time differences. The spike potential classification method based on wavelet transform and support vector machine has poor classification effect when the signal-to-noise ratio is low or there are overlapping spike potential signals.
[0005] Therefore, the existing technology still needs to be improved and developed.
[0006] Summary of the Invention
[0007] The main purpose of the present invention is to provide a multi-channel spike potential classification method, system, terminal and computer-readable storage medium based on the attention mechanism, aiming to solve the problem that the multi-channel spike potential classification algorithm in the existing technology cannot accurately classify the collected large-scale electrode data.
[0008] To achieve the above object, the present invention provides a multi-channel spike potential classification method based on an attention mechanism, the multi-channel spike potential classification method based on an attention mechanism comprising the following steps:
[0009] Acquire multi-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the multi-channel electrical signals to obtain the required digital signals emitted by neurons;
[0010] Performing band-pass filtering on the digital signal, and performing peak value search on the digital signal after band-pass filtering to obtain a peak potential;
[0011] Performing data enhancement processing on the spike potential to obtain five types of enhanced data, and using the spike potential and the five types of enhanced data to train a neural network model based on an attention mechanism to obtain a trained neural network model based on the attention mechanism;
[0012] For the newly collected target digital signal after bandpass filtering, the spike potential is searched in each channel of the electrode according to the threshold of the channel. If a spike potential is detected in one channel, all sampling points of all channels at the same time point are intercepted to obtain the target multi-channel spike potential. The target multi-channel spike potential is classified based on the trained neural network model based on the attention mechanism, and the classification probability of the multi-channel target spike potential is output.
[0013] Optionally, in the multi-channel spike classification method based on the attention mechanism, the data enhancement processing includes a first data enhancement processing, a second data enhancement processing, a third data enhancement processing, a fourth data enhancement processing, and a fifth data enhancement processing;
[0014] The first data enhancement processing is: multiplying or dividing the spike potential by a value to obtain first enhanced data;
[0015] The second data enhancement processing is: shifting the spike potential left and right to obtain second enhanced data;
[0016] The third data enhancement process is: adding random noise to the spike potential to obtain third enhanced data;
[0017] The fourth data enhancement process is: performing spike overlap on the spike potential to obtain fourth enhanced data;
[0018] The fifth data enhancement process is: performing a DC offset on the spike potential to obtain fifth enhanced data.
[0019] Optionally, the multi-channel spike classification method based on the attention mechanism, wherein the use of the spike and five types of enhanced data to train a neural network model based on the attention mechanism to obtain a trained neural network model based on the attention mechanism, specifically includes:
[0020] Inputting the spike potential, the first enhanced data, the second enhanced data, the third enhanced data, the fourth enhanced data and the fifth enhanced data into the attention mechanism-based neural network model;
[0021] The neural network model based on the attention mechanism outputs a first classification probability, a second classification probability, a third classification probability, a fourth classification probability, a fifth classification probability, and a sixth classification probability respectively according to the spike potential, the first enhanced data, the second enhanced data, the third enhanced data, the fourth enhanced data, and the fifth enhanced data;
[0022] When the number of training times of the neural network model based on the attention mechanism reaches a predetermined number of iterations, and when the mutual information formed by the first classification probability, the second classification probability, the third classification probability, the fourth classification probability, the fifth classification probability and the sixth classification probability is greater than a preset threshold, it indicates that the currently trained data set can continue to be classified, the current data set is divided into two, and the data subsets are continued to be trained separately, and the current model parameters are saved. Otherwise, the data set has only one type of data and cannot be classified anymore.
[0023] Optionally, the multi-channel spike potential classification method based on the attention mechanism, wherein the features of the multi-channel spike potential are extracted from different angles based on the Five-Head Attention module in the neural network model based on the attention mechanism.
[0024] Optionally, in the multi-channel spike potential classification method based on the attention mechanism, multi-channel electrical signals emitted by multiple neurons are collected by sensors;
[0025] Amplifying the multi-channel electrical signal is completed by a signal amplifier;
[0026] Bandpass filtering and peak value search of the digital signal are completed by a processor module.
[0027] Optionally, in the multi-channel spike potential classification method based on the attention mechanism, the threshold value of each channel of the electrode is different.
[0028] Optionally, in the multi-channel spike potential classification method based on the attention mechanism, the number of sampling points is 61.
[0029] In addition, to achieve the above-mentioned purpose, the present invention further provides a multi-channel spike potential classification system based on an attention mechanism, wherein the multi-channel spike potential classification system based on an attention mechanism includes:
[0030] A signal acquisition module is used to acquire multi-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the multi-channel electrical signals, and obtain the required digital signals emitted by neurons;
[0031] A peak value search module is used to perform bandpass filtering on the digital signal, and perform peak value search on the digital signal after bandpass filtering to obtain a peak potential;
[0032] a model training module, configured to perform data enhancement processing on the spike potential to obtain five types of enhanced data, and train a neural network model based on an attention mechanism using the spike potential and the five types of enhanced data to obtain a trained neural network model based on the attention mechanism;
[0033] The classification processing module is used to search for spike potentials in each channel of the electrode according to the threshold of the channel for the newly collected target digital signal after bandpass filtering. If a spike potential is detected in a channel, all sampling points at the same time point in all channels are intercepted to obtain the target spike potential. The target spike potential is classified based on the trained neural network model based on the attention mechanism, and the classification probability of the target spike potential is output.
[0034] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a multi-channel spike potential classification program based on the attention mechanism stored on the memory and run on the processor, and when the multi-channel spike potential classification program based on the attention mechanism is executed by the processor, the steps of the multi-channel spike potential classification method based on the attention mechanism as described above are implemented.
[0035] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a multi-channel spike potential classification program based on an attention mechanism, and when the multi-channel spike potential classification program based on an attention mechanism is executed by a processor, the steps of the multi-channel spike potential classification method based on the attention mechanism as described above are implemented.
[0036] In the present invention, a multi-channel electrical signal emitted by multiple neurons is obtained through electrodes, the multi-channel electrical signal is amplified and demodulated to obtain the required digital signal emitted by the neurons; the digital signal is band-pass filtered, and the peak value search is performed on the digital signal after band-pass filtering to obtain a spike potential; the spike potential is subjected to data enhancement processing to obtain five types of enhanced data, and the spike potential and the five types of enhanced data are used to train a neural network model based on an attention mechanism to obtain a trained neural network model based on an attention mechanism; for the newly collected target digital signal after band-pass filtering, the spike potential is searched according to the threshold of the channel in each channel of the electrode. If a spike potential is detected in a channel, all sampling points at the same time point of all channels are intercepted to obtain a target multi-channel spike potential, and the trained neural network model based on the attention mechanism is classified according to the target multi-channel spike potential, and the classification probability of the multi-channel target spike potential is output. The present invention introduces the attention mechanism into the multi-channel spike potential classification, enhances the data of the multi-channel spike potential, so that the trained neural network model based on the attention mechanism can quickly output the classification probability of the multi-channel spike potential, and ultimately obtains an extremely high classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] FIG1 is a flow chart of a preferred embodiment of a multi-channel spike classification method based on an attention mechanism of the present invention;
[0038] FIG2 is a schematic diagram of data enhancement processing for spike potentials in a preferred embodiment of the multi-channel spike potential classification method based on the attention mechanism of the present invention;
[0039] FIG3 is a schematic diagram of a model structure after three categories of data are classified in a preferred embodiment of the multi-channel spike classification method based on the attention mechanism of the present invention;
[0040] FIG4 is a schematic diagram of an ACCM Backbone network in a preferred embodiment of the multi-channel spike classification method based on the attention mechanism of the present invention;
[0041] 5 is a schematic diagram of a neural network model training based on an attention mechanism in a preferred embodiment of the multi-channel spike potential classification method based on an attention mechanism of the present invention;
[0042] FIG6 is a schematic diagram showing the principle of a preferred embodiment of a multi-channel spike classification system based on an attention mechanism of the present invention;
[0043] FIG7 is a schematic diagram of an operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0045] The relevant concepts in the present invention are explained as follows:
[0046] As an unsupervised algorithm, contrastive learning doesn't require data annotation during model training. Traditional supervised algorithms require data annotation, which is extremely labor-intensive and resource-intensive. Contrastive learning, as a type of unsupervised algorithm, is unique in that it requires data augmentation.
[0047] Sample augmentation: This involves generating an augmented sample that is similar to the original sample, ensuring that the original and augmented samples belong to the same class. During model training, the original and augmented samples are guaranteed to have the same class label after training. After multiple iterations of training, the model will correctly classify the data. Sample augmentation can be one-to-one or one-to-many. In the one-to-many case, an original sample and multiple augmented samples still belong to the same class label after training.
[0048] Embedded brain-computer interface: By implanting electrodes into the brain, single-channel electrical signals emitted by neurons are obtained.
[0049] Maximum mutual information: Enhancing the original data creates enhanced data. At this point, the original data and the enhanced data have a one-to-one or one-to-many relationship. Assuming data enhancement is a one-to-many relationship, the previous data needs to be copied into multiple copies, forming a many-to-many relationship. For example, if the data is one-to-five, the previous data needs to be copied four times, resulting in a five-to-five relationship, forming a data pair. Assuming the model has ten categories, after the original data is classified by the model, each category has a probability, but the sum of the ten categories is 1. Similarly, after the enhanced data is classified by the model, each category also has a probability, and the sum of the ten categories is still 1. The goal is to form a 10*10 matrix with the category probabilities formed by the original data and the category probabilities formed by the enhanced data. When the 10*10 matrices of multiple batches of data pairs are added together, it is guaranteed that a certain attribute of the matrix after the addition is maximized. This is called maximizing mutual information.
[0050] Converting a multi-classification problem to a binary classification problem: Data with the same label, whether binary or multi-class, will be classified into the same class after a trained model. After the data is trained, if its mutual information remains below a certain threshold (defined by the model), it indicates that the data has already been classified into a single class and no further model training is required. If, while maximizing the mutual information, the mutual information exceeds a certain threshold, it indicates that the data still has two or more classes and requires further training. Training batches (defined by the model). Throughout the entire process, if a dataset can be binary classified, it is divided into two subsets, and these two subsets are then classified separately. If the mutual information of a subset remains below a certain threshold within a defined training batch, it indicates that the subset has already been classified into a single class and no further classification is required. If the mutual information of a subset gradually exceeds a certain threshold within a defined training batch, the table can be binary-classified and the subset continues to be classified into two classes. The above process is then continued.
[0051] Spike potential overlap: When the electrode collects data, two or more neurons may emit discharge signals at the same time. At this time, the signal collected by the electrode is an overlapping electrical signal.
[0052] Neuronal burst: When a neuron is suddenly stimulated strongly, it will frequently emit electrical signals in a short period of time, and the peak value of the electrical signal will gradually decrease.
[0053] Attention mechanism: It is a data processing method that extracts effective features of input data from multiple perspectives, thereby automatically learning the contribution of input data to output data.
[0054] Sampling Points: Since different electrodes have different sampling frequencies, the required sampling points are also different. Generally, a neuron fires an action potential between 2ms and 3ms, so regardless of the electrode frequency, a sampling point between 2 and 3ms will be captured. (For example, if the electrode frequency is 20kHz, the number of sampling points would be 40-60. Generally, 60 or more sampling points are selected to capture all the information about the spike potential.)
[0055] The multi-channel spike potential classification method based on the attention mechanism described in the preferred embodiment of the present invention is shown in Figure 1, and the multi-channel spike potential classification method based on the attention mechanism includes the following steps:
[0056] Step S10: Acquire multi-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the multi-channel electrical signals to obtain the required digital signals emitted by neurons.
[0057] Specifically, the sensor is used to collect multi-channel electrical signals emitted by multiple neurons through the electrode, and then the multi-channel electrical signals are amplified through the signal amplifier (Interface readout, which mainly amplifies the recorded signals in the sensor). The amplified multi-channel electrical signals are demodulated to obtain digital signals (a series of numbers, equivalent to the original data).
[0058] Step S20: performing band-pass filtering on the digital signal, and performing peak value search on the digital signal after band-pass filtering to obtain a peak potential.
[0059] Specifically, the digital signal is bandpass filtered, and a spike value search is performed on the digital signal after bandpass filtering to obtain a spike potential (Spike waveform is a spike potential waveform). After obtaining the spike potential, that is, on the digital signal data after filtering, a spike value search is performed to search for the spike potential existing on the digital signal data, and many spike potentials may be found.
[0060] It should be noted that the number of electrode channels is much greater than 1, so a peak search is performed on each channel. Assuming a peak is found in the first channel, 61 sampling points around this peak point are intercepted, and 61 sampling points are also sampled for all remaining channels. The search then continues in the second channel, and continues until the last channel is found. However, there is a problem. When a neuron fires, a spike potential may appear at the same location in the first and second channels, and the data may be repeated. However, for the model, data duplication is allowed. Note that the threshold of each channel is determined by the signal of this channel, so when searching according to the threshold in each channel, the threshold of each channel is different.
[0061] Electrodes are used to obtain brain data. Usually, electrodes have 16, 32, 64, 128 or more channels. Assuming that the potential used has 32 channels, the spike potential data of all 32 channels can be obtained.
[0062] Step S30: After performing data enhancement processing on the spike potential, five types of enhanced data are obtained; the spike potential and the five types of enhanced data are used to train a neural network model based on the attention mechanism to obtain a trained neural network model based on the attention mechanism.
[0063] Specifically, the data enhancement processing includes first data enhancement processing, second data enhancement processing, third data enhancement processing, fourth data enhancement processing and fifth data enhancement processing; the first data enhancement processing is: multiplying or dividing the peak potential by a value to obtain first enhanced data; the second data enhancement processing is: shifting the peak potential left and right to obtain second enhanced data; the third data enhancement processing is: adding random noise to the peak potential to obtain third enhanced data; the fourth data enhancement processing is: overlapping the peak potential to obtain fourth enhanced data; the fifth data enhancement processing is: DC offsetting the peak potential to obtain fifth enhanced data.
[0064] Any of the five data enhancement processes mentioned above can achieve data enhancement, but if the spike potential is enhanced in multiple ways, the neural network model will converge better. For example, if the five enhancement methods are performed simultaneously as mentioned above, one original sample will produce five different enhanced samples. Then, when the neural network model generates information for comparison, the information generated by one sample corresponds to the information of five enhanced samples. This makes it easier to extract the most essential information of the original sample. In other words, the more enhancement methods, the better the model effect.
[0065] Among them, the first data enhancement processing: amplitude scaling, the spike potential is multiplied or divided by a value, simulating that when the electrode is implanted in the brain, the electrode will change over time and the position of the electrode will also change. At this time, the waveform collected from a specific neuron may become larger or smaller.
[0066] Among them, the second data enhancement processing: left and right offset, assuming the case of left offset, the current data dimension is 10*61, where 10 represents ten channels and 61 represents the sampling point. Then randomly select one to the left (an integer uniformly distributed between 0 and 10). Assuming 5 is selected, the 5 data of the sampling point 61 are discarded. At this time, the data dimension becomes 10*56, but in order to meet the dimension of 10*61, the remaining 5 data are the same as the last value in the 10*56 data. When selecting the spike potential, it cannot be guaranteed that the peak value point of the spike potential waveform always remains at a fixed position in the intercepted time window.
[0067] Among them, the third data enhancement processing: random noise, spike potential adds random noise, simulates tissue fluid or during movement, when the electrode collects the spike potential of a specific neuron, the shape of the spike potential at different times is different.
[0068] Among them, the fourth data enhancement processing: spike overlap, (one of the two multi-channel spikes is first offset left and right, then multiplied or divided by a value, and then the two are added.
[0069] Among them, the fifth data enhancement processing: DC offset. DC offset is to add a random value (uniformly distributed between 0-0.1) to the multi-channel spike potential as a whole. Because when the electrode is implanted in the brain, as time offsets, the electrical signals emitted by neurons collected by the electrode will collectively increase or decrease.
[0070] As shown in FIG2 , from top to bottom are schematic diagrams of original samples, amplitude scaling, left and right offsets, random noise, spike overlap, and DC offset.
[0071] The present invention introduces an attention mechanism into a neural network model. When training the neural network model based on the attention mechanism, the spike potential, the first enhanced data, the second enhanced data, the third enhanced data, the fourth enhanced data and the fifth enhanced data are input into the neural network model based on the attention mechanism; the neural network model based on the attention mechanism outputs a first classification probability, a second classification probability, a third classification probability, a fourth classification probability, a fifth classification probability and a sixth classification probability respectively according to the spike potential, the first enhanced data, the second enhanced data, the third enhanced data, the fourth enhanced data and the fifth enhanced data; when the number of training times of the neural network model based on the attention mechanism reaches a predetermined number of iterations, and when the mutual information formed by the first classification probability, the second classification probability, the third classification probability, the fourth classification probability, the fifth classification probability and the sixth classification probability is greater than a preset threshold, it indicates that the currently trained data set can continue to be classified, the current data set is divided into two, and the data subsets are further trained, and the current model parameters are saved. Otherwise, the data set has only one type of data and cannot be classified again.
[0072] That is, the present invention introduces the attention mechanism into the multi-channel spike potential, which allows the neural network model to extract the features of a multi-channel spike potential data from multiple angles. Extracting the features of the multi-channel spike potential means judging whether the multi-channel spike potential belongs to a neuron from factors such as the electrical signal distribution channel, amplitude, and shape. The neural network model mainly extracts features through the Five-Head Attention module. Five-Head Attention is five-head attention. Its simplest expression is that this module extracts the features of the multi-channel spike potential from five angles. The features are relative to the entire data, but the data generally has noise. If it is directly clustered, it will affect the classification effect. Therefore, the purpose of extracting features is to filter out useless noise and retain only useful information.
[0073] However, there may be cases where the features extracted from two or three angles are on the same dimension. For example, these two or three angles may all extract features from the perspective of the electrical signal distribution channel, resulting in duplication. Of course, the more angles of attention, the better, meaning that five heads of attention can become seven or eight. However, arbitrarily increasing the number of heads will result in insufficient feature information extracted by each head, resulting in reduced accuracy. Multiple angles: the amplitude of each channel in a multi-channel spike (the amplitude of the electrical signal emitted by a neuron varies across each channel. Because neurons emit signals, channels closer to each other receive larger signals, while channels farther away may not even receive any signals), the shape of each channel in a multi-channel spike, and the distribution of spikes across each channel (because neurons emit signals, an electrode has multiple channels. Some channels may not receive the signal, while others may receive it. However, the channels that do receive the signal may have different signal sizes and strengths depending on their distance from the neuron). These angles allow neural network models (using the model architecture of the attention mechanism) to classify multi-channel spikes from multiple angles. For example, a neural network model based on the attention mechanism can extract features of multi-channel spikes from the perspective of each channel's peak value and the channels in which they appear. Because a neuron's discharge signal cannot be recorded by all channels, it will only be recorded by a subset of channels. Simultaneously, by introducing contrastive learning (the attention mechanism is primarily related to feature extraction, while contrastive learning is the distinction between supervised and unsupervised learning; for example, the attention mechanism can be combined with contrastive learning, and similarly, the attention mechanism can be combined with non-contrastive learning, with contrastive learning being a subset of the unsupervised category) into multi-channel spikes, unsupervised classification can be achieved and model classification can be made interpretable.
[0074] As shown in Figure 3, a queue is set up. Initially, there is only one dataset (which contains all training data), named m-data. The first string sequence represents the order in which the neural network nodes are trained. For example, if there is a dataset named mll-data in the queue, this dataset is generated by: the left subset (ml-data) and right subset (ml-data) of the m-data dataset after binary classification by the m-network, and then the left subset (mll-data) and right subset (mlr-data) of the ml-data dataset after binary partitioning by the ml-network. When the model begins training, the queue has only one dataset, m-data. It is then trained through the m-network and divided into ml-data and mr-data. At this point, m-data is dequeued and ml-data and mr-data are enqueued. However, if the Controller module finds that the current dataset cannot be binary partitioned, it will simply dequeue it.
[0075] Among them, the Controller module has two functions: one is to calculate whether the current neural network model based on the attention mechanism should continue to be trained, and the other is to calculate the probability that the data set can be classified into two categories. First, the Controller module mainly uses the output information of its previous module F2:FC(2) to obtain the mutual information. The Controller module calculates the current number of iterations. If it is less than the set threshold, the current maximum mutual information is used to perform backpropagation on the neural network, and then the current neural network model based on the attention mechanism is continued to be trained. If the number of iterations is equal to the set threshold, then the current mutual information value is used to determine whether to divide the data set into the left subset and the right subset and queue them, and then dequeue the current data set, or directly dequeue the current data set and mark the training path from the original data set to the current data set as a complete classification path. During the test, as long as there is data that passes through the same training path, it will be considered to belong to a certain assumed category.
[0076] As shown in Figure 3, a dataset is placed in a queue, and the data subset at the head of the queue is taken out. If binary separation is possible, the left and right subsets after classification are put into the queue. The m network represents the neural network model corresponding to the m-data data. If the training is done on r-data, the network becomes the r network, and the backbone network is the same. F2:FC(2) represents a fully connected network with 2 neurons. Similarly, F4:FC(4) represents a fully connected network with 4 neurons. The augmentation network represents the five enhancement methods proposed above.
[0077] As shown in Figure 4, it shows the model structure after data with a total of three categories (actually there can be ten or even more analogous categories) are classified, in which each type of neuron represents a multi-channel neuron, but it is impossible to express it with multi-channel spike potentials.
[0078] As shown in Figure 5, it represents the backbone network model. The ACCM Backbone network corresponds to B: Backbone network in Figure 4. This architecture is the model architecture used in the present invention. The ACCM Encoder module in Figure 4 is a change made to the Transformer Encoder. There is no A: FeedForward module and B: Feed Forward module in the Transformer Encoder module. The reason why these two modules are added to the ACCM Encoder module of this model is mainly to reduce the number of parameters and speed up the training speed of the model. The N* in Figure 5 means that there are N ACCM Encoder modules one after another, a total of N, and this N is artificially set. Input means input. There are two Input modules in Figure 5, and the data is the same. The A / B / C / D: FeedForward modules are fully connected, Five-HeadAttention: is five-head attention, and Add&Norm: adds and then normalizes. For example, let's take the Add&Norm module after B: Feed Forward as an example: this Add&Norm module mainly adds the input after B: Feed Forward module to the value after Input, performs normalization, and then inputs it to C: FeedForward module. Similarly, the Add&norm module after C: Feed Forward adds the input before C: Feed Forward module and the input after C: Feed Forward module, and then normalizes.
[0079] Step S40: For the newly collected target digital signal after bandpass filtering, search for the spike potential in each channel of the electrode according to the threshold of the channel. If a spike potential is detected in one channel, all sampling points at the same time point in all channels are intercepted to obtain the target multi-channel spike potential. Classify the target multi-channel spike potential based on the trained neural network model based on the attention mechanism, and output the classification probability of the multi-channel target spike potential.
[0080] Specifically, after the training of the neural network model based on the attention mechanism is completed, for the newly collected target digital signal after bandpass filtering, the spike potential is searched in each channel according to the threshold of the channel. If a spike potential appears in one channel, all 61 samples of the same time point of all channels are intercepted. If the target multi-channel spike potential is obtained, the trained neural network model based on the attention mechanism is used to classify the target multi-channel spike potential, and the classification probability of the target multi-channel spike potential is output.
[0081] Furthermore, as shown in FIG6 , based on the above-mentioned multi-channel spike potential classification method based on the attention mechanism, the present invention also provides a multi-channel spike potential classification system based on the attention mechanism, wherein the multi-channel spike potential classification system based on the attention mechanism includes:
[0082] A signal acquisition module 51 is used to acquire multi-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the multi-channel electrical signals, and obtain the required digital signals emitted by the neurons;
[0083] A peak value search module 52 is configured to perform bandpass filtering on the digital signal, and perform peak value search on the digital signal after bandpass filtering to obtain a peak potential;
[0084] a model training module 53 for performing data enhancement processing on the spike potential to obtain five types of enhanced data, and training a neural network model based on the attention mechanism using the spike potential and the five types of enhanced data to obtain a trained neural network model based on the attention mechanism;
[0085] The classification processing module 54 is used to search for spike potentials in each channel of the electrode according to the threshold value of the channel for the newly collected target digital signal after bandpass filtering. If a spike potential is detected in a channel, all sampling points at the same time point in all channels are intercepted to obtain the target spike potential, and the target spike potential is classified based on the trained neural network model based on the attention mechanism, and the classification probability of the target spike potential is output.
[0086] Furthermore, as shown in FIG7 , based on the above-mentioned multi-channel spike classification method and system based on the attention mechanism, the present invention also provides a terminal, which includes a processor 10, a memory 20, and a display 30. FIG7 shows only some components of the terminal, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0087] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Furthermore, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a multi-channel spike potential classification program 40 based on an attention mechanism is stored on the memory 20, and the multi-channel spike potential classification program 40 based on an attention mechanism can be executed by the processor 10, thereby realizing the multi-channel spike potential classification method based on the attention mechanism in the present application.
[0088] In some embodiments, the processor 10 can be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the multi-channel spike potential classification method based on the attention mechanism.
[0089] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0090] In one embodiment, when the processor 10 executes the attention mechanism-based multi-channel spike classification program 40 in the memory 20, the following steps are implemented:
[0091] Acquire multi-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the multi-channel electrical signals to obtain the required digital signals emitted by neurons;
[0092] Performing band-pass filtering on the digital signal, and performing peak value search on the digital signal after band-pass filtering to obtain a peak potential;
[0093] Performing data enhancement processing on the spike potential to obtain five types of enhanced data, and using the spike potential and the five types of enhanced data to train a neural network model based on an attention mechanism to obtain a trained neural network model based on the attention mechanism;
[0094] For the newly collected target digital signal after bandpass filtering, the spike potential is searched in each channel of the electrode according to the threshold of the channel. If a spike potential is detected in one channel, all sampling points of all channels at the same time point are intercepted to obtain the target multi-channel spike potential. The target multi-channel spike potential is classified based on the trained neural network model based on the attention mechanism, and the classification probability of the multi-channel target spike potential is output.
[0095] The data enhancement processing includes a first data enhancement processing, a second data enhancement processing, a third data enhancement processing, a fourth data enhancement processing and a fifth data enhancement processing;
[0096] The first data enhancement processing is: multiplying or dividing the spike potential by a value to obtain first enhanced data;
[0097] The second data enhancement processing is: shifting the spike potential left and right to obtain second enhanced data;
[0098] The third data enhancement process is: adding random noise to the spike potential to obtain third enhanced data;
[0099] The fourth data enhancement process is: performing spike overlap on the spike potential to obtain fourth enhanced data;
[0100] The fifth data enhancement process is: performing a DC offset on the spike potential to obtain fifth enhanced data.
[0101] The method of using the spike potential and the five enhanced data to train the neural network model based on the attention mechanism to obtain a trained neural network model based on the attention mechanism specifically includes:
[0102] Inputting the spike potential, the first enhanced data, the second enhanced data, the third enhanced data, the fourth enhanced data and the fifth enhanced data into the attention mechanism-based neural network model;
[0103] The neural network model based on the attention mechanism outputs a first classification probability, a second classification probability, a third classification probability, a fourth classification probability, a fifth classification probability, and a sixth classification probability respectively according to the spike potential, the first enhanced data, the second enhanced data, the third enhanced data, the fourth enhanced data, and the fifth enhanced data;
[0104] When the number of training times of the neural network model based on the attention mechanism reaches a predetermined number of iterations, and when the mutual information formed by the first classification probability, the second classification probability, the third classification probability, the fourth classification probability, the fifth classification probability and the sixth classification probability is greater than a preset threshold, it indicates that the currently trained data set can continue to be classified, the current data set is divided into two, and the data subsets are continued to be trained separately, and the current model parameters are saved. Otherwise, the data set has only one type of data and cannot be classified anymore.
[0105] Among them, the Five-Head Attention module in the neural network model based on the attention mechanism extracts the features of multi-channel spike potentials from different angles.
[0106] Among them, multi-channel electrical signals emitted by multiple neurons are collected by sensors;
[0107] Amplifying the multi-channel electrical signal is completed by a signal amplifier;
[0108] Bandpass filtering and peak value search of the digital signal are completed by a processor module.
[0109] The threshold value of each channel of the electrode is different.
[0110] Among them, the number of sampling points is 61.
[0111] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a multi-channel spike potential classification program based on an attention mechanism, and when the multi-channel spike potential classification program based on an attention mechanism is executed by a processor, the steps of the multi-channel spike potential classification method based on the attention mechanism as described above are implemented.
[0112] In summary, the present invention provides a multi-channel spike potential classification method based on an attention mechanism and related equipment, the method comprising: obtaining multi-channel electrical signals emitted by multiple neurons through electrodes, amplifying and demodulating the multi-channel electrical signals to obtain the required digital signals emitted by neurons; band-pass filtering the digital signals, and performing peak value search on the band-pass filtered digital signals to obtain spike potentials; performing data enhancement processing on the spike potentials to obtain five types of enhanced data, and using the spike potentials and the five types of enhanced data to train a neural network model based on an attention mechanism to obtain a trained neural network model based on an attention mechanism; for a newly collected target digital signal after band-pass filtering, searching for spike potentials in each channel of the electrode according to the threshold of the channel, if a spike potential is detected in a channel, all sampling points at the same time point in all channels are intercepted to obtain the target multi-channel spike potential, and the target multi-channel spike potential is classified based on the trained neural network model based on the attention mechanism, and the classification probability of the multi-channel target spike potential is output. The present invention introduces the attention mechanism into the multi-channel spike potential classification and enhances the data of the multi-channel spike potential, so that the trained neural network model based on the attention mechanism can quickly output the classification probability of the multi-channel spike potential, and ultimately achieve extremely high classification accuracy.
[0113] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or terminal comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or terminal comprising the element.
[0114] Of course, those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware (such as a processor, controller, etc.) through a computer program. The program can be stored in a computer-readable storage medium that can be read by a computer. When the program is executed, it can include the processes in the above-described method embodiments. The computer-readable storage medium can be a memory, a magnetic disk, an optical disk, etc.
[0115] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A multi-channel spike potential classification method based on attention mechanism, characterized in that: The multi-channel spike potential classification method based on the attention mechanism includes: Acquire multi-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the multi-channel electrical signals to obtain the required digital signals emitted by neurons; Performing bandpass filtering on the digital signal, and performing peak value search on the digital signal after bandpass filtering to obtain a peak potential; After performing data enhancement processing on the spike potential, five types of enhanced data are obtained, and the spike potential and the five types of enhanced data are used to train a neural network model based on an attention mechanism to obtain a trained neural network model based on an attention mechanism; For the newly collected target digital signal after bandpass filtering, the spike potential is searched in each channel of the electrode according to the threshold of the channel. If a spike potential is detected in one channel, all sampling points at the same time point in all channels are intercepted to obtain the target multi-channel spike potential. The target multi-channel spike potential is classified based on the trained neural network model based on the attention mechanism, and the classification probability of the multi-channel target spike potential is output.
2. The multi-channel spike potential classification method based on the attention mechanism according to claim 1 is characterized in that: The data enhancement processing includes a first data enhancement processing, a second data enhancement processing, a third data enhancement processing, a fourth data enhancement processing and a fifth data enhancement processing; The first data enhancement process is: multiplying or dividing the spike potential by a value to obtain first enhanced data; The second data enhancement processing is: shifting the spike potential left and right to obtain second enhanced data; The third data enhancement process is: adding random noise to the spike potential to obtain third enhanced data; The fourth data enhancement processing is: performing peak potential overlap on the spike potential to obtain fourth enhanced data; The fifth data enhancement process is: performing a DC offset on the peak potential to obtain fifth enhanced data.
3. The multi-channel spike potential classification method based on the attention mechanism according to claim 2 is characterized in that: The use of the spike potential and the five enhanced data to train the neural network model based on the attention mechanism to obtain a trained neural network model based on the attention mechanism specifically includes: Inputting the spike potential, the first enhanced data, the second enhanced data, the third enhanced data, the fourth enhanced data and the fifth enhanced data into the attention mechanism-based neural network model; The neural network model based on the attention mechanism corresponds to the spike potential, the first enhanced data, the second enhanced data, the third enhanced data, the fourth enhanced data and the fifth enhanced data respectively. Output the first classification probability, the second classification probability, the third classification probability, the fourth classification probability, the fifth classification probability and the sixth classification probability; When the number of training times of the neural network model based on the attention mechanism reaches a predetermined number of iterations, and when the mutual information formed by the first classification probability, the second classification probability, the third classification probability, the fourth classification probability, the fifth classification probability and the sixth classification probability is greater than a preset threshold, it indicates that the currently trained data set can continue to be classified, the current data set is divided into two, and the data subsets are continued to be trained separately, and the current model parameters are saved, otherwise the data set has only one type of data and cannot be classified anymore.
4. The multi-channel spike potential classification method based on the attention mechanism according to claim 1 is characterized in that: Based on the Five-Head Attention module in the neural network model based on the attention mechanism, the features of multi-channel spike potentials are extracted from different angles.
5. The multi-channel spike classification method based on the attention mechanism according to claim 1, characterized in that: Multi-channel electrical signals emitted by multiple neurons are collected through sensors; Amplifying the multi-channel electrical signal is completed by a signal amplifier; Bandpass filtering and peak value searching of the digital signal are performed by a processor module.
6. The multi-channel spike potential classification method based on the attention mechanism according to claim 1, characterized in that: The threshold value of each channel of the electrode is different.
7. The multi-channel spike potential classification method based on the attention mechanism according to claim 1 is characterized in that: The number of the sampling points is 61.
8. A multi-channel spike classification system based on attention mechanism, characterized in that: The multi-channel spike classification system based on the attention mechanism includes: A signal acquisition module is used to acquire multi-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the multi-channel electrical signals, and obtain the required digital signals emitted by neurons; A peak value search module, used for performing bandpass filtering on the digital signal, and performing peak value search on the digital signal after bandpass filtering to obtain a peak potential; A model training module, used to perform data enhancement processing on the spike potential to obtain five types of enhanced data, and use the spike potential and the five types of enhanced data to train a neural network model based on an attention mechanism to obtain a trained neural network model based on an attention mechanism; The classification processing module is used to search for spike potentials in each channel of the electrode according to the threshold of the channel for the newly acquired target digital signal after bandpass filtering. If a spike potential is detected in one channel, all channels are filtered out. All sampling points at the same time point are intercepted to obtain the target spike potential, and the target spike potential is classified based on the trained neural network model based on the attention mechanism, and the classification probability of the target spike potential is output.
9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a multi-channel spike potential classification program based on an attention mechanism stored in the memory and executable on the processor. When the multi-channel spike potential classification program based on the attention mechanism is executed by the processor, the steps of the multi-channel spike potential classification method based on the attention mechanism as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a multi-channel spike potential classification program based on an attention mechanism, and when the multi-channel spike potential classification program based on the attention mechanism is executed by a processor, the steps of the multi-channel spike potential classification method based on the attention mechanism as described in any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Neural signal classification method for multi-electrode array
CN112381174A
SSVEP classification method based on convolutional neural network
CN113052099A
Depression state indication determination method based on neuron spike potential signal
CN114305423A
Neural mimicry calculation-based online neuron classification method
CN114925734A
Multi-channel-based integrated noise and echo signal cancellation device using deep neural network
WO2022158912A1
