Continuous Firing

I am interested in traveling waves and oscillations. In the following simulation, neurons continue firing event after the input is ceased, depending on the connectivity rate.

Notebook: Spiking Neural Network Oscillations

Is it expected (i.e. well known phenomenon) or is there an error in my simulation?

Here is the relevant code section:

# Model
num_neurons = 200               # Total number of neurons
duration = 200 * ms             # Total simulation time
input_duration = 100 * ms       # Duration of external input
refractory_period = 10 * ms     # Refractory period duration
threshold_v='v>0.9'             # Firing threshold
reset_v='v=0'   
tau = 10 * ms  # Membrane time constant
eqs = '''
dv/dt = (-v + I) / tau : 1
dI/dt = -I / tau : 1
'''

# Connection probability of the neuron group
p0 = 0.1

# Create neuron group
neurons = NeuronGroup(num_neurons, eqs, threshold=threshold_v, reset=reset_v, refractory=refractory_period)

# Set initial conditions for the neurons
neurons.v = 'rand()'
neurons.I = 0

# Set up connectivity within neuron group
connectivity = np.random.rand(num_neurons, num_neurons) < p0
i, j = np.where(connectivity)
S = Synapses(neurons, neurons, 'w : 1', on_pre='I_post += w')
S.connect(i=i, j=j)
S.w = 'rand()'

# Input connection probability to the neuron group
input_rate = 0.2

# Poisson spiking input neurons
input_neurons = PoissonGroup(num_neurons, rates=10 * Hz)
input_syn = Synapses(input_neurons, neurons, 'w : 1', on_pre='I_post += w')
input_syn.connect(p=input_rate)
input_syn.w = 'rand()'

# Network object
net = Network(neurons, S, input_neurons, input_syn)

# Record spikes
spike_mon = SpikeMonitor(neurons)
spike_mon_input = SpikeMonitor(input_neurons)
net.add(spike_mon)
net.add(spike_mon_input)

# Run simulation with external input
net.run(input_duration)

# Cease external input
input_neurons.rates = 0 * Hz  # Set input rates to zero

# Continue simulation without external input
net.run(duration - input_duration)

Hi @ersinesen . I would indeed say this is expected. But actually your model does not need any input to show sustained firing, if you remove it (or set rates or input connectivity to 0 from the start), neurons will still fire. The reason is that your connectivity within the neuron group is strong. With the random initialization, roughly 10% of the neurons will fire. An average neuron receives 200*0.1 = 20 inputs, so it will receive some spikes that are very likely to make it spike since the average weight is 0.5, and the threshold is at 1. This kind of network would usually be considered “pathological”, since all neurons fire as fast as they can, only limited by their refractory period.
If your network is randomly connected and has only excitatory neurons (and for this type of neuron/synapse model), then there are only two behaviours it can exhibit: either activity is self-sustained in a “pathological” way (strong connections; everything firing as fast as it can even without input), or it is completely driven by the input (weak connections; i.e. it will stop firing as soon as the input stops). For more interesting behaviours you need either inhibitory connections (e.g. you can get “real” oscillations, not just those due to the refractory period), or structured connectivity (this can give you spatial phenomena like travelling waves).
Hope that helps a bit!

I only now had a look at your notebook and saw that you actually tried out a few more things – but from a cursory look, most of the simulations still seem to have the issue that I pointed out above. For a more formal treatment and parameters that give you different behaviour, make sure to have a look at the classic papers by Brunel (if you haven’t already), e.g.

Brunel, Nicolas. “Dynamics of Sparsely Connected Networks of Excitatory and Inhibitory Spiking Neurons.” Journal of Computational Neuroscience 8, no. 3 (2000): 183–208. Dynamics of Sparsely Connected Networks of Excitatory and Inhibitory Spiking Neurons | Journal of Computational Neuroscience

Many thanks. As you pointed, it seems it is a consequence of connection density.

Just to clearify:

  • When inputs are disconnected (input_rate = 0), no firing occurs.
  • Initial neuron voltage does not effect the result. When I make it zero ( neurons.v = 0) result does not change.

It seems there is a phase transition between sparse and dense connectivity. For fixed input connection (input_rate=0.1), there is a phase change between p0=0.02 and 0.1. In the sparse case, there is no periodic firing and after input is ceased the firing gradually diminishes. In the latter case, firing occurs periodically and continues even after the input. It seems there is no discharge mechanism beyond a certain connectivity rate, because there are always enough number of ingress neurons that fired.

p0 = 0.02

Screen Shot 2024-02-27 at 22.56.15

p0=0.1

Screen Shot 2024-02-27 at 22.56.43

I still don’t think this is the case, the input shouldn’t matter (there only needs to be some kind of input and/or neurons that fire due to their initial condition at some point). If I take your code from above and change the line to input_rate = 0.0 (maybe a bit confusingly named, since it doesn’t set the rate but the number of connections), I get this:

See above, if you have input it does not matter, but without input you need it to kick off the activity.

There is definitely a phase transition, as I mentioned in my previous comment: either the network is dependent on external input for firing, or it stimulates itself strongly enough to go into the pathological firing mode with oscillations determined by the refractory period.