Abstract
Seeking high-quality neural latent representations to reveal the intrinsic correlation between neural activity and behavior or sensory stimulation has attracted much interest. Currently, some deep latent variable models rely on behavioral information (e.g., movement direction and position) as an aid to build expressive embeddings while being restricted by fixed time scales. Visual neural activity from passive viewing lacks clearly correlated behavior or task information, and high-dimensional visual stimulation leads to intricate neural dynamics. To cope with such conditions, we propose Time-Dependent SwapVAE (TE-ViDS), following the approach of separating content and style spaces in Swap-VAE, on the basis of which we introduce state variables to construct conditional distributions with temporal dependence for the above two spaces. Our model progressively generates latent variables along neural activity sequences, and we apply self-supervised contrastive learning to shape its latent space. In this way, it can effectively analyze complex neural dynamics from sequences of arbitrary length, even without task or behavioral data as auxiliary inputs. We compare TiDe-SwapVAE with alternative models on synthetic data and neural data from mouse visual cortex. The results show that our model not only accurately decodes complex visual stimuli but also extracts explicit temporal neural dynamics, demonstrating that it builds latent representations more relevant to visual stimulation.
Introduction
Understanding how the brain processes sensory information is a foundational goal of neuroscience. While modern recording techniques allow researchers to capture the spiking activity of thousands of neurons simultaneously, this data is inherently high-dimensional and noisy. Latent Variable Models (LVMs) are typically used to identify the low-dimensional signals that represent stimuli or drive behavior.
However, most existing LVMs were designed for the motor cortex, where neural activity is often tied to specific, timed movements. The visual cortex presents a greater challenge: naturalistic stimuli, such as movies, are high-dimensional and time-dependent, and neural responses are heavily influenced by "internal states"—such as arousal or spontaneous thoughts—that are unrelated to the external stimulus. Current models often struggle to separate these stimulus-driven signals from internal brain dynamics.
Methods
The proposed Time-Evolving Visual Dynamical System (TE-ViDS) addresses these challenges through a sequential Variational Autoencoder (VAE) framework. As illustrated in Figure 1, the architecture is built on three core principles:
- Temporal Evolution: Unlike static models, TE-ViDS utilizes Gated Recurrent Units (GRUs) to accumulate information over time, allowing latent variables to evolve dynamically and capture the temporal dependencies inherent in neural sequences.
- Split Latent Structure: The model disentangles the latent space into two distinct components: External Latents, which are deterministic and intended to capture stimulus-relevant information, and Internal Latents, which are stochastic and capture the brain's internal variability. The external space is shaped using self-supervised contrastive learning (NT-Xent loss).
- Causal Inference: The model respects the causal nature of biological time, ensuring that latent variables at any time $t$ depend only on the current input and previous states.
Key Results
TE-ViDS was rigorously tested on Neuropixel recordings from the Allen Brain Observatory, featuring data from six cortical regions in mice viewing natural scenes and movies. The model consistently outperformed leading alternatives, including LFADS, pi-VAE, and CEBRA.
- Decoding Accuracy: For natural scene decoding, TE-ViDS achieved an accuracy of 50.86% (in Mouse 1), significantly higher than LFADS (30.76%) and CEBRA (1.53%). For movie frames, it reached 65.38% accuracy within a 1-second window.
- Successful Disentanglement: A key insight of the study is the effectiveness of the split latent structure. As shown in Figure 6, the "External" latents carry nearly all the decoding power, while the "Internal" latents contribute very little to stimulus reconstruction. This suggests the model successfully filters out internal brain noise to isolate the stimulus-driven signal.
- Temporal Importance: Shuffling the time dimension of the spike data caused performance to plummet, proving that the temporal flow modeled by TE-ViDS is vital for accurate representation.
Discussion and Future Work
TE-ViDS provides computational evidence for the functional hierarchy of the mouse visual cortex, with decoding being most accurate in primary and mid-level regions. However, limitations remain. Because there is no ground truth for a mouse's internal thoughts, it is difficult to quantitatively verify the exact nature of the internal latents. Additionally, significant performance variation between individual mice suggests that internal states may dominate the neural signal more in some subjects than others. Future work will involve extending this framework to other recording modalities, such as calcium imaging, and applying it to more complex behavioral tasks.
Summary updated