Single-channel spike potential classification method based on comparative learning, and related device
The comparative learning method is used to classify neuron signals, which solves the problem in the existing technology that the number of neurons and the number of classifications cannot be determined, achieves high-accuracy classification of neuron signals, and enhances information utilization.
Patent Information
- Application Number
- PCT/CN2023/084143
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-17
- Filing Date
- 2023-03-27
- Publication Date
- 2024-09-26
AI Technical Summary
The existing technology cannot effectively handle the number of neuron firings and the number of classifications in spike classification, and the AE model is easily affected by noise, and the Kilosort model reduces the relationship between channels, resulting in a reduction in the amount of information and the inability to effectively solve the problem of neurons. Burst and spike overlap issues.
A single-channel spike potential classification method based on contrastive learning is used to obtain single-channel electrical signals emitted by neurons through electrodes, amplify, demodulate, band-pass filter and spike value search, perform data enhancement processing, and use neural network models for training. Outputting classification probability solves the problem of classification accuracy and information content of signals issued by neurons.
It achieves high-accuracy classification of neuron firing signals, can quickly identify the classification probability of neuron firing, solves the problem of neuron burst and spike overlap, and improves classification accuracy and information utilization.
Smart Images

Figure CN2023084143_26092024_PF_FP
Abstract
Description
A single-channel spike potential classification method based on contrastive learning and related equipment Technical Field
[0001] The present invention relates to the field of brain neuroscience technology, and in particular to a single-channel spike potential classification method, system, terminal and computer-readable storage medium based on contrastive learning. 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. The first category is supervised classification. However, supervised classification requires data labeling, which requires a lot of manpower and material resources and is not portable. The second category is unsupervised classification, the AE model - the autoencoder model, which reduces the dimensionality of the data and then increases the dimensionality, and uses the intermediate features after dimensionality reduction for clustering. However, the AE model can only compress data that is similar to the training data. It cannot effectively reconstruct data of different types or distributions. The AE model is also very susceptible to noise and is prone to problems such as being unable to reconstruct data after dimensionality reduction and then dimensionality increase. The AE model is to reduce the dimensionality of the data and then increase the dimensionality. The result is to ensure that the sum of the squared errors of the data after dimensionality increase and the original data is minimized, that is, the data after dimensionality increase is as consistent as possible with the distribution of the original data. The Kilosort model is currently the most famous spike classification model. The Kilosort model reduces the relationship between channels by performing a series of preprocessing on multi-channel spikes, such as de-common mode, zero-phase filtering, and ZCA whitening. In this way, it is only necessary to sort the spikes for each channel separately. This does not actually solve the problems of neuronal bursts (neuronal bursts: when a neuron is suddenly stimulated strongly, it will frequently emit discharge signals in a short period of time, and the peak value of the electrical signal will gradually decrease), spike potential overlap (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). In addition, while reducing the relationship between channels, it also reduces the amount of information used for classification.
[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 single-channel spike potential classification method, system, terminal and computer-readable storage medium based on contrastive learning, aiming to solve the problem in the prior art that in the spike potential classification process, it is impossible to know how many neurons are emitting spike potentials and the number of classifications cannot be determined.
[0008] To achieve the above object, the present invention provides a single-channel spike potential classification method based on contrastive learning, the single-channel spike potential classification method based on contrastive learning comprising the following steps:
[0009] Acquire single-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the 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 three types of enhanced data, and training a neural network model using the spike potential and the three types of enhanced data to obtain a trained neural network model;
[0012] For the newly collected target digital signal after bandpass filtering, the target spike potential is obtained by peak value search, and the target spike potential is classified based on the trained neural network model, and the classification probability of the target spike potential is output.
[0013] Optionally, in the single-channel spike classification method based on contrastive learning, the data enhancement processing includes a first data enhancement processing, a second data enhancement processing, and a third data enhancement processing;
[0014] The first data enhancement process is: adding random noise to the spike potential to obtain first enhanced data;
[0015] The second data enhancement processing is: multiplying or dividing the spike potential by a value to obtain second enhanced data;
[0016] The third data enhancement process is: randomly multiplying or dividing the rising edge or falling edge of the spike waveform by a value to obtain third enhanced data.
[0017] Optionally, the single-channel spike potential classification method based on contrastive learning, wherein the use of the spike potential and three types of enhanced data to train a neural network model to obtain a trained neural network model specifically includes:
[0018] Inputting the spike potential, the first enhanced data, the second enhanced data, and the third enhanced data into the neural network model;
[0019] The neural network model outputs a first classification probability, a second classification probability, a third classification probability and a fourth classification probability respectively according to the spike potential, the first enhanced data, the second enhanced data and the third enhanced data;
[0020] When the neural network model is trained for a predetermined number of iterations, and when the mutual information formed by the first classification probability, the second classification probability, the third classification probability and the fourth 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 any further.
[0021] Optionally, in the single-channel spike potential classification method based on contrastive learning, single-channel electrical signals emitted by multiple neurons are collected by sensors.
[0022] Optionally, in the single-channel spike potential classification method based on contrastive learning, the electrical signal is amplified by a signal amplifier.
[0023] Optionally, in the single-channel spike potential classification method based on contrastive learning, bandpass filtering and peak value search of the digital signal are completed by a processor module.
[0024] Optionally, in the single-channel spike potential classification method based on contrastive learning, each type of spike potential corresponds to an electrical signal emitted by a neuron.
[0025] In addition, to achieve the above-mentioned object, the present invention further provides a single-channel spike potential classification system based on contrastive learning, wherein the single-channel spike potential classification system based on contrastive learning comprises:
[0026] The data acquisition and processing module is used to obtain single-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the electrical signals, and obtain the required digital signals emitted by neurons;
[0027] A filtering 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;
[0028] a data enhancement training module, configured to perform data enhancement processing on the spike potential to obtain three types of enhanced data, and train a neural network model using the spike potential and the three types of enhanced data to obtain a trained neural network model;
[0029] The classification probability output module is used to obtain the target spike potential by peak value search for the newly collected target digital signal after bandpass filtering, classify the target spike potential based on the trained neural network model, and output the classification probability of the target spike potential.
[0030] 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 single-channel spike potential classification program based on contrastive learning stored on the memory and runnable on the processor, and when the single-channel spike potential classification program based on contrastive learning is executed by the processor, the steps of the single-channel spike potential classification method based on contrastive learning as described above are implemented.
[0031] 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 single-channel spike potential classification program based on contrastive learning, and when the single-channel spike potential classification program based on contrastive learning is executed by a processor, the steps of the single-channel spike potential classification method based on contrastive learning as described above are implemented.
[0032] In the present invention, a single-channel electrical signal emitted by multiple neurons is obtained through electrodes, and the 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 three types of enhanced data, and the spike potential and the three enhanced data are used to train a neural network model to obtain a trained neural network model; for a newly collected target digital signal after band-pass filtering, a target spike potential is obtained through peak value search, and the target spike potential is classified based on the trained neural network model, and the classification probability of the target spike potential is output. The present invention completes the training of the neural network model by enhancing the spike potential, so that the trained neural network model can quickly identify the classification probability of the spike potential in the original signal emitted by the neurons, and ultimately can obtain an extremely high classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] FIG1 is a flow chart of a preferred embodiment of a single-channel spike classification method based on contrastive learning of the present invention;
[0034] FIG2 is a schematic diagram of data enhancement processing of original data in a preferred embodiment of the single-channel spike potential classification method based on contrastive learning of the present invention;
[0035] FIG3 is a schematic diagram of a neural network model training in a preferred embodiment of the single-channel spike potential classification method based on contrastive learning of the present invention;
[0036] FIG4 is a schematic diagram of the flow of data final training in a preferred embodiment of the single-channel spike potential classification method based on contrastive learning of the present invention;
[0037] FIG5 is a schematic diagram of the neural network architecture of the m network in FIG3;
[0038] FIG6 is a schematic diagram showing the principle of a preferred embodiment of a single-channel spike classification system based on contrastive learning according to the present invention;
[0039] FIG7 is a schematic diagram of an operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0040] 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.
[0041] The relevant concepts in the present invention are explained as follows:
[0042] A brain-computer interface (BCI) is a direct connection pathway created between the human or animal brain (or a culture of brain cells) and an external device. In the case of a one-way BCI, the computer receives commands from the brain or sends signals to the brain, but cannot send and receive signals at the same time. A two-way BCI allows for two-way information exchange between the brain and an external device. In this definition, the term "brain" refers to the brain or nervous system of an organic life form, not just the abstract "mind." "Machine" refers to any processing or computing device, which can range in form from a simple circuit to a silicon chip. Based on years of animal experimentation, early implantable devices for use in humans were designed and manufactured to restore impaired hearing, vision, and limb movement abilities. The main line of research is the brain's unusual cortical plasticity, which is compatible with BCIs and can control implanted prostheses like natural limbs.
[0043] Brain-inspired intelligence refers to computational models and methods that are primarily based on brain mechanisms, rather than completely mimicking the brain. The goal is to enable machines to implement various human cognitive abilities and coordination mechanisms in a brain-inspired manner, ultimately reaching or surpassing human intelligence.
[0044] 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.
[0045] 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.
[0046] Embedded brain-computer interface: By implanting electrodes into the brain, single-channel electrical signals emitted by neurons are obtained.
[0047] 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.
[0048] 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.
[0049] The single-channel spike potential classification method based on contrastive learning described in the preferred embodiment of the present invention is shown in Figure 1. The single-channel spike potential classification method based on contrastive learning comprises the following steps:
[0050] Step S10: acquiring single-channel electrical signals emitted by multiple neurons through electrodes, amplifying and demodulating the electrical signals to obtain the required digital signals emitted by the neurons.
[0051] Specifically, the sensor collects single-channel electrical signals emitted by multiple neurons through the electrode, and then the electrical signal is amplified by the signal amplifier (Interface readout, which mainly amplifies the recorded signals in the sensor). The amplified single-channel electrical signal is demodulated to obtain a digital signal (a series of numbers, equivalent to the original data).
[0052] 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.
[0053] 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.
[0054] Step S30: Perform data enhancement processing on the spike potential to obtain three types of enhanced data, and use the spike potential and the three types of enhanced data to train a neural network model to obtain a trained neural network model.
[0055] Specifically, after obtaining the original data about the single-channel spike potential, the spike potential obtained by processing the original data is subjected to data enhancement processing. The data enhancement processing of the present invention includes first data enhancement processing, second data enhancement processing and third data enhancement processing; wherein, the first data enhancement processing is: adding random noise to the spike potential to obtain first enhanced data; the second data enhancement processing is: multiplying or dividing the spike potential by a value to obtain second enhanced data; the third data enhancement processing is: randomly multiplying or dividing the rising edge or falling edge of the waveform in the spike potential by a value to obtain third enhanced data.
[0056] Any of the three 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 three enhancement methods are performed simultaneously as mentioned above, one original sample will produce three different enhanced samples. Then, when the neural network model generates information for comparison, the information generated by one sample corresponds to the information of the three 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.
[0057] Among them, the first data enhancement processing: adding random noise to the spike potential is to simulate 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. The original noise is assumed to have 61 dimensions, and the random noise is a random normal distribution with a variance of 0.08 and a dimension of 61 dimensions. By adding random noise to the spike potential, two sets of data are obtained, one is the original data, and the other is the data after random noise is added to the original data, which is named enhanced data. Random noise + original data, the addition here is the addition of corresponding points. Assuming that the random noise has 61 dimensions and the original data has 61 dimensions, these 61 corresponding points can be added.
[0058] The second data augmentation process multiplies or divides the spike potential by a value. This simulates the way electrodes, when implanted in the brain, change position over time, potentially expanding or shrinking the waveform of a particular neuron's firing. This value is a random value uniformly distributed between 0.9 and 1.1, and each spike potential value is multiplied or divided by this value.
[0059] Among them, the third data enhancement processing is: randomly multiplying or dividing the rising edge or falling edge of the waveform in the spike potential by a value, the main purpose of which is to make the neural network model pay more attention to the shape of the original data waveform. Because the original waveform may have multiple rising edges or falling edges, each rising edge or falling edge will be randomly multiplied or divided by a value in an evenly distributed distribution between 0.9 and 1.1, that is, the first rising edge may be multiplied by 0.95, and the second rising edge may be multiplied by 0.96. In the waveform, the rising edge or the falling edge will pass through the zero point, so even if the rising edge or the falling edge is multiplied or divided by a value, the characteristics of the waveform passing through the zero point remain unchanged, which ensures that the distance between the two zero points is unchanged.
[0060] As shown in Figure 2 (the four curves in Figure 2 are named left one, left two, left three and left four from left to right), the left one is the original sample, the left two is the addition of random noise, and the left three is the overall scaling (purpose: mainly to make the neural network model pay more attention to the shape of the original data waveform). For the fourth left, the rising edge or the falling edge is multiplied or divided by a value respectively. Note that the value multiplied by each rising edge or falling edge is different.
[0061] When training the neural network model, the spike potential, the first enhanced data, the second enhanced data and the third enhanced data are input into the neural network model; the neural network model outputs the first classification probability, the second classification probability, the third classification probability and the fourth classification probability respectively according to the spike potential, the first enhanced data, the second enhanced data and the third enhanced data; when the number of training times of the neural network model 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 and the fourth 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 respectively, and the current model parameters are saved, otherwise the data set has only one type of data and cannot be classified again.
[0062] The present invention introduces contrastive learning into single-channel spike classification. Contrastive learning involves classifying enhanced data and original data through a neural network model. The enhanced data and original data must be classified into the same class, because the neural network model classification may be binary. Some data may be classified into class 1 by the neural network model, while some data may be classified into class 2. Assuming that there is a data set classified by the neural network model, the probability of this data being classified into class 1 is 0.8, and the probability of being classified into class 2 is 0.2; while the probability of the enhanced data being classified into class 1 is 0.3, and the probability of being classified into class 2 is 0.7. The purpose of the present invention is to ensure that the probability of the original data and the enhanced data being classified into the same class is similar. For example, when the neural network model is trained to a similar level, the probability of the original data being classified into class 1 is 0.9, and the probability of being classified into class 2 is 0.1. The probability of the enhanced data being classified into class 1 may be 0.95, and the probability of being classified into class 2 is 0.05. At the same time, data enhancement can solve the phenomenon of neuronal bursts and neuronal overlap during neuronal firing.
[0063] The present invention simultaneously divides a multi-classification problem into multiple binary classification problems. The traditional multi-classification model is a neural network with a fixed number of classifications. For example, there is a pile of image data, which contains pictures of cats, dogs and rabbits. After the traditional neural network model is trained, when a picture containing a cat enters the traditional neural network model, it will be directly classified into category 1, where category 1 represents cats. When a picture containing a dog enters the neural network model, it will be directly classified into category 2, where category 2 represents dogs. When a picture containing a rabbit enters the neural network model, it will be directly classified into category 3, where category 3 represents rabbits.
[0064] The neural network model of the present invention can break down a multi-classification problem into multiple binary classification problems. For example, the neural network model of the present invention will classify cats and dogs into Class 1, and rabbits into Class 2. If the data for Class 1 is further subdivided, cats will now be classified into Class 1-1, and dogs into Class 1-2.
[0065] In fact, any model can achieve binary classification, supervised classification: that is, the data has been labeled before training, one data is labeled 1, and the other data is labeled 2. Because the model classification probability is two-dimensional, it may be [0.8, 0.2]. For supervised classification, after training, the value of the first dimension output should be as close to 1 as possible, and the value of the second dimension output should be as close to 0 as possible. The purpose of data enhancement is to allow the model to perform unsupervised classification. Since the model of the present invention is unlabeled, it is impossible to specify which dimension is as close to 1 as possible during training. At this time, contrastive learning and enhanced data are used. This solves the problem of not being able to know how many neurons are emitting spikes and determining the number of classifications during the spike classification process.
[0066] In other words, traditional models directly output the probabilities of multiple categories. Assuming it is a ten-category model, the model will eventually output a ten-dimensional vector, and the index with the largest value in this vector will be selected as the category number of the data. However, the model of the present invention cannot know how many categories to output, so the model is binary classified each time, because if it is data of the same category, whether it is multi-classification or binary classification, it will be divided into one category. In this way, the data set is continuously divided into two until it can no longer be divided at all, indicating that the classification is completed; the mutual information controls whether the data set can be divided into two. If the mutual information is still below a threshold (artificially set) after a specified number of trainings, it means that it cannot be subdivided, which means that the current data set was previously a complete category.
[0067] Furthermore, the present invention can utilize GPU training acceleration during model training, and simultaneously train the model through comparative learning, making the model interpretable.
[0068] 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. Then, through the m-network training, it is divided into ml-data and mr-data. At this point, m-data is dequeued and ml-data and mr-data are enqueued. Of course, if the Controller module finds that the current dataset cannot be binary partitioned, it will simply dequeue it.
[0069] Among them, the Controller module has two functions: one is to calculate whether the current neural network model 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 back propagation on the neural network, and then the current neural network model continues 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.
[0070] As shown in Figure 3, a data set is placed in a queue, and the data subset at the head of the queue is taken out. If it can be divided into two, the left and right subsets after classification are put into the queue. Among them, 0m data represents the neural network model corresponding to 0-m-data data. If 1-r-data is trained, the network becomes 1r data, and the backbone network inside is the same. F2:FC(2) represents a full connection with 2 neurons. Similarly, F4:FC(4) represents a full connection with 4 neurons. The augmentation network represents the three enhancement methods proposed above.
[0071] Figure 4 shows the final data flow during training. Assume a data point is classified to the left after training on the m node, and then further classified to the left by the ml node. This indicates a category. Here, the non-leaf nodes m and ml represent the neural network model, while mlr, mll, and mr represent data nodes and category numbers. We can say that data flowing to mlr is category 1, to mll is category 2, and to mr is category 3. Figure 5 shows the neural network architecture of the m network in Figure 3. The m network + F2 + F4 in Figure 3 represents the m node in Figure 4. The neural network architecture of each non-leaf node in Figure 4 is identical.
[0072] In Figure 5, the first vertical column represents an input node with 61 neurons, the second vertical column represents a full connection with 80 neurons, the third vertical column represents a full connection with 100 neurons, and the fourth vertical column represents a full connection with 30 neurons.
[0073] Step S40: for the newly acquired target digital signal after bandpass filtering, obtain the target spike potential through peak value search, classify the target spike potential based on the trained neural network model, and output the classification probability of the target spike potential.
[0074] Specifically, once the neural network model is trained, it can be used directly to classify spikes. That is, for the newly acquired target digital signal after bandpass filtering, the target spikes (which can be multiple) are obtained through peak value search. The target spikes are classified based on the trained neural network model, and the classification probability of the target spikes is output, so as to know which category the target spikes belong to. The spikes emitted by different neurons are then used to control the robotic arm, because each type of spike corresponds to an electrical signal emitted by a neuron. At this time, it is determined which type of spike corresponds to the extension of the robotic arm and which type of spike corresponds to the handshake of the robotic arm. That is, different types of spikes correspond to different functions of controlling the robotic arm. When a spike is detected next time, the corresponding class is found, and then the robotic arm is commanded to perform a certain action.
[0075] Furthermore, the present invention proposes a single-channel spike potential classification design based on contrastive learning (the data enhancement process is the same as the previous three enhancement methods. At this time, four data (one original sample and three enhanced samples) can be obtained, all of which are put into the neural network model for training. The ultimate training goal is to maximize the mutual information process; first, electrodes are used to obtain brain data. Usually, electrodes have 16, 32, 64, or 128 channels or more. Assuming that the potential used has 32 channels, the signal data emitted by neurons in 32 channels can be obtained, and the data of one channel is randomly selected.
[0076] The data were then bandpass filtered at 300-3000 Hz. Because the electrode sampling frequency was 20 kHz and the time it takes for a neuron to fire an action potential is 2-3 ms, 60 sampling points were selected. Bandpass filtering was performed using a Butterworth bandpass filter.
[0077] Then use the threshold method to find the peak value of the filtered data. filted_data is equivalent to filtedData, where t is the threshold. First, take the absolute value of filted_data, then find the median, and then divide it by 0.6745. The final result is a threshold:
[0078] t=median(|filted_data|) / 0.6745;
[0079] Use a 60-point window to intercept the interval where the peak value is located. This is the peak potential waveform (generally the peak value point is located at the 20th position in the window).
[0080] Finally, a very high classification accuracy was achieved.
[0081] Furthermore, as shown in FIG6 , based on the above-mentioned single-channel spike potential classification method based on contrastive learning, the present invention also provides a single-channel spike potential classification system based on contrastive learning, wherein the single-channel spike potential classification system based on contrastive learning includes:
[0082] The data acquisition and processing module 51 is used to obtain single-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the electrical signals, and obtain the required digital signals emitted by neurons;
[0083] A filtering peak value search module 52 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;
[0084] a data enhancement training module 53 for performing data enhancement processing on the spike potential to obtain three types of enhanced data, and training a neural network model using the spike potential and the three types of enhanced data to obtain a trained neural network model;
[0085] The classification probability output module 54 is used to obtain the target spike potential by peak value search for the newly collected target digital signal after bandpass filtering, classify the target spike potential based on the trained neural network model, and output the classification probability of the target spike potential.
[0086] Furthermore, as shown in FIG7 , based on the above-mentioned single-channel spike classification method and system based on contrastive learning, 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 can be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 can also be an external storage device of the terminal, such as a plug-in hard disk equipped on the terminal, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 20 can 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 can also be used to temporarily store data that has been output or is to be output. In one embodiment, a single-channel spike potential classification program 40 based on contrastive learning is stored on the memory 20, and the single-channel spike potential classification program 40 based on contrastive learning can be executed by the processor 10, thereby realizing the single-channel spike potential classification method based on contrastive learning in the present application.
[0088] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, configured to execute program codes or process data stored in the memory 20, such as executing the single-channel spike classification method based on contrastive learning.
[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 single-channel spike classification program 40 based on contrastive learning in the memory 20, the following steps are implemented:
[0091] Acquire single-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the 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 three types of enhanced data, and training a neural network model using the spike potential and the three types of enhanced data to obtain a trained neural network model;
[0094] For the newly collected target digital signal after bandpass filtering, the target spike potential is obtained by peak value search, and the target spike potential is classified based on the trained neural network model, and the classification probability of the target spike potential is output.
[0095] The data enhancement process includes a first data enhancement process, a second data enhancement process, and a third data enhancement process;
[0096] The first data enhancement process is: adding random noise to the spike potential to obtain first enhanced data;
[0097] The second data enhancement processing is: multiplying or dividing the spike potential by a value to obtain second enhanced data;
[0098] The third data enhancement process is: randomly multiplying or dividing the rising edge or falling edge of the spike waveform by a value to obtain third enhanced data.
[0099] The method of training a neural network model using the spike potential and the three enhanced data to obtain a trained neural network model specifically includes:
[0100] Inputting the spike potential, the first enhanced data, the second enhanced data, and the third enhanced data into the neural network model;
[0101] The neural network model outputs a first classification probability, a second classification probability, a third classification probability and a fourth classification probability respectively according to the spike potential, the first enhanced data, the second enhanced data and the third enhanced data;
[0102] When the neural network model is trained for a predetermined number of iterations, and when the mutual information formed by the first classification probability, the second classification probability, the third classification probability and the fourth 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 any further.
[0103] Among them, single-channel electrical signals emitted by multiple neurons are collected through sensors.
[0104] Wherein, the amplification of the electrical signal is completed by a signal amplifier.
[0105] The bandpass filtering and peak value search of the digital signal are completed by a processor module.
[0106] Among them, each type of spike potential corresponds to an electrical signal emitted by a neuron.
[0107] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a single-channel spike potential classification program based on contrastive learning, and when the single-channel spike potential classification program based on contrastive learning is executed by a processor, the steps of the single-channel spike potential classification method based on contrastive learning as described above are implemented.
[0108] In summary, the present invention provides a single-channel spike potential classification method and related equipment based on contrastive learning, the method comprising: obtaining a single-channel electrical signal emitted by multiple neurons through an electrode, amplifying and demodulating the electrical signal to obtain a digital signal emitted by the required neuron; band-pass filtering the digital signal, performing a peak value search on the digital signal after band-pass filtering to obtain a spike potential; performing data enhancement processing on the spike potential to obtain three types of enhanced data, using the spike potential and the three enhanced data to train a neural network model to obtain a trained neural network model; for a newly collected target digital signal after band-pass filtering, obtaining a target spike potential through a peak value search, classifying according to the target spike potential based on the trained neural network model, and outputting the classification probability of the target spike potential. The present invention completes the training of the neural network model by enhancing the spike potential, so that the trained neural network model can quickly identify the classification probability of the spike potential in the original signal emitted by the neuron, and ultimately can obtain an extremely high classification accuracy.
[0109] 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.
[0110] 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 (e.g., a processor, a 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 executed, the program 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.
[0111] 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 single-channel spike potential classification method based on contrastive learning, It is characterized in that The single-channel spike potential classification method based on contrastive learning includes: Acquire single-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the 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, three types of enhanced data are obtained, and the spike potential and the three types of enhanced data are used to train a neural network model to obtain a trained neural network model; For the newly acquired target digital signal after bandpass filtering, the target spike potential is obtained by peak value search, and the target spike potential is classified based on the trained neural network model, and the classification probability of the target spike potential is output.
2. The single-channel spike potential classification method based on contrastive learning according to claim 1, It is characterized in that The data enhancement processing includes a first data enhancement processing, a second data enhancement processing and a third data enhancement processing; The first data enhancement process is: adding random noise to the spike potential to obtain first enhanced data; The second data enhancement process is: multiplying or dividing the spike potential by a value to obtain second enhanced data; The third data enhancement process is: randomly multiplying or dividing the rising edge or falling edge of the waveform in the spike potential by a value to obtain the third enhanced data.
3. The single-channel spike potential classification method based on contrastive learning according to claim 2, It is characterized in that The neural network model is trained using the spike potential and the three enhanced data to obtain a trained neural network model, specifically comprising: Inputting the spike potential, the first enhanced data, the second enhanced data and the third enhanced data into the neural network model; The neural network model outputs a first classification probability, a second classification probability, a third classification probability and a fourth classification probability respectively according to the spike potential, the first enhanced data, the second enhanced data and the third enhanced data; When the number of training times of the neural network model 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 and the fourth 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 respectively, and the current model parameters are saved. Otherwise, the data set has only one type of data and cannot be classified. Reclassify.
4. The single-channel spike potential classification method based on contrastive learning according to claim 1, It is characterized in that Single-channel electrical signals emitted by multiple neurons are collected by sensors.
5. The single-channel spike potential classification method based on contrastive learning according to claim 1, It is characterized in that The electrical signal is amplified by a signal amplifier.
6. The single-channel spike potential classification method based on contrastive learning according to claim 1, It is characterized in that Bandpass filtering and peak value searching of the digital signal are performed by a processor module.
7. The single-channel spike potential classification method based on contrastive learning according to claim 1, It is characterized in that Each type of spike potential corresponds to an electrical signal emitted by a neuron.
8. A single-channel spike classification system based on contrastive learning, It is characterized in that The single-channel spike potential classification system based on contrastive learning includes: A data acquisition and processing module is used to obtain single-channel electrical signals emitted by multiple neurons through electrodes, amplify and demodulate the electrical signals, and obtain the required digital signals emitted by neurons; A peak value search module for filtering, 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 data enhancement training module, used to perform data enhancement processing on the spike potential to obtain three types of enhanced data, and use the spike potential and the three types of enhanced data to train the neural network model to obtain a trained neural network model; The classification probability output module is used to obtain the target spike potential by peak value search for the newly collected target digital signal after bandpass filtering, classify the target spike potential based on the trained neural network model, and output the classification probability of the target spike potential.
9. A terminal, It is characterized in that The terminal includes: a memory, a processor, and a single-channel spike potential classification program based on contrastive learning stored in the memory and executable on the processor. When the single-channel spike potential classification program based on contrastive learning is executed by the processor, the steps of the single-channel spike potential classification method based on contrastive learning as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a single-channel spike potential classification program based on contrastive learning, and when the single-channel spike potential classification program based on contrastive learning is executed by a processor, the steps of the single-channel spike potential classification method based on contrastive learning as described in any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Neural signal classification method for multi-electrode array
CN112381174A
Implantable brain-computer interface neuron spike potential classification method
CN113378737A
Process and hardware implementation of adaptive real-time neural spike sorting
US20200352520A1
Cited By
Nerve spike data classification method and device
CN122045877A
