Method and apparatus for data processing in spiking neural networks

By selecting different algorithms for processing according to the membrane voltage change rate in the pulse neural network, the problem of insufficient computing efficiency and accuracy in the pulse neural network is solved, and efficient and high-precision membrane voltage calculation is achieved.

CN113642719BActive Publication Date: 2025-07-18HUAWEI TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010392960.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-11
Publication Date
2025-07-18
Estimated Expiration
2040-05-11

AI Technical Summary

Technical Problem

The prior art is difficult to improve the calculation accuracy of membrane voltage while maintaining computational efficiency in pulsed neural networks, especially in the treatment of rigid and non-rigid regions.

Method used

Different algorithms are used to calculate membrane voltages in different areas of the pulse neural network. The rigid areas use algorithms with high computing efficiency such as ETD algorithms, and non-rigid areas use algorithms with high computing accuracy such as RK algorithms, and combined with interpolation algorithms to estimate discharge time to improve calculation accuracy.

Benefits of technology

It realizes that the calculation efficiency of membrane voltage is not only improved but also the calculation accuracy is improved in the pulsed neural network, simplifying the circuit logic and reducing the calculation amount.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113642719B_ABST
    Figure CN113642719B_ABST
Patent Text Reader

Abstract

The present application provides a method for data processing in a spiking neural network, including: obtaining a first membrane voltage of a first neuron at time t-1 and a first input current at time t-1; determining whether a change rate of the first membrane voltage within a unit time is greater than a first preset threshold; if the change rate of the first membrane voltage is greater than the first preset threshold, calculating a second membrane voltage of the first neuron at time t according to the first membrane voltage and the first input current by a first algorithm; or if the change rate of the first membrane voltage is not greater than the first preset threshold, calculating the second membrane voltage according to the first membrane voltage and the first input current by a second algorithm, where the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm. The technical solution provided by the present application can not only achieve a high calculation efficiency of the membrane voltage, but also improve the calculation accuracy of the membrane voltage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of neural networks, and more particularly, to a method and device for data processing in a spiking neural network. Background Art

[0002] Artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling the machines to have the functions of perception, reasoning and decision-making. The research in the field of artificial intelligence includes robots, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, AI basic theory, etc.

[0003] The spiking neural network (SNN), as an emerging artificial neural network, is closer to the real biological processing system than the traditional artificial neural network in terms of information processing mode and biological model. In the process of calculating the membrane voltage of a spiking neuron, how to achieve high computational efficiency while improving the computational accuracy of the membrane voltage has become an urgent problem to be solved. Summary of the Invention

[0004] This application provides a method, device and spiking neural network for data processing in a spiking neural network, which can not only achieve high computational efficiency of the membrane voltage, but also improve the computational accuracy of the membrane voltage.

[0005] In a first aspect, a method for data processing in a spiking neural network is provided, including: obtaining a first membrane voltage of a first neuron at time t-1 and a first input current at time t-1; determining whether a change rate of the first membrane voltage per unit time is greater than a first preset threshold; if the change rate of the first membrane voltage is greater than the first preset threshold, calculating a second membrane voltage of the first neuron at time t according to the first membrane voltage and the first input current through a first algorithm; or if the change rate of the first membrane voltage is not greater than the first preset threshold, calculating the second membrane voltage according to the first membrane voltage and the first input current through a second algorithm, where the computational efficiency of the first algorithm is higher than that of the second algorithm, and the computational accuracy of the second algorithm is higher than that of the first algorithm.

[0006] In the above technical solution, when the change rate of the first membrane voltage is greater than the first preset threshold (i.e., in the rigid region), an algorithm with higher computational efficiency is used to calculate the second membrane voltage of the first neuron at time t. When the change rate of the first membrane voltage is not greater than the first preset threshold (i.e., in the non-rigid region), an algorithm with higher computational accuracy is used to calculate the second membrane voltage of the first neuron at time t. In this way, different algorithms are used in different regions, which can not only achieve higher computational efficiency of the membrane voltage, but also improve the computational accuracy of the membrane voltage.

[0007] In a possible implementation manner, it further includes: determining a first firing time T of the first neuron, where the first firing time T is between the time t - 1 and the time t; determining a current increment according to the first firing time T and the time t; outputting the current increment to the second neuron, where the current increment is used to instruct the second neuron to adjust the second current received from the first neuron according to the current increment, the second current is the current output by the first neuron when the first neuron determines that the second membrane voltage is greater than the second preset threshold, and the second neuron is the next-layer neuron of the first neuron.

[0008] In another possible implementation manner, the first firing time T of the first neuron is determined according to an interpolation algorithm.

[0009] In another possible implementation manner, the first firing time T of the first neuron is determined according to a linear interpolation algorithm.

[0010] In another possible implementation manner, the firing time T of the first neuron is determined according to the time t - 1, the first membrane voltage, the time t, and the second membrane voltage.

[0011] In another possible implementation manner, the first algorithm is an exponential time difference (ETD) algorithm.

[0012] In another possible implementation, determining the second membrane voltage on the first neuron through the ETD algorithm according to the first membrane voltage and the first input current specifically includes: determining an estimated value of a minor component of the change rate of the first membrane voltage according to the first membrane voltage and the first input current; determining an estimated value of a linear principal component of the change rate of the first membrane voltage according to the gating variable of the ion channel of the first neuron at the (t - 1)th moment; determining an estimated value of the second membrane voltage on the first neuron according to the estimated value of the minor component of the change rate of the first membrane voltage and the estimated value of the linear principal component of the change rate of the first membrane voltage; determining an estimated value of a minor component of the change rate of the second membrane voltage according to the estimated value of the second membrane voltage; determining the second membrane voltage according to the estimated value of the minor component of the change rate of the first membrane voltage, the estimated value of the linear principal component of the change rate of the first membrane voltage, and the estimated value of the minor component of the change rate of the second membrane voltage.

[0013] In another possible implementation, the second algorithm is the Runge - Kutta RK algorithm.

[0014] In another possible implementation, determining the second membrane voltage through the RK algorithm according to the first membrane voltage and the first input current specifically includes: determining an estimated value of a minor component of the change rate of the first membrane voltage according to the first membrane voltage and the first input current; determining an estimated value of the second membrane voltage on the first neuron according to the estimated value of the minor component of the change rate of the first membrane voltage; determining an estimated value of a minor component of the change rate of the second membrane voltage according to the estimated value of the second membrane voltage; determining the second membrane voltage according to the estimated value of the minor component of the change rate of the first membrane voltage and the estimated value of the minor principal component of the change rate of the second membrane voltage.

[0015] Second, a device for data processing in a spiking neural network is provided, including:

[0016] An acquisition module, configured to acquire the first membrane voltage and the first input current on the first neuron, where the first membrane voltage is the membrane voltage value of the first neuron at the (t - 1)th moment, and the first input current is determined according to the received input pulses by the first neuron at the (t - 1)th moment;

[0017] A determination module, configured to determine whether the change rate of the first membrane voltage within a unit time is greater than a first preset threshold;

[0018] A calculation module, if the change rate of the first membrane voltage within the unit time is greater than the first preset threshold, is used to calculate the second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a first algorithm, where the second membrane voltage is the membrane voltage value of the first neuron at time t, and the t-1 moment is the previous moment of the t moment; or

[0019] If the change rate of the first membrane voltage within the unit time is not greater than the first preset threshold, it is used to calculate the second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a second algorithm, where the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.

[0020] In a possible implementation manner, the determination module is further configured to: determine the first firing moment T of the first neuron, where the first firing moment T is between the t-1 moment and the t moment; determine the current increment according to the first firing moment T and the t moment;

[0021] The device further includes:

[0022] An output module, configured to output the current increment to the second neuron, where the current increment is used to instruct the second neuron to adjust the second current received from the first neuron according to the current increment, the second current is the current output by the first neuron to the second neuron when the first neuron determines that the second membrane voltage is greater than the second preset threshold, and the second neuron is the next-layer neuron of the first neuron.

[0023] In another possible implementation manner, the determination module is specifically configured to: determine the first firing moment T of the first neuron according to an interpolation algorithm.

[0024] In another possible implementation manner, the determination module is specifically configured to: determine the first firing moment T of the first neuron according to a linear interpolation algorithm.

[0025] In another possible implementation manner, the determination module is specifically configured to: determine the firing moment T of the first neuron according to the t-1 moment, the first membrane voltage, the t moment, and the second membrane voltage.

[0026] In another possible implementation manner, the first algorithm is an exponential time difference ETD algorithm.

[0027] In another possible implementation, when the first algorithm is the exponential time difference (ETD) algorithm, the calculation module is specifically configured to: determine an estimated value of a secondary component of the change rate of the first membrane voltage based on the first membrane voltage and the first input current; determine an estimated value of a linear principal component of the change rate of the first membrane voltage based on the gating variables of the ion channels of the first neuron at the (t - 1)th moment; determine an estimated value of a second membrane voltage on the first neuron based on the estimated value of the secondary component of the change rate of the first membrane voltage and the estimated value of the linear principal component of the change rate of the first membrane voltage; determine an estimated value of a secondary component of the change rate of the second membrane voltage based on the estimated value of the second membrane voltage; and determine the second membrane voltage based on the estimated value of the secondary component of the change rate of the first membrane voltage, the estimated value of the linear principal component of the change rate of the first membrane voltage, and the estimated value of the secondary component of the change rate of the second membrane voltage.

[0028] In another possible implementation, the second algorithm is the Runge - Kutta (RK) algorithm.

[0029] In another possible implementation, when the second algorithm is the Runge - Kutta (RK) algorithm, the calculation module is specifically configured to: determine an estimated value of a secondary component of the change rate of the first membrane voltage based on the first membrane voltage and the first input current; determine an estimated value of a second membrane voltage on the first neuron based on the estimated value of the secondary component of the change rate of the first membrane voltage; determine an estimated value of a secondary component of the change rate of the second membrane voltage based on the estimated value of the second membrane voltage; and determine the second membrane voltage based on the estimated value of the secondary component of the change rate of the first membrane voltage and the estimated value of the secondary principal component of the change rate of the second membrane voltage.

[0030] In a third aspect, a spiking neural network is provided, which is characterized by including:

[0031] A first current register for storing a first input current of a first neuron at the (t - 1)th moment, where the first input current is determined by the first neuron at the (t - 1)th moment according to received input pulses;

[0032] A first voltage register for storing a first membrane voltage of the first neuron at the (t - 1)th moment;

[0033] A first comparator connected to the first voltage register for determining whether a change rate of the first membrane voltage stored in the first voltage register within a unit time is greater than a first preset threshold;

[0034] The first algorithm circuit, connected to the first current register and the first voltage register, is configured to calculate the second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a first algorithm when the change rate of the first membrane voltage within the unit time is greater than the first preset threshold, where the second membrane voltage is the membrane voltage value of the first neuron at time t, and the time t - 1 is the previous moment of the time t; or

[0035] configured to calculate the second membrane voltage on the first neuron through a second algorithm when the change rate of the first membrane voltage within the unit time is not greater than the first preset threshold, where the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.

[0036] In a possible implementation manner, it further includes:

[0037] An estimation circuit that stores the first firing time T of the first neuron, and the first firing time T is between the time t - 1 and the time t;

[0038] A current increment register, connected to the estimation circuit, is configured to determine a current increment according to the first firing time T and the time t, and output the current increment to the second neuron, where the current increment is used to instruct the second neuron to adjust the second current received from the first neuron according to the current increment, the second current is the current output by the first neuron to the second neuron when the first neuron determines that the second membrane voltage is greater than the second preset threshold, and the second neuron is the next - layer neuron of the first neuron.

[0039] In another possible implementation manner, it further includes:

[0040] A second voltage register, configured to store the second membrane voltage on the first neuron;

[0041] The estimation circuit, connected to the second voltage register and the first voltage register, is specifically configured to: determine the firing time T of the first neuron according to the time t - 1, the first membrane voltage, the time t, and the second membrane voltage, and store the first firing time T of the first neuron.

[0042] In another possible implementation manner, the first algorithm is the exponential time difference (ETD) algorithm.

[0043] In another possible implementation, when the first algorithm is the exponential time difference (ETD) algorithm, the first algorithm circuit is specifically configured to: determine an estimated value of a minor component of the change rate of the first membrane voltage according to the first membrane voltage and the first input current; determine an estimated value of a linear principal component of the change rate of the first membrane voltage according to the gating variables of the ion channels of the first neuron at the (t - 1)th moment; determine an estimated value of a second membrane voltage on the first neuron according to the estimated value of the minor component of the change rate of the first membrane voltage and the estimated value of the linear principal component of the change rate of the first membrane voltage; determine an estimated value of a minor component of the change rate of the second membrane voltage according to the estimated value of the second membrane voltage; and determine the second membrane voltage according to the estimated value of the minor component of the change rate of the first membrane voltage, the estimated value of the linear principal component of the change rate of the first membrane voltage, and the estimated value of the minor component of the change rate of the second membrane voltage.

[0044] In another possible implementation, the second algorithm is the Runge - Kutta (RK) algorithm.

[0045] In another possible implementation, when the second algorithm is the Runge - Kutta (RK) algorithm, the first algorithm circuit is specifically configured to: determine an estimated value of a minor component of the change rate of the first membrane voltage according to the first membrane voltage and the first input current; determine an estimated value of a second membrane voltage on the first neuron according to the estimated value of the minor component of the change rate of the first membrane voltage; determine an estimated value of a minor component of the change rate of the second membrane voltage according to the estimated value of the second membrane voltage; and determine the second membrane voltage according to the estimated value of the minor component of the change rate of the first membrane voltage and the estimated value of the minor principal component of the change rate of the second membrane voltage.

[0046] In a fourth aspect, a computing device is provided, including a communication interface and a processor. The processor is configured to control the communication interface to transmit and receive information. The processor is connected to the communication interface and is configured to execute the method in the first aspect or any one of the possible implementations of the first aspect.

[0047] Optionally, the processor may be a general - purpose processor, which can be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor may be a general - purpose processor, which is implemented by reading software code stored in a memory. The memory may be integrated in the processor or may exist independently outside the processor.

[0048] In a fifth aspect, a computer - readable medium is provided. The computer - readable medium stores program code. When the computer program code runs on a computing device, the computing device is caused to execute the method in the first aspect or any one of the possible implementations of the first aspect.

[0049] In a sixth aspect, a computer program product is provided, which includes computer program code that, when running on a computing device, causes the computing device to execute the method in the above first aspect or possible implementations of the first aspect. Description of the Drawings

[0050] Figure 1 is a possible neural network structure provided by an embodiment of the present application.

[0051] Figure 2 is a schematic diagram showing the change of the membrane voltage on a pulsed neuron over time.

[0052] Figure 3 is an architecture diagram of a computing device 100 provided by the present application.

[0053] Figure 4 is a schematic flowchart of a method for data processing in a pulsed neural network provided by an embodiment of the present application.

[0054] Figure 5 is a schematic flowchart of another method for data processing in a pulsed neural network provided by an embodiment of the present application.

[0055] Figure 6 is a schematic diagram for determining the firing time of a pulsed neuron provided by an embodiment of the present application.

[0056] Figure 7 is a schematic block diagram of a device 700 for data processing in a pulsed neural network provided by an embodiment of the present application.

[0057] Figure 8 is a schematic circuit block diagram of a pulsed neural network provided by an embodiment of the present application.

[0058] Figure 9 is a schematic block diagram of a unified evolutionary algorithm circuit 840 provided by an embodiment of the present application. Detailed Embodiments

[0059] Next, the technical solutions in the present application will be described in conjunction with the accompanying drawings.

[0060] Artificial intelligence (AI) is a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a way similar to human intelligence. In the fields of machine learning and cognitive science, a neural network (NN) is a mathematical model or computational model that mimics the structure and function of a biological neural network (the central nervous system of an animal, especially the brain) and is used to estimate or approximate a function. Inside the biological brain, a large number of neurons are combined in different connection ways, and the information is transmitted between the previous neuron and the next neuron through the synaptic structure.

[0061] Figure 1 Figure 4 shows a possible neural network structure. Refer to Figure 1 , this neural network may include multiple nodes, each node simulating a neuron and used to perform a specific operation, such as an activation function. The connection between the previous neuron and the next neuron simulates a synapse. It should be understood that a synapse is a carrier for transmitting information between two neurons, and the weight value of the synapse represents the connection strength between the two neurons.

[0062] The spiking neural network (SNN) is often regarded as the third-generation artificial neural network. As an emerging artificial neural network, the spiking neural network is closer to the real biological processing system than the traditional artificial neural network in terms of information processing methods and biological models. Therefore, it has the characteristic of lower power consumption during operation, making it have a wider range of applications in future fields such as pattern recognition, natural language processing, complex control, and optimization.

[0063] In a spiking neural network, information is transmitted between neurons in the form of spikes, which is based on discrete-valued activities occurring at certain time points rather than continuous values. The occurrence of a spike is determined by differential equations representing various biological processes, with the most important being the membrane voltage of the neuron. Each neuron accumulates the spike train from previous neurons, and its membrane voltage changes with the input spikes. When the membrane voltage of a neuron reaches a preset voltage value, the neuron is activated and generates a new signal (e.g., emits a spike), which is then transmitted to other neurons connected to it. After the neuron emits a spike, its membrane voltage continues to change by accumulating the spike train from previous neurons. Neurons in a spiking neural network achieve information transmission and processing in the above way, and have information processing capabilities such as non-linearity, adaptability, and fault tolerance.

[0064] As an example, an equation for characterizing the membrane voltage of a neuron in a spiking neural network is introduced below.

[0065]

[0066] Among them, the subscript i represents the i-th spiking neuron in the spiking neural network;

[0067] V i represents the membrane voltage on the i-th spiking neuron;

[0068] C represents the membrane capacitance of the spiking neuron;

[0069] m i represents the gating variable parameter of the sodium ion current channel on the i-th spiking neuron;

[0070] E Na represents the reversal potential of sodium ions on the spiking neuron;

[0071] G Na represents the maximum conductance of sodium ions on the spiking neuron;

[0072] h i represents the gating variable parameter of the potassium ion current channel on the i-th spiking neuron;

[0073] E K represents the reversal potential of potassium ions on the i-th spiking neuron;

[0074] G K represents the maximum conductance of potassium ions on the i-th spiking neuron;

[0075] n i represents the gating variable parameter of the leakage current channel on the i-th spiking neuron;

[0076] EL Represents the reversal potential of the leakage current on the spiking neuron;

[0077] G L Represents the maximum conductance of the leakage current on the spiking neuron;

[0078] α m Represents the function of m with respect to V on the spiking neuron, which can be obtained by fitting experimental data; i ;

[0079] α h Represents the function of h with respect to V on the spiking neuron, which can be obtained by fitting experimental data; i ;

[0080] α n Represents the function of n with respect to V on the spiking neuron, which can be obtained by fitting experimental data; i ;

[0081] Represents the input current received by the i-th spiking neuron.

[0082] The above formula (1) can also be called the Hodgkin-Huxley (HH) model, which can be used to describe the process of the membrane voltage on the i-th spiking neuron changing with the input current .

[0083] It should be understood that the spikes emitted by the previous neuron form the input current of the subsequent neuron through a certain conversion relationship The subsequent neuron receives the input current which causes the membrane voltage of the neuron to increase. When the membrane voltage reaches a certain threshold voltage, the neuron will generate a new spike and transmit it to the subsequent neuron of this neuron.

[0084] It should be noted that a synaptic connection or multiple synaptic connections can be used between two neurons in the SNN, and this application does not make specific limitations on this. Each synapse has a modifiable synaptic weight, and multiple spikes transmitted by the presynaptic neuron can generate different postsynaptic membrane voltages according to the magnitude of the synaptic weight.

[0085] As an example, after the spike signal emitted by the previous neuron is received by the subsequent neuron, the generated input current can be characterized by the following formula (2).

[0086]

[0087] Among them, represents the input current of the i-th spiking neuron in the spiking neural network;

[0088] represents the externally input current;

[0089] S ij represents the weight of the connection from the j-th spiking neuron to the i-th spiking neuron;

[0090] represents whether the weight of the connection from the j-th spiking neuron to the i-th spiking neuron is excitatory or inhibitory;

[0091] T jk represents the time of the k-th spike fired by the j-th spiking neuron, that is, the firing time of the j-th spiking neuron, which can be the starting point of the interaction between the j-th spiking neuron and the i-th spiking neuron;

[0092] E Q represents the reversal potential;

[0093] α Q represents the conductance, and this conductance can be characterized by the following formula (3).

[0094]

[0095] where, σ d represents the time-scale variable of slow decay;

[0096] σ r represents the time-scale variable of rapid rise.

[0097] The following combines Figure 2 , and explains the change of the membrane voltage of the spiking neuron after receiving the input current .

[0098] Figure 2 is a schematic diagram of the change in the value of the membrane voltage on the spiking neuron. Among them, the abscissa represents time t, and the ordinate represents the value of the membrane voltage V on the spiking neuron.

[0099] As Figure 2 shown, when the spiking neuron receives an external input, its membrane voltage will increase with time. When its membrane voltage exceeds a fixed threshold (for example, the horizontal line in Figure 2 ), this spiking neuron can generate an action potential. In the subsequent firing region, the slope of the membrane voltage on this spiking neuron is larger. While in the non-firing region, the slope of the membrane voltage on this spiking neuron is smaller.

[0100] It should be understood that the slope of the membrane voltage can be the rate of change of the membrane voltage per unit time. A larger slope indicates that the membrane voltage of the spiking neuron has a larger rate of change per unit time. A smaller slope indicates that the membrane voltage of the spiking neuron has a smaller rate of change per unit time.

[0101] In the embodiments of the present application, the region with a larger rate of change of the membrane voltage per unit time can be referred to as a rigid region, and the region with a smaller rate of change of the membrane voltage per unit time can be referred to as a non-rigid region. When the membrane voltage of a spiking neuron exceeds a fixed threshold, an action potential is generated and the neuron enters the rigid region.

[0102] In a related technology, the membrane voltage of the i-th spiking neuron can be calculated according to the HH model by using the second-order runge-kutta (RK2) algorithm. Since the slope of the membrane voltage in the rigid region of the spiking neuron is large, the RK2 algorithm can use a larger time step in the non-rigid region of the i-th spiking neuron. To meet the stability requirements, the RK2 algorithm needs to use a smaller time step in the rigid region of the i-th spiking neuron. The smaller time step will result in a lower computational efficiency of the membrane voltage.

[0103] In another related technology, the membrane voltage of the i-th spiking neuron can be calculated according to the HH model by using the second-order exponential time differencing (ETD2) algorithm. Although the ETD2 algorithm can use a larger time step in both the rigid region and the non-rigid region, and has a higher computational efficiency, each time the ETD2 algorithm calculates the membrane voltage, it needs to decompose the HH model first (for example, decomposed into a linear rigid part and a non-linear non-rigid part), and each decomposition will accumulate the computational error of the membrane voltage, thus affecting the computational accuracy of the membrane voltage.

[0104] The embodiments of the present application provide a method for data processing in a spiking neural network, which can achieve both high computational efficiency and high computational accuracy of the membrane voltage during the calculation process of the membrane voltage on the spiking neuron.

[0105] Before introducing the method for data processing in the spiking neural network provided by the embodiments of the present application, the application scenarios and system architectures applicable to the embodiments of the present application will be introduced first.

[0106] The method for data processing in the spiking neural network provided by the embodiments of the present application can be applied to an artificial intelligence general platform, such as a computer and a chip. It can also be applied to simulations, vehicle-mounted chips, and mobile phone chips to implement artificial intelligence (such as image recognition, scene recognition, autonomous driving, etc.).

[0107] The method for data processing in the spiking neural network provided by the embodiment of the present application can be executed by a data processing device. The data processing device can be a hardware device, such as a server, a terminal computing device, etc. The data processing device can also be a software device, specifically a software system running on a hardware computing device. In the embodiment of the present application, the location where the data processing device is deployed is not limited. Exemplarily, the data processing device can be deployed on a server.

[0108] Logically, the data processing device can also be a device composed of multiple parts. For example, the data processing device can include an acquisition module, a determination module, etc. Each component in the data processing device can be deployed in different systems or servers respectively. Each part of the data processing device can run in three environments: a cloud computing device system, an edge computing device system, or a terminal computing device system, or can run in any two of these three environments. The cloud computing device system, the edge computing device system, and the terminal computing device are connected by a communication path and can communicate with each other.

[0109] Next, in conjunction with Figure 3 , a description will be given taking the data processing device as a computing device as an example.

[0110] Figure 3 Exemplarily, a possible architecture diagram of the computing device 100 of the present application is provided. As Figure 3 shown, the computing device 100 may include a processor 101, a memory 102, a communication interface 103, and a bus 104.

[0111] In the computing device 100, the number of processors 101 can be one or more, Figure 3 only one processor 101 is schematically shown.

[0112] Optionally, the processor 101 can be a central processing unit (CPU). If the computing device 100 has multiple processors 101, the types of the multiple processors 101 can be different or the same. Optionally, the multiple processors of the computing device 100 can also be integrated into a multi-core processor. The processor 101 can be used to execute the steps of the object recognition method. In practical applications, the processor 101 can be a very large scale integrated circuit. An operating system and other software programs are installed in the processor 101, so that the processor 101 can access devices such as the memory 102.

[0113] It can be understood that in the embodiments of the present application, the processor 101 is introduced by taking the CPU as an example. In practical applications, it can also be other specific integrated circuits (application specific integrated circuit, ASIC).

[0114] The memory 102 stores computer instructions and data. The memory 102 can store the computer instructions and data required to implement the data processing method in the spiking neural network provided by the present application. For example, the memory 102 stores the instructions for the acquisition module to execute the steps in the data processing method provided by the present application in the spiking neural network. For another example, the memory 102 stores the instructions for the determination module to execute the steps in the data processing method provided by the present application in the spiking neural network.

[0115] It should also be understood that the memory 102 in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM).

[0116] The communication interface 103 can be any one or any combination of the following devices: a network interface (such as an Ethernet interface), a wireless network card, or other devices with network access functions. The communication interface 103 is used for the computing device 100 to communicate with other computing devices 100 or terminals. In this application, the first characteristic pulse sequence of the object to be recognized can be received through the communication interface 103.

[0117] Figure 3 The bus 104 is represented by a thick line. The bus 104 can connect the processor 101 to the memory 102 and the communication interface 103. In this way, through the bus 104, the processor 101 can access the memory 102 and can also perform data interaction with other computing devices 100 or terminals by using the communication interface 103.

[0118] In this application, the computing device 100 executes the computer instructions in the memory 102 to implement the data processing method in the pulse neural network provided in this application by using the computing device 100. For example, the computing device 100 is caused to execute the steps performed by the acquisition module in the data processing method in the pulse neural network. For another example, the computing device 100 is caused to execute the instructions of the steps performed by the determination module in the data processing method in the pulse neural network.

[0119] The following combines Figure 4 , and details a data processing method in a pulse neural network provided in an embodiment of this application.

[0120] Figure 4 is a schematic flowchart of a data processing method in a pulse neural network provided in an embodiment of this application. As Figure 4 shown, the method may include steps 410-440, and the steps 410-440 are described in detail below.

[0121] Step 410: Obtain the first membrane voltage and the first input current on the first neuron.

[0122] Among them, the first membrane voltage is the membrane voltage value of the first neuron at the moment t-1, and the first input current is determined according to the received input pulses by the first neuron at the moment t-1.

[0123] Step 420: Determine whether the change rate of the first membrane voltage within a unit time is greater than a first preset threshold.

[0124] It should be understood that the change of the first membrane voltage within a unit time can also be called the derivative or slope of the first membrane voltage. If the change rate of the first membrane voltage within a unit time is greater than the first preset threshold, step 430 is executed. If the change rate of the first membrane voltage within a unit time is not greater than the first preset threshold, step 440 is executed.

[0125] Step 430: Calculate the second membrane voltage of the first neuron at time t according to the first membrane voltage and the first input current through a first algorithm. Step 440: Calculate the second membrane voltage of the first neuron at time t according to the first membrane voltage and the first input current through a second algorithm. Among them, the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.

[0126] In the embodiment of the present application, the time t - 1 is the previous moment of the time t.

[0127] In the embodiment of the present application, the region where the change rate of the membrane voltage per unit time is greater than a first preset threshold can be called a rigid region, and the region where the change rate of the membrane voltage per unit time is not greater than the first preset threshold can be called a non - rigid region. When the membrane voltage of a spiking neuron exceeds a fixed threshold, an action potential will be generated and it will enter the rigid region.

[0128] In the above - mentioned technical solution, when the change rate of the first membrane voltage is greater than the first preset threshold (i.e., in the rigid region), an algorithm with higher calculation efficiency is used to calculate the second membrane voltage of the first neuron at time t. When the change rate of the first membrane voltage is not greater than the first preset threshold (i.e., in the non - rigid region), an algorithm with higher calculation accuracy is used to calculate the second membrane voltage of the first neuron at time t. In this way, different algorithms are used in different regions, which can not only achieve a higher calculation efficiency of the membrane voltage, but also improve the calculation accuracy of the membrane voltage.

[0129] The following combines Figure 5 , and a specific implementation manner of the data processing method in the spiking neural network provided by the embodiment of the present application is described in detail. It should be noted that the following examples are only to help those skilled in the art understand the embodiment of the present application, rather than limiting the embodiment of the application to the specific numerical values or specific scenarios shown. Those skilled in the art can obviously make various equivalent modifications or changes according to the examples given in the text, and such modifications and changes also fall within the scope of the embodiment of the present application.

[0130] Figure 5 is a schematic flowchart of another data processing method in the spiking neural network provided by the embodiment of the present application. As Figure 5 shown, this method may include steps 510 - 560, and the steps 510 - 560 are described in detail below.

[0131] Step 510: Obtain the parameter information Z of the spiking neuron at time t - 1 t-1 .

[0132] In the embodiment of the present application, the parameter information Z of the spiking neuron at time t - 1 t-1may include the membrane voltage V of the spiking neuron at time t-1 t-1 .

[0133] Optionally, the parameter information Z t-1 may further include the input current of the spiking neuron at time t-1 and the intermediate variable of the spiking neuron at time t-1. Among them, the intermediate variable may include but is not limited to: the gating variable parameter m of the sodium ion current channel, the gating variable parameter h of the potassium ion current channel, and the gating variable parameter n of the leakage current channel.

[0134] Step 520: Determine whether the spiking neuron is in the rigid region at time t-1.

[0135] Specifically, in a possible implementation, it can be determined whether the spiking neuron is in the rigid region at time t-1 according to whether the slope of the membrane voltage of the spiking neuron at time t-1 is greater than a preset threshold. That is to say, it can be determined whether the spiking neuron is in the rigid region at time t-1 according to whether the change rate of the membrane voltage of the spiking neuron at time t-1 per unit time is greater than the preset threshold. It should be understood that the slope of the membrane voltage can also be called the derivative of the membrane voltage

[0136] If the slope of the membrane voltage of the spiking neuron at time t-1 is greater than the preset threshold, it can be determined that the spiking neuron is in the rigid region with a fast-changing membrane voltage at time t-1, and it can also be determined that the spiking neuron is in the rigid region with a fast-changing membrane voltage at time t.

[0137] If the slope of the membrane voltage of the spiking neuron at time t-1 is less than the preset threshold, it can be determined that the spiking neuron is in the non-rigid region with a slow-changing membrane voltage at time t-1, and it can also be determined that the spiking neuron is in the non-rigid region with a slow-changing membrane voltage at time t.

[0138] Step 530: Use different algorithms in the rigid region and the non-rigid region to determine the parameter information Z of the spiking neuron at time t t .

[0139] In the embodiment of the present application, the parameter information Z of the spiking neuron at time t t may include the membrane voltage V of the spiking neuron at time t t .

[0140] Optionally, the parameter information Z of the spiking neuron at time t t may further include the input current of the spiking neuron at time t and the intermediate variables of the spiking neuron at time t. Among them, the intermediate variables may include but are not limited to: the gating variable parameter m of the sodium ion current channel, the gating variable parameter h of the potassium ion current channel, and the gating variable parameter n of the leakage current channel.

[0141] Taking the HH model shown in formula (1) as an example, the HH model can also be expressed by the following formulas (4)-(5).

[0142]

[0143]

[0144] Among them, a V represents the principal component of the derivative (or rate of change) of the membrane voltage V and is the coefficient of the linear part of the equation ;

[0145] a m represents the principal component of the derivative (or rate of change) of the parameter m and is the coefficient of the linear part of the equation ;

[0146] a h represents the principal component of the derivative (or rate of change) of the parameter h and is the coefficient of the linear part of the equation ;

[0147] a n represents the principal component of the derivative (or rate of change) of the parameter n and is the coefficient of the linear part of the equation ;

[0148] represents the secondary component of the derivative (or rate of change) of the membrane voltage V and is the non-linear part of the equation ;

[0149] represents the secondary component of the derivative (or rate of change) of the parameter m and is the non-linear part of the equation ;

[0150] represents the secondary component of the derivative (or rate of change) of the parameter h and is the non-linear part of the equation ;

[0151] represents the secondary component of the derivative (or rate of change) of the parameter n and is the non-linear part of the equation ;

[0152] The F function can be represented by the following formula (6).

[0153]

[0154] In the embodiments of the present application, for ease of description, multiple F functions (for example, ) can also be merged into one where the variable z can take V, m, h, and n respectively.

[0155] In a possible implementation manner, taking the example that the spiking neuron determined in step 520 is in the rigid region at time t - 1, the specific implementation process of determining the parameter information Z of the spiking neuron at time t t will be described in detail.

[0156] In the embodiments of the present application, in the rigid region, the parameter information Z of the spiking neuron at time t can be determined by an algorithm with higher computational efficiency t . Specifically, taking the ETD algorithm as an example of an algorithm with higher computational efficiency, the parameter information Z of the spiking neuron at time t is determined by the ETD algorithm in the rigid region t .

[0157] The ETD algorithm will be described and explained in detail below.

[0158] 1. According to the parameter information Z of the spiking neuron at time t - 1 t-1 and formula (7), determine the estimated value F of the minor component of the derivative of the parameter information Z t-1 . z,1 .

[0159]

[0160] where F z,1 represents the estimated value of the minor component of the derivative of the parameter information Z t-1 .

[0161] In the embodiments of the present application, when the variable z takes V, m, h, and n respectively, F V,1 , F m,1 , F h,1 , and F n,1 can be calculated respectively.

[0162] Taking one example, when the variable z takes V. According to the membrane voltage V of the spiking neuron at time t - 1 t-1 , m t-1 h t-1 ,

[0163] n t-1 and the equation in formula (6) the equation a in formula (5)V Determine the membrane voltage V of the spiking neuron at time t-1 t-1 The secondary component F of the derivative (or rate of change) of V,1 .

[0164] Another example, let the variable z take m. According to the membrane voltage V of the spiking neuron at time t-1 t-1 , m t-1 , h t-1 , n t-1 and the equation in formula (6) The equation a in formula (5) m Determine the parameter m of the spiking neuron at time t-1 t-1 The secondary component F of the derivative (or rate of change) of m,1 .

[0165] Another example, let the variable z take h. According to the membrane voltage V of the spiking neuron at time t-1 t-1 , m t-1 , h t-1 , n t-1 and the equation in formula (6) The equation a in formula (5) h Determine the parameter h of the spiking neuron at time t-1 t-1 The secondary component F of the derivative (or rate of change) of h,1 .

[0166] Another example, let the variable z take n. According to the membrane voltage V of the spiking neuron at time t-1 t-1 , m t-1 , h t-1 , n t-1 and the equation in formula (6) The equation a in formula (5) n Determine the parameter n of the spiking neuron at time t-1 t-1 The secondary component F of the derivative (or rate of change) of n,1 .

[0167] 2. Determine the parameter information Z of the spiking neuron at time t according to F z,1 and formula (8) t .

[0168]

[0169] where c z represents the estimated value of z of the spiking neuron at time t.

[0170] In the embodiments of the present application, when the variable z takes V, m, h, and n respectively, c can be calculated respectively V , c m , c h , c n . And c V can be used as the membrane voltage V t of the spiking neuron at time t, c m can be used as the value of the parameter m of the spiking neuron at time t, c h can be used as the value of the parameter h of the spiking neuron at time t, and c n can be used as the value of the parameter n of the spiking neuron at time t.

[0171] An example, where the variable z takes V. According to the m t-1 , h t-1 , n t-1 in formula (5), the equation a V and F V,1 at time t - 1 of the spiking neuron, the estimated value c V of the membrane voltage of the spiking neuron at time t is determined. And c V can be used as the membrane voltage V t of the spiking neuron at time t.

[0172] Another example, where the variable z takes m. According to the m t-1 , h t-1 , n t-1 in formula (5), the equation a m and F m,1 at time t - 1 of the spiking neuron, the estimated value c m of the parameter m of the spiking neuron at time t is determined. And c m can be used as the value m t of the parameter m of the spiking neuron at time t.

[0173] Another example, where the variable z takes h. According to the m t-1 , h t-1 , n t-1 in formula (5), the equation a h and F h,1 at time t - 1 of the spiking neuron, the estimated value c h of the parameter h of the spiking neuron at time t is determined. And c h can be used as the value h t of the parameter h of the spiking neuron at time t.

[0174] Another example, where the variable z takes n. According to the m t-1 , h t-1 , n t-1Equation a in formula (5) n and F n,1 Determine the estimated value c of the parameter n of the spiking neuron at time t n . And c n can be used as the value n of the parameter n of the spiking neuron at time t t .

[0175] Optionally, in some embodiments, in order to obtain more accurate parameter information Z t , the parameter information Z can be further determined according to formulas (9)-(10) t .

[0176]

[0177] where F z,2 represents the estimated value of the minor component of the derivative of the parameter information Z t .

[0178] In the embodiments of the present application, when the variable z takes V, m, h, n respectively, F can be calculated respectively V,2 , F m,2 , F h,2 , F n,2 .

[0179] An example, with the variable z taking V. According to the estimated value c of V of the spiking neuron at time t V , the estimated value c of m m , the estimated value c of h h , the estimated value c of n n and the equation in formula (6) Determine the estimated value F of the minor component of the derivative of V of the spiking neuron at time t V,2 .

[0180] Another example, with the variable z taking m. According to the estimated value c of V of the spiking neuron at time t V , the estimated value c of m m , the estimated value c of h h , the estimated value c of n n and the equation in formula (6) Determine the estimated value F of the minor component of the derivative of the parameter m of the spiking neuron at time t m,2 .

[0181] Another example, with the variable z taking h. According to the estimated value c of V of the spiking neuron at time t V , the estimated value c of m m , the estimated value c of h h , the estimated value c of n n and the equation in formula (6) Determine the secondary component estimate F of the derivative of the parameter h of the spiking neuron at time t h,2 .

[0182] Another example, let the variable z take n. According to the estimate c of V of the spiking neuron at time t V and the estimate c of m m and the estimate c of h h and the estimate c of n n and the equation in formula (6) Determine the secondary component estimate F of the derivative of the parameter n of the spiking neuron at time t n,2 .

[0183]

[0184] where Z t represents the value of z of the spiking neuron at time t.

[0185] One example, let the variable z take V. According to V at time t - 1 of the spiking neuron t-1 and a V and the secondary component F of the derivative (or rate of change) of the membrane voltage V at time t - 1 of the spiking neuron t-1 and the secondary component estimate F of the derivative of V at time t of the spiking neuron V,1 Determine the value V of V of the spiking neuron at time t V,2 . t .

[0186] Another example, let the variable z take m. According to m at time t - 1 of the spiking neuron t-1 and a m and the secondary component F of the derivative (or rate of change) of the parameter m at time t - 1 of the spiking neuron t-1 and the secondary component estimate F of the derivative of the parameter m at time t of the spiking neuron m,1 Determine the value m of m of the spiking neuron at time t m,2 . t .

[0187] Another example, let the variable z take h. According to h at time t - 1 of the spiking neuron t-1 and a h and the secondary component F of the derivative (or rate of change) of the parameter h at time t - 1 of the spiking neuron t-1 and the secondary component estimate F of the derivative of the parameter h at time t of the spiking neuron h,1 Determine the value h of h of the spiking neuron at time t h,2 . t .

[0188] Another example is that the variable z takes n. According to n of the spiking neuron at the moment t-1 t-1 、a n 、the parameter n of the spiking neuron at the moment t-1 t-1 and the minor component F of the derivative (or rate of change) of the parameter n of the spiking neuron at the moment t n,1 as well as the estimated value F of the minor component of the derivative of the parameter n of the spiking neuron at the moment t n,2 to determine the value n of n of the spiking neuron at the moment t t 。

[0189] In another possible implementation, taking the spiking neuron at the moment t-1 determined in step 520 being in the non-rigid region as an example, the specific implementation process of determining the parameter information Z of the spiking neuron at the moment t t will be described in detail.

[0190] In the embodiment of the present application, in the non-rigid region, the parameter information Z of the spiking neuron at the moment t can be determined by an algorithm with higher calculation accuracy t . Specifically, taking the RK algorithm as an example of an algorithm with higher calculation accuracy, the parameter information Z of the spiking neuron at the moment t is determined by the RK algorithm in the non-rigid region t 。

[0191] It should be noted that in the embodiment of the present application, in order to implement a more efficient circuit, the ETD algorithm and the RK algorithm can be integrated into one circuit. For a in the above formulas (7)-(10) z when taking zero, the RK algorithm can be obtained. Taking the variable z as V, the value of a V is zero. Taking the variable z as m, the value of a m is zero. Taking the variable z as h, the value of a h is zero. Taking the variable z as n, the value of a n is zero.

[0192] The process of calculating the parameter information Z of the spiking neuron at the moment t by the RK algorithm t is similar to the process calculated by the ETD algorithm. For specific details, please refer to the description of the ETD algorithm in the above text and will not be elaborated here.

[0193] Step 540: Determine whether the membrane voltage V of the spiking neuron at the moment t t exceeds the threshold voltage.

[0194] Step 550: If the membrane voltage V of the spiking neuron at the moment t t exceeds the threshold voltage, then estimate the firing moment of the spiking neuron.

[0195] If the membrane voltage V of the previous spiking neuron at the moment t-1 t-1does not exceed the threshold voltage, and the membrane voltage V at time t t exceeds the threshold voltage, and the previous spiking neuron will send a spike to the subsequent spiking neuron connected to it. After receiving the spike, the subsequent spiking neuron can generate an input current according to Equation (2).

[0196] In Equation (2), the input current of the subsequent spiking neuron is related to the firing time of the previous spiking neuron sending a spike. In related technical solutions, if the previous spiking neuron fires within a time step (from time t - 1 to time t), for example, the membrane voltage V at time t - 1 t-1 does not exceed the threshold voltage, and the membrane voltage V at time t t exceeds the threshold voltage. Generally, the firing time is defaulted to the end of this time step. For example, the firing time is time t. Since the membrane voltage of the previous spiking neuron exceeding the threshold voltage may be at a certain moment within the time step (from time t - 1 to time t), therefore, taking the end of this time step as the firing time is not very accurate. In this way, it will lead to inaccurate input current of the subsequent spiking neuron, thus affecting the calculation of the membrane voltage on the subsequent spiking neuron.

[0197] In the embodiments of the present application, the firing time of the previous spiking neuron can be estimated. Specifically, the firing time of the previous spiking neuron can be estimated by an interpolation method, for example, a linear interpolation method. For example, referring to Figure 6 , the firing time estimated by the linear interpolation method is between the time step (from time t - 1 to time t).

[0198] For the specific implementation manner of estimating the firing time of the previous spiking neuron by the linear interpolation method, please refer to Equation (11).

[0199]

[0200] where t spike represents the firing time;

[0201] V th represents the threshold voltage;

[0202] V t-1 represents the membrane voltage of the spiking neuron at time t - 1;

[0203] V t represents the membrane voltage of the spiking neuron at time t.

[0204] Step 560: Output a current increment to the subsequent spiking neuron so that the subsequent spiking neuron can correct the input current according to the current increment.

[0205] In the embodiments of the present application, the determined firing time t spikeIt is between the time steps (time (t-1) and time t). Therefore, compared with the related technical solutions where the discharge time generally defaults to the end of this time step, the discharge time t determined in this application spike will cause an increment in the input current of the subsequent spiking neuron. So that the subsequent spiking neuron can update the input current according to this input current increment.

[0206] Specifically, according to the obtained discharge time t spike Please refer to formula (12) for the implementation process of determining the current increment.

[0207]

[0208] Among them, represents the current increment.

[0209] After the pulse signal emitted by the previous neuron is received by the subsequent neuron, the generated input current can be determined according to formula (2) In the embodiment of this application, the previous neuron will also estimate the discharge time t spike After that, the generated current increment is determined according to formula (12) and output to the subsequent neuron. The subsequent neuron can update or adjust the generated input current to obtain the updated input current. For the specific calculation process, please refer to the description in formula (13).

[0210]

[0211] Among them, represents the updated input current of the subsequent neuron.

[0212] In the embodiment of this application, according to the differences between the HH model in the rigid region and the non-rigid region, an adaptive method can be used to calculate the membrane voltage on the spiking neuron. In the rigid region, the membrane voltage on the spiking neuron can be calculated by an algorithm with higher calculation efficiency (for example, the ETD algorithm), and in the non-rigid region, the membrane voltage on the spiking neuron can be calculated by an algorithm with higher calculation accuracy (for example, the RK algorithm). In this way, on the one hand, compared with using the RK algorithm in both the rigid region and the non-rigid region, the calculation efficiency can be improved. On the other hand, compared with using the ETD algorithm in both the rigid region and the non-rigid region, the calculation accuracy can be improved.

[0213] As described above in combination with Figures 1 to 6 , the method for data processing in the spiking neural network provided in the embodiment of this application is described in detail. Next, in combination with Figures 7 to 9, describe in detail the embodiments of the device of the present application. It should be understood that the description of the method embodiments corresponds to the description of the device embodiments. Therefore, for the parts not described in detail, reference can be made to the previous method embodiments.

[0214] Figure 7 It is a schematic block diagram of a device 700 for data processing in a spiking neural network provided by an embodiment of the present application. This device for data processing can be implemented as part or all of the device through software, hardware, or a combination of both. The device provided by the embodiments of the present application can implement the Figure 4 method flow in the embodiments of the present application. The device 700 for data processing in the spiking neural network includes: an acquisition module 710, a determination module 720, and a calculation module 730, where:

[0215] The acquisition module 710 is configured to acquire a first membrane voltage and a first input current on a first neuron. The first membrane voltage is the membrane voltage value of the first neuron at the (t - 1)th moment, and the first input current is the input current determined by the first neuron at the (t - 1)th moment according to the received input pulses;

[0216] The determination module 720 is configured to determine whether the change rate of the first membrane voltage within a unit time is greater than a first preset threshold;

[0217] The calculation module 730, if the change rate of the first membrane voltage within the unit time is greater than the first preset threshold, is configured to calculate a second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a first algorithm, where the second membrane voltage is the membrane voltage value of the first neuron at the tth moment, and the (t - 1)th moment is the previous moment of the tth moment; or

[0218] If the change rate of the first membrane voltage within the unit time is not greater than the first preset threshold, it is configured to calculate the second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a second algorithm, where the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.

[0219] Optionally, the determination module 720 is further configured to: determine a first firing moment T of the first neuron, where the first firing moment T is between the (t - 1)th moment and the tth moment; determine a current increment according to the first firing moment T and the tth moment;

[0220] The device 700 for data processing in the spiking neural network further includes:

[0221] An output module 740 is configured to output the current increment to the second neuron. The current increment is used to indicate that the second neuron adjusts a second current received from the first neuron according to the current increment. The second current is the current output by the first neuron when the first neuron determines that the second membrane voltage is greater than a second preset threshold. The second neuron is the neuron in the next layer of the first neuron.

[0222] Optionally, the determining module 720 is specifically configured to: determine a first firing time T of the first neuron according to an interpolation algorithm.

[0223] Optionally, the determining module 720 is specifically configured to: determine a first firing time T of the first neuron according to a linear interpolation algorithm.

[0224] Optionally, the determining module 720 is specifically configured to: determine a firing time T of the first neuron according to the (t - 1) moment, the first membrane voltage, the t moment, and the second membrane voltage.

[0225] Optionally, the first algorithm is an exponential time difference (ETD) algorithm.

[0226] Optionally, when the first algorithm is an exponential time difference (ETD) algorithm, the calculating module 730 is specifically configured to: determine an estimated value of a minor component of the first membrane voltage change rate according to the first membrane voltage and the first input current; determine an estimated value of a linear principal component of the first membrane voltage change rate according to the gating variable of the ion channel of the first neuron at the (t - 1) moment; determine an estimated value of the second membrane voltage on the first neuron according to the estimated value of the minor component of the first membrane voltage change rate and the estimated value of the linear principal component of the first membrane voltage change rate; determine an estimated value of a minor component of the second membrane voltage change rate according to the estimated value of the second membrane voltage; determine the second membrane voltage according to the estimated value of the minor component of the first membrane voltage change rate, the estimated value of the linear principal component of the first membrane voltage change rate, and the estimated value of the minor component of the second membrane voltage change rate.

[0227] Optionally, the second algorithm is a Runge - Kutta (RK) algorithm.

[0228] Optionally, when the second algorithm is the Runge-Kutta RK algorithm, the calculation module 730 is specifically configured to: determine an estimated value of a secondary component of the first membrane voltage change rate according to the first membrane voltage and the first input current; determine an estimated value of the second membrane voltage on the first neuron according to the estimated value of the secondary component of the first membrane voltage change rate; determine an estimated value of the secondary component of the second membrane voltage change rate according to the estimated value of the second membrane voltage; and determine the second membrane voltage according to the estimated value of the secondary component of the first membrane voltage change rate and the estimated value of the secondary principal component of the second membrane voltage change rate.

[0229] Figure 8 FIG. 4 is a schematic circuit block diagram of a spiking neural network provided by an embodiment of the present application. The spiking neural network may include at least two neurons, and each neuron includes a plurality of registers. For ease of description, Figure 8 neuron 800 is taken as an example for illustration.

[0230] It should be understood that neuron 800 is any one of the multiple neurons in the spiking neural network. The input of neuron 800 is connected to the output of the previous layer of neurons, and the transmission of neuron 800 is connected to the input of the next layer of neurons.

[0231] Neuron 800 may include: current register 810, voltage register 820, first comparator 830, unified evolution algorithm circuit 840, current register 850, voltage register 860, second comparator 870, estimation circuit 880, and current increment register 890.

[0232] 1. Current register 810

[0233] Located at the input end of neuron 800, it is used to store the input current of neuron 800 at the previous moment (time t-1).

[0234] 2. Voltage register 820

[0235] It is used to store the membrane voltage of neuron 800 at the previous moment (time t-1).

[0236] 3. First comparator 830

[0237] It is used to implement the method steps in step 520. Specifically, it is used to determine whether neuron 800 is in the rigid region at the previous moment (time t-1).

[0238] For example, a preset threshold is stored in the first comparator 830. If the derivative of the membrane voltage of neuron 800 at the previous moment (time t-1) is greater than the preset threshold, it can be determined that neuron 800 is in the rigid region at the previous moment (time t-1).

[0239] For another example, if the derivative of the membrane voltage of neuron 800 at the previous moment (moment t - 1) is greater than a preset threshold, it can be determined that neuron 800 was in a non-rigid region at the previous moment (moment t - 1).

[0240] 4. Unified evolution algorithm circuit 840

[0241] It is used to implement the method steps in step 530. Specifically, it is used to calculate the membrane voltage of neuron 800 at the current moment (moment t) based on the input current of neuron 800 at the previous moment (moment t - 1) and the membrane voltage at the previous moment (moment t - 1).

[0242] See Figure 9 , the unified evolution algorithm circuit 840 includes: register 841, register 842, register 843, register 844.

[0243] Register 841 is used to obtain the parameters of neuron 800 stored in voltage register 820 at the previous moment (moment t - 1), such as vector u = [V, m, h, n] T , and determine and store the linear part of the HH model according to vector u = [V, m, h, n] T and the above formula (5), such as vector a = [a V , a m , a h , a n T .

[0244] Register 842 is used to obtain the vector u = [V, m, h, n] T stored in voltage register 820, obtain the vector a = [a V , a m , a h , a n T stored in register 841, and obtain the input current of neuron 800 at the previous moment (moment t - 1) stored in current register 810 and determine and store vector F1 = [F T , F V , F m , F h , F n T , and formula (6). V,1 , F m,1 , F h,1 , F n,1 T .

[0245] ​​​​Register 843, for obtaining vector F1 = [F V,1 , F m,1 , F h,1 , F n,1 T and vector u = [V, m, h, n] T , and determine and store vector c = [F V,1 , F m,1 , F h,1 , F n,1 T , vector u = [V, m, h, n] T and formula (8). V,1 , c m , c h , c n T .

[0246] Register 844, for obtaining vector c = [F V,1 , c m , c h , c n T , the input current of neuron 800 at the previous moment (moment t - 1) and determine and store vector F2 = [F V,1 , c m , c h , c n T , and formula (9). V,2 , F m,2 , F h,2 , F n,2 T .

[0247] In the embodiment of the present application, the unified evolution algorithm circuit 840 can implement two different algorithms. For example, the RK algorithm circuit and the ETD algorithm circuit are integrated into a unified evolution algorithm circuit 840. When the first comparator 830 determines that the neuron 800 is in the rigid region at the previous moment (moment t - 1), the ETD algorithm can be used to calculate the membrane voltage of the neuron 800 at the current moment (moment t). As another example, when the first comparator 830 determines that the neuron 800 is in the non-rigid region at the previous moment (moment t - 1), the RK algorithm can be used to calculate the membrane voltage of the neuron 800 at the current moment (moment t).

[0248] As an example, when it is necessary to use the RK algorithm to calculate the membrane voltage of the neuron 800 at the current moment (moment t), vector a = [a V , a​​​​​​m , a h , a n T is set to zero so that the unified evolutionary algorithm circuit 840 can implement the RK algorithm.

[0249] In another example, when it is necessary to use the ETD algorithm to calculate the membrane voltage of the neuron 800 at the current moment (time t), the vector a = [a V , a m , a h , a n T stored in the register 841 can be set to non - zero so that the unified evolutionary algorithm circuit 840 can implement the ETD algorithm.

[0250] 5. Current register 850

[0251] Is located at the output end of the neuron 800 and is used to store the output current of the neuron 800 at the current moment (time t).

[0252] 6. Voltage register 860

[0253] Is connected to the unified evolutionary algorithm circuit 840 and is used to store the membrane voltage of the neuron 800 calculated by the unified evolutionary algorithm circuit 840 at the current moment (time t).

[0254] 7. Second comparator 870

[0255] Is used to implement the method steps in step 540. Specifically, it is used to judge whether the membrane voltage of the neuron 800 at time t - 1 exceeds the threshold voltage and whether the membrane voltage at time t exceeds the threshold voltage. For example, the threshold voltage is stored in the second comparator 870. If the membrane voltage of the neuron 800 at time t - 1 does not exceed the threshold voltage and the membrane voltage at time t exceeds the threshold voltage, it can be understood that the neuron 800 will emit a pulse to the next - layer neuron during the time period from time t - 1 to time t.

[0256] 8. Estimation circuit 880

[0257] Is used to implement the method steps in step 550. Specifically, it is used to calculate the firing time t of the neuron 800 according to the threshold voltage stored in the second comparator 870, the membrane voltage of the neuron 800 at the previous moment (time t - 1) stored in the voltage register 820, and the membrane voltage of the neuron 800 at the current moment (time t) stored in the voltage register 860 spike . For the specific calculation process, please refer to formula (11) and will not be elaborated here.

[0258] ​​It should be noted that there are various implementation manners of the estimation circuit 880, and the present application does not make specific limitations. In one possible implementation manner, the estimation circuit 880 can be a register, which is used to discharge according to the threshold voltage, the membrane voltage of the neuron 800 at the previous moment (moment t - 1), and the membrane voltage at the current moment (moment t) of the membrane voltage at the current moment (moment t), and store the discharge moment t spike and store the discharge moment t spike . In another possible implementation manner, the estimation circuit 880 can further include two registers, one of which is used to calculate the discharge moment t according to the above method spike , and the other register is used to store the discharge moment t spike .

[0259] 9. Current increment register 890

[0260] is used to implement the method steps in step 560. Specifically, it is used to calculate and store the current increment according to the obtained discharge moment t spike . The current increment register 890 is connected to the input of the next - layer neuron, and is used to transmit the current increment stored in the current increment register 890 to the next - layer neuron, so that the next - layer neuron can update the input current according to the input current increment.

[0261] In the embodiments of the present application, on the one hand, the processes of the membrane voltage and the current can be implemented by an iterative algorithm. Only the corresponding parameters at the current moment and the previous moment need to be stored to quickly calculate the current voltage value, and the calculation amount is greatly reduced, and at the same time, the parallelism of the calculation is greatly improved. On the other hand, the voltage threshold is a constant and does not need to be adjusted. Only the input current needs to be corrected at the end of the time step. The above methods greatly simplify the circuit logic.

[0262] In this embodiment, a computing device is further provided. The computing device includes a processor and a memory. The memory is used to store one or more instructions, and the processor implements the method for data processing in the above - provided spiking neural network by executing the one or more instructions.

[0263] In this embodiment, a computer - readable storage medium is further provided. The computer - readable storage medium stores instructions. When the instructions in the computer - readable storage medium are executed on a computing device, the computing device is enabled to execute the method for data processing in the above - provided spiking neural network.

[0264] In this embodiment, a computer program product including instructions is further provided. When it runs on a computing device, the computing device is enabled to execute the method for data processing in the above - provided spiking neural network, or the computing device is enabled to implement the functions of the device for data processing in the above - provided spiking neural network.

[0265] It should be understood that in various embodiments of the present application, the magnitudes of the serial numbers of the above processes do not imply the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0266] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0267] In several embodiments provided by the present application, it should be understood that the above-described embodiments of the spiking neural network are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces.

[0268] The unit described as a separate component may or may not be physically separated. The component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0269] In addition, the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0270] If this function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0271] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims

1. A method for data processing in a spiking neural network, characterized in that, Including: Obtain the first membrane voltage and the first input current on the first neuron, where the first membrane voltage is the membrane voltage value of the first neuron at the moment t - 1, and the first input current is determined by the first neuron according to the received input pulses at the moment t - 1; Determine whether the change rate of the first membrane voltage within a unit time is greater than a first preset threshold; If the change rate of the first membrane voltage within the unit time is greater than the first preset threshold, calculate the second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a first algorithm, where the second membrane voltage is the membrane voltage value of the first neuron at the moment t, and the moment t - 1 is the previous moment of the moment t; or If the change rate of the first membrane voltage within the unit time is not greater than the first preset threshold, calculate the second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a second algorithm, where the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.

2. The method according to claim 1, wherein The method further includes: Determine the first firing moment T of the first neuron, where the first firing moment T is between the moment t - 1 and the moment t; Determine the current increment according to the first firing moment T and the moment t; Output the current increment to a second neuron, where the current increment is used to instruct the second neuron to adjust the second current received from the first neuron according to the current increment, where the second current is the current output by the first neuron when determining that the second membrane voltage is greater than a second preset threshold, and the second neuron is the next - layer neuron of the first neuron.

3. The method according to claim 2, wherein The determination of the first firing moment T of the first neuron specifically includes: Determine the firing moment T of the first neuron according to the moment t - 1, the first membrane voltage, the moment t, and the second membrane voltage.

4. The method according to any one of claims 1 to 3, characterized in that, The first algorithm is the exponential time difference ETD algorithm.

5. The method according to any one of claims 1 to 3, characterized in that, The second algorithm is the Runge - Kutta RK algorithm.

6. A device for data processing in a spiking neural network, characterized in that, Including: An acquisition module, configured to obtain the first membrane voltage and the first input current on the first neuron, where the first membrane voltage is the membrane voltage value of the first neuron at the moment t - 1, and the first input current is determined by the first neuron according to the received input pulses at the moment t - 1; A determination module, configured to determine whether the change rate of the first membrane voltage within a unit time is greater than a first preset threshold; A calculation module, if the change rate of the first membrane voltage within the unit time is greater than the first preset threshold, is configured to calculate the second membrane voltage on the first neuron according to the first membrane voltage and the first input current through a first algorithm, where the second membrane voltage is the membrane voltage value of the first neuron at the moment t, and the moment t - 1 is the previous moment of the moment t; If the change rate of the first membrane voltage within the unit time is not greater than the first preset threshold, the second membrane voltage on the first neuron is calculated according to the first membrane voltage and the first input current by a second algorithm, where the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.

7. The device according to claim 6, characterized in that, The determining module is further configured to: Determine a first firing time T of the first neuron, where the first firing time T is between the (t - 1)th moment and the tth moment; Determine a current increment according to the first firing time T and the tth moment; The apparatus further includes: An output module, configured to output the current increment to a second neuron, where the current increment is used to instruct the second neuron to adjust a second current received from the first neuron according to the current increment, where the second current is the current output by the first neuron to the second neuron when the first neuron determines that the second membrane voltage is greater than a second preset threshold, and the second neuron is the next-layer neuron of the first neuron.

8. The device according to claim 7, characterized in that, The determining module is specifically configured to: Determine the firing time T of the first neuron according to the (t - 1)th moment, the first membrane voltage, the tth moment, and the second membrane voltage.

9. The device according to any one of claims 6 to 8, characterized in that, The first algorithm is an exponential time difference (ETD) algorithm.

10. The device according to any one of claims 6 to 8, characterized in that, The second algorithm is a Runge-Kutta (RK) algorithm.

11. A device for data processing in a spiking neural network, characterized in that, Comprising: A communication interface, configured to receive a first characteristic pulse sequence of an object to be recognized; A processor, connected to the communication interface and configured to execute the method according to any one of claims 1 to 5.

12. A spiking neural network system, characterized in that, Comprising: A first current register, configured to store a first input current of the first neuron at the (t - 1)th moment, where the first input current is determined by the first neuron according to the received input pulse at the (t - 1)th moment; A first voltage register, configured to store the first membrane voltage of the first neuron at the (t - 1)th moment; A first comparator, connected to the first voltage register, configured to determine whether the change rate of the first membrane voltage stored in the first voltage register within the unit time is greater than a first preset threshold; A first algorithm circuit, connected to the first current register and the first voltage register, configured to calculate the second membrane voltage on the first neuron according to the first membrane voltage and the first input current by a first algorithm when the change rate of the first membrane voltage within the unit time is greater than the first preset threshold, where the second membrane voltage is the membrane voltage value of the first neuron at the tth moment, and the (t - 1)th moment is the previous moment of the tth moment; or To calculate the second membrane voltage on the first neuron by a second algorithm when the change rate of the first membrane voltage within the unit time is not greater than the first preset threshold, where the calculation efficiency of the first algorithm is higher than that of the second algorithm, and the calculation accuracy of the second algorithm is higher than that of the first algorithm.

13. The pulse neural network system according to claim 12, characterized in that, Further comprising: An estimation circuit stores the first firing time T of the first neuron, and the first firing time T is between the (t - 1)-th moment and the t-th moment; A current increment register is connected to the estimation circuit, and is configured to determine a current increment according to the first firing time T and output the current increment to a second neuron. The current increment is used to indicate that the second neuron adjusts a second current received from the first neuron according to the current increment. The second current is the current output by the first neuron when the first neuron determines that the second membrane voltage is greater than a second preset threshold, and the second neuron is the neuron in the next layer of the first neuron.

14. The spiking neural network system according to claim 13, wherein It further includes: A second voltage register is configured to store the second membrane voltage on the first neuron; The estimation circuit is connected to the second voltage register and the first voltage register, and is specifically configured to: determine the firing time T of the first neuron according to the (t - 1)-th moment, the first membrane voltage, the t-th moment, and the second membrane voltage, and store the first firing time T of the first neuron.

15. The spiking neural network system according to any one of claims 12 to 14, characterized in that, The first algorithm is an exponential time difference (ETD) algorithm.

16. The spiking neural network system according to any one of claims 12 to 14, characterized in that The second algorithm is a Runge-Kutta (RK) algorithm.

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a computing device, cause the computing device to execute the method according to any one of claims 1 to 5.