Mapping and Validating a Point Neuron Model on Intel's Neuromorphic Hardware Loihi

Neuromorphic hardware is based on emulating the natural biological structure of the brain. Since its computational model is similar to standard neural models, it could serve as a computational accelerator for research projects in the field of neuroscience and artificial intelligence, including biomedical applications. However, in order to exploit this new generation of computer chips, we ought to perform rigorous simulation and consequent validation of neuromorphic models against their conventional implementations. In this work, we lay out the numeric groundwork to enable a comparison between neuromorphic and conventional platforms. “Loihi”—Intel's fifth generation neuromorphic chip, which is based on the idea of Spiking Neural Networks (SNNs) emulating the activity of neurons in the brain, serves as our neuromorphic platform. The work here focuses on Leaky Integrate and Fire (LIF) models based on neurons in the mouse primary visual cortex and matched to a rich data set of anatomical, physiological and behavioral constraints. Simulations on classical hardware serve as the validation platform for the neuromorphic implementation. We find that Loihi replicates classical simulations very efficiently with high precision. As a by-product, we also investigate Loihi's potential in terms of scalability and performance and find that it scales notably well in terms of run-time performance as the simulated networks become larger.


Introduction
The human brain is a rich complex organ made up of numerous neurons and synapses.Replicating the brain structure and functionality in classical hardware is an ongoing challenge given the complexity of the brain and limitations of hardware.The advent of supercomputers now allows for complex neural model, but at a huge cost of both software complexity and energy consumption.
A recent intense focus on brain studies, with the BRAIN [1] initiative at the US, the Human Brain Project (HBP) [2] in Europe, and philanthropic endeavors like Janelia Research Campus [3], and the Allen Institute for Brain Science (AIBS) [4], has produced a wealth of new data and knowledge, from records of neuronal and network dynamics, to fine-grained data on network micro-and nano-structure, bringing in the era of big neural data.At the same time, advances in electronics and the search for post-von Neumann computational paradigms has led to the creation of neuromorphic systems like Intel's Loihi [5], IBM's TrueNorth [6][7][8], University of Manchester's SpiNNaker [9] and HBP's BrainScaleS [10].
Neuromorphic chips, as the name suggests -'like the brain' -can mimic the brain's function in a truer sense as their design is analogous to the brain [11,12].Inspired by its architecture, we work on developing a principled approach towards obtaining simulations of biologically realistic neural network models on a arXiv:2109.10835v1[cs.NE] 22 Sep 2021 novel neuromorphic commercial hardware platform.
Computers today are limited in this respect because of the way they have been built historically and the way they process data leading towards more energy and resource consumption in order to maintain versatility [13,14].Neuromorphic chips on the other hand claim to be faster and more efficient for a set of specialized tasks [15,16].In this study, we try to validate this assertion based on neural models derived from the primary visual cortex (VISp) of the mouse brain, as seen in recent work done on SpiNNaker [17,18].Intel's neuromorphic chip Loihi serves as our neuromorphic platform.Results obtained in Loihi are validated against classical simulations [19][20][21] given by AIBS's software package the Brain Modeling Toolkit (BMTK) [22].Overall, our implementation indicates that Loihi is highly efficient in terms of time and energy in context of large brain network simulations and thus shapes our central motivation for this work (see Figure 1 and Table I).The majority of this manuscript focuses on the trade-offs necessitated by these improvements, that is, how precise are the Loihi simulations when validated against BMTK simulations?Simulation of 500 ms of dynamics for 10,000 neurons, results in a Loihi run-time of up to 109 seconds with maximum energy consumption of 5.7 Watts.(See Table I for the explicit values.) As a first step in this approach, we focus on a class of neural network building blocks: point neuronal models as used in large AIBS simulations.The Generalized Leaky Integrate and Fire Models (GLIFs) [23] have been found to be appropriate for reproducing cellular data under standardized physiological conditions.
The data used for this study is made available by the AIBS.
The paper is organized as follows.In Section 2, we describe in detail the features of Loihi and the differences between the neuromorphic and classical hardware that form the basis for this study.Section 3 explains the implementation of the continuous LIF equation in BMTK on classical computational architecture, versus the discrete Loihi setting.Also, we list the validation methods and the cost function that is used  to draw comparisons between the implementations.In section 4, we list out and explain the various results leading to a qualitative and quantitative assessment between the two platforms based in part on methods from [24].

COMPARISON BETWEEN CLASSICAL AND NEUROMORPHIC PLATFORMS
At present, various simulators are available for implementing spiking neural networks [25].In this section, we lay out the details of the mathematical model and the platforms we use for our work.For the classical simulation, we use the Brain Modeling Toolkit (BMTK) [22] developed by the AIBS.Being open source, these resources enable us to experiment with a varied range of data and thus support our extensive validation of neuronal models in Loihi.Intel's fifth-generation chip Loihi provides us with the tools to implement and test out the various neuromorphic features.The output provided by Loihi simulations is then compared to the output of classical simulations implemented in BMTK.

The Brain Modeling Toolkit (BMTK)
The BMTK is a python-based software package for creating and simulating large-scale neural networks.
It supports models of different resolutions, namely, Biophysical Models, Point Models, Filter Models and Population Models along with the use of the rich data sets of the Allen Cells Database [4].It leverages the modeling file format SONATA which includes details on cell, connectivity and activity properties of a network along with being compatible with the neurophysiology data format Neurodata Without Borders (NWB), thus allowing easy access to a vast repertoire of experimental data.
In this study, we work with the Point Neuron Models with simulations supported by the BMTK module PointNet via NEST 2.11+ [26].For analysis and visualization we use the HDF5 output format, underlying both SONATA and NWB's spike and time series storage.

Loihi
Hardware inspired by the structure and functionality of the brain, envisioned to provide advantages such as low power consumption, high fault tolerance and massive parallelism for the next generation of computers, is called neuromorphic hardware.Towards the end of 2017, Intel Corporation unveiled its experimental neuromorphic chip called Loihi.We provide a summary of the platform here, since, unlike NEST and BMTK, Loihi is not so well-known in the computational neuroscience community.
As of its 2020 rendition, Loihi is a 60-mm 2 chip that implements 131,072 leaky-integrate-and-fire neurons.According to [5], it uses an asynchronous spiking neural network (SNN), comprising of 128 neuromorphic cores, each with 1024 neural computational units; 3 x86 cores; along with several off-chip communication interfaces that provide connectivity to other chips.As Loihi advances the modeling of SNNs in silicon, it comprises of a large number of features necessary for their implementation viz., hierarchical connectivity, dendritic compartments, synaptic delays and synaptic learning rules.Each neuron is represented as a compartment in the Loihi architecture.The top-level microarchitecture of a Loihi neural computational unit resembles an actual biological neuron model comprising of all the functional units.The SYNAPSE unit processes all the incoming spikes from the previous compartment/neuron and captures the synaptic weight from the memory.The DENDRITE unit updates the different state variables.The AXON unit generates the spike message to be carried ahead by the fan out cores.The LEARNING unit updates the synaptic weights based on a learning rule.
The aim of this study is to establish the groundwork required to execute an ambitious plan of simulating about ∼250,000 neurons with ∼500M synapses, which encapsulates much of the experimentally observed dynamics in the mouse visual cortex available to the AIBS, thus providing a close functional replica of the mouse visual cortex.Loihi's specialized hardware features holds promise for a real-time, low-powered version of this implementation.

Leaky Integrate and Fire Model (LIF)
A typical neuron consists of a soma, dendrites and a single axon.Neurons send signals along an axon to a dendrite through junctions called synapses.The classical Leaky Integrate and Fire (LIF) equation [27] is a point neuron model which reduces much of the neural geometry and dynamics in order to achieve computational efficiency.It is one of the simplest and rather efficient widely used representations of the dynamics of the neuron, and is given as: where, V r = reset membrane potential Here, = d/dt, t is time in ms, the membrane potential V (t) of the neuron is in mV.A LIF neuron fires when V (t) > Θ, i.e. the membrane potential exceeds the firing threshold Θ and subsequently the membrane potential is set to a reset value V r .
The classical LIF model (point generalized LIF) has been shown to match closely the dynamics of real neurons under a variety of conditions [23], as listed in the Allen Cell Types Database [4].In addition, this model matches the LIF abstraction in Loihi to some extent.Thus, we work with this model throughout this study to establish the basis for comparison for the two platforms, validate the neuromorphic implementation against the ground truth of a standard implementation, and provide evidence that our neuromorphic platform performs more efficiently.

Loihi LIF Model
In an SNN, spiking neurons form the primary processing elements.The individual neurons are connected through junctions called synapses and interact with each other through single-bit events called spikes.Each spike train can be represented as a list of event times, e.g. as a sum of Dirac delta functions where t i is the time of the i-th spike.
Since Loihi encapsulates the working of an SNN, one of the computational models it implements is a variation of the LIF model based on two internal state variables : the synaptic current and the membrane potential [5]. where, A neuron sends out a spike when its membrane potential exceeds its firing threshold θ , i.e., v(t) > θ .
After a spike occurs, v(t) is reset to 0. As in the classical LIF model, here ˙= d/dt.However, time and membrane potential values here are in arbitrary units.
Loihi follows a fixed-size discrete time-step model, similar to an explicit Euler integration scheme, where the time steps relate to the algorithmic time of the computation.This algorithmic time may differ from the hardware execution time.Moreover, to increase the efficiency of the chip, specific bit-size constraints are imposed on the state variables.We discuss the ones relevant for the LIF model implementation in the following section.

Model setup and integration
The classical LIF model as represented in equation ( 1) and ( 2) can be rewritten as : where τ = RC is membrane time constant of the neuron.
For a non-homogeneous linear differential equation, the solution is given by the 'variation of constants' method as : Comparing equation ( 6) to equation ( 7), we have, Here, the postsynaptic current I e is in the form of an exponent function.However, calculating the above integral at every step i.e. at all grid points t i ≤ t proves to be quite expensive.
BMTK uses NEST as backend to implement the above membrane potential dynamics.To avoid the expensive computations, NEST chooses to use the linear exact integration method [28], given below as follows : Equation ( 6) is rewritten as a multidimensional homogeneous differential equation: where, The solution is given by : y t+h = y(t + h) = e A(t+h) y(0) = e Ah • y t (10) for a fixed time-step h.It saves exorbitant computations since each step involves multiplication only.

Mapping between BMTK and Loihi models
In this section, we illustrate the primary step of implementing the BMTK-NEST LIF integration into the fixed-size discrete time-step Loihi dynamics.Following the linear exact numerics in the NEST implementation, we implement our model in the Loihi discrete setting using the forward Euler method as discussed below.
First, we rewrite equation ( 1), the standard LIF model to resemble the Loihi form as given in equation ( 4).Since Loihi parameters are unit-less, we introduce a re-scaling parameter V s , which converts standard physical units used in BMTK to Loihi units.
As we compare equation ( 2) and equation ( 5), it can be seen that for BMTK the membrane potential reset value is set to V r whereas it is set to zero for Loihi.
Thus, the forward transformation from BMTK to Loihi looks as follows : which produces an inverse transformation, to arrive back at the BMTK values, given by : Substituting the expression in (12) in (1) and isolating v, we get : = − 1 with Here, we reintroduce the LIF threshold Θ and the corresponding Loihi threshold θ in equation (20).
Loihi implements the continuous LIF as a discrete finite state machine model [29,30] implemented in silicon.The actual computation is similar to a forward Euler scheme with some peculiarities reflecting engineering design trade-offs.Specifically, the v(t) state evolves on-chip according to the update rule, where δ v is the membrane decay constant.
Using the forward Euler method : where y n+1 = y(t n+1 ) and t n+1 = t n + dt for a fixed time-step dt, we transform the classical LIF model into a form followed in equation (21).Thus, transforming the LIF model into the discrete form and grouping terms to match the Loihi integration (9) yields the following : where dt is the fixed time-step.
In order to equate the Loihi computation (21) with the Euler scheme (23), we use dt with units ms/Loihi timestep i.e. 1 BMTK millisecond per Loihi timestep that leads to a Loihi voltage decay parameter δ v such that,

Data
The data used here is provided by the Allen Mouse Brain Atlas [4], which is a survey of single cells from the mouse brain, obtained via intracellular electrophysiological recordings done through a highly standardized process.We focus on neurons with different morphologies with available GLIF parameters.The data used can be accessed in the Allen Cell Types Database.Our LIF model is implemented and simulated on BMTK based on this data, and these simulations form the ground truth for validating the Loihi implementations.

Methods and Cost Function
A spike-to-spike equivalence between the simulated spiking activity and the experimental data only allows for a qualitative validation.Since BMTK and Loihi run on two different computing environments, a statistical comparison becomes imperative to quantify the level of similarity between the two implementations.
We compare the simulation dynamics for both implementations based on the following -Raster Plot: We evaluate the membrane potential response at each time-step.The X-axis represents the membrane potential and the Y-axis represents the time-step.Raster plot helps to highlight the difference in the spike dynamics at each step and thus tune the parameters as needed.
Scatter Plot: For examining association between the two implementations, we use color-coded scatter plots identifying the correlation relationships.We add a trend line to illustrate the strength of the relationship and pin down the outliers to improve the simulation results.Since we anticipate an almost perfect linear relationship, we quantify the match with its Pearson correlation coefficient, where, Cost Function: To quantify the error between the BMTK and Loihi membrane potential values, we base our cost function on Root Mean Square Error (RMSE) values as follows :

RESULTS
In order to be able to simulate a network of over 250,000 neurons with a connectivity of over 500M synapses in the neuromorphic hardware, we begin by ensuring an high quality replication of individual neural and smaller network models.The replication performance here is evaluated based on membrane potential and current responses, the two state variables.We conjecture that securing a good replica for smaller models will ensure that parameters can be calibrated correctly and thus can be carried forward for the bigger networks needed in biological context [24,31,32].We begin our work on a single-neuron network sub threshold dynamics driven by both bias current and external spikes to ensure Loihi is able to handle both stimuli efficiently.Our test suite consists of LIF models based on 50 different parameter sets.
We perform rigorous quantitative analysis of our results based on various statistical measures to demonstrate that we have replication of high quality.It is important to restate here that we test our results based on neurons with different morphologies and biophysics, which attribute to the different parameter sets.

Simulations of a Single Neuron
We begin by simulating a single-neuron network in BMTK.The simulation is run for 500 ms.The classical parameters are translated to Loihi values and the corresponding LIF model is implemented as an one-neuron SNN executed for 500 time steps in Loihi.The simulations are driven either by bias current or external spikes.In the Loihi network, neurons are denoted by compartments.The compartment dynamics are guided by the parameters -bias current mantissa, membrane potential threshold, membrane potential decay and current decay.It is worth iterating here that the membrane potential values in Loihi are unitless as opposed to the BMTK values which are assigned units of millivolts (mV).We test the efficacy of our replication, both qualitatively and quantitatively, for all 50 parameters sets and find that the results are consistent with the ones described below.
In Figure 2, we illustrate the implementations achieved through bias current and external spikes on two different parameter sets.
For a qualitative comparison, it can be seen from Figure 2 that Loihi implementations simulate BMTK We perform a quantitative assessment of the replication using several statistical measures.As seen from Table II, the values on the two platforms are highly correlated with a relatively small RMSE.

Simulation Using Varied Precision
As already stated, Loihi follows a fixed-size discrete time-step model along with bit-size constraints for the different parameters.Thus, we investigate how changing the precision of the time scale and the neuron state values affects the accuracy of the simulations.We investigate this property for the two state variables -membrane potential and current.
Figure 4 below illustrates the membrane potential and current responses of a single neuron model in BMTK which form the basis of our comparison for the results below.

Simulation Using Varied Temporal Precision
For Loihi's fixed simulation time-step, we assign different time units to each step and test the corresponding simulation precision.This is achieved through the 'dt' available in our equations while transforming the classical LIF model to Loihi neural model.It enables us to experiment with several time units [33].
Following equation ( 24), the change of a time-step while working with the Loihi neural model necessitates a corresponding variation of the time constant 'τ' to yield the desired results.

Error comparison for temporal precision
We compare the simulations in Loihi with different temporal precisions against the simulations in BMTK.We calculate the RMSE to be able to deduce the result.As can be seen from Figure 6, the error is lowest when 1 ms of simulation time in BMTK equates to 1 time-step in Loihi for membrane potential and current.Thus, for the LIF model simulations, Loihi hardware time is close to the actual timescale of the simulations.FIG.6: Error comparison for different temporal precisions.In both panels, the RMSE for the corresponding state is plotted against the log of the temporal precision dt.

Simulation Using Varied Voltage Precision
We repeat the precision study by changing the voltage precision values using the re-scaling parameter V s .To check different precision results, we try 1K/mV, 10K/mV and 100K/mV (state level/mV) by using V s = 1.0 × 10 −3 , 1.0 × 10 −4 and 1.0 × 10 −5 respectively.Figure 7 illustrates the neuron state simulations based on different voltage precisions.

Error comparison for voltage precision
As can be seen from Figure 8, for membrane potential -error decreases significantly as the precision increases from V s = 1.0 × 10 −3 to V s = 1.0 × 10 −4 .However, the error is extremely small for the current simulation and remains the same for V s = 1.0 × 10 −4 and V s = 1.0 × 10 −5 .
In conclusion, the effect of precision on both scales depends on the model parameters and the information needing to be preserved.However, there are important performance differences.Increased voltage precision is essentially free, as it does not tax the hardware resources any further, and the sole risk is represented (again, proportionately to increased precision).Thus, the choice of simulation time step and corresponding precision should be weighed against these trade offs.

Simulation of Larger Networks
After establishing and verifying the calibrated Loihi parameters, we extend our network to larger number of neurons.Currently, we have successfully implemented a network of ∼10,000 neurons.It is done by increasing the number of cores that are involved in the processing of the network, as each core supports only 1024 neurons.12) is applied).Here, we have a correlation of 0.99985 with an RMSE of 0.24 ×10 −3 mV/ ms.This also validates the fact that the calibration of parameters for smaller networks done earlier is valid.This lays the foundation for building bigger and more complex networks on Loihi.

Comparison of Performance
The performance of Loihi far exceeds that of BMTK.For smaller networks, the time taken to build, compile and execute the networks is approximately similar in both the platforms.However, as the networks get larger, BMTK takes much longer than Loihi to complete the simulations.simulations on a single core on the same node to ensure no variability in terms of system performance.
Evidently, Loihi could prove to be a huge advantage as we aim to undertake the mammoth task of emulating the mouse primary visual cortex.

Conclusion
Inspired by the brain, neuromorphic computing holds great potential in tackling tasks with extremely low power and high efficiency.Many large-scale efforts including the TrueNorth, SpiNNaker and Brain-ScaleS have been demonstrated as a tool for neural simulations, each replete with its own strengths and constraints.Fabricated on Intel's 14nm technology node, Loihi is a forward-looking and continuously evolving state-of-the-art architecture for modeling spiking neural networks in silicon.As opposed to its predecessors, Loihi encompasses a wide range of novel features such as hierarchical connectivity, dendritic compartments, synaptic delays and programming synaptic learning rule.These features, together with solid SDK support by Intel, and a growing research community, make Loihi an effective platform to explore a wealth of neuromorphic features in more detail than before.
In this work, we have demonstrated that Loihi is capable of replicating the continuous dynamics of point neuronal models with high degree of precision and does so with much greater efficiency in terms of time and energy.The work comes with its challenges as simulations built on the conventional chips cannot be trivially mapped to the neuromorphic platform as its architecture differs remarkably from the conventional hardware.Classical simulations from the Brain Modeling Toolkit (BMTK) developed by the Allen Institute of Brain Science (AIBS) serves as the foundation of our neuromorphic validation.
For comparison between the conventional and the neuromorphic platforms, we use both qualitative and quantitative measures.It can be seen that Loihi replicates BMTK very closely in terms of both membrane potential and current, the two state variables on which the Loihi LIF model evolves.We use different validation methods and quantitative measures to assess the equivalence and identify sets of parameters which maximize precision while retaining high performance levels.Furthermore, simulation results indicate Loihi is highly efficient in terms of speed and scalability as compared to BMTK.As indicated by the Figure 10, Loihi is almost a thousand times faster than BMTK for smaller networks and scales markedly well with network size.
In conclusion, this work demonstrates that classical simulations based on Generalized Leaky Integrateand-Fire (GLIF) point neuronal models can be successfully replicated on Loihi with an exceptional degree of precision.Additionally, the high efficiency and low-power consumption of the neuromorphic platform with increasing network size paves the way for a complete replication of the mouse visual cortex dynamics, comprising hundreds of thousands of neurons and millions of synapses.

log 10 (FIG. 1 :
FIG.1:As the network size increases, Loihi performs consistently both in terms of time and energy. membrane potential (state) C = membrane capacitance (parameter) R = membrane resistance (parameter) E L = resting potential (parameter) I e = trans-membrane current (control and state) data point y L = transformed Loihi values y B = original BMTK values n = number of data points Distribution Function: Another approach we take is to compare the distributions of attained state values in the two cases.We use density plot as a representation of those distributions, thus allowing us to compare the two implementations in terms of concentration and spread of the values and provide a basis for comparing the collective dynamics of the implementations.

FIG. 2 :
FIG.2: Membrane potential response for single-neuron network based on two different neuron parameters.The first simulation is driven by bias current and the second one by external spikes.

Figure 3 FIG. 3 :
Figure 3 illustrates the comparison of Loihi implementations against the BMTK implementations for the two different stimuli using various statistical measures -(a) Distribution function approximating the

FIG. 4 :FIG. 5 :
FIG.4: Membrane potential response and current response for a single neuron model in BMTK

Figure 10 compares
Figure 10 compares the time taken by BMTK and Loihi to complete the simulations.We measure the system and user CPU time of each run, excluding the time elapsed in queue or sleep.The irregularities in the BMTK curve can be attributed to the initial loading of the data through 'h5py' files which have an initial large load time but scale well as the network gets larger.Moreover, NEST initializes neurons in batches and memory pre-allocation follows the log 2 scale.Care was taken to run the

TABLE I :
Time Usage in Loihi & BMTK

TABLE II :
Correlation and RMSE between BMTK and Loihi membrane potential values