HIPPIE: A Generative Model for Electrophysiological Analysis Across Species, Technologies, and Modalities
HIPPIE is a conditional variational autoencoder for extracellular
electrophysiology. It ingests three per-unit modalities (mean
waveform, inter-spike-interval distribution, autocorrelogram) and
learns a joint latent representation conditioned on recording
technology. The released checkpoint was pretrained on 11 publicly
available electrophysiology datasets and is intended for transfer to
new recordings without retraining the full model.
Each modality is independently encoded by a 1D ResNet18 backbone with
channel widths [64, 128, 256, 512]. A fusion encoder concatenates the
three modality representations and projects to the shared latent
space. The decoder mirrors the encoder structure and is conditioned on
both the latent code and (during supervised fine-tuning) a cell-type
label; the encoder is class-agnostic at inference time
(encoder_uses_class_embedding=False in the production config). The
released checkpoint disables super-region and layer conditioning
(num_super_regions=0, num_layers=0); only the recording-technology
source embedding is active.
For datasets that ship without an autocorrelogram (bimodal recordings),
the ACG channel is zero-filled.
Input format
Each per-unit input is a float32, batch-first array, pre-normalized to
[-1, 1]:
wave: (N, 50) mean waveform, min-max normalized.
isi: (N, 100)log(x+1) of the ISI histogram, min-max normalized.
acg: (N, 100) autocorrelogram, min-max normalized (zeros if unavailable).
Conditioning is a per-unit integer tech_id in {0, 1, 2} (see the
Technology Conditioning Vocabulary below).
Output format
HIPPIEClassifier.get_embeddings(...) returns the joint latent code
z of shape (N, 30) (10 latent dimensions per modality across the 3
modalities).
Intended Use
The checkpoint is intended for:
Extracting joint latent representations from new extracellular
recordings for downstream classification, clustering, or visualization.
The HIPPIE generative decoder additionally supports the following
capabilities, which are demonstrated in the manuscript rather than
shipped as turnkey features (they require the generative decoder and
the analysis code in the HIPPIE release):
Cross-modal imputation: reconstructing a missing modality from the
remaining inputs.
Counterfactual decoding: predicting how a unit's signal would appear
under a different recording technology.
Not intended for
Clinical diagnosis, treatment decisions, or any safety-critical
application.
Calibrated probabilistic inference. The KNN/MLP probe heads used in
the paper are post-hoc and are not part of the released checkpoint.
Human electrophysiology. Pretraining used only mouse, rat, and
macaque data; transfer to human recordings has not been validated.
Limitations
Species coverage: pretraining used mouse, rat, and macaque data.
No human electrophysiological data was used; transfer to human
recordings has not been validated.
Featurization: the model takes mean waveform, ISI distribution,
and ACG only. It does not consume raw spike trains, multi-channel
waveforms, or local field potentials.
Cell-type vocabulary: per-dataset cell-type labels are
heterogeneous and were used during dataset-specific supervised
fine-tuning, not during the pretraining that produced this
checkpoint. For tasks that require species- or region-specific class
predictions, fine-tune with the appropriate vocabulary using
cross_dataset_script.py in the HIPPIE release.
Cortical-layer / brain-region conditioning: the released
checkpoint disables super-region and layer embeddings
(num_super_regions=0, num_layers=0); only technology conditioning
is active.
Quality of input features: performance depends on upstream spike
sorting and unit curation. Use the data-wrangling scripts in the
HIPPIE release as a starting point.
Training Data
Pretrained on 11 labeled electrophysiology datasets spanning mouse,
rat, and macaque. Cell-type counts and sample sizes follow the
manuscript Methods.
A runnable CLI version of the snippets above ships in this repo as
extract_embeddings.py (mirrored in the
HIPPIE GitHub release). It
loads the checkpoint (Hub by default, --checkpoint for local),
iterates a directory of per-dataset CSVs in the canonical HIPPIE
layout, and writes the concatenated embeddings to a single .npz:
The GitHub copy in the HIPPIE release is the source of truth; keep the
two in sync when making changes.
Preprocessing reference
The model expects each modality to be min-max normalized to [-1, 1]
and resampled to the canonical lengths (waveform: 50, ISI: 100,
ACG: 100). ISI is additionally log(x+1)-transformed before
normalization. The MultiModalEphysDataset in
hippie/dataloading.py is the canonical implementation; the snippet
below reproduces it for the waveform case:
python
1import numpy as np
2import torch
3import torch.nn.functional as F
45defpreprocess_waveform(raw: np.ndarray, wave_len:int=50)-> np.ndarray:6 t = torch.as_tensor(raw, dtype=torch.float32)7if t.dim()==1:8 t = t.unsqueeze(0)9if t.shape[-1]!= wave_len:10 t = F.interpolate(t.unsqueeze(1), size=(wave_len,),11 mode="linear", align_corners=False).squeeze(1)12 mn = t.amin(dim=-1, keepdim=True)13 mx = t.amax(dim=-1, keepdim=True)14return((t - mn)/(mx - mn +1e-8)*2.0-1.0).numpy().astype(np.float32)
extract_embeddings.py already does this automatically when no local
--checkpoint is supplied.
Evaluation
Headline benchmark results (balanced accuracy, KNN probe on the latent
embeddings) are reported in the manuscript. The exact commands and
configurations that produced each figure are bundled with the
benchmarking release at
https://github.com/JesusGF1/HIPPIE-benchmarking-release.
Citation
If you use this model, please cite:
bibtex
1@article{gonzalez-ferrer2025hippie,
2 title = {HIPPIE: A Generative Model for Electrophysiological Analysis
3 Across Species, Technologies, and Modalities},
4 author = {Gonzalez-Ferrer, Jesus and Lehrer, Julian and
5 Alvarez-Esteban, Bruno and Schweiger, Hunter E. and
6 Geng, Jinghui and Eugenio dos Santos, Luiz F. S. and
7 Moreno-Ochando, Avelina and Hernandez, Sebastian and
8 Reyes, Francisco and Sevetson, Jess L. and
9 Schneider, Aidan and Salama, Sofie R. and
10 Teodorescu, Mircea and Haussler, David and
11 Mostajo-Radji, Mohammed A.},
12 year = {2025},
13 note = {Under revision at Nature Communications}
14}