Lisa Schmors, Dominic Gonschorek, Jan Niklas Böhm, Yongrong Qiu, Na Zhou, Dmitry Kobak, Andreas Tolias, Fabian Sinz, Jacob Reimer, Katrin Franke, Sebastian Damrich, Philipp Berens
4 min
Neuroscience experiments frequently generate large-scale, multi-trial time-series data, such as calcium imaging or electrophysiological recordings. Visualizing this high-dimensional data is essential for identifying functional cell types and continuous response variations. Existing dimensionality reduction techniques, like t-SNE or UMAP, often struggle with the noise inherent in neural data, while standard contrastive learning methods typically focus on high-dimensional representations rather than direct 2D visualization.
TRACE (Time series Representation Analysis through Contrastive Embeddings) addresses this by leveraging the inherent structure of multi-trial experiments. Instead of relying on generic data augmentations (like jittering or cropping), TRACE generates positive pairs by averaging non-overlapping subsets of trials for each neuron. This approach effectively captures the local noise structure of individual neurons, making the learned representation invariant to trial-to-trial fluctuations. The model utilizes a Cauchy similarity kernel to directly map these time series into a 2D embedding space, facilitating intuitive visual exploration.
TRACE demonstrates superior performance compared to existing contrastive frameworks like CEED and TS2Vec. In synthetic benchmarks, TRACE successfully identifies distinct neuronal classes even in the presence of high noise, where other methods fail to resolve the underlying structure. When applied to large-scale in vivo datasets—specifically two-photon calcium imaging of retinal ganglion cell boutons and Neuropixels recordings—TRACE produces 2D visualizations that more accurately reflect biological properties, such as functional cell types (ON, OFF, ON-OFF, and Suppressed-by-contrast) and brain area organization. Furthermore, the authors show that the resulting embeddings are useful for identifying recording artifacts and outliers, providing a dual-purpose tool for both data quality control and exploratory analysis.
By directly embedding neural time series into 2D, TRACE bridges the gap between complex self-supervised representation learning and the practical need for visual interpretability in neuroscience. Its ability to automatically learn from the trial-based structure of neural data allows researchers to bypass the need for hand-tuned augmentations, leading to more robust and biologically meaningful visualizations of large-scale neural recordings.
Modern neural recording techniques such as two-photon imaging or Neuropixel probes allow to acquire vast time-series datasets with responses of hundreds or thousands of neurons. Contrastive learning is a powerful self-supervised framework for learning representations of complex datasets. Existing applications for neural time series rely on generic data augmentations and do not exploit the multi-trial data structure inherent in many neural datasets. Here we present TRACE, a new contrastive learning framework that averages across different subsets of trials to generate positive pairs. TRACE allows to directly learn a two-dimensional embedding, combining ideas from contrastive learning and neighbor embeddings. We show that TRACE outperforms other methods, resolving fine response differences in simulated data. Further, using in vivo recordings, we show that the representations learned by TRACE capture both biologically relevant continuous variation, cell-type-related cluster structure, and can assist data quality control.
Sam: Right. The repeated trials were always there. Researchers have always collected them. TRACE just turns what used to be a limitation — the fact that neurons respond inconsistently — into a useful tool for discovery. It's a more honest representation of the underlying biology.
Alex: Are there any real downsides?
Sam: There are a couple worth noting. Training the model takes more computing time than simply running a standard visualization tool. And the whole approach depends on having those repeated trials in the first place — which isn't always possible in every experiment. So this is most useful when you have high-quality, repeated data and genuinely need that extra layer of clarity.
Alex: How do the researchers establish that the results are reliable — not just a one-off?
Sam: They ran multiple versions of their experiments and reported the average result alongside a measure of how much the results varied across runs. For their synthetic data tests, they also used confidence intervals — a way of saying "we're reasonably sure the true answer falls within this range." That combination gives a much clearer picture of how consistent the findings actually are.
Alex: And others can check the work themselves?
Sam: Yes. The authors documented their methods, their computing setup, and the hardware used. They credited the original sources for any external data. And since this is foundational research on how to represent neural data — not work involving human subjects — many of the typical ethical concerns around privacy don't apply, though they reviewed the relevant guidelines regardless.
Alex: So it's a well-documented contribution, with its limits stated clearly up front.
Sam: It is. The broader point TRACE makes is a useful one: the right approach to handling data can reveal structure that was always there, just hidden beneath the noise. By focusing on foundational improvements to how we visualize neural activity, it gives researchers a cleaner window into how the brain is organized. Thanks for listening to ResearchPod.