Modelling Spontaneous Firing Activity of the Motor Cortex in a Spiking Neural Network with Random and Local Connectivity

Computational models of cortical activity can provide in-sight into the mechanisms of higher-order processing in the human brain including planning, perception and the control of movement. Activity in the cortex is ongoing even in the absence of sensory input or discernible movements and is thought to be linked to the topology of the underlying cortical circuitry [1]. However, the connectivity and its functional role in the generation of spatio-temporal firing patterns and cortical computations are still unknown. Movement of the body is a key function of the brain, with the motor cortex the main cortical area implicated in the generation of movement. We built a spiking neural network model of the motor cortex which incorporates a laminar structure and circuitry based on a previous cortical model by Potjans and Diesmann [2]. A local connectivity scheme was implemented to introduce more physiological plausibility to the cortex model, and the effect on the rates, distributions and irregularity of neuronal firing was compared to the original random connectivity method and experimental data. Local connectivity increased the distribution of and overall rate of neuronal firing. It also resulted in the irregularity of firing being more similar to those observed in experimental measurements, and a reduction in the variability in power spectrum measures. The larger variability in dynamical behaviour of the local connectivity model suggests that the topological structure of the connections in neuronal population plays a significant role in firing patterns during spontaneous activity. This model took steps towards replicating the macroscopic network of the motor cortex, replicating realistic spatiotemporal firing to shed light on information coding in the cortex. Large scale computational models such as this one can capture how structure and function relate to observable neuronal firing behaviour, and investigates the underlying computational mechanisms of the brain.

input layers, and layers 2/3 and 5 as output layers, was based originally on Hubel and Wiesel [31]'s work on the cat visual cortex and a similar pattern observed in other cortical areas in primate studies including the auditory cortex, somatosensory cortex and motor cortex [29,32,33,30]. Binzegger et al. [34] quantified connectivity of the cortical circuit through in vivo intracellular recordings and morphometry of cell types and laminar distribution. This and other photostimulation and optogenetic studies of the mouse motor cortex have shown a dominant connection of layer 2/3 neurons to layer 5 neurons [35,36,37].
Experiments involving in vivo extracellular injections of neuronal tracers in the cortex observe 'patchy' projections, in which synapses are highly localised [33] (also see Voges et al. [38] for review). Recent photostimulation experiments and digital image reconstruction suggest a distance-based connectivity model with strong connectivity within 0.2 mm of the soma and connectivity decreasing as a function of distance [39,40]. Diffusion tensor imaging also shows smallworld, patchy connections in the cortex and greater local connectivity than "random" connections [41]. Localised connections are also thought to be optimal in regards to minimising wiring but maximising connectivity between nodes in a network. Local connections with some long range connections may be an efficient method of information transfer in the brain [38]. Structural variations in network topology influence the spatio-temporal activity of the cortex, with changes in connectivity patterns resulting in different dynamics [42].
Large-scale neural network models can be used to explore how network structure influences the generation of cortical activity. Voges et al. [38] modelled the horizontal connectivity in the neocortex and showed complex activity patterns arise in structured, spatially clustered synapses. There recently has also been the development of larger-scale cortical models which contain tens of thousands of spiking neuron models [43,2]. However, previous models of the motor cortex have been limited in replicating physiological detail and mainly been focused on generating movement dynamics or responses to stimulation [44,45,43,46]. The role of network connectivity in generating spontaneous cortical activity in physiologically-based spiking neural network models has not been explored.
Computational models can aid in the understanding of the electrophysiological mechanisms which underlie the generation of spontaneous activity. In this study, a large-scale spiking neural network containing over 38,000 neurons and 150 million synapses, based on previous modelling work by Potjans and Diesmann [2], was implemented in the Python-based neural network simulator, Brian2 [47]. The model was developed to replicate the spontaneous firing behaviour of the motor cortex and explore the effect of local connectivity on the network behaviour. The aim of this work was to provide insights into resting state motor cortex dynamics using a spiking neural network model and investigate connectivity as a potential source of variability and efficient information transmission in spontaneous firing behaviour.

| METHODS
This model was based on previous work by Potjans and Diesmann [2] and implemented in Brian2 with reference to source code from Shimoura et al. [48]. The original cortical circuit model was adapted to represent a 1 mm 2 surface area of the motor cortex. The model follows a laminar structure, grouping the neurons into four layers, 2/3, 4, 5, and 6. Each layer was further divided into excitatory and inhibitory cell groups. Layer 1 was ignored due to its low density of neuronal cell bodies [49]. Connection weights in the circuit are shown in figure 1 below.
Individual neuron dynamics were governed by leaky-integrate-and-fire equations simulated using the linear state updater with a time step of 0.1 ms. Equation 1 describes the membrane potential (V ) of each neuron, where τ m is the time constant, C m is the membrane capacitance, V r is the reset value for the membrane potential following a spike and I s y n is the total input current described by equation 2. Action potentials were fired whenever V (t ) became more F I G U R E 1 Circuit diagram of the motor cortex model showing connections between the populations of excitatory (E) and inhibitory (I) neuron groups. Groups are organised according to their layer. The colour of the lines indicates the source group. Thickness represents the relative number of connections and weighting of synapses.
positive than the threshold (θ). On the firing of a presynaptic neuron, the synaptic current of the postsynaptic neuron (I post s y n ) was changed by the value determined by the conductance (g ) multiplied by the weight (w ) after a delay (d ) which accounts for the finite time interval of an action potential propagation in a presynaptic neuron (equation 3). The delay between the spiking activity of a presynaptic neuron and postsynaptic neuron was drawn from a normal distribution with a mean of 1.5 ms for excitatory neurons and 0.8 ms for inhibitory neurons; the standard deviation of delay times was half of the mean value. A shorter inhibitory delay was used in the model as inhibitory neurons generally make more local connections over smaller distances [50,51,52,53,54]. In unmyelinated axons, each millimetre could introduce a conduction delay of at least 2 ms [55]. Cortical neurons exhibit a range of myelination, though inhibitory interneurons also show more myelination, thus also potentially increasing conduction speed [56]. Our model only incorporated 1 mm of cortical area and so delays were defined as less than 2 ms with shorter delays for inhibitory neurons, and were also independent of layer as in Potjans and Diesmann [2]. Following a spike being fired, the membrane voltage was reset to -65 mV. The refractory period of the neuron was 2 ms meaning another spike could not be fired within that period of time following a previous spike. As in the original Potjans and Diesmann [2] model, the conductance value in the layer 4E to layer 2/3E connection was doubled compared to the other excitatory connections. Parameter descriptions and values are given in table 1.
dI s y n d t = − I s y n τ s y n TA B L E 1 Parameters for neuron model. Taken from Potjans and Diesmann [2].   [57]. Previously, the motor cortex has thought to lack a distinct layer 4 but recent studies support a functional, albeit small, layer 4 in the motor cortex with similar connections to layer 4 in the somatosensory cortex, notably as an input pathway from the thalamus [58,59]. The superficial layers of 2/3 and 4 contain approximately 40% of the neurons, layer 5 has 35% of the neurons and layer 6 has 25% of the neurons, which is similar to reported physiological experimental data [60]. The E/I ratio in this model is on average 24%. With inhibitory neurons making up 28.2% 24.8%, 22.4%, 20.5% for layers 2/3, 4, 5 and 6, respectively. The proportion of GABA cells in motor area has been reported as 24.2% with slightly lower percentage of GABA in deeper layers [61]. A sensitivity analysis was carried out to investigate the effect of the total number of neurons in the network, to select a minimal number of neurons at which the rate and irregularity of firing TA B L E 3 Connectivity probability values (C a ) used in equation (4) to determine the number of synapses (K) between each group.

Source Group
Target Potjans and Diesmann [2] original connectivity map integrated the findings of multiple anatomical and electrophysiological studies to estimate the probabilities of connection and number of synapses formed between each neuron group. Combining these data from different species and areas, including rat visual and somatosensory areas and cat visual striate cortex, builds on the theoretical framework suggesting an equivalency across cortical areas. Comparative studies of primary motor cortex also show functional preservation across mammals [62]. The connectivity profile was based on a modified version of Peter's rule which proposes that the number of synapses is dependent on the number of neurons collocated in the presynaptic and postsynaptic layers and a probability value of connection between layers, derived from experimental data [63,64,34,65].
Based on Peter's rule and probabilities derived from anatomical and physiological studies, the number of connections (K ) was calculated for neuron groups using equation 4 (Equation 3 in Shimoura et al. [48]) where C a is the connection probability defined in table 3, and N pr e and N post are the sizes of the presynaptic and postsynaptic populations, respectively. The C a values in the connectivity matrix (Table 3) describing the probabilities of connections between groups were adapted from the original Potjans and Diesmann [2] study in this motor cortex model based on changes to the number of neurons in each layer, while maintaining the average relative number of connections in each neuron target group as the original model. The resulting connectivity was similar to experimental investigations of layer specific wiring in the motor cortex [35], notably the dominant layer 2/3 to layer 5 connection pathway ( Figure 2).
The original Potjans and Diesmann [2] cortical model implemented a random connectivity scheme. This was reimplemented and adapted here to model the motor cortex, as described above, and a new local connectivity scheme was developed. In the random and local connectivity schemes, the total number of synapses in both models was kept constant for fair comparison. Neurons were given spatial parameters (X, Y, and Z coordinates) to be distributed  5). This connectivity is compatible with the synapse definition of the original random model described earlier but the added spatial description of neurons allowed constraining the synapses to a localised connectivity. The spatial connectivity description was also adapted from previous cortical modelling work [66,67,43]. Intralaminar connectivity had a greater radius of connectivity than interlaminar connectivity and inhibitory connections had a lower connectivity radius than excitatory connections as supported by physiological data [39,68,54,69]. The radius value for different connection types is given in table 4.
Multiple connections could be established between two neurons in both the random and local connectivity schemes and self connections in the local connectivity model were not allowed. Figure 3 shows the postsynaptic connections of a single neuron (red) on the random connectivity model and the connectivity of a single neuron in the distance based connectivity model. [ 48], but due to the inconsistency in the spiking behaviour in the first 50 ms, this settling period was excluded for the analyses carried out in this study.

| RESULTS
The motor cortex receives connections from multiple brain regions such as the thalamus, premotor cortex and so-  [57,70]. Figure 5 shows the firing rates and CVs in the network over a range of 0-80,000 neurons for both random and local connectivity, with standard deviation measures over ten simulations.
The firing rates and CVs were more stable in the local connectivity model at lower number of neurons. In both models, layer 6E neuron CVs were not able to be calculated or were highly variable, probably due to very low firing rates in the neuron group, and were thus excluded from the figures.
The firing rates of the model were within an appropriate range of baseline physiological recordings of a number of studies, with lower firing rates in layer 2/3 and layer 6 of the model than layer 5 [71]. Beloozerova et al. [72] presented microelectrode measurements of the motor cortex in awake rabbits, with mean discharge rates of 0.  the middle-deep layers, notably in 5E which is the dominant neuron group. Firing frequencies were also observed to be higher in inhibitory neuron groups. Table 5 reports the mean values and standard distributions of firing rates and irregularity (CV) in the random connectivity model and local connectivity model.
The activity of neurons in the model showed a different pattern of activity in the local connectivity model compared to the random connectivity. Figure 6 shows a raster plot of 10% of the neurons in the model and a plot of the frequencies across the neuron groups. Firing rates of the neuron groups generally remained < 100 Hz but the random connectivity model showed a greater tendency for sudden high frequency firing activity across the network. This synchrony of firing activity could be neuronal avalanches, bursts of firing, which are a noted feature of brain dynamics and indicator of scale-free critical dynamics in complex systems [77].
The range of firing rates in recorded neurons also varies with long-tailed distributions of firing rates [17]. The range of firing is reported to be 0-40 Hz in measurements of awake mice and cats [78,79], while recordings in monkeys ranged from 0-100 Hz [4]. The firing rates of the model also showed long tailed distributions (Figure 7), with longer tailed distributions, closer to physiological data, in the local connectivity model.

| DISCUSSION
This study builds on previous cortical modelling work, and investigates the effects of a physiologically-realistic, spatially defined local connectivity scheme on neuron activity, while focusing on replicating the spontaneous firing in the motor cortex. We replicated spontaneous firing behaviour in regards to neuron firing rates, irregularity, and power spectrum peaks, as recorded by previous experimental data. Local and random connectivity was compared in the model to provide insight to the topological network properties that influence population-based firing behaviour. Local connectivity showed qualitatively different temporal patterns of firing and more realistic irregularity (CV). It also resulted in a wider tailed distribution of firing and a narrower standard deviation in the power spectrum.
Spontaneous activity in the cortex has been characterised by low firing rates and asynchronous activity. The model with random connectivity replicated previously measured values with lower firing rates in layers 2/3 and 6 and higher firing rates in layer 5. The increase in firing rates in the local connectivity model may be due to more coordinated inputs within a local cluster resulting in a greater likelihood to reach threshold. This could be broadly explained by the theory of neurons as coincidence detectors, which states that information is encoded and propagated by the timing of action potentials [21,83,84,85]. Though local connectivity increased the firing rates of the network, similar proportions of firing rate values between layers were maintained, which suggests additional tuning of input or overall connectivity density might resolve the differences in absolute firing rate and be able to reduce firing to match experimental results.
The local connectivity model replicated experimentally derived CV values in the deeper layers of 5 and 6, with similar CV values to the random connectivity model in the superficial layers 2/3 and 4. As such, the topological structure played a key role in the variability of firing activity. The local connectivity model also exhibited a lower standard deviation in the power spectrum, compared to the random connectivity model. The narrower range in the power spectrum suggests a more reliable occurrence of beta wave frequencies that are consistently observed in EEG recordings. The more realistic, local connectivity model could therefore be a topological pattern in the cortex which contributes to the occurrence of the beta wave.
Compared to the random connectivity model, the local connectivity scheme showed more sensitivity and instability in response to input activity. Within the range of changes in the input, the local connectivity model covered a larger range of frequencies in the firing behaviour of the network. The greater sensitivity to input could be a key factor in the highly variable activity in the cortex which might be necessary for phase transitions or changes in state, a notion described by criticality [86,77,87,88]. This critical state is hypothesised to be functionally beneficial for efficient information transmission in the cortex [89]. In the motor cortex, being in the critical state may play a role in the generation of a wide range of voluntary muscle movements.
The E/I ratio is critical in determining the model dynamics and emergent behaviour [90,91]. The balance of E/I activity is linked to scale-free dynamics and operating near a critical point of activity, which does not extinguish or explode into seizure [92,89]. The overall level of excitation and inhibition, as well as the detailed dynamics of excitatory and inhibitory synaptic conductance, has a large effect on circuit activity. Our model contained 24% excitatory neurons, with post-synaptic conductance of inhibitory connections modelled with a conductivity 4 times stronger than excitatory connections, resulting in a stable E/I balance. However, this E/I ratio could be an area of further exploration as recently a study by Bakken et al. [62] looked at rat, marmoset and human cell types and found a proportion of GABAergic neurons as 16% in mouse primary motor cortex, 23% in marmosets and 33% in human primary motor cortex.
The random connectivity model has been used in previous studies of cortical dynamics [93,94] [97,98]. However, to further investigate the spatio-temporal activity of the cortex, particularly with longer range connections, across a cortical network a larger spatial surface area is still needed and this will require increased computing power.
Whether the connection of neurons in the cortex are specific or random has not yet been fully resolved, though recent studies have suggested that neuron morphology and patterns of recorded activity support a notion of specific connections [99,100]. Axons do not simply connect to neurons based on spatially overlapped locations but selectively target specific neuron types or groups, for example in layer-specific connectivity patterns [99,101]. There also appears to be both local and long-range connections in the cortex which is suggested to be efficient in regards to wiring cost and information transfer [38,98]. However, the function of this columnar organisation remains unclear and there is still no agreed upon function or definition [104,105,103]. In the motor cortex, recordings of neurons show directional tuning during upper limb movements with activity [106]. Multi-unit recordings also support functional clusters which exhibit directional tuning, with widths of the tuning field reported in the range of 50-250 µm in diameter [107,108,109]. Individual neurons can make connections outside of columns, with horizontal connections spanning up to 1.5 mm [68]. Although this model only represented 1 mm 2 of cortical surface area, future development could explore an area representation with and without an added constraint to model cortical columns. The topographic structure of the motor cortex and its relation to muscle movement parameters is still undefined and with this model, we can begin to explore these intricate connections in the motor cortex.
The effect of neuron types on cortical dynamics might also be an interesting area for future investigation using this model. Spontaneous activity may physiologically reflect a wider range of neuron types or synaptic dynamics, such as bursting or faster and slower transients, than the simplified excitatory and inhibitory neurons captured in this model [11,110,111,112,13]. The diversity of inhibitory interneurons also plays a significant role in the modulation of cortical dynamics, though there still currently lacks a clear consensus on the classification of neurons [113,50]. Though our model incorporated a simplified model of neuron dynamics and input, we showed that more realistic patterns of spontaneous activity can be replicated in a cortical circuit with local connectivity. Incorporation of different cell types would certainly have dynamical consequences at the network level.
Our approach increases the biological plausibility of previous cortical modelling work and contrasts with previous models of the motor cortex which have used continuous-value recurrent neural networks [114,115]. We recognise that we have not considered other properties such as neuron types, dendritic processing and synaptic plasticity that are likely to play a role in firing dynamics. Biological learning paradigms such as reinforcement learning with spiketiming dependent plasticity (STDP) have previously been incorporated in spiking neuronal models of motor control, though not specifically replicating motor cortex activity [116]. Concurrently, experimental data will also be vital for continued model development and validation, a synergy of computational and experimental techniques will be required to elucidate the complex connectivity of cortical circuits and how it contributes to the generation of dynamic activity.
This work is the beginning of a larger scale exploration of neural control in the motor system with scope to extend the model. The proposed model could be incorporated into feedforward and feedback circuits in the neuromusculoskeletal system involving the spinal cord and alpha-motoneuron pools. Motor-unit and muscle recruitment might be task-specific [117], however, the role of the motor cortex in executing movement commands has not yet fully been elucidated. Our model could be used to explore the generation of muscle activity [118]. The model could also fit into a thalamocortical circuit framework to explore mechanisms of movement generation [119]. Dynamical motifs in the activity could be further explored through dynamical systems frameworks, incorporating dimensionality reduction techniques to look at patterns of 'trajectories' in neural population activity which may be task-specific [6,120].
In summary, the implementation of a local connectivity scheme in a spiking neural network model has shown that the topology of the network plays a critical role in the resulting cortical dynamics. Our results support theories of structured cortical circuitry and local, patchy connectivity in the generation of spontaneous activity patterns in the motor cortex. Random networks appear to be more regular or synchronous in their behaviour, while the local connectivity model showed more realistic irregularity, particularly in the large pyramidal, output neurons of layer 5.
Our model builds on previous work incorporating local connectivity in a more complex laminar structure and cortical circuit, and reproduces firing patterns comparable to those measured in vivo in the motor cortex. The output from our model indicates the importance of including physiologically-based local network topology, which resulted in an increased range and irregularity in firing as well as a slight regularisation in the power spectrum, compared to a random network.

| CONCLUSION
In developing this model, we have aimed to build on previous modelling work and keep parameters as physiologically realistic as possible to replicate the spontaneous firing activity in the motor cortex. To our knowledge, this is the first physiologically based spiking neural-network model to explore the effects of 3D spatially realistic connectivity on spontaneous neuron firing activity in the motor cortex. The pattern of connectivity is shown to play an important role in the generation of irregular firing dynamics and long-tailed firing distributions of cortical neurons, which could have an impact on criticality and information transmission. With the implementation of local connectivity in a structured cortical circuit, this model links neuroscientific theories of structure to functional network dynamics.

Code availability & License
Code and data available at https://github.com/MunozatABI/MotorCortex. This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.