Skip to main content
QUICK REVIEW

[Paper Review] Trial matching: capturing variability with data-constrained spiking neural networks

Christos Sourmpis, Carl C.H. Petersen|arXiv (Cornell University)|Jun 6, 2023
Neural dynamics and brain functionNeuroscience3 citations
TL;DR

This paper introduces a data-constrained recurrent spiking neural network (RSNN) that captures trial-to-trial variability in neural and behavioral data using optimal transport-based trial matching. By jointly optimizing spiking activity and jaw movement predictions across 28 sessions from six cortical areas, the model generates realistic, interpretable variability modes—including task-irrelevant movements—without assuming low-dimensional latent structures a priori.

ABSTRACT

Simultaneous behavioral and electrophysiological recordings call for new methods to reveal the interactions between neural activity and behavior. A milestone would be an interpretable model of the co-variability of spiking activity and behavior across trials. Here, we model a mouse cortical sensory-motor pathway in a tactile detection task reported by licking with a large recurrent spiking neural network (RSNN), fitted to the recordings via gradient-based optimization. We focus specifically on the difficulty to match the trial-to-trial variability in the data. Our solution relies on optimal transport to define a distance between the distributions of generated and recorded trials. The technique is applied to artificial data and neural recordings covering six cortical areas. We find that the resulting RSNN can generate realistic cortical activity and predict jaw movements across the main modes of trial-to-trial variability. Our analysis also identifies an unexpected mode of variability in the data corresponding to task-irrelevant movements of the mouse.

Motivation & Objective

  • To develop a biologically interpretable, large-scale RSNN that simulates cortical sensory-motor pathways with millisecond precision.
  • To address the challenge of matching trial-to-trial variability in neural spiking activity and behavior across multiple recording sessions.
  • To avoid prior assumptions about low-dimensional latent dynamics by allowing the network to learn structured variability from unstructured noise.
  • To enable joint modeling of neural activity and behavior using gradient-based optimization on multi-session data.
  • To identify the circuit mechanisms underlying variability, including task-irrelevant movements, through a hypothesis-free approach.

Proposed method

  • The model uses a large recurrent spiking neural network (RSNN) with biologically constrained dynamics: leaky integrate-and-fire neurons, 2–4 ms synaptic delays, and excitatory/inhibitory types.
  • The network is trained via gradient-based optimization using a novel trial matching loss function based on optimal transport to match the empirical distribution of neural activity and jaw movements across trials.
  • The trial matching loss computes the distance between generated and recorded trial distributions using optimal assignment and statistics (e.g., mean, variance) of spike trains and movements.
  • The method enables end-to-end training on multi-session data (28 sessions, six cortical areas) without requiring trial-specific latent variables or prior assumptions on low-dimensional dynamics.
  • The model incorporates unstructured noise (Gaussian inputs and stochastic spikes) as input, allowing the network to transform it into structured, realistic trial-to-trial variability.
  • Alternative loss functions—likelihood-based and GAN-based—were evaluated, but trial matching proved more robust and numerically stable without requiring discriminator tuning.
Figure 1: Modeling trial-variability in electrophysiological recordings. A . During a delayed whisker detection task, the mouse should report the sensation of a whisker stimulation by licking to obtain a water reward. Neural activity and behavior of the mouse are recorded simultaneously. B . A recur
Figure 1: Modeling trial-variability in electrophysiological recordings. A . During a delayed whisker detection task, the mouse should report the sensation of a whisker stimulation by licking to obtain a water reward. Neural activity and behavior of the mouse are recorded simultaneously. B . A recur

Experimental results

Research questions

  • RQ1Can a data-constrained RSNN generate realistic trial-to-trial variability in neural activity and behavior across multiple recording sessions?
  • RQ2Does the model recover interpretable circuit mechanisms that explain variability without assuming low-dimensional latent variables?
  • RQ3What role do unstructured noise sources play in generating structured variability in neural and behavioral outputs?
  • RQ4How does the trial matching loss based on optimal transport compare to likelihood-based or GAN-based alternatives in fitting multi-session RSNNs?
  • RQ5Can the model identify task-irrelevant behavioral variability, such as spontaneous movements, as a distinct mode of variability?

Key findings

  • The RSNN successfully captures the main modes of trial-to-trial variability in neural activity and jaw movements across 28 sessions from six cortical areas.
  • The model generates realistic spiking patterns and predicts jaw movements with high fidelity, even in miss trials, without prior assumptions on latent structure.
  • An unexpected mode of variability was identified: task-irrelevant movements of the mouse, which the model successfully reproduced as part of the trial distribution.
  • The trial matching loss based on optimal transport outperformed likelihood-based and GAN-based alternatives in stability and performance, especially in multi-session settings.
  • Adding a low-dimensional latent input (e.g., 5D Gaussian noise) accelerated optimization but did not improve final performance, suggesting that the network alone can generate realistic variability.
  • The UMAP visualization revealed a low-dimensional manifold in the trial distribution, indicating that structured variability emerges naturally from the network dynamics, even without explicit architectural constraints.
Figure 2: Artificial Dataset. A . Session stitching: every neuron from the recordings is uniquely mapped to a neuron from our model. For example, an excitatory neuron from our model that belongs in the putative A1 is mapped to an excitatory neuron “recorded” in A1. In our network, we constrain the c
Figure 2: Artificial Dataset. A . Session stitching: every neuron from the recordings is uniquely mapped to a neuron from our model. For example, an excitatory neuron from our model that belongs in the putative A1 is mapped to an excitatory neuron “recorded” in A1. In our network, we constrain the c

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.