Image classification method based on R-Multi-parameter PBSNLR model
1. An image classification method based on an R-Multi-parameter PBSNLR model is characterized by comprising the following steps:
s1, constructing a traditional PBSNLR model;
s2, modifying the neuron weight adjustment rule of the traditional PBSNLR model to obtain an R-Multi-parameter PBSNLR model; wherein the neuron weight adjusting rule of the R-Multi-parameter PBSNLR model is as follows:
wherein ω isnewThe adjusted weight value of the neuron; omegaoldThe neuron weight value before adjustment; beta is a learning rate parameter; u. ofi(t) is the membrane voltage of the neuron; thr is the ignition threshold; t represents the current time; t is tdIndicating a target ignition timing;indicating a period of time that is relatively far from the target ignition time,td(n) denotes the nth target ignition timing, td(n) + delta denotes the time of delta duration after the nth target ignition, td(n +1) -delta represents the time of the delta duration before the n +1 th target ignition,the (n +1) th time period far away from the target ignition moment;indicating a period of time closer to the target ignition time,td(n) - δ represents the time of the δ duration before the nth target ignition,an nth time period closer to the target ignition time; eta1Is constant and greater than 0, η1>η2>0;Is the output time of the f-th pulse for pre-synaptic neuron j; epsilonjiThe method comprises the following steps of (1) calculating the influence value of external input current received by a neuron on the neuron membrane voltage;
s3, and carrying out image classification by adopting an R-Multi-parameter PBSNLR model.
2. The image classification method based on the R-Multi-parameter PBSNLR model according to claim 1, wherein the ignition threshold thr is 1, the time length δ is 5ms, and the constant η is in step S21Is 0.4mV with a constant eta20.1mV, 0.01 learning rate parameter beta.
3. The method for classifying images based on an R-Multi-parameter PBSNLR model according to claim 1, wherein the initial value of the neuron weight of the R-Multi-parameter PBSNLR model in step S2 is a random number in [0,0.04 ].
Background
The perceptron is a common machine learning model and is used for carrying out binary classification on input feature vectors and outputting a judgment result. The supervised learning process of spiking neural networks is a task in which the control neurons, through weight adjustment, only send pulses at the desired firing times during the running time and remain silent at other times. Briefly, the essence of this task is a binary problem that distinguishes whether a neuron model should send impulses at a particular time, at which point the impulse neural model can be fully trained by existing perceptron learning rules. PBSNLR is a typical supervised learning algorithm (model) based on a perceptron, which first converts the training task of a pulse sequence into a classification problem at all runtime points, and then performs weight adjustment with the training strategy of the perceptron to enable neurons to accurately emit desired output pulses. PBSNLR (membrane voltage driving algorithm Based on the Learning Rule of the conventional Perceptron) is an efficient Learning algorithm as the Perceptron, and the Learning success rate is also high. However, PBSNLR cannot perform the task of online learning, and requires a large number of training samples to ensure convergence.
Disclosure of Invention
Aiming at the defects in the prior art, compared with the traditional PBSNLR model, the image classification method based on the R-Multi-parameter PBSNLR model provided by the invention has better learning efficiency, classification accuracy and anti-noise performance.
In order to achieve the purpose of the invention, the invention adopts the technical scheme that:
provided is an image classification method based on an R-Multi-parameter PBSNLR model, which comprises the following steps:
s1, constructing a traditional PBSNLR model;
s2, modifying the neuron weight adjustment rule of the traditional PBSNLR model to obtain an R-Multi-parameter PBSNLR model; wherein the neuron weight adjusting rule of the R-Multi-parameter PBSNLR model is as follows:
wherein ω isnewThe adjusted weight value of the neuron; omegaoldThe neuron weight value before adjustment; beta is a learning rate parameter; u. ofi(t) is the membrane voltage of the neuron; thr is the ignition threshold; t represents the current time; t is tdIndicating a target ignition timing;indicating a period of time that is relatively far from the target ignition time,td(n) denotes the nth target ignition timing, td(n) + delta denotes the time of delta duration after the nth target ignition, td(n +1) -delta represents the time of the delta duration before the n +1 th target ignition,the (n +1) th time period far away from the target ignition moment;indicating a period of time closer to the target ignition time,td(n) - δ represents the time of the δ duration before the nth target ignition,an nth time period closer to the target ignition time; eta1Is constant and greater than 0, η1>η2>0;Is the output time of the f-th pulse for pre-synaptic neuron j; epsilonji(. is a kernel function for computing the external portion received by the neuronThe influence value of the input current on the neuron membrane voltage;
s3, and carrying out image classification by adopting an R-Multi-parameter PBSNLR model.
Further, in step S2, the ignition threshold thr is 1, the time period δ is 5ms, and the constant η1Is 0.4mV with a constant eta20.1mV, 0.01 learning rate parameter beta.
Further, the initial value of the neuron weight of the R-Multi-parameter PBSNLR model in step S2 is a random number in [0,0.04 ].
The invention has the beneficial effects that: according to the method, the distance between the membrane voltage and the threshold is introduced as a dynamic parameter of the weight regulation rule, so that the problem caused by the unique weight regulation amplitude of the model in the training process can be effectively solved, and on the basis of accurately learning a target pulse signal, the method has higher learning efficiency compared with the traditional PBSNLR model; the method simultaneously adopts a dynamic threshold strategy in different time periods, avoids the defect that the membrane voltage accumulation at the target ignition moment is insufficient and the ignition cannot be realized due to the fact that a new threshold lower than the original threshold is used for training at the non-target ignition moment near the target ignition moment, and has higher accuracy, particularly the learning efficiency and the accuracy under the noise environment are obviously higher than those of other membrane voltage driving methods.
Drawings
FIG. 1 is a schematic flow diagram of the present invention;
FIG. 2 is a schematic of a time period further from the target ignition time and a time period closer to the target ignition time;
FIG. 3 is a diagram illustrating initial weights used in a validation process;
FIG. 4 is a weight value after completion of the R-Multi-parameter PBSNLR model training in the verification process;
FIG. 5 is a schematic diagram of the R-Multi-parameter PBSNLR model during verification with learning clock transmission;
FIG. 6 is a graph of the correlation between a conventional PBSNLR model and the R-Multi-parameter PBSNLR model for different iterations;
FIG. 7 is a pulse distribution diagram after encoding picture "6" in a noise-free mode;
FIG. 8 shows the learning process of picture "6" in the noise-free mode and the final learned similarity between 10 sequences and the target sequence;
FIG. 9 is a graph illustrating comparison of optical character recognition rates at various inversion noise levels;
FIG. 10 is a diagram illustrating comparison of optical character recognition rate in a Gaussian blur scene.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate the understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and it will be apparent to those skilled in the art that various changes may be made without departing from the spirit and scope of the invention as defined and defined in the appended claims, and all matters produced by the invention using the inventive concept are protected.
As shown in fig. 1, the image classification method based on the R-Multi-parameter PBSNLR model includes the following steps:
s1, constructing a traditional PBSNLR model;
s2, modifying the neuron weight adjustment rule of the traditional PBSNLR model to obtain an R-Multi-parameter PBSNLR model; wherein the neuron weight adjusting rule of the R-Multi-parameter PBSNLR model is as follows:
wherein ω isnewThe adjusted weight value of the neuron; omegaoldThe neuron weight value before adjustment; beta is a learning rate parameter; u. ofi(t) is the membrane voltage of the neuron; thr is the ignition threshold; t represents the current time; as shown in FIG. 2, tdIndicating a target ignition timing;indicating a period of time that is relatively far from the target ignition time,td(n) denotes the nth target ignition timing, td(n) + delta denotes the time of delta duration after the nth target ignition, td(n +1) -delta represents the time of the delta duration before the n +1 th target ignition,the (n +1) th time period far away from the target ignition moment;indicating a period of time closer to the target ignition time,td(n) - δ represents the time of the δ duration before the nth target ignition,an nth time period closer to the target ignition time; eta1Is constant and greater than 0, η1>η2>0;Is the output time of the f-th pulse for pre-synaptic neuron j; epsilonjiThe method comprises the following steps of (1) calculating the influence value of external input current received by a neuron on the neuron membrane voltage;
s3, and carrying out image classification by adopting an R-Multi-parameter PBSNLR model.
In the specific implementation process, although in various existing dynamic threshold algorithms, the threshold is set to a new threshold higher than the original threshold for training, if the neuron membrane voltage is lower than the original threshold at the target ignition time, the modification amplitude of the weight can be increased in each iteration process, the learning efficiency of the algorithm is improved, and the trained neuron membrane voltage can be better ensured to be higher than the threshold at the target time to complete the ignition. This way of moving the threshold up can achieve the goal of letting the membrane voltage be able to send pulses at the target moment, but it does so in a way that allows the membrane voltage to be always pulsed at the target momentIn the case of fine time steps, the ignition time is not necessarily the target ignition tdThe membrane voltage thereof is highly likely to be at tdHas previously equaled the predetermined threshold to trigger a pulse signal.
The neuron weight adjustment rule provided by the method only correctly classifies the samples under the last condition, and the weight adjustment is not needed at the moment. The first three are all cases where the sample is misclassified: 1) if the neuron is at the target firing time tdIf the membrane voltage does not reach the threshold value, i.e. the pulse signal cannot be transmitted, the positive samples are misclassified, and the first method in the rule should be selected to adjust the weight; 2) if the neuron is at a non-target firing moment (includingAndall time points in two time periods) the membrane voltage reaches the dynamic threshold value of the corresponding time point, namely, a pulse signal is excited at the time point, negative samples are misclassified, and a weight adjustment rule needs to be selected from the second and third ways of the rule according to the distance between the time point and the next target ignition. In the present method, becauseAndthe new threshold value lower than the original threshold value is used for training, so that at the beginning of the method, more negative samples are wrongly classified, but the wrongly classified negative samples are continuously corrected along with the training of the algorithm until the membrane voltage is lower than the dynamic threshold value at the corresponding moment.
In one embodiment of the present invention, to verify the performance of the method, the ignition threshold thr is 1, the duration δ is 5ms, and the constant η is set in step S21Is 0.4mV with a constant eta20.1mV, learningThe rate parameter beta is 0.01; the initial value of the neuron weight is [0,0.04]]The random number of (1). 400 input neurons of a single pulse are set as pre-synaptic neurons. The input pulse sequence and the target pulse sequence are respectively in accordance with the frequency p1=10Hz,p260Hz poisson process. The step size is 0.01.
As can be seen from fig. 3, 4 and 5, the difference between the value of the initial weight and the weight distribution after training is large, and the R-Multi-parameter PBSNLR model can accurately excite the target pulse sequence after training by adjusting the connection weight between neurons, so as to complete the learning target.
As shown in fig. 6, the correlation coefficient variation of the models of the PBSNLR and the R-Multi-parameter PBSNLR model is compared under different iteration times, the correlation metric C of the R-Multi-parameter PBSNLR model is at a lower level at the beginning of training, and as the learning process progresses, the accuracy of the R-Multi-parameter PBSNLR continuously rises, and finally the algorithm has excellent accuracy. The reason for this is that the R-Multi-parameter PBSNLR performs a pull-down operation on the threshold, so that a large number of negative samples are misclassified when the algorithm starts to learn, and with continuous training of the model, the membrane voltages of all misclassified samples reach below the newly set threshold, thereby increasing the accuracy of the method. And the R-Multi-parameter PBSNLR dynamically controls the weight adjustment amplitude according to the relation between the current point membrane voltage and the threshold value in the weight adjustment process, so that the weight adjustment is more sufficient in each iteration, and convergence can be achieved in fewer iterations.
To verify the effect of the method on image classification, taking the identification number "6" as an example, the pulse distribution graph obtained by encoding the picture "6" by the R-Multi-parameter-PBSNLR model in the noise-free mode is shown in fig. 7, and the learning process of the picture "6" in the noise-free mode and the similarity between the finally learned 10 sequences and the target sequence are shown in fig. 8. As can be seen from the column in fig. 8, the similarity of the character class 6 is the highest, so the spiking neural network trained by the R-Multi-parameter PBSNLR model under the noise-free scene can successfully recognize the picture of the number "6". Next, the optical character recognition performance in the reverse noise scenario will be analyzed through experiments.
The inversion noise is a noise interference mode that certain pixel points are randomly extracted from the total pixel points of the image according to a given noise proportion to perform inversion operation, so that the pixel points have the effect of exchanging partial coordinates 0 and 1 during encoding. In each training, 10 inversion noise pictures are generated for each character picture under the condition of random noise level [0, 25% ], 100 inversion noise images are used as model training samples for each noise level, and the training is repeated for 10 times. In the testing stage, under the condition of random noise rate [0, 25% ] of each character picture, 4 pictures are randomly generated for each noise rate, namely, 100 reversed noise images are generated for each character, 40 images are generated at each noise level, and the images are used as a test set input model for classification decision. And taking the average value of the classification accuracy of 40 pictures at each noise level as the final accuracy of the noise level. The situation of the recognition accuracy of the picture "6" by different algorithms under different inversion noise ratios after the test is shown in fig. 9 as follows.
By comparison, it can be found that when the proportion of the inversion noise of the picture is increased to a certain amount, the recognition accuracy of each algorithm is remarkably reduced, so that the inversion noise has a great influence on the image recognition effect. However, as can be still seen from fig. 9, at each inversion noise level, the recognition accuracy of the R-Multi-parameter PBSNLR model added with the dynamic threshold strategy is better than that of the PBSNLR model and the Multi-parameter PBSNLR model (a model in which only the distance between the membrane voltage and the threshold is used as the dynamic parameter of the weight adjustment rule based on the PBSNLR), which proves that the algorithm has strong anti-noise capability in the inversion noise mode.
Gaussian disturbance means that a probability density function obeys Gaussian distribution (namely normal distribution) to randomly interfere with an image pulse sequence by using a type of noise. The training samples and the test samples are obtained in the same way as the inversion noise mode sampling method in the previous section, but the inversion rate in the inversion disturbance is converted into the variance in the gaussian function, because the variance is used to control the amount of noise in the gaussian function, and the value of the variance in the experiment is [0.3,3] ms. The mean value of the classification accuracy of all pictures at each noise level is also used as the final accuracy of the noise level. The comparison of the recognition accuracy of different algorithms for the picture "6" under different inversion noise ratios after the test is shown in fig. 10.
It can be seen from fig. 10 that the recognition accuracy of the three algorithms has a large downward drop as the noise increases. However, under various Gaussian noise levels, the R-Multi-parameter PBSNLR model still has the highest recognition accuracy, and the Multi-parameter PBSNLR model and the PBSNLR model have small performance difference and are sensitive to noise. The experiment proves that the R-Multi-parameter PBSNLR model still can relatively obtain better accuracy under the condition that Gaussian noises of various levels exist, the anti-noise performance of the method is stronger than that of the traditional pulse neural network supervised learning algorithm PBSNLR and the Multi-parameter PBSNLR algorithm, and the method is a new robust algorithm.
In conclusion, the distance between the membrane voltage and the threshold is introduced as the dynamic parameter of the weight adjustment rule, so that the problem caused by the unique weight adjustment amplitude of the model in the training process can be effectively solved, and the model has higher learning efficiency compared with the traditional PBSNLR model on the basis of accurately learning the target pulse signal; the method simultaneously adopts a dynamic threshold strategy in different time periods, avoids the defect that the membrane voltage accumulation at the target ignition moment is insufficient and the ignition cannot be realized due to the fact that a new threshold lower than the original threshold is used for training at the non-target ignition moment near the target ignition moment, and has higher accuracy, particularly the learning efficiency and the accuracy under the noise environment are obviously higher than those of other membrane voltage driving methods.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:语言模型预训练方法、装置