<figure><img src="image_1.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
Spiking Neuron Network Based on VTEAM
Memristor and MOSFET-LIF Neuron *

Jiahui Fu¹[0000-0001-7709-3645], Shuiping Gou¹,²[0000-0002-2619-6481], and
Zhang Guo³,²[0000-0001-7586-4020]

¹ Key Laboratory of Intelligent Perception and Image Understanding of Ministry of Education, School of Artificial Intelligence, Xidian University, Xi’an, Shaanxi 710071, China

shpgou@mail.xidian.edu.cn

² Academy of Advanced Interdisciplinary Research, Xidian University, Xi’an, Shaanxi 710071, China;

guozhang@xidian.edu.cn

**Abstract.** Neuromorphic computing has been widely developed due to its low power consumption and powerful interpretability. LIF neurons, the general-purpose neurons in neuromorphic computing, are under constant research in hardware implementations of spiking neural networks. In this paper, we design a LIF circuit with MOSFET based on the mathematical model of the LIF neuron. The simulated circuit can be directly applied to the spiking neural network through the VTEAM memristor crossbar architecture. The effect of parameter changes in the circuit on the membrane potential is demonstrated. Finally, we validate feasibility of the process on the DVS128 gesture dataset using a generic spiking neural network architecture and obtain satisfactory performance.

**Keywords:** LIF neuron · Spiking Neural Network · memristor.

# 1 Introduction

Spiking neural networks [1] is a critical development in neuromorphic computing. For the trade-off between model reasonableness and computational feasibility, Leaky Integrate-and-Fire (LIF) neuron has been widely used in spiking neural networks[2]. Many improvements in the model structure are currently being made in the field of spiking neuron networks[3, 4]. A Circuit Simulation tool, such as SPICE, allows LIF neurons to be used more efficiently in spiking neural networks.

In this paper, we designed a LIF circuit based on the biological properties of LIF neurons. With this circuit, the values of the membrane time constant, threshold voltage and other indicators of the LIF neuron can be adjusted by the

* This research was funded by the Natural Science Foundation of Shaanxi Province (Grant No. 2022JQ-661) and the Fundamental Research Funds for the Central Universities (Grant No. XJS222215).
circuit properties[2]. The input to the model will be converted into voltage pulses. The crossbar structure[5] passes the input voltage pulses through a memristor node with a resistance value to generate the output voltage pulses. Next, we built a spiking neural network with layer-by-layer propagation. After steps such as integration processing on the DVS128 gesture dataset[6], the feasibility of the network for the action classification task on the DVS dataset is verified.

# 2 Proposed Method

In this section, we will briefly describe the structure of the LIF neuron model and analyse its modelling mechanisms. Next, the circuit designed to control the parametric characteristics of the LIF model is described, along with an analysis of its construction principles and component characteristics. Finally, the acquisition process and the processing of the adopted dataset will be presented.

## 2.1 Leaky Integrate-and-Fire model

From a dynamical system perspective, the LIF model reduces the Hodgkin Huxley(HH) model's computational complexity while maintaining the HH model's[7, 8] necessary properties and is now the more commonly used neuron for large-scale SNN simulations[9]. The LIF model can be summarised in the following equation:

$$C_m \frac{dV}{dt} = -G_L (V(t) - E_L) + I_{in} \quad (1)$$

assume that $\tau = RC_m$, then the above equation can be expressed as:

$$\tau \frac{dV}{dt} = E_L - V(t) + RI_{in} \quad (2)$$

where $C_m$ represents the capacitance of the cell membrane surface, $G_L$ represents the conductance of the leakage term, $E_L$ represents the resting potential, $I_{in}$ represents the incoming current, $\tau$ represents the time constant. When the external current input raises the accumulated potential to a certain threshold, a pulse will be generated. The membrane potential then returns to a reset potential $V_{reset}$. Since the model is a computationally tractable first-order differential equation, it is often used as a spiking neuron in large-scale spiking neural network construction.

## 2.2 Design of LIF Circuit

LIF neurons are classical neurons that are often applied to spiking neural networks. The LIF Circuit can be simulated by LTSpice, which is a general-purpose simulation software based on SPICE. The LTspice simulation circuit designed in this section can achieve the setting of the film time constant, pulse amplitude, and threshold voltage. This model uses a combination of PMOS and NMOS to design the circuit. The circuit can achieve the functional characteristics of the
<figure><img src="image_2.png" /><figcaption>Fig. 1. Input and output of LIF circuit</figcaption></figure>

memristive devices. The circuit components used are shown in Fig.1. A capacitor is used as a potential leakage element. The parameters of the MOSFET used are shown in Table 1.

<table><caption>**Table 1.** Parameters of MOSFET in LIF circuits</caption><thead><tr><th>Parameter</th><th>Rg</th><th>Rd</th><th>Rs</th><th>Vto</th><th>Kp</th><th>Cgd(max)</th><th>Cgd(min)</th><th>Cgs</th><th>Cjo</th><th>Is</th><th>Rb</th><th>Vds</th><th>Ron</th><th>Qg</th></tr></thead><tbody><tr><td>PMOS</td><td>3</td><td>14m</td><td>10m</td><td>-0.8</td><td>32</td><td>0.5n</td><td>0.07n</td><td>0.9n</td><td>0.26n</td><td>26p</td><td>17m</td><td>-20</td><td>34m</td><td>13n</td></tr><tr><td>NMOS</td><td>3</td><td>4.8m</td><td>3.6m</td><td>0.8</td><td>0.7</td><td>0.7n</td><td>0.25n</td><td>1n</td><td>0.36n</td><td>0.1u</td><td>6m</td><td>20</td><td>12m</td><td>18n</td></tr></tbody></table>

In Fig.1, V1 is the voltage source that controls the threshold voltage for pulse issuance, V2 is the voltage source that controls the pulse amplitude, V3 is the voltage source that causes the membrane potential to rise, Vt is the voltage source that controls the membrane time constant, M1-M5 are PMOS of type AO6047, and M6-M7 are NMOS of type AO6408.

The crossbar structure is used in our designed spiking neural network testing process. There are many types of memristors. The device used here is one in which the voltage value does not vary in resistance between the $V_{on}$ and $V_{off}$. Therefore it can be used as a fixed weight in the test process. Crossbar consists of a set of memristors, and the memristor model used is the VTEAM model[10]. It is a current threshold-based memristor model, i.e., the change in the memristor's resistance depends on the relationship between the current real-time value flowing through the memristor and the current elucidation value. The equations for the state variables of the model are as follows:

$$ \frac{dx}{dt} = \begin{cases} k_{\text{off}} \cdot (v/V_{\text{off}} - 1)^{\alpha_{\text{off}}} \cdot f_{\text{off}}(x) & 0 < V_{\text{off}} < v \\ 0 & V_{\text{on}} < v < V_{\text{off}} \\ k_{\text{on}} \cdot (v/V_{\text{on}} - 1)^{\alpha_{\text{on}}} \cdot f_{\text{on}}(x) & v < V_{\text{on}} < 0 \end{cases} \quad (3) $$

where $k_{off}, k_{on}, \alpha_{off}, \alpha_{on}$ are the fitted parameters of the model. $V_{off}, V_{on}$ are the voltage thresholds of the model. $f_{off}, f_{on}$ are the window functions of the model (Shahar).

$v$ is the voltage across the memristor:

$$ v = R_M(x) \cdot i \quad (4) $$
where $R_M$ is the amnestic resistor resistance value:

$$R_M(x) = R_{\text{on}} + \frac{x - x_{\text{on}}}{x_{\text{off}} - x_{\text{on}}} (R_{\text{off}} - R_{\text{on}}) \quad (5)$$

<figure><img src="image_3.png" /><figcaption>Fig. 2. Schematic of the output from the LIF circuit to the Crossbar structure.</figcaption></figure>

With the pulse output from this circuit, it can be inserted into the crossbar structure[5]. The circuit corresponds to the neuron layer of the neural network. Afterwards, we can test the spiking neural network to arrive at the output of the pattern recognition problem. A schematic of the process is shown in Fig.2.

## 2.3 Correspondence between network and circuit

The Fig.3 shows the correspondence of the parameters between the neural network and the LIF circuit. The input in the network is converted into a voltage input into the LIF circuit, and the weight of the network is converted into the conductance value of the memristor. The LIF model used is a simplified model built into SpikingJelly[11].

Upon inputting an RGB picture to the neural network, the values of the pixel points on the picture are first converted into voltage values and loaded on the input port of the neural network. Subsequently, the weights of the columns corresponding to this input voltage in the network are set, at which point the corresponding amnesia resistance of the crossbar in the circuit is also changed.

## 2.4 Processing of the DVS128 gesture dataset

The DVS dataset is a neuromorphic dataset obtained from event camera shots. DVS128 gesture dataset contains 11 hand gestures from 29 subjects under 3 illumination
<figure><img src="image_4.png" /><figcaption>Fig. 3. Correspondence between spiking neural network and simulated circuit</figcaption></figure>

conditions[6]. We integrate the original event stream into frame data and divide
the data evenly by the number of events according to the set number size[12].
The resulting frame of the dataset after integration is shown in Fig.4.

The image shown in Fig.4 is a random selection of examples from the DVS
128 Gesture dataset after integrating the pulses. Subsequently, we intend to
apply spiking neural networks to the obtained image frames for classification.

<figure><img src="image_5.png" /><figcaption>Fig. 4. Continuous frame of the DVS dataset after integration</figcaption></figure>

**2.5 Network Formulation**

A generic spiking neural network is constructed here, as shown in Fig.5 con-
tains five 2D convolutional layers, five pooling layers, two fully connected layers
and several spiking neuron layers[4]. There are about 27 million model param-
eters. The input image is expanded into a vector and fed into the network.
<figure><img src="image_6.png" /><figcaption>Fig. 5. Spiking neural network architecture diagram</figcaption></figure>

The vectors are encoded in the LIF layer in the first Conv2D layer. Finally, an 11-dimensional classification probability vector is output by a one-dimensional pooling operation. The one with the highest probability dimension is the predicted classification.

## 3 Performance Analysis and Discussion

<figure><img src="image_7.png" /><figcaption>Fig. 6. Performance of different film time constants</figcaption></figure>

The LIF circuit design allows us to simulate the mathematics of some LIF neurons. This is shown below is the membrane potential curve obtained in the circuit by setting different values of the voltage source to control the membrane period. The membrane time constant is determined by the conductance and capacitance values of the circuit, and when the circuit is determined, the value is a definite term, and it can be seen that the time for the circuit to reach the
threshold voltage in a cycle varies while the membrane time constant varies. A comparative plot of the effect of voltage adjustment on the membrane potential corresponding to the membrane time constant is shown in Fig.6.

<figure><img src="image_8.png" /><figcaption>Fig. 7. Loss and accuracy graph for training</figcaption></figure>

This LIF circuit also adjusts the resetting potential of the LIF neuron. The circuit controls the return of the membrane potential to the resetting potential when the pulse release threshold potential is reached.

As shown in Fig.7, this simple network performs well on the DVS128 gesture dataset, with an accuracy of about 90% on the test dataset. The performance of the test dataset is shown in Fig.8.

<figure><img src="image_9.png" /><figcaption>Fig. 8. Loss and accuracy graph for test dataset</figcaption></figure>

## 4 Conclusion

In this paper, we propose a LIF circuit that can simulate LIF neurons using different parameters controlled by the value of the supply voltage. We compare
the effect of different parameter values obtained at various voltages on the mem-
brane potential profile. Additionally, we propose a method in which the pulses
generated by the circuit are directly incorporated into the neural network algo-
rithm. The input voltage pulses can be used for pattern recognition after passing
through the crossbar structure. Also, the DVS128 gesture dataset was processed,
and a network was designed and tested using a spiking neural network based on
LIF neurons. It can be seen that our training converges very fast and that the
convergence of the model is very effective. In addition, a well performed result
was obtained on the test dataset.

References

1. Maass, Wolfgang. "Networks of spiking neurons: the third generation of neural network models." Neural networks 10.9 (1997): 1659-1671.

2. Gerstner, Wolfram, et al. Neuronal dynamics: From single neurons to networks and models of cognition. Cambridge University Press, 2014.

3. Fang, Wei, et al. "Deep residual learning in spiking neural networks." Advances in Neural Information Processing Systems 34 (2021).

4. Fang, Wei, et al. "Incorporating learnable membrane time constant to enhance learning of spiking neural networks." Proceedings of the IEEE/CVF International Conference on Computer Vision. 2021.

5. Yakopcic, Chris, and Tarek M. Taha. "Energy efficient perceptron pattern recognition using segmented memristor crossbar arrays." The 2013 International Joint Conference on Neural Networks (IJCNN). IEEE, 2013.

6. Amir, Arnon, et al. "A low power, fully event-based gesture recognition system." Proceedings of the IEEE conference on computer vision and pattern recognition. 2017.

7. Hodgkin, Alan L., and Andrew F. Huxley. "A quantitative description of membrane current and its application to conduction and excitation in nerve." The Journal of physiology 117.4 (1952): 500.

8. Gupta, Ankur, and Lyle N. Long. "Hebbian learning with winner take all for spiking neural networks." 2009 International Joint Conference on Neural Networks. IEEE, 2009.

9. Indiveri, Giacomo. "A low-power adaptive integrate-and-fire neuron circuit." Proceedings of the 2003 International Symposium on Circuits and Systems, 2003. ISCAS'03.. Vol. 4. IEEE, 2003.

10. Kvatinsky, Shahar, et al. "VTEAM: A general model for voltage-controlled memristors." IEEE Transactions on Circuits and Systems II: Express Briefs 62.8 (2015): 786-790.

11. Fang, Wei, et al. "SpikingJelly." https://github.com/fangwei123456/spikingjelly. 2020.

12. Fang, Wei, et al. "Incorporating learnable membrane time constant to enhance learning of spiking neural networks." Proceedings of the IEEE/CVF International Conference on Computer Vision. 2021.