The Case for Cleaner Biosignals: High-fidelity Neural Compressor Enables Transfer from Cleaner iEEG to Noisier EEG

Francesco S. Carzaniga, Gary Tom Hoppeler, Michael Hersche, Kaspar Schindler, Abbas Rahimi

Abstract

Recording and transmitting high-resolution brain activity, such as Electroencephalography (EEG) and intracranial EEG (iEEG), presents significant data-handling challenges. We present BrainCodec, a high-fidelity neural compressor that achieves up to 64x compression without sacrificing clinical utility. BrainCodec utilizes a quantized autoencoder architecture enhanced by a multi-scale discriminator and a novel "Relative Line Length Loss" to preserve high-frequency features essential for diagnosis. A key finding is the "clean data" effect: training on high-SNR iEEG data significantly improves reconstruction performance on noisier scalp EEG, mirroring trends in large-scale language modeling where high-quality data curation is paramount.

Introduction

The digitization of brain activity generates massive multi-channel time-series datasets. For long-term monitoring and wireless wearables, this volume creates bottlenecks in storage and transmission. While lossless compression offers perfect fidelity, its ratios are typically insufficient (1.2x–1.5x). Conversely, traditional lossy compression often discards fine-grained features—like high-frequency oscillations—required for downstream tasks such as seizure detection or motor imagery classification. BrainCodec addresses this by providing a universal, modality-agnostic compressor that maintains high fidelity at extreme compression ratios.

BrainCodec Architecture

BrainCodec is built on a quantized autoencoder framework, drawing inspiration from high-performance audio codecs like SoundStream and EnCodec.

Extracted figure from page 2 of The Case for Cleaner Biosignals: High-fidelity Neural Compressor Enables Transfer from Cleaner iEEG to Noisier EEG

Core Components

  • Encoder/Decoder: Convolutional networks map raw brain waves into a compact latent space and reconstruct them back to the time domain.
  • Residual Vector Quantization (RVQ): The latent representation is mapped to discrete codebook indices, effectively turning the signal into a series of indices for efficient digital storage.
  • Multi-Scale Discriminator (GAN): A generative adversarial component ensures reconstructions remain realistic and sharp across various time and frequency scales.
  • Relative Line Length Loss: Beyond standard reconstruction losses, this metric specifically penalizes errors in "line length"—a feature neurologists use to identify seizure activity—ensuring the preservation of clinical markers.

The "Clean Data" Transfer Effect

A pivotal discovery in this research is the benefit of training on high-quality signals. The study found that a model trained on "cleaner" iEEG (recorded inside the skull with high SNR) outperforms models trained directly on "noisier" scalp EEG when tasked with compressing and reconstructing that same EEG data.

This suggests that high-SNR data allows the neural network to learn more robust, fundamental representations of brain dynamics. This phenomenon aligns with recent findings in Natural Language Processing (e.g., "Textbooks Are All You Need"), where high-quality, curated data leads to superior model performance compared to larger, noisier datasets.

Experimental Results

BrainCodec was evaluated across multiple iEEG and EEG datasets, including SWEC, CHB-MIT, and BCI Competition IV-2a.

Extracted figure from page 2 of The Case for Cleaner Biosignals: High-fidelity Neural Compressor Enables Transfer from Cleaner iEEG to Noisier EEG
  • Compression Performance: The model maintains high fidelity (low Percentage Root-mean-square Difference) even at 64x compression.
  • Clinical Utility: In seizure detection tasks using iEEG, there was no loss in F1-score at 64x compression.
  • Brain-Machine Interface (BMI): For motor imagery tasks using EEG, classification accuracy remained high up to 16x compression.
  • Expert Validation: Neurologists confirmed that reconstructed signals were indistinguishable from originals for clinical purposes, avoiding the artifacts common in previous lossy methods.

Conclusion

BrainCodec demonstrates that high-fidelity lossy compression is viable for clinical and research neurotechnology. By leveraging the "clean data" effect from iEEG, the model achieves state-of-the-art performance across modalities. Future work will focus on optimizing quantization efficiency and reducing the computational overhead for real-time deployment on low-power edge devices.

BibTeX
@inproceedings{carzaniga2025case,
  author = {Francesco S. Carzaniga and Gary Tom Hoppeler and Michael Hersche and Kaspar Schindler and Abbas Rahimi},
  title = {{The Case for Cleaner Biosignals: High-fidelity Neural Compressor Enables Transfer from Cleaner iEEG to Noisier EEG}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=b57IG6N20B},
}