A Simple Algorithm for Averaging Spike Trains

Hannah Julienne, Conor HoughtonThe Journal of Mathematical Neuroscience 2013 · DOI

Abstract

Although spike trains are the principal channel of communication between neurons, a single stimulus will elicit different spike trains from trial to trial. This variability can obscure the temporal structure of neural responses and often necessitates running computations on numerous trials to extract common features. This increases computational burden and can obscure analytical results. We describe a simple method for finding a "central" spike train that summarizes a set of trials. The spike trains are first mapped to functions, these functions are averaged, and a greedy algorithm is used to map the average function back to a spike train. Tested on a large dataset, these central spike trains significantly outperform traditional medoid spike trains in classification tasks.

Introduction

Neurons communicate via sequences of action potentials known as spike trains. A major challenge in neuroscience is that these responses are highly stochastic: even when presented with the exact same stimulus, a neuron will produce different spike timings and counts across multiple trials.

To understand the underlying message a neuron is sending, researchers often need to summarize these trials. For continuous signals, such as EEG or local field potentials, one can simply take the arithmetic mean. However, spike trains are discrete point processes; you cannot simply "average" two spikes occurring at different times. Traditionally, researchers have used the medoid—the single trial from the dataset that is "closest" to all others based on a distance metric. However, the medoid is often a poor representative of the population center. We propose a method to synthesize a new, "central" spike train that better captures the underlying signal.

Methodology: From Discrete Spikes to Continuous Functions

The proposed algorithm follows a three-step process to move from a collection of variable spike trains to a single representative exemplar.

Schematic of the central spike train algorithm. (A) Original trial spike trains are (a) filtered into (B) continuous functions. These are (b) averaged to create (C) a target function. A (d) greedy matching pursuit then generates (E) a central spike train whose (D) filtered function (c) closely matches the target.
  1. Filtering (Mapping to Function Space): Each trial's spike train is converted into a continuous real-valued function by convolving it with a causal exponential kernel. This moves the problem from the discrete domain of spike times into a Hilbert space of functions where linear operations like averaging are well-defined.
  2. Averaging: In this function space, calculating a mean is straightforward. We compute the arithmetic average of all the filtered functions derived from the individual trials.
  3. The Greedy "Pre-image" Search: The final step is mapping this average function back into a valid spike train (a list of discrete times). Since finding the exact global optimum is computationally difficult, we employ a greedy algorithm (a type of matching pursuit). Spikes are added one by one; at each step, the algorithm chooses the timing that most reduces the squared error between the new spike train’s filtered function and the target average function. The process terminates when the central spike train reaches the average number of spikes found in the original trials.

Experimental Validation

The algorithm was validated using a large, publicly available dataset from the Frederic Theunissen laboratory at UC Berkeley. This dataset consists of extracellular recordings from 183 auditory neurons in anesthetized zebra finches, with each cell responding to 20 different zebra finch songs (10 trials per song).

The performance of the central spike train was compared against the "medoid" response and the "function average" itself using a classification-based test. We measured how well the central spike train could act as a template to identify which song a new, unseen trial belonged to.

Key Results and Performance

The synthesized central spike train proved to be a mathematically superior "average" compared to the medoid. On average, the summed distance from the central spike train to the trials was significantly lower than the distance from the medoid to the trials.

Distribution of classification performance (normalized transmitted information $\tilde{h}$) across cells. (a) Performance using medoid spike trains as templates. (b) Performance using the synthesized central spike trains. The shift to the right indicates a significant improvement in template quality.

As shown in the figure above, the central spike train achieved a much higher normalized transmitted information score ($\tilde{h}$) than the medoid. Specifically, the mean score improved from 0.41 (medoid) to 0.60 (central). Surprisingly, the central spike train even performed better at classification than using the weighted average distance to all trials in a cluster ($\tilde{h} = 0.56$).

Discussion

Insights into Neural Noise

A key insight from this work is that the medoid is often an outlier in high-dimensional spike train space. By synthesizing a center, we achieve significant noise reduction. The resulting central spike train is more "regular" than biological trials; while the mean inter-spike interval (ISI) matches the data, the standard deviation of the ISIs is lower. This suggests the algorithm effectively filters out the temporal jitter (noise) inherent in individual biological trials.

Limitations and Future Directions

The algorithm's performance is dependent on the choice of the timescale parameter ($\tau$) for the exponential kernel, which typically requires optimization. Furthermore, because the central train is more regular than real neural responses, it may not capture certain higher-order statistical properties, such as bursting patterns, that could be biologically relevant.

Future work could explore the use of different kernels, such as Gaussian filters, although the computational efficiency of the causal exponential kernel is a significant advantage. Additionally, this method could be extended to average across different neurons in a population rather than just different trials of the same neuron, potentially offering new ways to study population coding.

Conclusion

We have presented a simple and efficient algorithm for calculating a central spike train. By leveraging the properties of Hilbert spaces and a greedy search strategy, we can produce representative summaries of neural activity that are more robust and informative than traditional medoid-based approaches.

Summary updated

Abstract

Although spike trains are the principal channel of communication between neurons, a single stimulus will elicit different spike trains from trial to trial. This variability, in both spike timings and spike number can obscure the temporal structure of spike trains and often means that computations need to be run on numerous spike trains in order to extract features common across all the responses to a particular stimulus. This can increase the computational burden and obscure analytical results. As a consequence, it is useful to consider how to calculate a central spike train that summarizes a set of trials. Indeed, averaging responses over trials is routine for other signal types. Here, a simple method for finding a central spike train is described. The spike trains are first mapped to functions, these functions are averaged, and a greedy algorithm is then used to map the average function back to a spike train. The central spike trains are tested for a large data set. Their performance on a classification-based test is considerably better than the performance of the medoid spike trains.
BibTeX
@article{julienne2013simple,
  author = {Hannah Julienne and Conor Houghton},
  title = {{A Simple Algorithm for Averaging Spike Trains}},
  journal = {The Journal of Mathematical Neuroscience},
  year = {2013},
  doi = {10.1186/2190-8567-3-3},
}
Figure