A novel method for adjusting synaptic weights of a spiking neural network
By improving the Gaussian impulse temporal dependence plasticity rule and Q-learning mechanism, and combining it with the convolutional attention module, the weight adjustment of the spiking neural network is optimized, which solves the problem that traditional rules cannot achieve global adjustment and improves the accuracy of classification tasks.
Patent Information
- Application Number
- CN202411458895.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-10-18
AI Technical Summary
Traditional pulse timing-dependent plasticity rules cannot achieve ideal weight adjustment in spiking neural networks, nor can they perform global adjustment of neuron weights.
Local weight adjustment is performed by improving the Gaussian pulse temporal dependence plasticity rule, and global weight adjustment is performed by introducing a Q-learning mechanism. The weight adjustment of the spiking neural network is optimized by combining it with a convolutional attention module.
It improves the accuracy of spiking neural networks in classification tasks, enables local and global adjustment of spiking neural network weights, and enhances the strength of effective connections between neurons.
Smart Images

Figure CN119647531B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a novel pulse neural network synaptic weight adjustment method and belongs to the field of artificial intelligence. BACKGROUND
[0002] In the research field of exploring the transmission process of simulated pulses between neurons, the pulse timing-dependent plasticity rule has attracted much attention due to its biological rationality and high efficiency of operation. However, the performance of the pulse neural network based on the traditional pulse timing-dependent plasticity rule still needs to be improved. In order to more accurately simulate the influence of neurotransmitters on the action potential of post-synaptic neurons and realize the local and global regulation of synaptic plasticity, the traditional pulse timing-dependent plasticity rule is innovatively improved, the local adjustment of synaptic weights is optimized, and a Q learning mechanism is introduced to realize the global adjustment of synaptic connections, so that a novel pulse neural network synaptic plasticity rule is constructed. SUMMARY
[0003] The technical problem to be solved by the application is that the traditional pulse timing-dependent plasticity rule is not ideal for the weight adjustment of the pulse neural network, and cannot realize the global adjustment of the neuron weight.
[0004] The technical scheme of the application is a novel pulse neural network synaptic weight adjustment method, comprising:
[0005] Step 1: according to the Leaky Integrate and Fired algorithm, a pulse neural network model is built, the time interval between the pulse emission of the presynaptic neuron of the pulse neural network model and the pulse emission of the postsynaptic neuron is tracked, and the change information of the synaptic weight is obtained through the time interval.
[0006] The Step 1 is specifically:
[0007] Step 1.1: initialize the Leaky Integrate and Fired algorithm model, simulate the process of accumulating membrane potential and emitting pulses of the pulse neuron through the Leaky Integrate and Fired, wherein the process of accumulating membrane potential is:
[0008]
[0009] In the formula, l is the number of layers of the neural network, t is the time step, V (l) [t] is the membrane potential of the lth layer at the time step t, tau is a time constant, V reset represents the resting potential, and the membrane potential accumulation exceeding the threshold value leads to pulse emission, and the membrane potential is reset to the resting potential value;
[0010] The membrane potential accumulation process of Leaky Integrate and Fired model is tracked, and a pulse is fired when the membrane potential accumulation exceeds a set threshold, and the expression of the process is as follows:
[0011]
[0012] In the formula, S (l-1) is the pulse input of the previous layer, W (l) is the synaptic weight of the lth layer, the initial membrane potential is set as the resting potential, i.e. V rest = 0, V th is the threshold value of the membrane potential, and Θ(·) is a step function. When the value of the membrane potential gradually accumulates and exceeds the threshold value, the neuron will fire a pulse. After the pulse is fired, the membrane potential is reset to the resting state, i.e. V reset = V rest = 0. The mechanism of pulse firing is defined as the following function:
[0013]
[0014] Step 1.2: The accumulation process of the membrane potential is tracked, and a pulse is fired when the membrane potential accumulation exceeds a threshold value. The firing time of the pulse is recorded, thereby obtaining the firing time of the presynaptic neuron and the postsynaptic neuron in the pulse neural network. According to the adjustment mechanism of the synaptic neural network, the change of the synaptic weight is related to the time interval between the firing of the presynaptic neuron and the firing of the postsynaptic neuron. The time interval is used as the basis for weight adjustment. The calculation method of the time interval Δt is as follows:
[0015]
[0016] In the formula, is the time of the firing of the presynaptic neuron, is the time of the firing of the postsynaptic neuron.
[0017] Step 2: The traditional pulse timing-dependent plasticity rule is improved according to the change trend of the Gaussian function. The improved Gaussian pulse timing-dependent plasticity rule can be used for local adjustment of the weight in the pulse neural network, enhance the connection probability between neurons with strong correlation, and reduce the connection probability between neurons with weak correlation, so that the pulse neural network meets the Hebbian learning theory and the lateral inhibition phenomenon in biological neurology.
[0018] In the Step 2, the local adjustment mechanism of the weight in the pulse neural network includes:
[0019] In the established pulse neural network, all neurons are fully connected, and the weight is updated by the time interval between the pre-synaptic neuron firing pulse and the post-synaptic neuron firing pulse.
[0020] If the pre-synaptic neuron fires a pulse slightly later than the post-synaptic neuron, and the time interval tends to 0, the weight between the corresponding neurons is enhanced.
[0021] If the pre-synaptic neuron fires a pulse slightly earlier than the post-synaptic neuron, and the time interval tends to 0, the weight between the corresponding neurons is weakened.
[0022] If the pre-synaptic neuron fires a pulse later than the post-synaptic neuron, or the pre-synaptic neuron fires a pulse earlier than the post-synaptic neuron, but the time interval is longer, the weight change between the corresponding neurons is smaller.
[0023] The weight change between neurons changes with the time interval, and the change trend is similar to that of the Gaussian function. When the time interval tends to 0, the corresponding weight change is larger, and with the increase of the time interval, the corresponding weight change shows an accelerated decay trend.
[0024] According to the weight change mechanism, local adjustment of the weight of the pulse neural network is realized.
[0025] The Gaussian pulse timing-dependent plasticity rule obtained in Step 2 is as follows:
[0026] Step 2.1: Initialize the traditional pulse timing-dependent plasticity rule, and the weight update mechanism in the pulse neural network is defined as the following function:
[0027]
[0028] In the formula, Δw is the weight change value, A pre and A post represent the amplitude parameters of long-term potentiation and long-term depression, respectively, τ pre and τ post represent the time constants of long-term potentiation and long-term depression, respectively, the parameter τ pre determines the decay rate of the weight when Δt>0, and the parameter τ post determines the enhancement rate of the weight when Δt<0. If the pre-synaptic neuron fires a pulse slightly later than the post-synaptic neuron, the weight increases, corresponding to the long-term potentiation effect; if the pre-synaptic neuron fires a pulse earlier than the post-synaptic neuron, the weight decreases, corresponding to the long-term depression effect.
[0029] Step 2.2: According to the change trend of the Gaussian function, the traditional pulse timing-dependent plasticity rule is modified to obtain the Gaussian pulse timing-dependent plasticity rule. The formula of the modified Gaussian pulse timing-dependent plasticity rule is as follows:
[0030]
[0031] According to the modified Gaussian pulse timing-dependent plasticity rule, when the time interval tends to 0, the corresponding weight change degree increases, and vice versa, when the time interval gradually increases, the corresponding weight change shows an accelerated downward trend. Specifically, when the post-synaptic neuron emits a pulse slightly earlier than the time of the pre-synaptic neuron, and the time interval tends to 0, then under the Gaussian pulse timing-dependent plasticity rule, the weight increase value will be higher than the weight increase value under the traditional pulse timing-dependent plasticity adjustment, and vice versa, in the state that the pre-synaptic neuron emits a pulse slightly earlier than the post-synaptic neuron, and the time interval tends to 0, which leads to a higher degree of weight decrease than the weight change based on the traditional pulse timing-dependent plasticity rule; when the absolute value of the above time interval gradually increases, the weight change will show an accelerated downward trend, and under the same time interval, the modified plasticity rule can make the weight change less than the weight change based on the original plasticity rule.
[0032] Step3: Establish a global weight adjustment rule through Q-learning, based on the local weight adjustment in Step2, to globally adjust the weights of the pulse neural network, strengthen the effective connections between neurons, and weaken the ineffective connections between neurons.
[0033] In the global adjustment rule, the value of the Q function is the object of the agent performing the action, and the agent updates the value of the Q function according to the reward signal to enhance the weights between neurons.
[0034] The event of the pre-synaptic neuron emitting a pulse slightly later than the post-synaptic neuron is set as the reward signal, and the agent uses the ε-greedy strategy for exploration and utilization, and when the reward signal in the environment is identified, the weight of the reward signal source is enhanced, and this rule can enhance the effective connections between neurons.
[0035] The Step3 is specifically:
[0036] Step3.1: Associate Q-learning with neural network weights, define the value of the Q function as an agent, set the event of the pre-synaptic neuron emitting a pulse slightly later than the post-synaptic neuron and the time interval tending to 0 as the reward signal, and determine the exploration and utilization decisions of Q-learning through the ε-greedy strategy, ε is a parameter between 0 and 1, which determines the probability of exploration by the agent at each decision, and ε will gradually decrease, so that the agent changes from exploration to utilization;
[0037] Step3.2: According to the settings of Step3.1, the agent continues to conduct global regulation on the basis of the local adjustment of the neural network weight in Step2. According to the ε-greedy strategy, the agent will explore the action with the probability of ε, and perform the action with the probability of (1-ε). When the agent explores the reward signal in the learning process of the pulse neural network based on the high-frequency pulse time-dependent plasticity rule, the agent updates the value of the Q function and increases the weight between neurons. The agent updates the Q function iteratively, and ε gradually decays. The agent updates the Q function using known behaviors. When all training samples complete the learning process in the pulse neural network, the agent stops updating the Q function immediately. The update formula of the Q function is as follows:
[0038] Q(s,a)←Q(s,a)+α[r+γmax a′ Q(s′,a′)-Q(s,a)]
[0039] where s is the state, a is the action, Q(s,a) is the Q value of taking action a in state s, i.e., the weight update value between neurons, α is the learning rate, r is the immediate reward received after performing the action, γ is the discount factor, s' is the new state reached after performing the action, max a′ Q(s′,a′) is the maximum Q value of all possible actions in the new state.
[0040] Step4: Use the convolution attention module to preprocess the data that needs to perform the classification task, extract the key features of the data, and use the key features as the input of the pulse neural network model. The weight adjustment of the pulse neural network is realized through the local adjustment rule and the global adjustment rule of the pulse neuron weight, and the classification task is completed.
[0041] The Step4 is specifically:
[0042] Step4.1: Obtain the data that needs to perform the classification task, randomly select a part of the data as the training sample, and obtain the class label corresponding to the selected training sample;
[0043] Step4.2: Construct a channel attention module. The input training sample will be processed by global average pooling and global maximum pooling respectively. The two processing results are shared in a network structure composed of a multilayer perceptron with one hidden layer. The results of global average pooling and global maximum pooling are summed and merged. The calculation formula of channel attention is as follows:
[0044]
[0045] wherein, σ(·) is a sigmoid function, MLP(·) is a multi-layer perceptron calculation model, AvgPool(F) represents average pooling of input features, MaxPool(F) represents maximum pooling of input features, and respectively correspond to the features after average pooling and maximum pooling, W0 and W1 are weights of the MLP(·) multi-layer perceptron, and a channel attention feature M c (F) is finally obtained.
[0046] Step 4.3: A spatial attention module is constructed, average pooling and maximum pooling operations are performed along the channel axis of the input data, and then the two are connected to form a spatial feature, and the calculation formula of the spatial attention is as follows:
[0047]
[0048] wherein, f 7×7 (·) represents a 7*7 filter convolution operation, AvgPool(·) and MaxPool(·) represent average pooling and maximum pooling operations in the convolution operation, and respectively represent the average pooling feature and the global pooling feature in the spatial attention mechanism, and a channel attention feature M s (F) is obtained according to the calculation.
[0049] Step 4.4: A convolution attention model is built, the channel attention module and the spatial attention module are connected in series, and the calculation formula of the convolution attention is as follows:
[0050]
[0051] wherein, F is the original data input, M c is a channel attention operation, and M s is a spatial attention operation.
[0052] Step 4.5: The training sample is used as the input of the built convolution attention model, and the key feature of the training sample is obtained according to the convolution attention calculation. The key feature is the relevant feature retained after the redundant features and noise of the training sample are removed, which is beneficial to the learning and training effect of the pulse neural network. The key feature is used as the input of the pulse neural network model for training. The local adjustment and global adjustment rules of the neuron weight are used to adjust the weight between the pulse neurons during the sample training process. After the training is completed, a pulse sequence tensor is obtained.
[0053] Step 4.6: Build a fully connected classifier with a three-layer structure. The number of neurons in the first layer classifier is equal to the product of the original data size of the training samples. The number of neurons in the second layer classifier is equal to 128. The number of neurons in the third layer classifier is equal to the number of categories. The classifier is trained based on the three fully connected layers. The pulse sequence tensor generated during the sample training process in Step 6.5 is used as the training sample for the classifier. After a preset number of iterations, the classifier is obtained.
[0054] Step 4.7: Obtain pulse sequences from the data to be classified using a spiking neural network, and then classify the data using a trained classifier.
[0055] This invention proposes a novel synaptic plasticity rule to optimize the weights of spiking neural networks, thereby improving the accuracy of spiking neural networks in performing classification tasks.
[0056] The beneficial effects of this invention are: modifying the traditional pulse timing-dependent plasticity rule calculation formula to locally optimize the weights between neurons in a spiking neural network; introducing Q-learning to update neuron weights based on the update of the Q function, thereby enhancing the weights between neurons with strong correlations, and thus achieving global adjustment of the weights of the spiking neural network. Attached Figure Description
[0057] Figure 1 This is a flowchart illustrating the implementation of the present invention. Detailed Implementation
[0058] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0059] Example 1: As Figure 1 As shown, the optimization of a spiking neural network based on a novel weight adjustment mechanism involves the following steps:
[0060] Step 1: First, obtain the training data of the target dataset and randomly select 5000 data points as training data, and record the category labels corresponding to the selected training data; randomly select 5000 data points and their corresponding labels from the MNIST, Fashion MNIST and CIFAR10 datasets respectively as training data.
[0061] Step 2: Build a convolutional attention model using channel attention and spatial attention models. Use the convolutional attention model to refine the selected 5000 training samples and extract data feature values. Calculate the feature values of the training samples randomly selected in Step 1 using the convolutional attention model.
[0062] Step3: build a pulse neural network with Leaky Integrate and Fired technology, the initial pulse of the pulse neural network is a random value of 0-1, and the feature value calculated according to Step2 is taken as the input of the network structure.
[0063] Step4: optimize the pulse neural network of Step3 according to the local adjustment mechanism of the Gaussian pulse timing dependent plasticity weight and the global adjustment mechanism of the Q learning weight, calculate the training result according to the neural network, and obtain the pulse tensor and the network model.
[0064] Step5: establish a three-layer fully connected structure, take the pulse tensor calculated in Step4 and the classification label in Step1 as input, and perform classifier training according to the set epoch value to obtain a pulse classifier.
[0065] Step6: calculate the pulse sequence of the data to be classified according to the network model obtained in Step4, and the pulse sequence is classified according to the classifier of Step5.
[0066] The application will be described in detail below through specific examples.
[0067] Step1: simulation environment and experimental parameter setting;
[0068] The application adopts Python programming voice, MNIST data set, Fashion MNIST data set and CIFAR10 data set for simulation experiment. The application realizes image data classification according to the method process shown in the figure. Figure 1 The novel pulse neural network synaptic weight adjustment method proposed by the application optimizes the pulse neural network, and three public data sets perform classification tasks according to the optimized model.
[0069] Step2: overall implementation process;
[0070] As shown in Figure 1 , the specific implementation process of the application is:
[0071] First, obtain the MNIST, Fashion MNIST and CIFAR10 data sets, randomly select 5000 data in the training set of each data set as training samples, and obtain the category label corresponding to the training sample.
[0072] Second, calculate the features of the selected training samples through the convolution attention module, and extract the features corresponding to each training data.
[0073] Then, a pulse neural network is built by using the Leaky Integrate and Fired technology, the initial pulse of the pulse neural network is a random value of 0-1, the pulse neural network model is initialized, the training features are input into the training of the pulse neural network model as the input of the pulse neural network model, the weight of the pulse neural network model is locally adjusted according to the Gaussian pulse time-dependent plasticity rule, the model weight is globally adjusted according to the global weight adjustment mechanism based on Q learning, the pulse neural network model is updated, and a pulse tensor is obtained.
[0074] Subsequently, a three-layer fully connected structure is built, the pulse tensor and the sample label are taken as the input for training, and a pulse classifier is obtained.
[0075] Finally, the classified data obtains a pulse sequence according to the pulse neural network, and a classification result is obtained according to the fully connected classifier.
[0076] Step3: build a pulse neural network and initialize the model;
[0077] Step3.1: initialize the Leaky Integrate and Fired algorithm model, simulate the process of accumulating membrane potential and firing pulses of pulse neurons by Leaky Integrate and Fired, wherein the process of accumulating membrane potential is as follows:
[0078]
[0079] In the formula, l is the number of layers of the neural network, t is the time step, V (l) is the membrane potential of the lth layer at the time step t, τ is the time constant, V reset represents the resting potential, and the membrane potential accumulation exceeding the threshold value leads to pulse firing, and the membrane potential is reset to the resting potential value;
[0080] The process of accumulating membrane potential of the Leaky Integrate and Fired model is tracked, and a pulse is fired when the membrane potential accumulation exceeds a set threshold value, and the expression of the process is as follows:
[0081]
[0082] In the formula, S (l-1) is the pulse input of the previous layer, W (l) is the synaptic weight of the lth layer, the initial membrane potential is set to the resting potential, i.e. V rest = 0, V th is the threshold value of the membrane potential, and Θ(·) is a step function. When the value of the membrane potential gradually accumulates and exceeds the threshold value, the neuron will fire a pulse. After the pulse is fired, the membrane potential is reset to the resting state, i.e. V reset = V rest= 0, the mechanism of the pulse firing is defined as the following function:
[0083]
[0084] Step 3.2: Track the cumulative process of the membrane potential, when the cumulative membrane potential exceeds the threshold, a pulse is fired, and the firing time of the pulse is recorded, thereby obtaining the firing time of the presynaptic neuron and the postsynaptic neuron in the pulse neural network. According to the adjustment mechanism of the synaptic neural network, the change of the synaptic weight is related to the time interval between the firing of the presynaptic neuron and the firing of the postsynaptic neuron, and the time interval is used as the basis for weight adjustment. Let the time interval be Δt, and the calculation method of Δt is as follows:
[0085]
[0086] In the formula, is the time of the presynaptic neuron firing a pulse, is the time of the postsynaptic neuron firing a pulse.
[0087] Step 4: Construct a Gaussian pulse time-dependent plasticity rule:
[0088] Step 4.1: Initialize the traditional pulse time-dependent plasticity rule, and the weight update mechanism in the pulse neural network is defined as the following function:
[0089]
[0090] In the formula, Δw is the weight change value, A pre and A post represent the amplitude parameters of long-term potentiation and long-term depression, respectively, τ pre and τ post represent the time constants of long-term potentiation and long-term depression, respectively, the parameter τ pre determines the decay rate of the weight when Δt > 0, and the parameter τ post determines the enhancement rate of the weight when Δt < 0. If the presynaptic neuron fires a pulse slightly later than the postsynaptic neuron, the weight increases, corresponding to the long-term potentiation effect; if the presynaptic neuron fires a pulse earlier than the postsynaptic neuron, the weight decreases, corresponding to the long-term depression effect.
[0091] Step 4.2: Modify the traditional pulse time-dependent plasticity rule according to the change trend of the Gaussian function, and obtain the Gaussian pulse time-dependent plasticity rule. The formula of the modified Gaussian pulse time-dependent plasticity rule is as follows:
[0092]
[0093] According to the modified Gaussian pulse timing-dependent plasticity rule, when the time interval tends to 0, the corresponding weight change degree increases, and vice versa, when the time interval gradually increases, the corresponding weight change shows an accelerated downward trend. Specifically, when the post-synaptic neuron emits a pulse slightly earlier than the time of the pre-synaptic neuron, and the time interval tends to 0, the weight increase value under the Gaussian pulse timing-dependent plasticity rule will be higher than the weight increase value under the traditional pulse timing-dependent plasticity adjustment, and vice versa, when the pre-synaptic neuron emits a pulse slightly earlier than the post-synaptic neuron, and the time interval tends to 0, the weight decrease degree will be higher than the weight change based on the traditional pulse timing-dependent plasticity rule; when the absolute value of the above time interval gradually increases, the weight change will show an accelerated downward trend, and under the same time interval, the modified plasticity rule can make the weight change less than the weight change based on the original plasticity rule.
[0094] Step 5: Constructing a global adjustment rule for the pulse neural network based on Q-learning.
[0095] Step 5.1: Associate Q-learning with neural network weights, define the value of Q function as an agent, set the event that the pre-synaptic neuron emits a pulse slightly later than the post-synaptic neuron and the time interval tends to 0 as a reward signal, determine the exploration decision and utilization decision of Q-learning through the ε-greedy strategy, ε is a parameter between 0 and 1, which determines the probability of exploration of the agent at each decision, and ε gradually decreases, so that the agent changes from exploration to utilization;
[0096] Step 5.2: According to the setting of Step 3.1, the agent continues to perform global regulation based on the local adjustment of the neural network weights in Step 2, according to the ε-greedy strategy, the agent will perform exploration action with the probability of ε, and perform utilization action with the probability of (1-ε), when the agent explores the reward signal in the learning process of the pulse neural network based on the Gaussian pulse timing-dependent plasticity rule, the agent updates the value of Q function, increases the weight between neurons, the behavior of the agent updating Q function is iterative, and ε gradually decays, the agent updates Q function using known behavior, when all training samples complete the learning process in the pulse neural network, the agent stops updating Q function immediately, the update formula of Q function is as follows:
[0097] Q(s,a)←Q(s,a)+α[r+γmax a′ Q(s′,a′)-Q(s,a)]
[0098] where s is a state, a is an action, Q(s, a) is the Q value of taking action a in state s, i.e., the weight update value between neurons, a is a learning rate, r is an immediate reward received after performing an action, g is a discount factor, s' is a new state reached after performing an action, max a′ Q(s', a') is the maximum Q value of all possible actions in the new state.
[0099] Step6: Extract data samples, obtain the pulse neural network model and the corresponding classifier, and realize data classification.
[0100] Step6.1: Obtain MNIST, Fashion MNIST and CIFAR10 data sets, randomly select 5000 data in the training set of each data set as training samples, and obtain the class labels corresponding to the training samples.
[0101] Step6.2: Construct a channel attention module, the input training sample will be processed by global average pooling and global maximum pooling, and the two processing results will be shared in a network structure composed of a multilayer perceptron with one hidden layer. The results of global average pooling and global maximum pooling are summed and combined, and the calculation formula of channel attention is as follows:
[0102]
[0103] where σ(·) is a sigmoid function, MLP(·) is a multilayer perceptron calculation model, AvgPool(F) represents average pooling of input features, MaxPool(F) represents maximum pooling of input features, and respectively correspond to the features after average pooling and maximum pooling, W0 and W1 are the weights of the MLP(·) multilayer perceptron, and finally the channel attention feature M c (F) is obtained.
[0104] Step6.3: Construct a spatial attention module, perform average pooling and maximum pooling operations along the channel axis of the input data, and then connect the two to form a spatial feature. The calculation formula of spatial attention is as follows:
[0105]
[0106] where f 7×7 (·) represents a 7x7 filter convolution operation, AvgPool(·) and MaxPool(·) represent average pooling and maximum pooling operations during convolution, and respectively represent the average pooling feature and the global pooling feature in the spatial attention mechanism, and the channel attention feature M is obtained according to the calculation s (F).
[0107] Step 6.4: a convolution attention model is built by connecting the channel attention module and the spatial attention module in series, and the calculation formula of the convolution attention is as follows:
[0108]
[0109] In the formula, F is the original data input, M c is the channel attention operation, M s is the spatial attention operation.
[0110] Step 6.5: the training sample is used as the input of the built convolution attention model, and the key feature of the training sample is obtained according to the convolution attention calculation. The key feature is the relevant feature that is beneficial to the learning and training effect of the spiking neural network after the redundant features and noise of the training sample are removed. The key feature is used as the input of the spiking neural network model for training. The local adjustment and global adjustment rules of the neuron weight are used to adjust the weight between the spiking neurons during the sample training process. After the training is completed, the spiking sequence tensor is obtained.
[0111] Step 6.6: a three-layer fully connected classifier is built, the number of neurons of the first layer classifier is equal to the product of the original data size of the training sample, the number of neurons of the second layer classifier is equal to 128, and the number of neurons of the third layer classifier is equal to the number of categories. According to the built three-layer fully connected classifier, the training is implemented. The spiking sequence tensor generated in the sample training process of Step 6.5 is used as the training sample of the classifier. After a preset number of iteration times, the classifier is obtained.
[0112] Step 6.7: the data to be executed for the classification task is obtained through the spiking neural network to obtain the spiking sequence, and the obtained spiking sequence is input into the trained classifier to complete the data classification.
[0113] To prove the effectiveness of the local adjustment rule of the timing-dependent plasticity weight of the Gaussian pulse and the global adjustment rule of the weight based on Q-learning, experiments and evaluations were performed on the MNIST, Fashion MNIST and CIFAR10 data sets by using the accuracy index, and the existing work based on the pulse neural network model was investigated. The classification accuracy data of the three same data sets in the existing work were listed for comparison. It can be seen that the local adjustment rule of the timing-dependent plasticity weight of the Gaussian pulse and the global adjustment rule of the weight based on Q-learning enable the pulse neural network to maintain a high accuracy in performing the classification task. Table 1 is the classification accuracy of the pulse neural network using the new synaptic weight adjustment rule of the application on the MNIST data set and the comparative experiment, Table 2 is the classification accuracy of the pulse neural network using the new synaptic weight adjustment rule of the application on the Fashion MNIST data set and the comparative experiment, and Table 3 is the classification accuracy of the pulse neural network using the new synaptic weight adjustment rule of the application on the CIFAR10 data set and the comparative experiment.
[0114] Table 1 is the classification accuracy of the pulse neural network using the new synaptic weight adjustment rule of the application on the MNIST data set and the comparative experiment
[0115]
[0116] Table 2 is the classification accuracy of the pulse neural network using the new synaptic weight adjustment rule of the application on the Fashion MNIST data set and the comparative experiment
[0117]
[0118]
[0119] Table 3 is the classification accuracy of the pulse neural network using the new synaptic weight adjustment rule of the application on the CIFAR10 data set and the comparative experiment
[0120]
[0121] The specific embodiments of the application are described in detail above with reference to the accompanying drawings, but the application is not limited to the above-described embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the application.
Claims
1. A novel method for adjusting synaptic weights of a spiking neural network, characterized by: Step 1: building a spiking neural network model according to the Leaky Integrate and Fired algorithm, tracking the time interval between the firing of a presynaptic neuron and the firing of a postsynaptic neuron in the spiking neural network model, and obtaining the change information of synaptic weights through the time interval; Step 2: establishing a Gaussian pulse temporal-dependent plasticity rule for local weight adjustment, forming a local adjustment rule for the weights of spiking neurons; Step 3: introducing reinforcement learning based on the Gaussian pulse temporal-dependent plasticity rule to form a global adjustment rule for the weights of spiking neurons; Step 4: using a convolutional attention module to preprocess data that needs to perform an image classification task, extracting key features of the image data, taking the key features as the input of the spiking neural network model, and realizing the weight adjustment of the spiking neural network through the local and global adjustment rules of the weights of spiking neurons to complete the classification task.
2. A novel method of adjusting synaptic weights of a spiking neural network according to claim 1, characterized in that, The Step 1 is specifically: Step 1.1: initializing the Leaky Integrate and Fired algorithm model, simulating the process of accumulating membrane potential and firing pulses of spiking neurons through Leaky Integrate and Fired, wherein the process of accumulating membrane potential is: where l is the number of layers of the neural network, t is the time step, V (l) [t] is the membrane potential of the lth layer at time step t, τ is a time constant, V reset represents the resting potential, and the membrane potential accumulates over the threshold value to cause a spike to fire, while the membrane potential will reset to the resting potential value; Tracking the process of accumulating membrane potential of the Leaky Integrate and Fired model, and firing a pulse when the accumulated membrane potential exceeds a set threshold, the expression of the process is as follows: where S (l-1) is the input of the previous layer, W (l) is the synaptic weight of the lth layer, and the initial membrane potential is set to the resting potential, i.e., V rest = 0, V th is the threshold of the membrane potential, and Θ(·) is the step function. When the value of the membrane potential gradually accumulates and exceeds the threshold, the neuron will fire a pulse. After the pulse is fired, the membrane potential will reset to the resting state, i.e., V reset = V rest = 0. The mechanism of pulse firing is defined as the following function: Step 1.2: tracking the process of accumulating membrane potential, firing a pulse when the accumulated membrane potential exceeds a threshold, and recording the firing time of the pulse, thereby obtaining the time of firing pulses of presynaptic neurons and postsynaptic neurons in the spiking neural network; according to the adjustment mechanism of the synaptic neural network, the change of synaptic weight is related to the time interval between the firing of presynaptic neurons and the firing of postsynaptic neurons, and the time interval is used as the basis for weight adjustment, wherein the time interval is Δt, and the calculation method of Δt is as follows: wherein is the time at which the presynaptic neuron fires a pulse, is the time at which the postsynaptic neuron fires a pulse.
3. The novel method of adjusting synaptic weights of a spiking neural network according to claim 1, wherein, In Step 2, the Gaussian pulse temporal-dependent plasticity rule is improved according to the change trend of the Gaussian function based on the original pulse temporal-dependent plasticity rule, and the local adjustment of the synaptic weights of spiking neurons is realized by adjusting the weight change at different time intervals, which is specifically: Step 2.1: initializing the traditional pulse temporal-dependent plasticity rule, and the weight update mechanism in the spiking neural network is defined as the following function: where Δw is the weight change value, A pre and A post represent the amplitude parameters of LTP and LTD respectively, τ pre and τ post represent the time constant of LTP and LTD respectively, the parameter τ pre determines the decay rate of the weight when Δt > 0, the parameter τ post determines the increase rate of the weight when Δt < 0, if the presynaptic neuron fires later than the postsynaptic neuron, the weight increases, corresponding to the LTP effect; if the presynaptic neuron fires earlier than the postsynaptic neuron, the weight decreases, corresponding to the LTD effect; Step 2.2: modifying the traditional pulse temporal-dependent plasticity rule according to the change trend of the Gaussian function to obtain the Gaussian pulse temporal-dependent plasticity rule, and the modified Gaussian pulse temporal-dependent plasticity rule is as follows: According to the modified Gaussian pulse temporal-dependent plasticity rule, when the time interval tends to 0, the corresponding weight change degree increases, and vice versa, when the time interval gradually increases, the corresponding weight change shows an accelerated downward trend.
4. The novel method of adjusting synaptic weights of a spiking neural network according to claim 1, wherein, In Step 3, the introduction of reinforcement learning, i.e., Q-learning and ε-greedy strategy, is used to realize global adjustment of the synaptic weights of the spiking neuron, specifically as follows: Step 3.1: Q-learning is associated with the weights of the neural network, and the value of the Q function is defined as the agent. The reward signal is set as the event that the presynaptic neuron fires a pulse slightly later than the postsynaptic neuron, and the time interval tends to 0. The exploration decision and utilization decision of Q-learning are determined by the ε-greedy strategy. ε is a parameter between 0 and 1, which determines the probability of exploration by the agent at each decision, and ε gradually decreases, so that the agent changes from exploration to utilization. Step 3.2: Based on the setting of Step 3.1, the agent continues to perform global regulation on the basis of the local adjustment of the neural network weights in Step 2. According to the ε-greedy strategy, the agent will perform exploration action with probability ε and utilization action with probability (1-ε). In the learning process of the spiking neural network based on the high-gaussian pulse time-dependent plasticity rule, when the agent explores the reward signal, the agent updates the value of the Q function and increases the weights between neurons. The agent updates the Q function iteratively, and ε gradually decays. The agent updates the Q function using known behaviors. When all training samples complete the learning process in the spiking neural network, the agent stops updating the Q function immediately. The update formula of the Q function is as follows: Q(s, a)←Q(s, a) + a[r + y max a′ Q(s', a') - Q(s, a)] where s is a state, a is an action, Q(s, a) is the Q-value of taking action a in state s, i.e., the weight update value between neurons, a is a learning rate, r is an immediate reward received after performing the action, g is a discount factor, s' is a new state reached after performing the action, max a′ Q(s', a') is the maximum Q-value of all possible actions in the new state.
5. The novel method of adjusting synaptic weights of a spiking neural network according to claim 1, wherein, In Step 4, the convolutional attention module is composed of a channel attention module and a spatial attention module. The classification task is completed as follows: Step 4.1: Obtain the data required to perform the classification task, randomly select a part of the data as training samples, and obtain the class labels corresponding to the selected training samples; Step 4.2: Construct a channel attention module. The input training samples are processed by global average pooling and global maximum pooling, respectively. The two processing results are shared in a network structure composed of a multilayer perceptron with one hidden layer. The results of global average pooling and global maximum pooling are summed and combined. The calculation formula of channel attention is as follows: wherein σ(·) is a sigmoid function, MLP(·) is a multi-layer perceptron computation model, AvgPool(F) represents average pooling of input features, MaxPool(F) represents maximum pooling of input features, and correspond to the features after average pooling and maximum pooling, respectively, W0and W1are weights of the MLP(·) multi-layer perceptron, and a channel attention feature M c (F) is finally obtained. Step 4.3: Construct a spatial attention module. Perform average pooling and maximum pooling operations along the channel axis of the input data, and then connect them to form spatial features. The calculation formula of spatial attention is as follows: wherein f 7×7 (·) represents a filter convolution operation with a size of 7x7, AvgPool(·) and MaxPool(·) represent average pooling and maximum pooling operations in the convolution operation process, respectively, and represent average pooling features and global pooling features in the spatial attention mechanism, respectively, and the channel attention features M s (F) are obtained according to the calculation. Step 4.4: Build a convolutional attention model by concatenating the channel attention module and the spatial attention module. The calculation formula of convolutional attention is as follows: where F is the original data input, M c is the channel attention operation, M s is the spatial attention operation; Step4.5: taking the training sample as an input of the built convolutional attention model, obtaining a key feature of the training sample according to convolutional attention calculation, the key feature being a relevant feature beneficial to learning and training effect of the spiking neural network after eliminating redundant features and noise of the training sample, taking the key feature as an input of the spiking neural network model for training, respectively using the local adjustment and global adjustment rules of the neuron weight to adjust the weight between the spiking neurons in the sample training process, and obtaining a spiking sequence tensor after the training; Step4.6: building a three-layer structure full connection classifier, the neurons in the three-layer structure being full connection, taking the spiking sequence tensor generated in the sample training process as a training sample of the classifier, and completing the classifier training after a preset number of iteration times; Step4.7: obtaining a spiking sequence of data to be executed by the spiking neural network, and completing data classification by the trained classifier.
Citation Information
Patent Citations
Synaptic weight training method, electronic equipment and computer readable medium
CN113269313A
Image classification learning method based on multi-scale pulse convolutional neural network
CN118447317A