Digital spiking neural network conversion method and apparatus for attractor neural networks

By constructing a large neuron structure with receptor state and clock-activated neurons in the attractor neural network, the problems of long processing time and limited application scenarios when converting traditional ANN to SNN are solved, achieving efficient parallel data processing and enhanced stability.

CN116108898BActive Publication Date: 2026-06-02SHANGHAI NEW HELIUM BRAIN INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI NEW HELIUM BRAIN INTELLIGENT TECH CO LTD
Filing Date
2021-11-09
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies for converting traditional artificial neural networks into spiking neural networks suffer from long processing times and limited application scenarios, especially in classification tasks where there are issues with increased data length and latency.

Method used

A digital spiking neural network conversion method using attractor neural networks is proposed. This method establishes a large neuron structure containing receptor state neurons and clock-excited neurons, and uses digital signals for iterative updates to achieve parallel data processing.

Benefits of technology

It improves processing speed and stability, reduces data length, enhances anti-interference capabilities, and achieves functionality equivalent to traditional neural networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116108898B_ABST
    Figure CN116108898B_ABST
Patent Text Reader

Abstract

This invention relates to a method and apparatus for converting an attractor neural network into a digital spiking neural network. The method includes: acquiring the neuronal structure of the attractor neural network; establishing a one-to-one correspondence between each neuron in the neuronal structure of the attractor neural network and a large neuron in the digital spiking neural network, each large neuron including a receptor surface state neuron and a clock excitation neuron; the connection relationship of the digital spiking neural network is as follows: the clock excitation neuron in each large neuron is connected to the receptor surface state neurons in other large neurons (excluding itself), and the receptor surface state neurons in each large neuron are connected to the receptor surface state neurons in other large neurons (excluding itself). Compared with the prior art, this invention has the characteristics of high stability, strong anti-interference, and good real-time performance of parallel data compared with traditional serial input data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of spiking neural network technology, and in particular to a method and apparatus for converting attractor neural networks into digital spiking neural networks. Background Technology

[0002] Spiking neural networks (SNNs) are hailed as the "third generation of artificial neural networks" because their simulated artificial neuron structure more closely resembles that of real neurons while also preserving temporal information within the network. They possess high scalability, strong adaptability, and high fault tolerance. In recent years, SNNs have been increasingly regarded by both academia and business as one of the next-generation AI frontiers. Currently, SNN applications primarily target classic deep learning problems such as machine vision (CV), natural language processing (NLP), and pattern recognition (PR). Therefore, the ability to universally convert existing deep learning frameworks and algorithms into corresponding SNNs to achieve similar functionalities has become a crucial technology for the industrialization of SNNs. This technology also represents a current area of ​​intense exploration and represents a significant bottleneck.

[0003] Traditional algorithms for transforming Artificial Neural Networks (ANNs) into corresponding SNN structures mostly employ the encoding of spiking frequencies. This involves converting traditional tensor or array information (such as images and audio) into pulse-series signals based on different spiking frequencies, which are recognizable by the SNN structure. The output is a series of pulse segments containing different spiking frequencies to distinguish different categories. Traditional deep learning algorithms require a large amount of training data to optimize network parameters; however, when equivalently transforming into an SNN, the massive training data needs to be encoded and preprocessed, converting it into a series of data with temporal information. This significantly increases the data length, computation time, and output latency. Furthermore, due to the characteristic that the output consists of pulse segments with different spiking frequencies, the application is limited to problems such as classification where the output is finite and discrete. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the existing technology in terms of processing time and application scenarios of traditional ANN to corresponding equivalent SNN network structures, and to provide a digital spiking neural network conversion method and apparatus for attractor neural networks.

[0005] The objective of this invention can be achieved through the following technical solutions:

[0006] A method for converting an attractor neural network into a digital spiking neural network includes the following steps:

[0007] Obtain the neuronal structure of the attractor neural network;

[0008] Each neuron in the neuronal structure of the attractor neural network is correspondingly established as a large neuron in the digital spiking neural network, and each of the large neurons includes a receptor surface state neuron and a clock excitation neuron.

[0009] The connection relationship of the digital spiking neural network is as follows: the clock excitation neuron in each large neuron is connected to the receptor surface state neuron in the large neurons other than itself, and the receptor surface state neuron in each large neuron is connected to the receptor surface state neuron in the large neurons other than itself.

[0010] Furthermore, within each clock cycle of the digital spiking neural network, each receptor surface state neuron receives input signals from clock-excited neurons and receptor surface state neurons from other large neurons, and updates its own membrane potential.

[0011] Furthermore, the expression for the membrane potential update of the receptor surface state neuron is:

[0012]

[0013] In the formula, In order to be in Clock cycle number i The membrane potential of a neuron For the connection of the previous clock cycle i The first target neuron j The state of each neuron To connect the first i The first neuron and the second j Axonal weights of individual neurons For the first j One neuron in The state of the clock cycle.

[0014] Furthermore, the update expression for the axon weight is:

[0015]

[0016] In the formula, To connect the first i The first neuron and the second j Axonal weights of individual neurons M represents the total number of neurons, and M represents the total number of patterns. For the first i The neuron in the first The state under each mode, For the firstj The neuron in the first The state under each mode.

[0017] Furthermore, if the membrane potential of the input receptor surface state neuron does not reach the preset emission threshold in the previous clock cycle, it is in an inactive state, and its state is represented as -1; otherwise, it is in an active state, and its state is represented as +1.

[0018] Furthermore, the digital spiking neural network conversion method also includes setting the emission threshold of neurons in the established digital spiking neural network, the input current and time constant of the clock-excited neurons, and the time constant of the receptor surface state neurons.

[0019] Furthermore, the time constant of the receptor surface state neuron is less than one-fifth of the time constant of the clock-excited neuron.

[0020] Furthermore, the tensors or matrices input to the attractor neural network are converted into corresponding neuron state sequences, which are then input into the established digital spiking neural network for network training.

[0021] Furthermore, in the digital spiking neural network, the clock cycles of each clock-excited neuron are synchronized.

[0022] The present invention also provides a digital spiking neural network conversion device for attractor neural networks, including a memory and a processor, wherein the memory stores a computer program, and the processor calls the computer program to execute the steps of the method described above.

[0023] Compared with the prior art, the present invention has the following advantages:

[0024] This invention provides a general conversion method for converting attractor neural networks (Hopfield networks) into their equivalent SNN network structures. Its iterative update algorithm adopts a design method that converts analog electrical signals of neurons into digital signals, which has the characteristics of high stability, strong anti-interference, and good real-time performance of parallel data compared with traditional serial input data. Attached Figure Description

[0025] Figure 1 This is a flowchart illustrating a digital spiking neural network conversion method for an attractor neural network provided in an embodiment of the present invention;

[0026] Figure 2 This is a topological diagram showing the transformation of a traditional k-ary fully connected attractor neural network into its equivalent attractor neural network based on a digitized SNN neuron structure, as provided in this embodiment of the invention.

[0027] Figure 3This is a diagram illustrating the internal connection structure of a ternary Hopfield model as provided in this embodiment of the invention, converted into an equivalent SNN neuron that performs the same algorithmic function.

[0028] Figure 4 This is a schematic diagram illustrating a specific connection method for converting a ternary Hopfield network into an SNN structure, as provided in an embodiment of the present invention.

[0029] Figure 5 This invention provides a method for applying an external current. A schematic diagram of the periodic emission waveform of the neuron model when a steady current is applied.

[0030] Figure 6 This is a schematic diagram illustrating the neuron state change process based on a fully connected symmetric traditional ternary Hopfield model provided in an embodiment of the present invention.

[0031] Figure 7 for Figure 6 A schematic diagram of the output results of the traditional ternary Hopfield model after conversion based on the neuron structure of a digital spiking neural network (SNN);

[0032] Figure 8 This is a schematic diagram illustrating the change process of a neuron based on a fully connected symmetric traditional ternary Hopfield model provided in an embodiment of the present invention, but the initial states of each neuron are not exactly the same.

[0033] Figure 9 For Figure 8 A schematic diagram of the output results of the traditional ternary Hopfield model after conversion based on the neuron structure of a digital spiking neural network (SNN). Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0035] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0036] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0037] Example 1

[0038] This embodiment provides a method for converting an attractor neural network into a digital spiking neural network, including the following steps:

[0039] Obtain the neuronal structure of the attractor neural network;

[0040] For each neuron in the neuronal structure of the attractor neural network, a large neuron is established in the digital spiking neural network in a one-to-one correspondence. Each large neuron includes a receptor surface state neuron and a clock excitation neuron.

[0041] The connection relationships of the digital spiking neural network are as follows: the clock excitation neuron in each large neuron is connected to the receptor surface state neuron in other large neurons, and the receptor surface state neuron in each large neuron is connected to the receptor surface state neuron in other large neurons.

[0042] In each clock cycle of a digital spiking neural network, each receptor surface state neuron receives input signals from clock-excited neurons and receptor surface state neurons from other large neurons, and updates its own membrane potential.

[0043] If the membrane potential of the input receptor surface state neuron did not reach the preset emission threshold in the previous clock cycle, it is in an inactive state, and its state is represented as -1; otherwise, it is in an active state, and its state is represented as +1.

[0044] In use, the firing threshold of neurons in the established digital spiking neural network, the input current and time constant of clock-excited neurons, and the time constant of receptor surface state neurons are preset to construct the aforementioned digital spiking neural network; then, the tensor or matrix of the input attractor neural network is converted into the corresponding neuron state sequence and input into the established digital spiking neural network for network training.

[0045] Specifically, the expression for updating the membrane potential of neurons in the receptor surface state is:

[0046]

[0047] In the formula, In order to be in Clock cycle number i The membrane potential of a neuron For the connection of the previous clock cycle iThe first target neuron j The state of each neuron To connect the first i The first neuron and the second j Axonal weights of individual neurons For the first j One neuron in The state of the clock cycle.

[0048] The update expression for axon weights is:

[0049]

[0050] In the formula, To connect the first i The first neuron and the second j Axonal weights of individual neurons M represents the total number of neurons, and M represents the total number of patterns. For the first i The neuron in the first The state under each mode, For the first j The neuron in the first The state under each mode.

[0051] I. Detailed Description of the Plan

[0052] The specific description of the above process is as follows:

[0053] 1. Generate the corresponding SNN structure based on the traditional attractor neural network (Hopfield Network) structure: Each neuron in the original traditional attractor neural network corresponds to a large neuron in the new SNN structure. Each large neuron in the SNN structure contains two standard SNN neurons. One standard neuron is used as the clock stimulus for other neurons. The other standard SNN neuron in the large neuron structure is used to represent the state (+1 or -1) of the neuron in the traditional attractor neural network. The clock cycles of all neurons used as clock stimuli in the overall SNN network structure are synchronized.

[0054] like Figure 2 As shown, this diagram illustrates the topological transformation of a traditional k-ary (k=3 in this diagram) fully connected attractor neural network (left) into its equivalent attractor neural network based on a digitized SNN neuron structure: the left diagram shows the topological transformation of each neuron in the traditional attractor neural network (Hopfield network). Transformed into the large neuron structure in SNN neuron structure The structure of each large neuron It includes two standard SNN neurons: one of the standard neurons is used as the clock stimulus for the other neurons. Another is used to represent the state of this neuron in a traditional attractor neural network. +1 or -1).

[0055] 2. Connection methods and weight ratios of neurons in the SNN structure: In the neural network arranged according to the content in section 1, there is no axonal connection between the two standard SNN neurons in the large neuron structure. The axonal connections between the two standard SNN neurons and external neurons are the same and consistent with the connection method of the original traditional attractor neural network: all standard SNN neurons are divided into two groups according to their functions (the first group of standard neurons is the set that provides clock excitation, and the second group of standard neurons is the set that represents the neuron state in the traditional attractor neural network). The connection method of each standard neuron in the first group is exactly the same as that of the standard neuron in the same large neuron structure in the second group. They are directed to the corresponding standard neurons in the second group according to the same connection method as the original traditional attractor neural network. The axonal weight connecting the i-th large neuron structure and the j-th large neuron structure is equal to the connection weight in the original traditional attractor neural network. .

[0056] like Figure 3 As shown, this diagram illustrates the internal connections of an equivalent SNN neuron that performs the same algorithm function as a ternary Hopfield model. In the diagram, source represents the starting neuron number of the directed axonal connection, and target represents the ending neuron number of the directed axonal connection. Figure 4 This demonstrates the specific connection method for converting the ternary Hopfield network into an SNN structure.

[0057] The above group is divided into clock-activated neurons. The following group represents receptor surface state neurons. The connection method is Each neuron in Each of the following is excluded Each of the other neurons is connected. It connects with every other neuron except itself.

[0058] 3. In a standard SNN neuron model, appropriate parameters are set, including the spiking threshold, the input current and time constant of the clock-stimulated neuron, and the time constant of the state-representing receptor neuron. The firing frequency of the state-representing receptor neuron should be much lower than that of the clock-stimulated neuron (to ensure that there is no residual potential superposition effect after each clock cycle). Therefore, the time constant of the receptor neuron should be much smaller than that of the clock-stimulated neuron. The input current of the clock-stimulated neuron will affect its firing frequency. Therefore, it is necessary to select an input current that allows the clock-stimulated neuron to fire stably (reach the firing threshold) and has a suitable firing frequency.

[0059] 4. In each clock cycle, each receptor surface state neuron receives input signals from clock-activated neurons and receptor surface state neurons from other large neurons and updates its own membrane potential: if the membrane voltage of the input receptor surface state neuron in the previous clock cycle did not reach the emission threshold, it is inactive and its state is represented as -1; conversely, if its membrane voltage reaches the emission threshold, it is active and its state is +1. The state of the input receptor surface state neuron affects the increase (state is +1) or decrease (state is -1) of the membrane potential of its positively input receptor surface state neuron. The amount of change in membrane potential is the weight value of the input axon. The membrane potential of the receptor surface state neuron in the current clock cycle is recorded at each clock cycle and used to update the membrane potential of each receptor surface state neuron in the next clock cycle.

[0060] II. General Implementation Process

[0061] like Figure 1 As shown, the general implementation process of this embodiment is as follows:

[0062] 1) Calculate the axon weights connecting the i-th neuron and the j-th neuron according to the weight calculation formula of the attractor neural network. Where N is the total number of neurons and M is the total number of patterns. For the i-th neuron in the i-th... The state under each mode;

[0063] 2) According to Figure 2-4 The method is used to design the equivalent transformation SNN network structure of the attractor neural network and select appropriate hyperparameters, including the emission threshold, the input current and time constant of the clock-excited neuron, the time constant of the receptor neuron representing the state, and assign the weights calculated in (1) to the new network.

[0064] 3) The tensors or matrices input to the network are converted into corresponding neuron state sequences and input into the neural network;

[0065] 4) Calculate the membrane potential of each neuron and update the state of each neuron in each clock cycle, according to the formula:

[0066]

[0067] in, This represents the state of neuron j recorded in the previous clock cycle. If... The neuron fires during that clock cycle and is in an excited state.

[0068] III. Explanation of the Technical Effects and Principles of the Solution

[0069] Hopfield networks are a relatively simple type of attractor neural network, where the state of each neuron i is... The value is +1 or -1. In pattern recognition problems, network parameters are trained using black and white images of existing patterns (e.g., 32*32 dimensional vectors). First, the known pattern image is transformed into a 1-dimensional linear column vector of length 1024 = 32*32. Each element in the vector represents a neuron. The neuron's state is +1 if the pixel is black, and -1 if the pixel is white. During training, the axon weights connecting the i-th neuron and the j-th neuron are updated. ,in M represents the total number of neurons, and M represents the number of existing pattern images that need to be stored. For the i-th neuron in the corresponding i-th The pixel state of each pattern image.

[0070] After learning the axonal weights corresponding to the pattern images Then, for a new set of states as input. The iteration is performed according to the following algorithm:

[0071]

[0072] in Let be the membrane potential of the i-th neuron at time t;

[0073]

[0074] This represents the probability that the state of the i-th neuron will become +1 in the next clock cycle, based on the membrane potential of the neuron in the current clock cycle. (General function) Pick .

[0075] The Leaky Integrated Firing (LIF) model is one of the most commonly used standard neuron models in SNN structures. The relationship between the change in membrane potential of a single neuron and the external input current is as follows:

[0076]

[0077] in These represent the time constants of capacitance and admittance affecting the neuron, respectively. This represents the membrane potential of the neuron. The external input current and its effects. To compensate for the voltage.

[0078] When the applied current When a suitable steady current is present, this neuron model will periodically fire (Spike), such as Figure 5 As shown.

[0079] Neurons fire after their membrane voltage rises exponentially to a set firing threshold. Figure 5 (At 17s, 32s, and 48s), the membrane potential instantly drops back to the reset point after emission, and then the cycle of charging and emission begins again.

[0080] Based on the characteristics of the Hopfield network described above, an SNN structure equivalent to the attractor neural network is constructed. Each receptor surface state neuron operates according to the following at each clock cycle (when the clock-excited neuron fires):

[0081]

[0082] The updating of its own membrane potential is influenced by neurons connected to it, among which... This refers to the state of neuron j connected to target neuron i in the previous clock cycle; if it is inactive... This indicates that the effect of neuron j on neuron i is to lower the membrane potential, and vice versa. This indicates that the effect of neuron j on neuron i is to increase its membrane potential. Therefore... Therefore, under time-series conditions, the receptor surface state neuron i is updated as follows, influenced by the overall network:

[0083]

[0084] This structure allows for the same computations as the algorithms implemented using the traditional Hopfield network described above. Based on the firing condition of the LIF neuron: in the next clock cycle... Membrane potential of time-state receptor neurons The firing condition of this LIF neuron can be equivalently transformed into the neuron state transition model of a traditional Hopfield network. Therefore, theoretically, the transformed neuron structure based on a digital spiking neural network (SNN) can fully implement the algorithm of a traditional attractor neural network.

[0085] Figure 6 This describes the neuron state change process based on a traditional ternary Hopfield model with full connectivity and symmetry.

[0086] Among them, the neuron state sequence (S1, S2, S3) changes from the initial (-1, -1, -1) to (+1, +1, +1) and then back to (-1, -1, -1) before entering a stable cycle.

[0087] Figure 7 This is the output result based on the digital spiking neural network (SNN) neuron structure after conversion. According to the settings, the neuron state sequence (S1, S2, S3) changes from the initial (-1, -1, -1) to (+1, +1, +1) and then back to (-1, -1, -1) in a stable cycle in each clock cycle, which is consistent with the evolutionary state process of traditional attractor neural networks;

[0088] Figure 8 This is a neuron based on a fully connected, symmetric traditional ternary Hopfield model, but the initial states of each neuron are not entirely the same, and the process of change is as follows:

[0089] The neuron state sequence (S1, S2, S3) changes from the initial (+1, -1, -1) to (-1, +1, +1) and then back to (+1, -1, -1) before entering a stable cycle.

[0090] Figure 9 This is the output result of the converted digital spiking neural network (SNN) neuron structure. According to the settings, the neuron state sequence (S1, S2, S3) changes from the initial (+1, -1, -1) to (-1, +1, +1) and then back to (+1, -1, -1) in a stable cycle in each clock cycle, which is consistent with the evolutionary state process of traditional attractor neural networks.

[0091] Therefore, the technical solution of this embodiment has the following advantages: the design is based on digital signals, which has high stability and strong anti-interference. Compared with traditional serial input data, the parallel data has good real-time performance and can be used as a general method to convert traditional neural networks into equivalent SNN structures.

[0092] This embodiment also provides a digital spiking neural network conversion device for attractor neural networks, including a memory and a processor. The memory stores a computer program, and the processor calls the computer program to execute the steps of the digital spiking neural network conversion method for attractor neural networks as described above.

[0093] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A method for converting attractor neural networks into digital spiking neural networks, characterized in that, Includes the following steps: The known pattern image is transformed into a 1-dimensional column vector, where each element represents a neuron. The state of the neuron is +1, which means that the pixel corresponding to the neuron is black, and -1 means that the pixel corresponding to the neuron is white, thus obtaining the neuron structure of the attractor neural network. Each neuron in the neuronal structure of the attractor neural network is correspondingly established as a large neuron in the digital spiking neural network, and each of the large neurons includes a receptor surface state neuron and a clock excitation neuron. The connection relationship of the digital spiking neural network is as follows: the clock excitation neuron in each large neuron is connected to the receptor surface state neuron in the large neurons other than itself, and the receptor surface state neuron in each large neuron is connected to the receptor surface state neuron in the large neurons other than itself. In each clock cycle of the digital spiking neural network, each receptor surface state neuron receives input signals from clock-excited neurons and receptor surface state neurons from other large neurons, and updates its own membrane potential. The expression for updating the membrane potential of neurons in the receptor surface state is: In the formula, In order to be in Clock cycle number i The membrane potential of a neuron For the connection of the previous clock cycle i The first target neuron j The state of each neuron To connect the first i The first neuron and the second j Axonal weights of individual neurons For the first j One neuron in The state of the clock cycle.

2. The method for converting an attractor neural network into a digital spiking neural network according to claim 1, characterized in that, The update expression for the axon weight is: In the formula, To connect the first i The first neuron and the second j Axonal weights of individual neurons M represents the total number of neurons, and M represents the total number of patterns. For the first i The neuron in the first The state under each mode, For the first j The neuron in the first The state under each mode.

3. The method for converting an attractor neural network into a digital spiking neural network according to claim 1, characterized in that, If the membrane potential of the input receptor surface state neuron did not reach the preset emission threshold in the previous clock cycle, it is in an inactive state, and its state is represented as -1; otherwise, it is in an active state, and its state is represented as +1.

4. The method for converting an attractor neural network into a digital spiking neural network according to claim 1, characterized in that, The digital spiking neural network conversion method also includes setting the emission threshold of neurons in the established digital spiking neural network, the input current and time constant of clock-excited neurons, and the time constant of receptor surface state neurons.

5. The method for converting an attractor neural network into a digital spiking neural network according to claim 4, characterized in that, The time constant of the receptor surface state neuron is less than one-fifth of the time constant of the clock-excited neuron.

6. The method for converting an attractor neural network into a digital spiking neural network according to claim 1, characterized in that, The tensors or matrices input to the attractor neural network are converted into corresponding neuron state sequences, which are then input into the established digital spiking neural network for network training.

7. The method for converting an attractor neural network into a digital spiking neural network according to claim 1, characterized in that, In the digital spiking neural network, the clock cycles of each clock-excited neuron are synchronized.

8. A digital spiking neural network conversion device for attractor neural networks, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor invokes the computer program to perform the steps of the method as described in any one of claims 1 to 7.