QuantFormer: Learning to Quantize for Neural Activity Forecasting in Mouse Visual Cortex
Salvatore Calcagno, Isaak Kavasidis, Simone Palazzo, Marco Brondi, Luca Sità, Giacomo Turri, Daniela Giordano, Vladimir R. Kostic, Tommaso Fellin, Massimiliano Pontil, Concetto Spampinato
TL;DR
QuantFormer addresses the challenge of forecasting neural activity from two-photon calcium imaging by reframing the regression problem as classification through latent space vector quantization. It combines self-supervised pre-training via masked auto-encoding with neuron- and stimulus-specific tokens to scale to arbitrary neuronal populations, and adapts the encoder for two downstream tasks: activation prediction and response forecasting. The approach achieves state-of-the-art performance on the Allen Brain Observatory dataset, demonstrating strong generalization across stimuli and subjects and offering interpretable codes and neuron embeddings that reflect activation dynamics. This work lays a foundation for scalable, real-time neural signal prediction applicable to online interventions in the mouse visual cortex.
Abstract
Understanding complex animal behaviors hinges on deciphering the neural activity patterns within brain circuits, making the ability to forecast neural activity crucial for developing predictive models of brain dynamics. This capability holds immense value for neuroscience, particularly in applications such as real-time optogenetic interventions. While traditional encoding and decoding methods have been used to map external variables to neural activity and vice versa, they focus on interpreting past data. In contrast, neural forecasting aims to predict future neural activity, presenting a unique and challenging task due to the spatiotemporal sparsity and complex dependencies of neural signals. Existing transformer-based forecasting methods, while effective in many domains, struggle to capture the distinctiveness of neural signals characterized by spatiotemporal sparsity and intricate dependencies. To address this challenge, we here introduce QuantFormer, a transformer-based model specifically designed for forecasting neural activity from two-photon calcium imaging data. Unlike conventional regression-based approaches, QuantFormerreframes the forecasting task as a classification problem via dynamic signal quantization, enabling more effective learning of sparse neural activation patterns. Additionally, QuantFormer tackles the challenge of analyzing multivariate signals from an arbitrary number of neurons by incorporating neuron-specific tokens, allowing scalability across diverse neuronal populations. Trained with unsupervised quantization on the Allen dataset, QuantFormer sets a new benchmark in forecasting mouse visual cortex activity. It demonstrates robust performance and generalization across various stimuli and individuals, paving the way for a foundational model in neural signal prediction.
