Hardware-friendly STDP learning method and system based on threshold adaptive neurons

By adopting a hardware-friendly STDP learning method based on threshold adaptive neurons in the pulsed neural network, combined with the hardware-friendly weight normalization method, the problem of high resource consumption in the hardware implementation of existing STDP learning rules is solved, and the effect of efficient deployment on hardware devices with limited resources is achieved.

CN114118378BActive Publication Date: 2025-06-06ZHEJIANG LAB +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111456234.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-02
Publication Date
2025-06-06
Estimated Expiration
2041-12-02

AI Technical Summary

Technical Problem

In the hardware implementation of existing STDP learning rules, the standard weight normalization method includes division operations, which leads to a large resource consumption and makes it difficult to efficiently deploy on dedicated hardware devices with limited resources.

Method used

The hardware-friendly STDP learning method based on threshold adaptive neurons is adopted, and the input images are encoded into pulse sequences through frequency encoding, and the synaptic weights are updated in the pulse neural network using STDP learning rules and hardware-friendly weight normalization method. Specifically, a hardware-friendly STDP normalization method is proposed, which reduces division calculations and improves hardware implementation efficiency through dynamic summing values ​​and settlement methods.

Benefits of technology

While ensuring accuracy and stability, the resource consumption of the algorithm in hardware implementation is reduced, so that it can be deployed efficiently on dedicated hardware devices with limited resources, providing a new idea of ​​unsupervised learning methods for deep SNN.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114118378B_ABST
    Figure CN114118378B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of pulse neural network, and relates to a hardware-friendly STDP learning method and system based on threshold adaptive neurons, the method comprising the following steps: S1: frequency coding is used to encode an input image into a pulse sequence and input into a pulse neural network SNN; S2: the excitatory layer neurons of the SNN receive input pulses, accumulate membrane potential, and when the membrane voltage reaches a threshold, pulses are issued and the membrane potential is reset; S3: the SNN inhibition layer is connected one-to-one with the excitatory layer neurons, receives its output pulses and inhibits the excitatory layer neurons; S4: according to the STDP learning rule and using a hardware-friendly weight normalization method, the excitatory synaptic weights between the input layer and the excitatory layer are updated; S5: after learning is completed, the pulse output sequence of the excitatory layer neurons is used for image recognition. The present invention can reduce the resource consumption of the algorithm in hardware implementation while ensuring accuracy and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of pulse neural networks and relates to a hardware-friendly STDP learning method and system based on threshold adaptive neurons. Background Art

[0002] Spiking Neural Network (SNN) is known as the third generation of artificial neural network, in which spiking neurons transmit and calculate pulse sequences as effective information. It has strong biological rationality in terms of neuron model, synaptic model and pulse emission mechanism, and is highly close to real biological neural network. The Hebb learning rule shows that the connection strength of synapses changes with the changes in the activities of presynaptic and postsynaptic neurons, and neuroscience research has found that the change of synaptic weights is closely related to the precise time of neuron firing pulses, and the relative time difference of pulse firing plays a key role in the change of weight direction and size. This learning rule based on the correlation between pre- and postsynaptic pulse firing time is called Spiking Timing Dependent Plasticity (STDP), which is an unsupervised local learning rule and is considered to be an important mechanism for brain learning and information storage.

[0003] Since the standard weight normalization method of STDP includes division operations, it consumes a lot of resources when implemented in hardware and is difficult to deploy efficiently on dedicated hardware devices with limited resources. Summary of the invention

[0004] In order to solve the above technical problems existing in the prior art, the present invention proposes a hardware-friendly STDP learning method and system based on threshold adaptive neurons, and its specific technical solution is as follows:

[0005] The hardware-friendly STDP learning method based on threshold adaptive neurons includes the following steps:

[0006] S1: Use frequency coding to encode the input image into a pulse sequence and input it into the pulse neural network SNN;

[0007] S2: The excitatory layer neurons of SNN receive input pulses and accumulate membrane potential. When the membrane voltage reaches the threshold, pulses are emitted and the membrane potential is reset.

[0008] S3: The SNN inhibition layer is connected one-to-one with the neurons in the excitation layer, receiving their output pulses and inhibiting the neurons in the excitation layer;

[0009] S4: Update the excitatory synaptic weights between the input layer and the excitatory layer according to the STDP learning rule and adopt a hardware-friendly weight normalization method;

[0010] S5: After learning is completed, the pulse output sequence of the neurons in the excitatory layer is used for image recognition.

[0011] Furthermore, the step S1 uses frequency coding to encode the input image into a pulse sequence of a specific frequency according to its pixel size, wherein the frequency coding expression is:

[0012]

[0013] in represents a uniformly distributed random number, c represents a scaling factor, Represents the normalized image pixel value.

[0014] Furthermore, in the pulse neural network, the input layer is a pulse sequence after the input image is encoded, the input layer and the excitation layer are fully connected, the number of neurons in the inhibitory layer is consistent with that in the excitation layer, each excitatory neuron is connected one-to-one with an inhibitory neuron, and each inhibitory neuron inhibits the excitatory neurons except the corresponding neuron.

[0015] Furthermore, the excitatory layer neurons maintain the balance of pulse firing rate by raising the threshold, and the neuron model expression is:

[0016]

[0017] in represents the membrane potential of the neuron at time t, Represents the reset voltage, represents the connection weights between input neurons and output neurons, represents the threshold value, represents the adaptive parameter, and They represent the input pulse and output pulse of the neuron respectively, and take the value of 0 or 1 depending on whether the pulse is emitted. and They represent two attenuation constants, Indicates the threshold increase amount.

[0018] Furthermore, the inhibitory layer neurons are Leaky Integrate-And-Fire (LIF) neuron models, expressed as:

[0019]

[0020] Furthermore, the step S4 is specifically as follows: first, based on the STDP learning rule, the expression is:

[0021]

[0022]

[0023] in, represents the time when the presynaptic pulse arrives at synapse j, represents the discharge time of the postsynaptic neuron, represents the total weight change caused by pre-synaptic and post-synaptic stimulation, represents the learning function of STDP, i.e., the learning window, and They represent the time constants, , Represents the learning rate; for the STDP learning rule, if the pulse emitted by the presynaptic neuron arrives before the pulse emitted by the postsynaptic neuron, the synapse is strengthened; otherwise, the synapse is weakened;

[0024] A STDP online learning method is adopted, that is, the weights are updated when receiving input pulses or issuing output pulses. The formula is as follows:

[0025]

[0026] in, and denote the pulse trajectories of the input and output neurons at time t, respectively. represents the trajectory decay constant, Represents the weight update amount at time t;

[0027] Then perform normalization operation to obtain the original normalization formula of STDP:

[0028]

[0029]

[0030]

[0031] in, is the normalization constant, It means that for each postsynaptic neuron, the weights of all its corresponding presynaptic neurons are summed up;

[0032] Finally, referring to Oja's normalization and improvement method of the original Hebbian rule, a hardware-friendly STDP normalization method is proposed. The specific expression is as follows:

[0033]

[0034] in and The value is close to 0, and the linear main part of the formula is taken.

[0035] The hardware-friendly STDP learning system based on threshold adaptive neurons includes: an encoding module, an excitation module, an inhibition module, a learning module and an output module. The encoding module uses frequency encoding to encode an input image into a pulse sequence and inputs the pulse neural network; the excitation module uses SNN excitation layer neurons to receive input pulses and accumulate membrane potential. When the membrane voltage reaches a threshold, pulses are emitted and the membrane potential is reset; the inhibition module is used for one-to-one connection between the SNN inhibition layer and the excitation layer neurons, receiving their output pulses and inhibiting the excitation layer neurons; the learning module updates the excitatory synaptic weights between the input and excitation layers according to the STDP learning rules and using a hardware-friendly weight normalization method; the output module is used to use the pulse output sequence of the excitation layer neurons for image recognition after learning is completed.

[0036] Beneficial effects:

[0037] The present invention can reduce the resource consumption of the algorithm in hardware implementation while ensuring accuracy and stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flowchart of a hardware-friendly STDP learning method based on threshold adaptive neurons according to an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of a threshold adaptive neuron structure according to an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of a pulse neural network structure according to an embodiment of the present invention;

[0041] Figure 4 A flow chart of an STDP unsupervised learning algorithm according to an embodiment of the present invention;

[0042] Figure 5 Schematic diagram of the structure of a hardware-friendly STDP learning system based on threshold adaptive neurons according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical scheme and technical effect of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings.

[0044] like Figure 1 As shown, a hardware-friendly STDP learning method based on threshold adaptive neurons includes the following steps:

[0045] S1: Use frequency coding to encode the input image into a pulse sequence and input it into the pulse neural network SNN;

[0046] Among them, the formula for frequency encoding is:

[0047]

[0048] in represents a uniformly distributed random number, c represents a scaling factor, represents the normalized image pixel value; according to the MNIST input pixel intensity, the firing frequency of the input neuron is set to 63.75 Hz, that is, It is 0.06375.

[0049] S2: The excitatory layer neurons of SNN receive input pulses and accumulate membrane potential. When the membrane voltage reaches the threshold, pulses are emitted and the membrane potential is reset.

[0050] like Figure 2 As shown in the figure, the threshold adaptive neuron in the excitation layer maintains the balance of the pulse firing rate by raising the threshold to prevent the phenomenon that the neuron that fired the pulse first keeps firing. The neuron model is:

[0051]

[0052] in represents the membrane potential of the neuron at time t, represents the reset voltage, represents the connection weight between the input neuron and the output neuron, represents the threshold value, represents the adaptive parameter, and They represent the input pulse and output pulse of the neuron respectively, and take the value of 0 or 1 depending on whether the pulse is emitted. and They represent two attenuation constants, Indicates the threshold increase amount.

[0053] S3: The SNN inhibition layer is connected one-to-one with the neurons in the excitation layer, receiving their output pulses and inhibiting the neurons in the excitation layer;

[0054] The inhibitory layer neurons are Leaky Integrate-And-Fire or LIF neuron model:

[0055]

[0056] Among them, inhibition can make neurons respond differently to samples of different categories, so that all sample patterns can be learned.

[0057] The pulse neural network in the above technical solution is connected as follows Figure 3As shown, the input layer is the pulse sequence after the input image is encoded, the input layer and the excitation layer are fully connected, the number of neurons in the inhibition layer is the same as that in the excitation layer, each excitation neuron is connected one-to-one with an inhibitory neuron, and each inhibitory neuron inhibits the excitation neurons except the corresponding neurons.

[0058] S4: Figure 4 As shown, the excitatory synaptic weights between the input layer and the excitatory layer are updated according to the STDP learning rule and a hardware-friendly weight normalization method;

[0059] Among them, the STDP learning rule is:

[0060]

[0061]

[0062] in, represents the time when the presynaptic pulse arrives at synapse j, represents the discharge time of the postsynaptic neuron, represents the total weight change caused by pre-synaptic and post-synaptic stimulation, represents the learning function of STDP, i.e., the learning window, and They represent the time constants, , Represents the learning rate; for the STDP learning rule, if the pulse fired by the presynaptic neuron arrives before the pulse fired by the postsynaptic neuron, the synapse is strengthened; otherwise, the synapse is weakened.

[0063] Since the standard STDP learning method needs to find all pulse time differences, which is not conducive to hardware implementation, a STDP online learning method is adopted, that is, the weights are updated when receiving input pulses or issuing output pulses. The formula is as follows:

[0064]

[0065] in, and denote the pulse trajectories of the input and output neurons at time t, respectively. represents the trajectory decay constant, Represents the weight update amount at time t.

[0066] According to the STDP rule, pulse output will increase the weight value, and the increase in weight value will lead to an increase in output pulses. In this way, learning will usually lead to weight divergence, so normalization operation is needed to make the weight distribution within a certain range to prevent weight divergence and the inability to recognize the target.

[0067] Furthermore, the original normalization formula of STDP is:

[0068]

[0069]

[0070]

[0071] in, is the normalization constant, It means that for each postsynaptic neuron, the weights of all its corresponding presynaptic neurons are summed up.

[0072] Since hardware-implemented division operations consume a lot of resources, it is difficult to deploy them efficiently on dedicated hardware devices with limited resources. Therefore, the present invention draws on Oja's normalization and improvement methods for the original Hebbian rule and proposes a hardware-friendly STDP normalization method, which is specifically in the following form:

[0073]

[0074] and The value is close to 0, the higher-order infinitesimal can be ignored, and the linear main part of the formula is taken. In addition, research shows that during the training process, the dynamic sum of the weights is combined with At the same time, cancellation can make it converge and omit the division calculation, so it can be implemented efficiently on hardware.

[0075] S5: After learning is completed, the pulse output sequence of the neurons in the excitatory layer is used for image recognition.

[0076] like Figure 5 As shown, the hardware-friendly STDP learning system 10 based on threshold adaptive neurons includes: an encoding module 100, an excitation module 200, an inhibition module 300, a learning module 400 and an output module 500.

[0077] Among them, the encoding module 100 uses frequency coding to encode the input image into a pulse sequence and input it into the pulse neural network; the excitation module 200 uses SNN excitation layer neurons to receive input pulses and accumulate membrane potential. When the membrane voltage reaches the threshold, pulses are emitted and the membrane potential is reset; the inhibition module 300 is used for one-to-one connection between the SNN inhibition layer and the excitation layer neurons, receiving their output pulses and inhibiting the excitation layer neurons; the learning module 400 updates the excitatory synaptic weights between the input and excitation layers according to the STDP learning rule and a hardware-friendly weight normalization method; the output module 500 is used to perform image recognition using the pulse output sequence of the excitation layer neurons after learning is completed.

[0078] The above-mentioned method and system in the present invention, on the one hand, adopt threshold adaptation and suppression layer operations, which can effectively train and improve accuracy; on the other hand, a hardware-friendly weight normalization method is proposed to reduce the resource consumption of hardware implementation, so that it can be efficiently deployed on dedicated hardware devices with limited resources, providing new ideas for the hardware-implemented unsupervised learning method of deep SNN.

[0079] The above is only a preferred implementation case of the present invention and does not limit the present invention in any form. Although the implementation process of the present invention is described in detail above, for those familiar with the art, they can still modify the technical solutions recorded in the above examples, or replace some of the technical features therein with equivalents. All modifications, equivalent replacements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. Hardware-friendly STDP learning method based on threshold adaptive neurons, It is characterized in that The following steps are involved: S1: Use frequency coding to encode the input image into a pulse sequence and input it into the pulse neural network SNN; S2: The excitatory layer neurons of SNN receive input pulses and accumulate membrane potential. When the membrane voltage reaches the threshold, pulses are emitted and the membrane potential is reset. S3: The SNN inhibition layer is connected one-to-one with the neurons in the excitation layer, receiving their output pulses and inhibiting the neurons in the excitation layer; S4: According to the STDP learning rule and the hardware-friendly weight normalization method, the excitatory synaptic weights between the input layer and the excitatory layer are updated. Specifically, based on the STDP learning rule, the expression is: , in, represents the time when the presynaptic pulse arrives at synapse j, represents the discharge time of the postsynaptic neuron, represents the total weight change caused by pre-synaptic and post-synaptic stimulation, represents the learning function of STDP, i.e., the learning window, and They represent the time constants, , Represents the learning rate; for the STDP learning rule, if the pulse emitted by the presynaptic neuron arrives before the pulse emitted by the postsynaptic neuron, the synapse is strengthened; otherwise, the synapse is weakened; The STDP online learning method is adopted, that is, the weights are updated when receiving input pulses or issuing output pulses. The formula is as follows: , in, and denote the pulse trajectories of the input and output neurons at time t, respectively. represents the trajectory decay constant, Represents the weight update amount at time t; Then perform normalization operation to obtain the original normalization formula of STDP: , in, is the normalization constant, It means that for each postsynaptic neuron, the weights of all its corresponding presynaptic neurons are summed up; The hardware-friendly STDP normalization method is used. The specific expression is as follows: , and The value approaches 0, and the linear main part of the formula is taken; S5: After learning is completed, the pulse output sequence of the neurons in the excitatory layer is used for image recognition.

2. The hardware-friendly STDP learning method based on threshold adaptive neurons as claimed in claim 1, It is characterized in that The step S1 uses frequency coding to encode the input image into a pulse sequence of a specific frequency according to its pixel size, wherein the frequency coding expression is: , in represents a uniformly distributed random number, c represents the scaling factor, Represents the normalized image pixel value.

3. The hardware-friendly STDP learning method based on threshold adaptive neurons as claimed in claim 1, It is characterized in that The pulse neural network has an input layer that is a pulse sequence after the input image is encoded. The input layer and the excitation layer are fully connected. The number of neurons in the inhibitory layer is consistent with that in the excitation layer. Each excitatory neuron is connected one-to-one with an inhibitory neuron, and each inhibitory neuron inhibits excitatory neurons other than the corresponding neuron.

4. The hardware-friendly STDP learning method based on threshold adaptive neurons as claimed in claim 1, It is characterized in that The excitatory layer neurons maintain the balance of pulse firing rate by raising the threshold. The neuron model expression is: , in represents the membrane potential of the neuron at time t, Represents the reset voltage, represents the connection weights between input neurons and output neurons, represents the threshold value, represents the adaptive parameter, and They represent the input pulse and output pulse of the neuron respectively, and take the value of 0 or 1 depending on whether the pulse is emitted. and They represent two attenuation constants, Indicates the threshold increase amount.

5. The hardware-friendly STDP learning method based on threshold adaptive neurons as claimed in claim 4, It is characterized in that The inhibitory layer neurons are Leaky Integrate-And-Fire (LIF) neuron models, expressed as: 。 6. A system using the hardware-friendly STDP learning method based on threshold adaptive neurons according to any one of claims 1 to 5, comprising an encoding module (100), an input module (200), a suppression module (300), a learning module (400) and an output module (500), Features: The encoding module (100) uses frequency encoding to encode the input image into a pulse sequence and inputs it into the pulse neural network; the excitation module (200) uses the SNN excitation layer neurons to receive the input pulses, accumulate the membrane potential, and when the membrane voltage reaches the threshold, emit pulses and reset the membrane potential; the inhibition module (300) is used to connect the SNN inhibition layer with the excitation layer neurons one-to-one, receive their output pulses and inhibit the excitation layer neurons; The learning module (400) updates the excitatory synaptic weights between the input and excitatory layers according to the STDP learning rule and adopts a hardware-friendly weight normalization method; the output module (500) is used to perform image recognition using the pulse output sequence of the neurons in the excitatory layer after the learning is completed.

Citation Information

Patent Citations

  • STDP-based pulse neural network handwritten Chinese character recognition method

    CN110837776A

  • Spiking Neural Network with STDP apllied to the threshold of neuron

    KR102204107B1