A flow-based latent state generative model of neural population responses to natural images

Mohammad Bashiri, Edgar Y. Walker, Konstantin-Klemens Lurz, Akshay Kumar Jagadish, Taliah Muhammad, Zhiwei Ding, Zhuokun Ding, Andreas S. Tolias, Fabian H. Sinz

Overview

Predicting how sensory neurons respond to stimuli like natural images—a process known as "system identification"—is a central challenge in neuroscience. A major hurdle is that neurons are notoriously "noisy." Even when presented with the exact same image twice, a neuron's response will differ. This variability stems from two main sources:

  1. Stimulus-driven activity: The predictable response triggered directly by the image.
  2. Stimulus-conditioned variability: Shared fluctuations caused by internal brain states, such as attention, arousal, or "noise correlations."

Historically, models have struggled to capture both simultaneously. Deep Neural Networks (DNNs) excel at predicting average stimulus-driven responses but typically assume neurons act independently, ignoring shared correlations. Conversely, latent state models capture these correlations well but often require repeated presentations of the same stimulus, failing to generalize to novel images.

To bridge this gap, researchers have developed ZIFFA (Zero-Inflated Flow-based Factor Analysis), a joint generative model that simultaneously predicts image-driven neural responses and shared internal fluctuations.

Architecture and Methods

The authors introduce FlowFA (Flow-based Factor Analysis) and its specialized extension for calcium imaging, ZIFFA. The architecture integrates deep learning with probabilistic modeling through several primary components:

Schematic of the Flow-based Factor Analysis model, illustrating the stimulus model, latent model, and flow transform.
  • The Stimulus Model ($f_\theta$): A deep convolutional neural network (CNN) processes an input image to predict the "mean" response across thousands of neurons. It utilizes a "Gaussian readout" to map physical cortical positions to receptive fields in visual space.
  • The Latent Model (Factor Analysis): To account for correlated variability, the model employs a low-dimensional latent state ($z$). This captures shared internal signals that modulate the entire population's response.
  • The Marginal Normalizing Flow ($T_\phi$): Neural data, particularly from calcium imaging, is highly non-Gaussian. Standard Factor Analysis relies on Gaussian assumptions. To resolve this, the model uses a series of learnable, invertible transformations (diffeomorphisms) to map non-Gaussian neural responses into a Gaussian latent space where Factor Analysis thrives.
  • Zero-Inflation: Because calcium imaging data contains an abundance of "zero" responses, ZIFFA incorporates a mixture model. This treats zeros separately from positive responses, preventing the zero-peak from distorting the learned distributions.

Key Insights and Results

The model was rigorously validated using synthetic data, two-photon calcium imaging from the mouse visual cortex (areas V1, LM, and PM) responding to ~6,000 ImageNet images, and simultaneous behavioral data (pupil dilation).

Learned vs. Fixed Transformations

Traditionally, neuroscientists rely on fixed mathematical tricks—like the square-root or Anscombe transform—to force neural data into a more "Gaussian" shape. This research demonstrates that learning a unique transformation for each neuron via normalizing flows yields a significantly better model fit.

Comparison of fixed transformations (identity, sqrt, anscombe) versus learned flow transformations in normalizing neural response distributions.

Biological Relevance of Latent States

The model's "hidden" variables are not merely abstract mathematical constructs; they correlate strongly with actual biology. For instance, one of the learned latent dimensions closely tracked the animal's pupil dilation, confirming that the model successfully captured the internal arousal state of the mouse without being explicitly trained to do so.

Identifying Brain Areas via Mathematics

By analyzing the Jacobian (the rate of change) of the learned receptive field positions, the model could automatically delineate different brain areas. It successfully detected "retinotopic flips"—boundaries where the map of the visual world reverses between distinct cortical areas—achieving up to 84% accuracy.

Superior Performance

  • Density Estimation: ZIFFA achieved higher log-likelihoods than standard Poisson or Zero-Inflated Gamma (ZIG) models, providing a much more accurate probabilistic description of neural activity.
  • Generalization: Unlike traditional latent state models, ZIFFA can predict the full distribution of responses for novel images it has never seen before, without requiring repeated trials.
  • Capturing Correlations: The model dramatically improved "conditional correlation" predictions. If the activity of 99 neurons is known, ZIFFA is significantly better at predicting the 100th neuron's activity compared to models that assume independence.

Limitations and Future Directions

While powerful, the current model has limitations. The authors applied the normalizing flow to each neuron individually (marginally) to maintain computational efficiency. However, this restricts the model's ability to capture highly complex, non-linear interactions between neurons that fall outside a linear latent state.

Additionally, the current version assumes the correlation structure (the covariance matrix) is fixed across all images. Future iterations could explore "richer," stimulus-dependent flows, allowing the model to capture even more nuanced, image-specific dependencies within neural populations.

Summary updated

BibTeX
@inproceedings{bashiri2021flow,
  author = {Mohammad Bashiri and Edgar Y. Walker and Konstantin-Klemens Lurz and Akshay Kumar Jagadish and Taliah Muhammad and Zhiwei Ding and Zhuokun Ding and Andreas S. Tolias and Fabian H. Sinz},
  title = {{A flow-based latent state generative model of neural population responses to natural images}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure