The Case for Cleaner Biosignals: High-fidelity Neural Compressor Enables Transfer from Cleaner iEEG to Noisier EEG
Authors: Francesco S. Carzaniga
Gary Tom Hoppeler
Michael Hersche
Kaspar Schindler
Abbas Rahimi
Venue: ICLR 2025 Poster (2025)
Keywords: eeg
ieeg
intracranial eeg
electroencephalography
compression
transfer
seizure
seizure detection
motor imagery
Primary area: learning on time series and dynamical systems

Abstract: All data modalities are not created equal, even when the signal they measure comes from the same source. In the case of the brain, two of the most important data modalities are the scalp electroencephalogram (EEG), and the intracranial electroencephalogram (iEEG). iEEG benefits from a higher signal-to-noise ratio (SNR), as it measures the electrical activity directly in the brain, while EEG is noisier and has lower spatial and temporal resolutions. Nonetheless, both EEG and iEEG are important sources of data for human neurology, from healthcare to brain–machine interfaces. They are used by human experts, supported by deep learning (DL) models, to accomplish a variety of tasks, such as seizure detection and motor imagery classification. Although the differences between EEG and iEEG are well understood by human experts, the performance of DL models across these two modalities remains under-explored. To help characterize the importance of clean data on the performance of DL models, we propose BrainCodec, a high-fidelity EEG and iEEG neural compressor. We find that training BrainCodec on iEEG and then transferring to EEG yields higher reconstruction quality than training on EEG directly. In addition, we also find that training BrainCodec on both EEG and iEEG improves fidelity when reconstructing EEG. Our work indicates that data sources with higher SNR, such as iEEG, provide better performance across the board also in the medical time-series domain. This finding is consistent with reports coming from natural language processing, where clean data sources appear to have an outsized effect on the performance of the DL model overall. BrainCodec also achieves up to a 64x compression on iEEG and EEG without a notable decrease in quality. BrainCodec markedly surpasses current state-of-the-art compression models both in final compression ratio and in reconstruction fidelity. We also evaluate the fidelity of the compressed signals objectively on a seizure detection and a motor imagery task performed by standard DL models. Here, we find that BrainCodec achieves a reconstruction fidelity high enough to ensure no performance degradation on the downstream tasks. Finally, we collect the subjective assessment of an expert neurologist, that confirms the high reconstruction quality of BrainCodec in a realistic scenario. The code is available at https://github.com/IBM/eeg-ieeg-brain-compressor.

Published as a conference paper at ICLR 2025
THE CASE FOR CLEANER BIOSIGNALS: HIGH- FIDELITY NEURAL COMPRESSOR ENABLES TRANSFER FROM CLEANER IEEG TO NOISIER EEG
Francesco Carzanigal-, 1-2, Gary Hoppeler', Michael Hersche', Kaspar A. Schindler', Abbas Rahimi'
'BMM Research Zurich, Rüschlikon, Switzerland Department of Neurology, Inselspital, Sleep- Wake-Epilepsy-Cenne Bern University Hospital, Bern University, Bern, Switzerland
ETH Zürich, Zürich, Switzerland free wwurrcc.ibm.com
ABSTRACT
All data modalities are not created equal, even when the signal they measure comes from the same source. In the case of the brain, two of the most impor- tant data modalities are the scalp electroencephalogram (EEG), and the intracra- nial elsctroencephalogramm (iEEG). iEEG benefits from higher signal-to-noise ratio (SNR), it measures the electrical activity directly in the brain, while EEG is noisier and has lower spatial and temporal resolutions. Nonetheless, both EEG and iEEG important sources of data for human neurology, from healthcare to brahn- interfaces. They are used by human experts, sup- ported by deep learning (DL) models, accomplish variety of tasks, such seizure detection and motor imagery classification. Although the differences be- tween EEG and iEEG are well understood by human experts, the performance of DL models across these two modalities remains under-explored. To help charac- terize the importance of clean data on the performance of DL. models, we pro- pose BrainCodec, high-fidelity EEG and iEEG neural compressor. We find that training BrainCodec on iEEG and then transferring to EEG yields higher reconstruction quality than training on EEG directly. In addition, also find that training BrainCodec on both EEG and iEEG improves fidelity when recon- structing EEG. Our work indicates that data sources with higher SNR, such iEEG, provide better performance across the board also in the medical time- series domain. This finding is consistent with reports coming from natural lan- guage processing, where clean data sources appear to have an outsized effect on the performance of the DL model overall. BrainCodec also achieves up to 64x compression on iEEG and EEG without a notable decrease in qual- ity. BrainCodec markedly surpasses current state-of-the-a compression mod- els both in final compression ratio and in reconstruction fidelity. We also eval- uate the fidelity of the compressed signals objectively on seizure detection and motor imagery task performed by standard DL models. Here, we find that BrainCodec achieves a reconstruction fidelity high enough to ensure no per- formance degradation jective assessment of an expert ncurologist, that confirms the high reconstruc- tion quality of BrainCodec in realistic scenario. The code is available htttps://qitie com/ bra.:eggggee--bbaan-comeeeeeee
the downstream tasks. Finally,
collect the sub-
INTRODUCTION
Collecting high signal-to-noise ratio (SNR) data can prove to be a challenging endeavor in many situations, especially when considering human data. However, noisier signals are sometimes ade- quate to perform the task at hand. Following this principle, different data modalities can be collected from the same source with varying levels of quality. For instance, the electroencephalogramm (EEG)

---

Published as a conference paper at ICLR 2025
a. BrainCodec training
Encoder
Decoder
Ch
Quantizrr
Ch.
Ch 2
www.aau Sura Ch.
Ch myya yoth
Time
High-quality cross-modal compression
Downstream tasks with compressed signals
Testing modality
IEEG
Training modality
IEEG EEG
ww
BrainCodec
Seizure detection
IEEG
EEG
EEG
X
/
NW Wpl
BrainCodec
Motor imagery
IEEG + EEG
Figure I: BrainCodec training and usage. a. BrainCodec can be trained on EEG or iEEG data. b. BrainCodec trained on iEEG can compress both iEEG and EEG data, while BrainCodec trained on EEG can only compress other EEG data. c. BrainCodec's ' nigh-fidelity compressed signals can be used to perform downstream classification on iEEG and EEG data.
a multi-variate time-series recording of the electrical activity of the brain, where the quality and SNR vary considerably based the specific recording setup. On the one hand, non-invasive scalp EEG can be easily collected in many environments through the placement of extracranial electrodes on the scalp, but suffers from low spatial and temporal resolutions. The use of ultra long-tem term non-invasive EEG systems is expected to help improve personalized patient care, for example, by objectively assessing seizure rate, and also macro- and microstructure of sleep (Yilmaz al. 2024
Casson et al. 2010), which are both treatable risk factors for dementia (Hanke et al.) (022). On the other hand, intracranial EEG (iEEG) collected through invasive intracranial electrodes benefits from a higher SNR and more direct physical connection to the brain. In particular, iEEG is used by neu- rologists to delineate the seizure onset zone patients suffering from pharmacoresistant epilepsy, and deep learning (DL) models have been developed to support them (Kuhlmann et al. 2018 Craik al. 2019). As such, both EEG and iEEG are essential data sources available to physicians and re- searchers for the study and treatment of variety of neurological diseases. However, the storage and transmission of EEG signals is often very costly these highly critical and sensitive environments.
Data compression is viable solution to reduce the costs associated with storing and transmitting the large quantities of (i)EEG data that are collected every day. Data compression significantly predates the current rise of DL; therefore, the most successful algorithms in this field do not belong to the class of DL models, i.e., they are not neural compressors. However, recent developments (Dani & Srinivasan | Webex 2022|Dééossee et al. (023) have shown that DL models may outperform more traditional approaches. Nonetheless, no compressor has yet found widespread use for EEG and iEEG data.
Data compressors can be divided into two main classes: lossless and lossy. Lossless compression, e.g., 1z4, guarantees full signal integrity, the cost of lower compression ratios. Lossy compression, on the contrary, achieves high compression ratios; however, the fidelity of the reconstruction cannot be guaranteed. As such, lossy compression algorithm seizure detection without thorough evaluation in real-world scenarios. For time-series, it is usually preferred to use lossy compression, as they often contain information that is noisy and/or relevant for use by humans. For example, lossy audio compressors are ubiquitous and achieve remarkable size reductions by discarding all content that is mostly unnoticeable by humans. We can do the same with EEG and iEEG. However, the spectral content and the frequencies of interest in audio and EEG are significantly different. Moreover, lossy compression is strongly affected by noise. For these reasons, we expect the behavior of lossy compression EEG and iEEG to be notably different between the two modalities, and also from audio.
be used for manual automated
The state-of-the ah- neural model (EnCodec; Défossez et al. (2023) currently available for high- fidelity lossy audio signal compression cannot be used directly on EEG signals, since its design is inadequate in preserving the information content relevant for further analysis. Moreover, the state-
2

---

Published as a conference paper at ICLR 2025
of ar- neural compressors have not been validated as viable effective either EEG or iEEG signals. As we have seen previously, is well-known that EEG is overall a noisier data source than iEEG, so model that is successful the same time, it has been reported in other fields, such as natural language processing (Lee et al, 2022 Muennighoff al.] 2023] Gunasekar al. 2023), that training DL models on cleaner and less noisy data can provide increased performance across the board. Therefore, we also aim to provide concrete guidelines on the performances of neural compressors when transferring between the two data modalities.
modality is not guaranteed work the other. At
To guide our evaluation throughout this work, we propose set of criteria to define the high-fidelity reconstruction of EEG signals: 1. percentage noot-mean-suuat difference (PRD) lower than 30 as suggested by Higgins et al. (2010); and 2. less than 1% drop in classification performance of down- stream tasks such as seizure detection or motor imagery classification for brain-machine interface; and high reconstruction quality as rated by an expert neurologist. Any EEG compressor that fulfills all the criteria outlined above is considered high-fidelity compressor.
In this work, we introduce BrainCodec (see Figure D a high-fidelity quantized autoencoder com- pressor for EEG and iEEG. BrainCodec has the following features:
universal compression of both iEEG and EEG using the same model;
favorable transfer from cleaner iEEG to noisier EEG;
high-fidelity compression of EEG signals up to a compression ratio as high as 64;
variable compression ratio, depending the task requirements.
Remarkably, BrainCodec model trained on iEEG signals and used compress EEG signals con- sistently achieves better performance at high compression ratios compared to BrainCodec trained on the same EEG modality. This indicates that training with higher quality, higher SNR data gener- alizes better even across modalities. This is also consistent with previous body work on natural language, and highlights the advantage of clean signals with high SNR for the pretraining stage. In fact, training DL models on such high-quality signals can improve performance even on their noisier counterparts.
2 RELATED WORK
Neural audio compression. Neural network models have recently started gaining popularity in the audio compression domain due to their high compression ratios and design flexibility. Most neural compression architectures consist of the encoder-decoder pair of autoencoder, together with quantizer to generate discrete representations. VQ- VAE (Van Den Oord et al.) (017] introduced this method--unrelated the compression objective-by by combining variational autoencoders (VAE) with vector quantization (VQ). VQ uses a learnable codebook containing a discrete set of vectors to represent larger set of input vectors.
GANs have been shown (Kumar et al. 2019 Yamamoto et al. 2020 Kong et al. 2020) to be an ef- fective solution to drive the overall neural compressor towards better representations. McIGAN (Ku- mar et al.) 2019) introduced a multi-scale discriminator that consists of three convolutional discrimi- nators that operate on different scales of the waveform. This architecture restricts the discriminators to specific frequency bands so that they learn features of different scales. The learned features can be used to train a generator by minimizing the distance between features of real and synthetic data.
Combining autoencoder, quantizer, and GAN, SoundStream (Zeghidour et al. 2022) and En- Codec (Défossez et al., 2023) represent the state-of-the-art audio compression models. They are based a fully convolutional encoder-decoder network with a residual vector quantizer (RVQ) and a convolutional GAN discriminator, operating on the frequencies of interest of the signal. All components are jointly trained end-to-end by minimizing reconstruction, quantization, well as perceptual adversarial losses.
Lossless EEG compression. Standard lossless compression algorithms such gzip, zstd, and lz4 are used routinely to reduce the storage requirements of large EEG collections. Typical compression ratios for these algorithms EEG 1.2x to 1.5x. Lossless compression models developed
3

---

Published as a conference paper at ICLR 2025
specifically for EEG are more scarce (Alsenwi et al. 2018: Hadi et al. 2021 Al- Al-Nassrawy et al. 2022) and have not found use in practice.
Lossy EEG compression. Lossy compression has not been adopted for either clinical research use due to the uncertainty about the fidelity of the reconstructed signal. In particular, standard lossy time-series compressed formats such mp3 have not been developed for EEG and thus have poor performance. Recently, wavelet transform-base arithmetic coding (AAC: Nguyen et al. (2017)), and artificial neural networks (ANN: Hejrati et al. (0177) have shown impressive results on EEG, with compression ratios up to 8x and high re- construction fidelity. Given the importance of EEG signals in variety of clinical tasks, seizure detection (guuye et al. (2018) has been used to validate the reconstruction fidelity of lossy com- pression as well. Finally, DI. models equipped with compressed sensing techniques (CS: Du et al. (2024) have achieved state-of- ofate-of-the-art compression performance in terms of reconstruction fidelity. Our BrainCodec surpasses existing work by consistently achieving higher compression ratios and higher reconstruction fidelity.
techniques using NLSPIHT (Xu et al. (2055)
BRAINCODEC: QUANTIZED AUTOENCODER NEURAL COMPRESSOR
This section presents the main contribution of this work, the neural compressor BrainCodec.
First, we outline a typical use case for BrainCodec. Consider an EEG signal X E RRCT having C channels and duration T = d x Is of d seconds at sampling frequency of f-s First, each channel of the signal is fed separately to the BrainCodec encoder, which outputs a compressed representation for the given channel. The compressed signal can now be transmitted and stored at fraction of the cost of the original signal. The BrainCodec decoder reconstructs the original EEG signal from the compressed representation, preserving the relevant information content and producing a high-fidelity result.
We now focus the design of our neural compressor model, specifically adapted EEG signals. We adopt the basic quantized autoencoder design of SoundStream (Zeghidour et al. 2022) and EnCodec (Défossez al. 2023), , and tailor it to the EEG use case by modifying the loss function and the parameters of the architecture. The compressor consists of three components: an encoder, a quantizer, and a decoder. The encoder maps the EEG signal latent representation. The quantizer compresses this latent representation to a quantized representation using residual vector quantization Finalll the decoder reconstructs the signal from the RVQ output. We design the compressor to achieve high compression ratios while preserving the information content needed to perform classification on the signal. The model trained end-to-end together with a discriminator that learns multi-scale features of the input data. We apply multiple losses over both the time and frequency domain to capture different propertics of the signal. This allows our compressor to be used in end-to- end classification pipelines as we show in our seizure detection and motor imagery results, providing significant storage savings.
Encoder and decoder. First, we divide the EEG signal (X) channel-wise into short patches æyy RW, i E 1,....C. C, j 1 1..... T Tww with the patch size W in the order of few seconds. In particular, we choose W to be 4 seconds long at the signal sampling frequency. The patches serve as the input the encoder. The encoder composed of 2D convolutional layer with input channel, F' output channels, and a kernel size of (3, 1). This ensures that each channel is treated separately, and allows the encoder to work on signals with varying number of channels. The initial layer is followed by N encoder blocks, where N depends on the compression ratio. Each encoder block comprises a residual block as well as 2D convolutional layer with kernel size of (K, 1) and stride of (S,1) 1) for down-sampling, with K twice the size of S. The number of channels is doubled with each down-sampling layer until there are 256. The encoder blocks are followed by final 2D convolutional layer with D output channels and kernel size of (3, 1). We choose F = 16, 5 = 2, D 64, and ELU as the activation function. The encoder finally outputs a latent representation zj,j for each input patch. The decoder mirrors the encoder, replacing strided convolutions with transposed convolutions.
We quantize the latent representation (z) to a compressed representation (zg) through RVQ. A codebook stores a finite set of learnable prototype vectors that are used to represent a set of input vectors. When compressing z, the quantizer maps the input vector to the closest pro-
Quantizer.
larger
4

---

Published as a conference paper at ICLR 2025
totype vector in the codebook. RVQ (Zeghidour et al. 2022 extends this principle to iterative process. After mapping an imput vector onto a prototype vector, RVQ computes the residual and maps it to another prototype vector from second codebook. By repeating this process, the sum of prototype vectors converges to the original vector. As suggested in previous literature (Zeghidour et al. 2022 Dhariwal al. 2020), the selected prototype vectors are updated using an exponential moving average with decay of 0.99, whereby the entries that have not been assigned to an input vector are replaced by a randomly sampled input vector. To improve the initialization of the code- books, we apply k-means clustering to the first training batch and use the centroids as prototype vectors. During training, we use straight-throus
estimator (Bengio al.) 2013) to pass the gradi- ents from the decoder to the encoder. At the same time, we compute the MSE between and 2, and add it to the overall loss. For all our models, we use codebooks each of size 256 (i.e., the storage of an index that refers to codebook entry requires 8 bits).
Discriminator (GAN component). During training, we use a multi-scale STFT-based (MS-STFT) discriminator (Défossez et al. 2023) to improve the reconstruction of high frequencies. The MS- STFT discriminator is composed of convolutional discriminators operating on different scales of the complex-valued spectrogram. Each discriminator is composed of initial 2D convolutional layer with 64 output channels and a kernel size of (3, 3). The initial layer is followed by 3 con- volutional layers with increasing dilation in the time dimension of 1, 2, and 4, kernel size of (3, 3), and a stride of (1,2). Another 2D convolutional layer with a kernel size of (3, 3) is fol- lowed by the final 2D convolutional layer with output channel and a kernel size of (3, 3). We use (2048, 1024, 512, 256, 128) as STFT window lengths and LeakyReLU as the activation function.
4 TRAINING SETUP
We train BrainCodec following the schema of SoundStream (Zeghidour et al. 2022). To help guide BrainCodec towards reconstructed signals apt for downstream classification, we also add a new loss based on the line length, which is widely considered to be useful feature for EEG classifica- tion (Schindler et al., [001]] Guo et al.) 2010 Burrello et al., 2021). We observe that the GAN has a significant effect on the reconstruction fidelity of the signal (see App. C.3 ; therefore, we train one model with GAN and one without. To avoid the risk of cross contamination between the subjects, we always train the model on one single subject, and test the reconstruction on the remaining sub- jects. To provide a direct baseline for the performance of BrainCodec in the seizure detection task, we also train standard EEGWaveNet on the original signal, and then test it using the reconstructed signal.
Validation. We also provide objective metries of the reconstruction performance of our BrainCodec in two downstream tasks: the iEEG seizure detection task, and the EEG motor imagery classification task. In particular, for iEEG we train standard EEGWaveNet (Thuwajit al. 2022) classifier on the original signal, and evaluate its performance on the reconstructed signal. For EEG, we train an MI-BMInet (Wang et al. (2024b) classifier on the original signal, and evaluate its performance on the reconstructed signal. For more information on the detailed training regime of BrainCodec refer to App. A
Optimizer and setup. We apply the 1-cycle learning rate policy, with a learning rate varying from 10 10-4 for the generator and from 10-7 10-6 6 for the discriminator. We further use the weights \ = and X 1 for the base model. For the GAN model, we choose X = 0.1, X = 1, A 0.1, A = 3, Ag = 3, and X, = The model trained with full fp32 precision.
4.1 DATASETS
SWEC IEEG (Burrello et al., 2019). This short-term iEEG dataset contains 15 subjects, 14 hours of recording, and 104 ictal events. The iEEG signals were recorded intracranially with sampling rate of either 512 Hz or 1024 Hz. The signals were median- rediinn-eferenced and band-pass filtered between 0.5 and H2 using a fourth-order Butterworth filter, both in a forward and backward pass. All the recordings were inspected by an expert neurologist for identification of seizure onsets and offsets, and to remove channels corrupted by artifacts.
5

---

Published as a conference paper at ICLR 2025
Multi-center (MC) iEEG et al. 2021). This iEEG dataset contains iEEG signals around ictal events for 91 subjects for a total of 462 events, with a sampling rate up to 1000 Hz. The onset and offset times of the seizures are included in the dataset.
Brain Treebank iEEG (Wang et al., 2024a). This iEEG dataset contains 10 subjects for total of 43 hours. The subjects have average of 168 electrodes with a sampling rate of 2048 Hz. As this not an ictal dataset, there are no labels for seizures.
CHB-MIT (Shoeb, 2010; 2009). This EEG dataset contains total of 24 subjects, 983 hours of recording, and 198 seizures. All signals have a sampling rate of 256 Hz. The onset and offset times of the seizures are included in the dataset.
BONN (Andrzeaak et al,, 2001). This EEG dataset composed of five sets (Z, O. N, F, each containing approximately 40 minutes of single-channel EEG. All signals have a sampling rate of 173.61 Hz, and they were band-pass filtered between 0.5 Hz and 40 Hz. We use all sets for evaluating the compression only.
BCI Competition IV-2a (Tangermann et al., 2012). This EEG dataset contains a total of 9 subjects. The data was collected for the purpose of 4-class motor imagery classification in brain- brain-machine machine interfaces, so we have useful labels for downstream classification. All signals have sampling rate of 250 Hz, and they were band-pass filtered between 0.5 Hz and 120 Hz with an additional notch filter at 50 Hz to remove line noise.
4.2 BASELINES
We compare the performance of BrainCodee with multiple state-of-the-arr lossy compression al- gorithms that have been developed for EEG. We benchmark against the following methods: NL-
SPIHT (Xu et al. 2015), a classical algorithm; ANN (Hejrati et al. (017), a deep-learning model; AAC (Nguyen al. 2017), a wavelet-based model with adaptive arithmetic coding; and CS (Du et al. 2024), a compressed-sensing based deep learning model.
To showcase the adaptability of BrainCodec, bank), which have high SNR, and also on multiple EEG datasets (CHB-MIT, BONN, and BCI IV-2a), which are noisier. Finally, we evaluate the generalization capabilities of BrainCodec across datasets and modalities. The full comparison with all the baselines is shown in App.
on three iEEG datasets (SWEC. MC, Tree-
5 RESULTS
To evaluate the compression performance in terms of reconstruction fidelity, we report the percent- age root-mean-square distortion (PRD):
|
PRD
100,
[ [z|2
which represents the relative Lo-distance between the original and the reconstructed signal. In order to have a comprehensive outlook, we train multiple models at varying compression ratios.
5.1 BRAINCODEC ECOSS-MODAL COMPRESSION
Reports from other fields, especially natural language processing, have shown (Lee al., 2022 Muennighoff et al. 2023) Gunasekar et al., 2023) that training with higher-quality data often yields better performance than simply training with more, and more similar, data. We aim to characterise this phenomenon for human iEEG and EEG, where, due to its higher SNR, we consider iEEG to be of higher quality than EEG in the signal processing domain.
To evaluate the role of high-SNR data in human EEG signals, we train an instance of BrainCodec on the SWEC iEEG dataset and use to compress EEG signals. Figure 2a shows the median PRD across all tested BEG datasets when training BrainCodec iEEG or on EEG. The EEG-trained compressor performs slightly better at lower compression ratios, while the iEEG-trained model becomes competitive and even achieves higher performance at higher compression ratios. Aside from the pure compression advantage, variational autoencoders have been shown to produce bet- ter representations when the information bottleneck becomes more restrictive and learning pressure

---

Published as a conference paper at ICLR 2025
BrainCadec trained leed *+ BrainCodee trdind on EEO
BrainCodec insieed Iseo
5) BranCCodee inannd on EEG
20-
EBG [PRD)
Compressing
20-
10-
Compression [log]
Compression ratio [log]
(a) Testing cross- modal BrainCodee scalp EEG,
(b) Testing cross modal BrainCodec intracranial EEG (iEEG).
Cross-modality signal reconstruction fidelity of BrainCodec. BrainCodec trained on iEEG (higher SNR) always performs better at moderate and higher compression ratios compared to BrainCodec trained on scalp EEG (lower SNR), even when compressing BEG.
Figure 2:
increases (Burgess et 2018). In this region of interest, high-SNR iEEG also becomes better data source than low-SNR EEG. We hypothesize that the increased performance of the cross-modal BrainCodec (i.e., from iEEG to EEG) at above moderate compression ratios can traced back to the effect of the noise content of the lower SNR EEG with respect to the higher SNR iEEG (see App. C.I for more details).
Conversely, train instance of BrainCodec the EEG CHB-MIT dataset and use it com- press the SWEC iEEG dataset. As expected, Figure 2b shows that the EEG to iEEG cross-modal BrainCodec performs worse than the within-modality model, indicating that a lower-quality signal less effective at generalizing than a higher-quality one.
In summary, by characterizing the behavior of BrainCodec when trained across modality, have corroborated previous reports about data quality from natural language processing. In particular, we have shown that training with higher quality data sources yields improved performance when generalizing to lower quality ones. The converse is, expectedly, not true. App. C.1 provides more details.
+de DiraiCCadec trained ISGG
14. RrainCodec Iralned EEGHEEG
+d- BruinCodee triined on EEO
de0 BrainCodoc tninnd on IEEO
36.
12-
EEG [PRD]
30-
20-
28
Compressing
Compressioo [[og]
Compression ratlo [log]
(a) Testing mixed-moda BrainCodec scalp EEG.
(b) Testing mixed-moddll BrainCodec intracranial
EEG (iEEG).
Figure 3: fixeedmmddality signal reconstruction fidelity of BrainCodec. BrainCodec trained on both intracranial EEG and scalp EEG maintains the reconstruction fidelity of an iEBG-model when compressing iEEG. At the same time, it improves performance at high compression ratios with respect scalp BEG-trained model compressing scalp EEG.

---

Published as a conference paper at ICLR 2025
5.2 BRAINCODEC MIXED- MIXED-MODAL MODAL COMPRESSION
Given the promising results shown by BrainCodec when transferring across modalities, we now investigate the performance of our neural compressor when trained with both modalities- - scalp EEG and intracranial EEG - at the same time.
To evaluate the effect of mixed-modal compression, we train BrainCodec on both the SWEC iEEG dataset and the CHB EEG dataset, for the same overall amount of data as the previous models to keep the evaluation balanced. Figure shows that the median PRD of our mixed model is notably superior to the EEG-only model when compressing EEG signals, indicating that the performance benefits of iEEG training have transferred successfully. In line with the previous cross-modal results, this improvement is more marked at high compression ratios. At the same time, the mixed model also performs on par with the EEG-only model at lower compression ratios, mitigating the drawback we had reported in the previous cross moos-modal results.
On the other hand, we also test mixed BrainCodec on iEEG recordings. In this case, we do not observe any benefit of mixed-modal training in reconstruction fidelity. However, we also do not observe any notable reduction in performance.
5.3 BRAINCODEC COMPRESSION PERFORMANCE
BrainCodec
BrainCodce
20-
AAC SAHHH
M.SHHT
PRO (owerls 1
PRD [lowerts
16
20
32
64
Compression ratio [log]
Compression miio [log]
(a) Testing on the SWEC dataset.
(b) Testing on the MC dataset.
Figure 4: Within-modality signal reconstruction fidelity of BrainCodec on intracranial EEG (iEEG). BrainCodec trained only on the SWEC dataset shows increased performance across the board both on the SWEC and MC dataset, and also reaches higher compression ratios while main- taining a moderate PRD.
Next, we train BrainCodec exclusively on iEEG data to compress other iEEG datasets. Likewise, we train BrainCodec on EEG data compress other EEG datasets, ensuring compression is performed within the same modality. We then compare the results with baseline methods.
We compress iEEG and EEG signals with varying compression ratios from 2x to 64x. We com- pare BrainCodec with multiple state-of-the-art methods found in the literature, both neural network- based and classical. The full set of results can be found in App.
We choose two iEEG datasets to test the performance of BrainCodec with iEEG compression: SWEC and MC. We train all models that require training on a subset of the respective dataset and test on the remaining part. The results of the best performing BrainCodec model on the SWEC dataset are shown in Figure 44a At lower compression ratios, BrainCodec improves on the PRD compared to both AAC and NLSPIHT, but the baselines remain competitive. At higher compression ratios, however, BrainCodec is notably better, with lower PRD at almost twice the compression. In particular, BrainCodec remains in the high-fidelity regime even with 64x compression ratio. Figure 4b paints a similar picture for the iEEG MC dataset. BrainCodec surpasses all baselines at lower compression ratios and reaches much higher ratios overall. Performance is high when trained with the iEEG SWEC dataset, indicating that BrainCodec generalizes well across iEEG datasets within the same modality.
8

---

Published as a conference paper at ICLR 2025
40-
Braie AAC
BrainCodec ARR
MLSPHT
NLISHHT
AAC
20
25
PRO
16-
10-
18-
Compression [log]
Compression ratio [log]
(a) Testing the CHB dataset.
(b) Testing the BONN N dataset.
Figure 5: Within-modality signal reconstruction fidelity BrainCodec on scalp EEG. Brain- Codec trained only the CHB dataset, shows increased performance across the board both on the CHB and the BONN dataset, and also reaches higher compression ratios while maintaining a moderate PRD.
We test BrainCodec's performance on EEG data with three EEG datasets, CHB-MIT, BONN, and BCI IV-2a. Figure [al shows that BrainCodec improves the PRD compared to all other methods on the EEG CHB-MIT dataset. Moreover, it can also achieve much higher compression ratios. The model BrainCodec Base trained subset of the CHB-MIT dataset and tested the remaining part. to ensure no contamination between the subjects. The same trend holds for the EEG BONN N dataset (Figure (5b). The BONN dataset is too small both train and test the two neural network- based approaches, BrainCodec and ANN. Therefore, we first train them on other EEG datasets and then test them on BONN. As seen previously with iEEG, the performance BrainCodec is notably better than the baselines even when trained across EEG datasets within the same modality. The results of BrainCodec on BCI can be found in Figure A6
Finally, we also provide a subjective evaluation by expert neurologist of the SWEC iEEG and the CHB-MIT EEG datasets as compressed by BrainCodec. The evaluation subjectively confirms that BrainCodec achieves high-fidelity reconstruction both on iEEG and EEG. More details can be found in App.
We find that BrainCodec shows superior performance compared to all baselines across suite of benchmarks both on iEEG and EEG, as can be seen App. D Overall, these results indicate that BrainCodec is an efficient iEEG and EEG compressor, both within and across datasets.
5.4 DOWNSTREAM CLASSIFICATION TASKS
As another objective measurement of reconstruction quality, we validate the reconstruction fidelity on downstream classification tasks: the iEEG seizure detection task, and the EEG motor imagery task.
First, we evaluate BrainCodec on the iEEG seizure detection task, by testing a subject-specific EEG- WaveNet (Thuwajit et al.] 2022) seizure classifier on the reconstructed signal. We test the EEG- WaveNet across all subjects with leave-one-out
valliation scheme, training for each subject on all seizures but one and testing on the remaining seizure. Table [ provides the compression ratio, PRD, and resulting F1-score for the signals reconstructed by BrainCodec. Even at 64x compression, there is loss of performance in the seizure detection task. Moreover, the Fl-score of the BrainCodec GAN model degrades only by 8% 256x compression, likely due to its better reconstruction of the higher frequencies with respect the Base model (see App. C.3). Thus, the relevant information content is preserved by BrainCodec while providing significant storage and transmission savings.
Second, we evaluate BrainCodec on the EEG motor imagery task using the MI-BMInet (Wagg et al.) 2024b) classifier. The training and testing setup is analogous to the seizure detection task. Specif-

---

Published as a conference paper at ICLR 2025
Original iEEG
BrainCodec Base
BrainCodec GAN
CR
8
64
128
256
8
64
128
256
F1 t
0.79
0.79
0.78
0.72
0.62
0.78
0.78
0.72
0.72
PRD
+ n.a
1.88
15.7
26.3
40.7
2.37
17.6
30.0
47.4
Table 1: Performance of the BrainCodec compressor the iEEG seizure detection task. The PRD remains low (<30) even at 64x compression, and the F1-score remains high when a standard subject-dependent EEGWaveNet makes inferences with the reconstructed data instead of the original iEEG (< % drop).
ically, we train the compressor on the first subject of the BCI dataset, and then report the average test accuracy across all remaining subjects. BrainCodec shows high-fidelity reconstructions up to a 4x compression ratio, and maintains useful classification performance up to 16x. This rate of compression is expectedly lower than iEEG, as EEG has intrinsically lower SNR and is thus less amenable to compression.
Original EEG
BrainCodec Base
BrainCodec GAN
CR f
n.a.
4
8
16
64
4
8
16
64
Acc. f
77%
76%
73%
72%
63%
74%
73%
73%
57%
PRD | n.a
3.44
10.4
29.0
45.5
8.04
39.2
45.3
73.8
Table 2: Performance of the BrainCodec compressor the EEG motor imagery task (BCI IV-2a). Subject has been excluded from the evaluation, as it has been used to train BrainCodec. The PRD remains moderate even at high compression ratios, and the accuracy remains high when standard subject-dependent MI-B.MInet makes inferences with the reconstructed data instead of the original EEG.
Overall, we confirm that BrainCodec can achieve high compression ratios both on iEEG and EEG signals without notably impacting downstream task performance. Therefore, we have sufficiently characterized and validated BrainCodec as efficient iEEG and EEG compressor.
6 DISCUSSION
In this work, we present BrainCodec, high-fidelity neural compressor for EEG and iEEG signals. BrainCodec is effective across both modalities and a variety of datasets, indicating that it can suc- cessfully replace existing methods and be introduced in any EEG processing pipeline. Compression by BrainCodec up to 64x x does not affect downstream seizure detection performance as evaluated both by human experts and deep learning models. We also observe that BrainCodec performs bet- ter when trained with high SNR iEEG. This performance increase is maintained when compressing the noisier EEG signal, compared the same model trained on the very same EEG modality. We therefore highlight the importance of training deep learning models on high-quality signals also in the medical domain.
Overall, BrainCodec is an immediate compression replacement for many EEG and iEEG applica- tions, enabling transmission and storage cost savings in critical clinical environments. We expect the adoption of BrainCodec to increase the feasibility of long-term recordings and wearable devices.
Further work is necessary to assess whether the intermediate representations of BrainCodec can be directly used by other deep learning models, to increase performance and provide an additional speed-up. Architectural changes to BrainCodec could be made, for example by utilising decoder models specifically developed for biosignals (Zhang al. 2023). Moreover, the RVQ quantiza- tion schema of BrainCodec known to be not necessarily codebook efficient, and improvements already being developed in the field (Kumar et al.) 2024). On this front, more venues be- ing explored to replace RVQ with another quantization schema, such as Finite Scalar Quantiza- tion (Mentzer et al. 2024).
10

---

Published as a conference paper at ICLR 2025
ACKNOWLEDGMENTS
This work supported by the Swiss National Science foundation (SNF), grant no. 200800.
REPRODUCIBILITY
The training setup, losses, and optimizers are described in detail in Sec. 4 and App. A All datasets used are listed and are publicly available for download, and the data selection for the generation of the results is also explained in detail. Finally, the code is available at https: /ggi/igiit thub. com/ pta///egg-eeee---aai---opppppppp
REFERENCES
Kahlaa K. Al-Nassrawy, Ali Kadhum Idrees, and Dhiah Al-Shammary. A novel lossless eeg com- pression model using fractal combined with fixed-length encoding technique. In Lecture Notes on Data Engineering and Communications Technologies. 2022.
Madyan Alsenwi, Tawfik Ismail, and M. Saeed Darweesh. Hybrid compression techniques for EEG data based on lossy/lossless compression algorithms. arXiv preprint arXiv: 027133 2018.
Ralph G. Andrzejak, Klaus Lehnertz, Florian Mormann, Christoph Rieke, Peter David, and Chris- tian E. Elger. Indications of nonlinear deterministic and finiteddimensional structures in time se- ries brain electrical activity: Dependence on recording region and brain state. Physical Review E, 64(6), 2001.
Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3433 2013.
2013.
Christopher P. Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Des- jardins, and Alexander Lerchner. Understanding disentangling in f-vae. arXiv preprint NPXiv:/804.03590 2018.
Alessio Burrello, Lukas Cavigelli, Kaspar Schindler, Luca Benini, and Abbas Rahimi. Laclaps: An energy-efficient seizure detection algorithm from long-term human iEEG recordings without false alarms. In Design, Automation & Test in Europe Conference & Exhibition (DATE), 2019.
Alessio Burrello, Simone Benatti, Kaspar Schindler, Luca Benini, and Abbas Rahimi. An ensemble of hyperdimensional classifiers: cerdware--rienddee short-latency seizure detection with automatic ieeg electrode selection. IEEE Journal of Biomedical and Health Informatics, 25(4))935-946, 2021. doi: 10.1
Alexander J. Casson, David C. Yates, Shelagh J.M. Smith, John S. Duncan, and Esther Rodriguez- Villegas. Wearable electroencephallograpyy IEEE Engineering in Medicine and Biology Maga- zine, 29(3), 2010.
Alexander Craik, Yongtian He, and Jose L Contreras-Videe Deep learning for electroenccehhalogram (EEG) classification tasks: review. Journal of Neural Engineering, 16(3), 2019.
Jigar Dani and Sriram Srinivasan. Satin: Microsoft's latest ai- ai-powered audio codec for real-time wawenns-boog/aaa-mmiiiiee February 2021.
communications. http:://cchhoommuuiiiiiiccccoooo wwwpaiiirrooootttaa-l-eeeeeeeeee henpep/ppoerreeuuaaooodddeorooar
Alexandre Défossez, Jade Copet, Gabriel Synnaeve, and Yossi Adi. High fidelity neural audio compression. Transactions on Machine Learning Research, 2023.
Prafulla Dhariwal, Heewoo Jun, Christine Payne, Jong Wook Kim, Alec Radford, and llya Sutskever. Jukebox: A generative model for music. arXiv preprint arXiv:2005.00341, 2020.
XiuLi Du, Kuan KuanYang Liang, YaNa Lv, and ShaoMing Qiu. Fast reconstruction of EEG signal compression sensing based on deep learning. Scientific Reports, 14(1), 2024.
11

---

Published as a conference paper at ICLR 2025
Suriya Gunasekar, Yi Zhang. Jyoti Aneja, Caio César Teodoro Mendes, Allie Del Giorn,, Sivakanth Gopi, Mojan Javaheripi, Piero Kauffmann, Gustavo de Rosa, Olli Saarikivi, Adil Salim, Shital Shah, Harkirat Singh Behl, Xin Wang. Sébastien Bubeck, Ronen Eldan, Adam Tauman Kalai, Yin Tat Lee, and Yuanzhi Li. Texthooks are all you need. arXiv preprint arXiv:2306. 1144, 2023.
Ling Guo, Daniel Rivero, Julián Dorado, Juan R. Rabuñal, and Alejandro Pazos. Automatic epileptic seizure detection EEGs based on line length feature and artificial neural networks. Journal of Neuroscience Methods, 191(1), 2010.
Hend A. Hadi, Loay E. George, and Enas Kh. Hassan. Lossless EEG data compression using delta modulation and two types of enhanced adaptive shift coders. In New Trends in Information and Communications Technology Applications. 2021.
Sten Hanke, Francesca Mangialasche, Markus Bödenler, Bernhard Neumayer, Tiia Ngandu, Patrizia Mecocci, Helena Untersteiner, and Elisabeth Stögmann. Ai-based predictive modelling of the onset and progression of dementia. Smart Cities, 5(2), 2022.
Behzad Hejrati, Abdolhossein Fathi, and Fardin
A new near-lossless EEG compression method using ANN-based reconstruction technique. Computers in Biology and Medicine, 87, 2017.
Higgins, Faul, R P McEvoy, McGinley, Glavin, W Marnane, and E Jones. EEG com- pression using JPEG2000: How much loss is too much? In Anmual International Conference of the IEEE Engineering in Medicine and Biology, 2010.
Jungil Kong, Jaehyeon Kim, and Jaekyoung Bae. HiFi-GAN: Generative adversarial networks for efficient and high fidelity speech synthesis. Advances in Neural Information Processing Systems (NeurIPS), 33, 2020.
Levin Kuhlmann, Klaus Lehnertz, Mark P. Richardson, Björn Schelter, and Hitten P. Zaveri. Seizure prediction - ready for a new era. Nature Reviews Neurology, 14(10), 2018.
Kundan Kumar, Rithesh Kumar, Thibault De Boissiere, Lucas Gestin, Wei Zhen Teoh, Jose Sotelo, Alexandre De Brebisson, Yoshua Bengio, and Aaron Courville. MelGAN: Generative adver- sarial networks for conditional waveform synthesis. Advances in Neural Information Processing Systems (NeurIPS), 32, 2019.
Rithesh Kumar, Prem Seetharaman, Alejandro Luebs, Ishaan Kumar, and Kundan Kumar. High- fidelity audio compression with improved RVQGAN. Advances in Neural Information Processing Systems (NeurIPS). 36, 2024.
Katherine Lee, Daphne Ippolito. Andrew Nystrom, Chiyuan Zhang, Douglas Eck, Chris Callison- Burch, and Nicholas Carlini. Deduplicating training data makes language models better. In Smaranda Muresan, Preslav Nakov, and Aline Villavicencio (eds.), Proceedings of the 60th An- mual Meeting of the Association for Computational Linguistics (Volume Long Papers), Dublin, Ireland, 2022.
Adam Li, Chester Huynh, Zachary Fitzgerald, Iahn Cajigas, Damian Brusko, Jonathan Jagid, An- gel O. Claudio, Andres M. Kanner, Jennifer Hopp, Stephanie Chen, Jennifer Haagensen, Emily Johnson, William Anderson, Nathan Crone, Sara Inati, Kareem A. Zaghloul, Juan Bulacio, Jorge Gonzalez-Martinez, and Sridevi V. Sarma. Neural fragility as EEG marker of the seizure onset zone. Nature Neuroscience, 24(10), 2021.
Fabian Mentzer, David Minnen, Eirikur Agustsson, and Michael Tschannen. Finite scalar quantiza- tion: VQ-VAE made simple. In The Twelfth International Conference Learning Representa- fions (ICLR), 2024.
Niklas Muennighoff, Alexander M Rush, Boaz Barak, Teven Le Scao, Nouamane Tazi, Aleksandra Piktus, Sampo Pyysalo, Thomas Wolf, and Colin Raffel. Scaling bata-constrained language mod- els. In seieth-eeventh Conference Neural Information Processing Systems (NeurIPS), 2023.
12

---

Published as a conference paper at ICLR 2025
Binh Nguyen, Dang Nguyen, Wanli Ma, and Dat Tran. Wavelet transform and adaptive arithmetic coding techniques for EEG lossy compression. International Joint Conference on Neural Net- works (IJCNN), 2017.
Binh Nguyen, Wanli Ma, and Dat Tran. A study of combined lossy compression and seizure detec- tion on epileptic EEG signals. Procedia Computer Science, 126, 2018.
K Schindler, R Wiest, M Kollar, and F Donati. Using simulated neuronal cell models for detection of epileptic seizures in foramen ovale and scalp eeg. Clinical Neurophysiology. 112(6):1006-1017, June 2001. ISSN 1388-2457. doi:
J00522-3.
Ali Shoeb. CHB-MIT scalp EEG database. 2010. doi: 10.13026/C2K0IR.
Ali Hossam Shoeb. Application of machine learning epileptic seizure onset detection and treat- ment. PhD thesis, Massachusetts Institute of Technology. 2009.
Michael Tangermann, Klaus-Robert Müller, Ad Aertsen, Niels Birbaumer, Christoph Braun, Clemens Brunner, Robert Leeb, Carsten Mehring, Kai J. Miller, Gernot R. MüllerrPutz, Guido Nolte, Gert Pfurtscheller, Hubert Preissl, Gerwin Schalk, Alois Schlögl, Carmen Vidaurre, Stephan Waldert, and Benjamin Blankertz. Review of the BCI competition IV. Frontiers in Neuroscience, 2012.
Punnawish Thuwajit, Phurin Rangpong, Phattarapong Sawangjai, Phairot Autthasan, Rattanaphon Chaisaen, Nannapas Banluesombatkul, Puttaranun Boonchit, Nattasate Tatsaringkansakuu, Tha- panun Sudhawiyangkul, and Theerawit Wilaiprasitporn. EFGWaveNet: Multiscale CNN-based spatiotemporal feature extraction for EEG seizure detection. IEEE Transactions on Industrial Informatics, 18(8), 2022.
Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Advances in Neural Information Processing Systems (NeurIPS), 30, 2017.
Christopher Wang, Adam Uni Yaari, Aaditya K Singh, Vighnesh Subramaniam, Dana Rosenfarb, Jan DeWitt, Pranav Misra, Joseph R. Madsen, Scellig Stone, Gabriel Kreiman, Boris Katz, Ignacio Cases, and Andrei Barbu. Brain treebank: Large-scale intracranial recordings from naturalistic language stimuli. In The Thihty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2024a. URL httpss:/opeenevvee..ette/./e net.:oummffff
K2IJF KZ1JF8kguO
Xiaying Wang, Michael Hersche, Michele Magno, and Luca Benini. MI-BMInet: An efficient convolutional neural network for motor imagery brain-machine interfaces with EEG channel se- lection. IEEE Sensors Journal, 24(6), 2024b.
Webex. Webex Al codec: The pooreed codec for modern communications. Whitepaper, 2022.
URL www.hhtpp:/w/wwt webex. haamm/ggwwebbbx a codec. html
Gaowei Xu, Jun Han, Yao Zou, and Xiaoyang Zeng. A 1.5-D multi-channel EEG compression algorithm based on nlspiht. IEEE Signal Processing Letters, 22(8), 2015.
Ryuichi Yamamoto, Eunwoo Song, and Jae-Min Kim. Parallel WaveGAN: A fast waveform genera- tion model based on generative adversarial networks with multi-resolltion spectrogram. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2020.
Gürkan Yilmaz, Andrea Seiler, Olivier Chételat, and Kaspar A. Schindler. UUtra--LoggTermmm Monitoring (ULTEEM) systems: Towards user-friendly out-of-hospital recordings of electrical brain signals in epilepsy. Sensors, 24(6), 2024.
Neil Zeghidour, Alejandro Luebs, Ahmed Omran, Jan Skoglund, and Marco Tagliasacchi. Sound- Stream: An end-to-end neural audio codec. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 30, 2022.
Yukun Zhang, Shuang Qiu, and Huiguang Hc. Multimodal motor imagery decoding method based on temporal spatial feature alignment and fusion. Journal of Neural Engineering, 20(2):026009, March 2023. ISSN 1741-2553 doi: 10.
13

---

Published as a conference paper at ICLR 2025
A NEURAL COMPRESSOR DETAILS
A.1 TRAINING OBJECTIVE
We apply multiple losses to capture properties of both the time and frequency domain. The recon- struction loss over the time domain & measures the L1 distinte between the original signal (a) and the reconstructed signal (æ):
(x, at) | +111-
The reconstruction loss over the frequency domain E, consists of linear combination between L1- and Li-distance computed over different scales of the spectrogram. particular,
(x, ④)
Σ RE!
(1)) S;(a)] + (a.( (2)))
(3)
[.)))
where 5,(+) the output of an STFT with window size of 2 and hop length of 2 We choose T= (5, 11) and a = 1.
further introduce a new relative line length loss that accounts for large differences amplitude. Often the amplitude of seizure sample is much larger than the amplitude of a non-seizure sample. When reconstructing such seizure sample, a relatively small deviation can cause large L1- or Ly-distance. In these cases, the weight updates contribute much more to the overall loss than non-seizure samples. To address this imbalance, compute the relative difference in line length of the original and reconstructed signal, which is independent of the amplitude. Formally,
mainly driven by seizure samples, since they
W Σ
Fo 1
Be+wi
&t 11--+1m5 1
(axx, .))
T+tWS
3t -1-1+w
with Tw windows of size W and stride S. We choose T = 128 and 64.
To improve the reconstruction high frequencies, we apply perceptual losses that are based on the MS-STFT discriminator. The discriminator network is trained by minimizing the adversarial loss of the generator fg as well as the adversarial loss of the discriminator la. The two losses are defined as follows:
K
(z)
mean(max Dx
(5)
K
La x)
Σ mean (0 0, 1 (x(x)) + mean(max(0, 1 D)())),
(6)
where is the number of discriminators and D the output of the respective discriminator.
At the same time, exploit the multi-scale features learned by the discriminators compute feature loss,
a) ΣΣ - (1)1
[
where K is the number of discriminators, L is the number of layers of a discriminator, and D is the output of the respective layer.
We further add quantization loss b that computes the MSE between the latent representation (z)
and its quantized version (z,)):
(z 2n) = Σ Izz (2
(8)
o=l
14

---

Published as a conference paper at ICLR 2025
where C' is the number of codebooks. Since the codebook entries updated using exponential moving average, we compute the gradients only with respect to the latent representation (z).
With the exception of La, all losses added up the overall generator loss.
LG d 4 As Eg
d l X5 Eg + >g Eg
Xg bg.
where de. A,. A₁. Ay. Ag. and 0g the weights to balance between the loss terms. We further a loss balancer introduced by Défossez et al. (2023) to deal with the varying scale the gradients and to stabilize training between generator and discriminator.
A.2 TRAINING SCHEMA
For the iEEG compression task, the recordings from subject IDI, which have 47 channels for a total duration 5604 seconds, and contain 13 seizures. We randomly sample 80% of that data for training and use the remaining 20% for validation. For the seizure detection task, exclude IDI from the dataset and use the recordings from the remaining 15 subjects of the database.
For the leave-one-our tross-validation. seizures of the respective subject. We use the original recordings N seizures for training, and the reconstructed recording of the remaining seizure for validation. The performance for subject is the average across N trials. The final performance is the average across all subjects, weighted by the number of seizures. All classifiers are trained for 50 epochs with a learning rate of 10-4 44 We use samples of 5 seconds and a batch size of 128.
train N classifiers per subject, where N is the number of
B ABLATIONS
B. REFERENCE SCHEMA
The reference schema is often underappreciated aspect of data collection. To evaluate how BrainCodec's performance varies with different references, we use the unprocessed Brain Treebank dataset and reference in post-processing. Laplacian refers referencing each electrode with the mean within its electrode group
Reference
CR
PRD
PRD-spec
RMSE
SNR t
PSNR
None
64
15.21
10.27
10400
18.49
27.81
Median
64
14.67
9.89
8440
18.36
27.95
Bipolar
64
14.36
9.19
8439
18.89
28.38
Laplacian
64
16.56
11.75
1160
18.96
27.53
Table A1: Ablation of the reference schema.
Table A1 shows that BrainCodec is robust to the reference schema. Moreover, variations can most likely be explained with the changes in SNR of the dataset due to the reference itself.
B.2 ENCODER
Out of the three components of BrainCodec the Encoder is directly in contact with the raw data, such that its parameters have a noticeable effect on all downstream components. In particular, we adopt the same choices as SoundStream (Zeghidour al. 2022) except for the initial kernel size, which needs to be modulated based on the specific characteristics of EEG and iEEG.
We evaluate the effect of the initial kernel size of the Encoder component the compression per- formance in Table A2 We use the Base model at 64x compression trained on the iEEG SWEC dataset and tested the same dataset.
15

---

Published as a conference paper at ICLR 2025
Kernel size
PRD +
PRD-spec |
RMSE +
SNR 1
PSNR t
3
15.74
10.93
16.14
17.96
36.73
15.94
11
16.37
17.94
33.86
15.91
10.91
16.27
17.83
33.87
Table A2: Ablation of the Encoder's initial kernel size.
value of was chosen in the original architecture; however, in accordance with the decreased sample rate of our data, our choice of a kernel size of 3 yields increased performance with respect all alternatives.
B.3 QUANTIZER
We evaluate the effects of the parameters of the Quantizer component the compression perfor- mance. In particular, we vary the number of residuals in Table A3 and doing so we also change the compression ratio. In contrast, for models choose to change the Encoder's framerate to adjust the compression ratio, as it yields superior performance.
Residuals
CR
PRD 4
PRD-spec +
RMSE
SNR t
PSNR
256
38.36
31.75
36.03
9.67
25.72
4
64
15.74
10.93
16.14
17.96
36.73
8
32
10.26
6.08
10.95
22.04
37.94
16
8.74
4.32
9.44
23.76
39.57
Table A3: Ablation of the Quantizer's number of residuals.
The compression ratio is also affected, albeit in a minor way. by the size of the codebook. Therefore, we also perform an ablation on the codebook size, as shown in Table A4
Codebook size
CR
PRD 4
PRD-spec spec 1
RMSE 4
SNR
PSNR 1
64
85.33
21.09
17.82
21.58
15.47
31.26
128
73.14
18.16
14.40
18.70
16.79
32.63
256
64
15.74
10.93
16.14
17.96
36.73
512
56.89
13.95
9.02
14.34
19.02
35.02
1024
51.20
12.74
7.85
13.09
19.77
35.83
Table A4: Ablation of the Quantizer's codebook size.
Our choice of 256 represents effective compromise between reconstruction fidelity and compres- sion, requiring only log, 256 bits to store.
B.4 LINE LENGTH LOSS
One of the major improvements we adopt over the original SoundStream to better suit our data's characteristics is an additional line length loss term. This term is informed by the existing consensus that line length can a useful indicator of seizures and other pathological states. Considering that most collected iEEG data is pathological by nature, considering its line length can yield effective improvement in compression and downstream classification tasks. Therefore, we evaluate the ef- fect of our additional line length loss the reconstruction fidelity. Table shows the performance of a Base model trained both with and without line length loss. Results show that there a net improvement both in PRD and SNR.
16

---

Published as a conference paper at ICLR 2025
Line length
CR f
PRD
PRD-spec |
RMSE +
SNR f
PSNR
Yes
64
15.74
10.93
16.14
17.96
36.73
No
64
15.95
10.87
16.26
17.93
33.84
Table A5: Ablation of the line length loss.
However, a larger effect can be appreciated in the spectrogram of signals reconstructed by the GAN model.
200
120
140
Frequency [F4]
140
Frequency
130
120
100
50
[s]
(a) Ictal sample reconstructed with line length loss.
Ictal sample reconstructed without line length loss.
Figure Al: Difference in reconstruction fidelity of GAN BrainCodec trained with and without line
length loss. The performance high frequencies notably improves with the line length loss.
Figure Al shows that the line length loss improves the reconstruction fidelity of high frequencies, especially on ictal samples. In particular, the model without line length loss shows clear artifacting above Hz.
B.5 NUMBER OF TRAINING SUBJECTS
As detailed in Section A.2 we only use one subject to train each compression model, which show- cases our model cross-subject generalisability. of BrainCodec increases as the number of training subjects increases, there are diminishing returns. In particular, we train two additional models on subjects IDO1, ID03, and IDO1, ID03, ID04, IDO5, and always test on all subjects except ID01, ID03, ID04, ID05. Therefore, our model presents the best compromise between training data, training complexity, and reconstruction fidelity.
Table A6 we report that, while the performance
Training patients
CR t
PRD
PRD-spec
RMSE J
SNR
PSNR
64
15.56
10.73
16.83
18.26
34.41
2
64
14.31
7.36
13.56
18.58
34.97
4
64
13.96
7.37
13.45
18.79
35.2
Table A6: Ablation of the number of training subjects.
17

---

Published as a conference paper at ICLR 2025
C ADDITIONAL RESULTS
C.I CROSS-DATASE AND CROSS-MODALITY COMPRESSION
We test the performance BrainCodec both in a cross-dataset and cross-modality scenario. We evaluate the iEEG to EEG and EEG to iEEG generalization by training BrainCodec on the SWEC, CHB-MIT, and BCI IV-2a datasets and using those same models compress the SWEC, MC, CHB- MIT, BCI IV-2a, and finally all the subsets of the BONN dataset.
On the iEEG SWEC dataset (see Figure A2) the neural compressor trained on the same SWEC dataset performs notably better for compression ratios above 16, but the CHB model is still compet- itive with the other basclines even across modalities. For lower compression ratios, the CHB-MIT and the SWEC models both perform par. Finally, the BCI model is never competitive, likely because the BCI dataset does not contain any seizures and the model is thus unable to compress them well.
On the iEEG MC dataset (see Figure A3) the neural compressor trained on SWEC surpasses all baselines that trained on the same MC dataset.
On the iEEG Brain Trecbank dataset (see Figure A4) the neural compressor trained on SWEC per- forms comparable level to testing on SWEC itself. Due the challenging nature of train- ing GAN models, some of the results obtained by training on the combined SWEC and TreeBank datasets are not favourable.
On the CHB-MIT dataset (see Figure A5). the three models paint a different pictures. While the CHB model performs the best, being trained the same dataset as it is tested on, the SWEC models is very competitive across the board, even beating the native model at the 64 compression ratio. On the other hand, the BCI model still performs the worst, but the gap smaller than on the SWEC dataset.
Next, we test on the BCI IV-2a dataset. Figure A6 indicates that, like previous results, cross-testing with different datasets and modalities generally lowers performance. However, the distance between the two models train on EEG datasets less significant here, presumably due the fact that the testing dataset is large enough to lessen the effects of overfitting. In fact, when training on a different modality, the lower compression scenario most affected, where the specific information content of the signal is more relevant to a better compression. On the contrary, with a higher compression ratio fidelity suffers as a consequence, and hence the differences between EEG and iEEG also become less impactful.
Finally, we test the cross-dataset and cross-modalities generalization performance on the BONN dataset. Figure [A7 are competitive. In particular, the model trained on CHB-MIT tends to perform better at lower com- pression ratios. The opposite is true for the model trained SWEC, which scales more gracefully with the compression ratio.
| shows that the CHB (same modality) and SWEC (different modalities) models
Across all the different datasets we observe similar trends: the EEG models perform better at lower compression while the iEEG model performs better at higher compression. One possible interpre- tation is that EEG models exposed to a sufficient amount of noise and able to compress at low compression ratios, while they tend to overfit on that same noise and are less effective in higher compression scenario. On the contrary, iEEG models are less exposed noise and thus do not compress it as efficiently, but also do not lose performance because of it with high compression ratios.
18

---

Published as a conference paper at ICLR 2025
Model
*
BrainCodec Base
60
BrainCodec GAN
AAC
NLSPIHT
Training dataset
PRD [lower better]
SWEC
40
CHB-MIT
BCI
SWEC+CHB
30
10
2
4
16
32
64
Compression ratio [log]
Figure A2: Reconstruction fidelity of BrainCodec on the iEEG SWEC dataset.
18
Model
BrainCodec Base
16
BrainCodec GAN
AAC
14
NLSPIHT
Training dataset
PRD [lower is better]
SWEC
SWEC+CHB
10
2
2
4
16
32
64
Compression ratio [log]
Figure A3: Reconstruction fidelity of BrainCodec on the iEEG MC dataset.
19

---

Published as a conference paper at ICLR 2025
Model
BrainCodec Base
100
BrainCodec GAN
Training dataset
SWEC
80
SWEC+Treebank
PRD [lower better]
60
40
20
0
2
16
32
64
Compression ratio [log]
Figure A4: Reconstruction fidelity of BrainCodec on the iEEG Brain Treebank dataset.
80
Model
BrainCodec Base
BrainCadec GAN
70
AAC
NLSPIHT
60
Training dataset
PRD [lower better]
SWEC
CHB
BCI
SWEC+CHB
20
10
2
4
16
32
64
Compression ratio [log]
Figure A5; Reconstruction fidelity of BrainCodec on the EEG CHB dataset.
20

---

Published as a conference paper at ICLR 2025
Model
BrainCodec Base
X
BrainCodec GAN
CS
AAC
Training dataset
PRD [lower better]
SWEC
CHB-MIT
BCI
40
SWEC+CHB
30
20
2
16
32
64
Compression ratio [log, higher is better]
Figure A6: Reconstruction fidelity of BrainCodec on the EEG BCI IV-2a dataset.
21

---

Published as a conference paper at ICLR 2025
Model
Model
SrainCodce Base
BrainCodio Base
BranCodue GAN
70
Brantoduc GAN
LiGHT
ISPHT
40-
is bettor)
60-
Training dataset swec
Training dataset SWEC
30-
PRD (lower
CHII-IT
40
CHID-II
DCI
10-
10-
Compression ratio [log]
Compression raii [log]
(a) BONN Z dataset.
(b) BONN O dataset.
40
Model
45
Model
BrainCodic
BrainCodic
30-
AAC
PRO [lowert bettor)
AAC
25
Training dataset
Training dataset SWEC
SWEC
PRD
12.
20-
16
16
Compression [log]
Compression ratio [Dog]
(c) BONN dataset.
(d) BONN F dataset.
BrainCodec Buse
1T BraisCodie CAN
200
NLISPNT
ANN
PRO flower to better)
AAC
220 SWEc
Training
CHI-MIT
BCI
*
32
Compression ratio [log]
(e) BONN dataset.
Figure A7: Reconstruction fidelity of BrainCodec the EEG BONN dataset.
22

---

Published as a conference paper at ICLR 2025
C.2 SEIZURE DETECTION AT EXTREME COMPRESSION RATIOS
We analyze the performance of BrainCodec in retaining the information content of the iEEG signal necessary to perform seizure detection.
Figure A8a shows the same scenario as in the main Results, i.e., when an BEGWaveNet model trained on the original signal is tested on the reconstructed signal. Both Fl-score and accuracy are stable to a 64x ratio, and then start to decrease significantly. Interestingly, the GAN model loses performance more gracefully than the base model, indicating that retains more of the information used by the automated seizure detection model. This is in contrast to human preference, as the expert evaluates the Base model as better than the GAN model for seizure detection (see App. E
The opposite scenario, i.e.. when an WEGWaveNet model trained on the reconstructed signal is tested on the original signal, shows similar results in Figure A8b Here, the GAN model keeps the same performance up to x28x compression ratio, but then also decreases rapidly. The Base model still reaches 64x compression at the same Fl-score level.
Finally, Figure A8c shows significantly different behavior. When the models are both trained and tested on the reconstructed signal, only minor degradation in performance can be observed at 512x compression ratio. This result suggests that the neural compressor is preserving some the necessary information to perform seizure detection even at such high compression, but the EEGWaveNet model relies on other, not maintained, information when trained on the original signal. Only when trained with this new implicit set of features is the classification model able to fully make use of it.
23

---

Published as a conference paper at ICLR 2025
0.8
0.7
F1-score
0.6
0.5
BrainCodec Base
BrainCodec GAN
32
64
128
256
512
Compression ratio
(a) EEGWaveNet is trained on the original iEEG signal, and then the compressed signal used to perform classification.
F1-score
0.7
0.65
BrainCodec Base
BrainCodec GAN
8
16
32
64
128
256
512
Compression ratio
(b) Seizure classification performance of BrainCodec with EEGWaveNet. EEGWaveNet trained the orig- iEEG signal, and then compressed signal is used to perform classification.
0.8
0.79
F1-score
0.78
0.77
BrainCodec Base
0.76
BrainCodec GAN
Compression ratio
(c) Scizure classification performance of BrainCodec with FFGWaveNet. REGWaveNet is trained on the com- pressed iEEG signal, and then the same compressed signal is used to perform classification.
Figure A8: Seizure classification performance BrainCodec with EEGWaveNet.
24

---

Published as a conference paper at ICLR 2025
C.3 BASE VS GAN NEURAL COMPRESSOR
The architecture of BrainCodec allows us to introduce an adversarial training routine using a GAN, which has empirically shown better performance in compressing audio (Défossez et al. 2023). We observe that the effect of GAN on EEG is more mixed, improving results in some aspects and worsening in others. On the one hand, seen in the main Results and in App. C.2 the GAN model better compresses the information content required by the BEGWaveNet model to perform seizure detection. Moreover, Figure A9 shows that the reconstruction of the higher frequencies is significantly better for the GAN model. In fact, with an increasing compression ratio, the Base model suppresses frequencies above 40Hz. The GAN, on the other hand, recovers the entire range of frequencies even at high compression. Figure A9 further illustrates the trade-off between the time and frequency domain. Comparing Figure A9c and Figure A9d is clear that by increasing the weight λ the output of the GAN converges to the output of the Base model.
On the other hand, the Base model obtains a higher PRD overall, indicating that the EEG signal contains predominantly lower frequency information. Given that the Base model does not hinder seizure detection even at 64x compression, this indicates that EEGWaveNet mostly focuses on the lower frequency components make its prediction even when the full signal is available. However, the GAN model with a fuller spectrum of frequency reconstruction still outperforms the Base model on the downstream task. This observation might extend human experts as well, as our neurologist subjectively evaluated the signal compressed by the Base model as higher fidelity than the GAN model and more useful for seizure classification (see App. E
25

---

Published as a conference paper at ICLR 2025
200
200
200
Frequency [Pz]
150
Frequency
120
100
100
50
(a) Original sample.
(b) BrainCodec Base with 128x compression.
200
200
200
Prequeenn [Pa]
Frequency [M4]
150
120
120
100
100
50
0.6
(c) BrainCodec GAN with x28x and A, 0.1
(d) BrainCodec GAN with 128x and X
Figure A9; Comparison among the spectrograms generated by different BrainCodec models.
26

---

Published as a conference paper at ICLR 2025
D FULL COMPRESSION RESULTS
SWEC
PRI>
PRID-spec 4
RMSE
SNR
PSNR
Source
0.66
0.81
1.67
57.60
70.14
4
0.94
1.05
2.12
50.95
64.89
Base
8
1.88
1.46
3.11
39.86
55.12
Ours
16
4.60
3.39
6.33
31.08
46.00
64
15.74
17.96
36.73
0.65
0.88
1.78
61.76
73.64
1.35
1.20
3.04
51.11
63.26
Base [CHB]
3.56
3.02
5.67
36.60
49.93
Ours
16
7.79
7.57
10,90
28.63
42.01
64
22.17
22.54
25.08
16.23
31.19
30.74
51.56
36.53
26.35
29.58
28.27
47.78
33.39
22.74
29.90
Base [BCI]
29.45
47.94
34.44
18.34
29.08
Ours
16
32.45
49.87
36.49
14.99
27.61
64
55.31
76.93
55.54
7.24
22.23
0.89
0.86
1.83
54.63
63.58
0.95
0.85
1,91
47.78
62.53
Base [CBB
2.16
1.69
3.64
39.29
53.88
Ours
16
4.78
3.51
6.33
30.35
45.36
16.21
17.63
1.20
1.13
2.41
49.92
60.72
4
1.49
1.15
2.68
44.51
57.67
GAN
8
2.37
1.57
3.49
37.20
52.23
Ours
16
4,79
2.15
5.83
29.15
44.98
16.31
0.84
1.04
2.14
54.33
68.50
4
1.42
2.32
3.17
47.13
61.30
GAN (CHB)
3.18
1.57
4.34
34.23
49.25
Ours
16
12.86
30.72
17.73
27.71
41.40
64
22.79
71,43
26.09
15.88
31.41
33.78
56.68
38.63
20.16
28
4
26.39
46.92
30.14
18.80
29.64
GAN [BCT]
63.35
61.97
70.76
12.33
22.34
Ours
16
62.43
63.04
69.80
11.51
22.46
54.25
52.04
22.30
2.78
1.91
3.99
36.76
53.00
4
1.25
1.00
2,30
45.19
59.32
GAN [SHEC+CHB]
15.80
3.79
14.58
17.80
36.31
Ours
16
7.67
2.91
7.87
24.51
43.11
16.97
16.56
6.93
1.64
AAC
8.65
2.95
1
Reproduced Nguyen et al 2017
11.15
5,36
1
22.71
18.27
NESPIHT
3.69
Reproduced Xu al.
2015
16
21.09
Table A7: Full compression results on the SWEC iEEG dataset.
27

---

Published as a conference paper at ICLR 2025
MC
CR f
PRD J
PRD-spec
RMSE
SNR f
PSNR
Source
2
0.62
0.11
1.07
47.49
61,83
4
0.88
0.37
1.77
44.60
58.28
Base [SWEC]
8
1.48
0.64
3.07
39.43
53.45
Ours
16
4.29
5.01
11.80
32.59
44.80
64
13.76
19.31
37.43
21.03
34,12
2
0.26
0.22
0.64
56.44
67.82
4
0.54
0.36
1.39
48.54
61.87
Base [SWEC+CHB]
8
1.58
1.14
3.95
39.36
52.70
Ours
16
3.86
3.81
9.93
32.09
45.14
64
13.91
19.38
37.25
20.31
33.83
2
1.03
0.54
2.14
43.87
56.84
4
1.23
0.63
2.69
41.85
55.20
GAN (SWEC)
1.88
1.23
4.09
37.75
51.43
Ours
16
3.89
3.08
9.68
31.81
45.02
12.12
10.38
29.19
34.73
1.85
1.91
4.75
38.86
52.65
0.74
45.61
58.92
GAN CSWE
9.21
4.64
19.98
22.97
38,37
Ours
5.14
3.40
11.07
28.50
43.84
11.89
8.49
28.06
20.70
34.89
3,96
3.52
AAC
Reproduced Nguyen
13.93
11.38
8
2.52
NLSPIHT
Reproduced Xu et
2015
16
16.78
Table A8: Full compression results on the MC iEEG dataset.
28

---

Published as a conference paper at ICLR 2025
Treebank
CR t
PRD
PRD-spec
RMSE
SNR
PSNR
Source
3.32
1.51
8418.56
34.58
44.10
3.54
1.63
8417.44
33.70
43.23
Base [SWEC]
8
3.89
1.80
8418.83
32.56
42.10
Ours
16
5.26
3.16
8422.62
28.92
38.45
64
14.36
9.19
8438.63
18.89
28.38
2.78
1.91
3,99
36.76
53.00
1.25
1.00
2.30
45.19
59.32
Base [SWEC+Treeban]
15.80
3.79
14.58
17.80
36.31
Ours
16
7.67
2.91
7.87
24.51
43.11
64
16.97
7.08
16.09
16.56
33.12
1.20
1.13
2.41
49.92
60.72
1.49
1.15
2.68
44.51
57.67
GAN [SWEC]
2.37
1.57
3,49
37.20
52.23
Ours
16
4.79
2.15
5,83
29.15
44.98
64
17.60
7.82
16.52
16.31
32,79
8,52
3.74
6312.93
23.08
32.41
65.14
65.24
7145.75
4.62
13.81
GAN [SWEC+Treebank]
70.19
66.90
7166.63
3.53
12.73
Ours
16
89.24
76.40
7634.31
1.01
10.19
64
105.87
105.57
10410.84
-0.41
8.76
Table A9: Full compression results the Brain Treebank iEEG dataset.
29

---

Published as a conference paper at ICLR 2025
CHB
CR 1
PRD 4
PReD-ppe
RMSE 4.
SNR
PSNR
Source
2
0.61
0.44
0.90
55.30
70.21
4
3.10
2.73
4.90
42.22
57.80
Buse
7.10
6.82
28.32
44.88
Ours
13.97
7.99
12.07
21.01
37.74
64
33.66
20.21
24.69
10.96
28.20
2
6.65
2.67
5.25
30.66
46.53
4
8.82
3.92
7.27
27.36
43.96
Base [SWEC)
8
11.42
5.14
9.12
23.70
40.75
Ours
14.88
6.74
11.64
19.99
37.21
28.69
2
22.65
38.81
20.08
34.25
35.14
4
21.80
35.30
18.98
26.35
34.12
Base [BCT]
8
27.11
38.01
22.51
18.22
30.94
Ours
16
34.43
44.01
26.82
13.86
28.02
64
55.37
66.13
39.41
6.66
22.99
1.04
0.34
0.72
46.81
58.77
1.78
0.55
1.28
37.4 37.49
54.62
Base [SWEC+CHB]
5.51
1.91
4.15
28.13
45.36
Ours
10.98
4.09
7.94
21.54
38.84
64
28.73
14.79
19.60
11.71
29.35
2
0.77
0.52
1.02
49.61
65.74
4
3.48
35.17
3.89
39.77
55.94
GAN
8.43
3.24
6.86
25.63
42.70
Ours
74.91
19.01
35.95
78.70
10214.30
64.54
9.76
27.07
2
9.25
4.02
7.40
27.00
42.91
4
10.30
4.40
8.32
25.11
41.77
GAN [SWEC]
8
12.97
5.12
10.01
22.23
39.35
Ours
16.76
6.56
12.36
18.67
36.11
36.96
13.44
24.91
9.42
27.39
26.22
43.68
24.60
32.26
23.22
36.67
19.39
19.99
32.13
GAN [BCI]
43.47
47.88
34.92
12.73
26.24
Ours
16
46.73
50.64
36.91
11.20
25.47
64
$9.94
55.57
39.82
4.74
22.11
2
6.79
1.85
4.85
26.42
43.65
2.28
0.59
1.59
34.89
52.03
GAN [SWEC+CHB]
31.50
9.82
11.02
29.07
Ours
21.01
4.90
14.33
15.61
33.55
64
36.80
9.99
25.47
9.63
27.58
6
AAC
11.07
10.44
Reported Nguyen al. 2017
14
12
11.76
NLSPITT
Reported Xu al 2015
21.83
Table A10: Full compression results the CHB EEG dataset.
30

---

Published as a conference paper at ICLR 2025
BCT
CR
PRD
PRD>-pec 4
RMSE
SNR
PSNR
Source
2
1,50
0.88
0.23
40.73
51.20
4
3,44
1.79
0.52
31.83
44.29
Base
8
10.36
5.98
1.78
19.81
34,86
Ours
29.05
11.73
12.38
25.66
45.51
25.37
7.34
22.31
2
20.40
5.74
3.04
15.65
28.93
4
23.00
6.14
3.44
14,10
27.83
Base [SWBC]
8
25.46
7.18
4.05
13.01
26.83
Ours
16
29.82
9.99
6.36
11.05
25.21
49.29
24.52
10.53
5.42
21.48
2
0.71
1.00
46.29
60.51
4
2.19
1.13
33.07
48.19
Base (CHB)
8
11.44
5.08
3.11
17.63
33.41
Ours
16
27.50
11.36
7.85
11.26
25.95
64
47.81
23.80
11,56
5.93
21.81
2
1.97
0.92
0.53
35.12
48.41
4.55
0.94
25.68
41.10
Base ISIEC+CIIB
8
12.56
5.56
2.45
16.60
32.41
Ours
27.35
10.08
5.09
10.81
25.84
64
47.55
25.33
9.88
5.44
21.79
2
3.77
2.12
0.55
29.23
43.14
4
8.04
6.24
1.17
22.13
36.70
GAN
8
39.18
10.84
21.53
9.72
23.46
Ours
45.35
11.62
22.24
21.95
73.78
34.63
11.22
2.05
17.88
2
25.22
7.90
3.79
13.60
26.99
4
24.94
6.87
3.73
13.20
27.08
GAN [SWEC]
8
28.14
7.30
4.38
12.10
25.93
Ours
33.60
10.16
6.29
9.63
24.11
64.42
25.23
11.18
2.39
19.06
2
0.84
0.49
0.42
41.08
56.14
4
3.19
12.46
0.93
29.63
44.97
GAN [CHB]
8
23.34
6.27
3.74
13.35
27.53
Ours
16
32.55
9.53
7.17
10.21
24.52
64
55.64
28.73
17.46
4.36
20.46
2
19.31
3.52
14.55
30.14
5.53
23.54
39.31
GAN (SWEC+CHB]
8
46.38
14.64
8.04
6.69
22.06
Ours
16
44.57
13.24
7.35
7.01
22.81
64
58.81
23.49
10.16
3.32
19.88
5
7
AAC
7.5
10
Reported (guuyen al. 2017
5
20.19
CS
Reported Du al. 2024
30.23
Table A1l: Full compression results on the BCI EEG dataset.
31

---

Published as a conference paper at ICLR 2025
BONN Z
CR
PRD
PRDsspec 1
RMSE 4
SNR
PSNR
Source
4.15
0.51
1.91
28.63
39.67
4.60
0.69
2.11
27.55
38.75
Basc [SWEC]
5.97
1.75
2.74
25.20
36.26
Ours
10.97
5.14
5.05
20.07
30.85
64
42.42
20.82
19.41
8.21
19.00
0.18
0.12
0.08
57.12
66.63
0.98
0.38
0.45
42.52
51.95
Base [CHB]
6.28
2.68
2.90
35.72
Ours
16
13.75
6.15
6.33
18.17
28.87
64
53.02
24.89
24.61
6.49
17.07
2.64
2.75
1.36
43.37
44.69
6.20
3.99
2.98
30.30
35.90
Basc [BCI]
21.71
17.09
10.21
17.08
24.99
Ours
16
32.19
23.89
14.98
11.80
21.44
64
58.33
46.19
27.08
5.25
16.07
5.16
1.17
2.37
27.58
37.75
5.19
0.94
2.38
26.54
37.61
GAN [SWEC]
6.73
1.38
3.07
23.86
35.12
Ours
12.21
3.62
18.84
64
51.84
19.67
23.67
5.90
17.23
0.37
0.26
0.17
50.14
60.28
1.09
0.57
0.50
40.84
50.95
GAN (CHB]
7.84
1.57
3.59
22.84
33.85
Ours
16
15.51
4.34
7.10
16.88
27.87
64
51,00
23.91
23.36
6.09
17.38
6.79
3,33
29.15
12.79
11.02
6.09
21.25
29.38
GAN [BCI]
8
27.93
21.00
13.08
12.88
22.70
Ours
35.83
22.84
16.69
10.26
20.51
69.00
37.75
31.51
3.39
3.44
4.31
AAC
6.67
13.93
Reproduced Nguyen ct al. 2017
15.71
44.38
8,64
NLSPIHT
Reproduced Xu el al. 2015
16
29
ANN [BCT]
3.96
6.64
Reported Hejrati et al. 2017
Table A12: Full compression results on the Z. subset of the BONN EEG dataset.
32

---

Published as a conference paper at ICLR 2025
BONN
CR
PRD
PRDsspec 1
RMSE 4
SNR
PSNR
Source
2.57
0.49
1.70
33.20
42.19
3.13
0.78
2.07
31,45
40.57
Basc [SWEC]
5,48
2.28
3.65
26.48
35.48
Ours
13.44
8.84
9.23
18.92
27.37
64
49.93
37.88
33.93
6.93
15.88
0.18
0.12
0.12
57.50
64.88
1,06
0.45
0.74
42.48
Base [CHB]
8.32
5,33
24.20
31.67
Ours
16
18.43
14.43
13.07
16.68
24.71
64
70.19
53.87
48.72
3.93
12.92
8.52
10.22
6.77
39.43
33.01
12.02
12.10
9.01
26.12
28.61
Basc [BCI]
34.94
39.01
24.89
12.87
19.04
Ours
16
46.80
48.75
32.80
8.52
16.42
64
76.50
117.39
53.85
3.13
12.09
3.52
1.07
2.33
31.26
39.49
4.02
1.11
2.67
29.31
38.26
GAN [SWEC]
6.61
1.75
4.36
24.63
34.07
Ours
13.13
18.45
64
58.62
37.89
39.84
5.02
14.48
0.40
0,26
0.28
49.93
57.72
1.14
0.56
0.77
41.24
48.77
GAN (CHB]
7.61
2,22
5.15
23.61
32.42
Ours
16
42.66
315.81
36.42
16.47
23.75
64
79.69
450.99
57.10
3.76
12.81
13.42
17.12
10.27
27.80
19.14
24.02
13.92
18.49
24.27
GAN [BCI]
8
40.33
46.75
28.54
9.95
17.71
Ours
53.15
56.85
37.60
7.33
15.33
81.31
67.09
55.69
1.99
11.55
3.52
4.53
AAC
6.79
14.56
Reproduced Nguyen ct al. 2017
16.13
46.79
7.58
NLSPIHT
Reproduced Xu el al. 2015
16
27.3
ANN [BCT]
2.84
Reported Hejrati et al. 2017
Table A 11: Full compression results on the O subset of the BONN EEG dataset.
33

---

Published as a conference paper at ICLR 2025
BONN N
CR 1
PRD )
PRD-spec
RMSE
SNR !
PSNR
Source
2.97
0.24
1.70
31.34
43.06
3.30
0.34
1.89
30.25
42.14
Base [SWEC]
8
3.83
0.81
2.20
28.84
40.77
Ours
6.05
2.33
3.55
25.01
36.74
12.17
13.58
2
0.11
0.09
0.06
59.97
70.89
4
0.53
0.19
0.32
47.21
57.96
Base [CHB]
3.12
1.07
1.88
31.40
42.70
Ours
7.07
2.58
4.22
23.84
35.45
64
25.07
13.91
14.89
12.77
24.24
6.74
9.41
4.85
46.02
40.34
7,80
9.52
35.87
Base [BCI]
8
13.20
12.78
8.68
24.30
30.74
Ours
16
20.84
19.55
13.05
17.77
26.21
48.97
52.07
29.16
7.47
18.13
3.68
0.63
2.10
30.33
41.20
4
3.63
0.43
2.07
29.47
41.28
GAN [SWEC]
4.31
0.72
2.44
27.64
39.65
Ours
6.85
1.32
3.95
23.66
35.55
64
27.88
8.74
16.00
11.16
23.16
2
0.23
0.17
0.13
53.61
64.86
0.67
0.40
0.38
44.30
55.68
GAN (CHB)
4.40
0.64
2.56
27.68
39.53
16
7.88
1.62
4.60
22.45
34.37
64
26.25
9.50
15.19
11.76
23.71
10.38
13.99
7.13
33.77
33.97
11.51
13.76
7,50
26.42
31.67
GAN [BCT]
8
22.17
23.59
14.18
17.60
25.73
Ours
26.17
24.44
16.55
15.31
24.20
55.56
42.30
31.92
5.40
16.93
3.63
3.95
AAC
6.96
12.08
Reproduced Nguyen et al. 2017
15.3
40.17
6.13
NLSPPHTT
Reproduced Xu et 2015
16
23.55
ANN [BCT]
5.23
6.82
Reported (Hejrati 2017
Table A A14: Full compression results the N subset of the BONN EEG dataset.
34

---

Published as a conference paper at ICLR 2025
BONN F
CR
PRD
PRDsspec J
RMSE 4
SNR
PSNR
Source
2.63
0.25
1.61
33.16
42.27
2.92
0.37
1.80
32.10
41,31
Basc [SWEC]
3.57
0.91
2.40
30.32
39.24
Ours
6.53
2.83
5.36
25.78
33.88
64
25.00
14.66
18.73
13.43
21.98
0.14
0.11
0.19
60.50
68.00
0.75
0.38
1.16
48.11
54.46
Base [CHB
3.69
1.58
3.79
32.33
39.41
Ours
16
8.43
4.14
7.99
24.51
32.01
64
28.05
17.80
23.06
12.71
21.07
12.82
15.81
17.68
44.92
35.97
12.85
14.89
16.79
35.08
32.39
Basc [BCI]
19.13
19.26
20.88
23.88
26.30
Ours
16
26.91
27.10
25.90
17.42
22.23
64
53.77
54.26
43.01
6.90
15.27
3.27
0.64
2.04
32, 10
40.28
3,28
0.47
2.07
31.14
40.11
GAN [SWEC]
4.04
0.76
2.67
28.95
38.09
Ours
6.81
24.41
33.34
64
29.10
10.84
20.41
11.30
20.61
0.34
0.31
0.63
54.15
61.99
0.78
0.52
0.88
45.14
$2.78
GAN (CHB]
4.30
0.88
3.35
28.97
37.55
Ours
16
11,29
8.53
16.70
23.15
31.33
64
28.87
14.65
23.85
11.74
20.76
16.01
19.79
33.02
30.22
15.62
18.81
17.52
25.99
27.97
GAN [BCI]
8
27.74
28.25
27.50
17.24
22.35
Ours
32.62
30.71
31.15
14.86
20.58
60.25
48.45
4.98
14.12
3.73
4.17
AAC
7.16
12.7
Reproduced Nguyen ct al. 2017
15.96
42.84
5,41
NLSPIHT
Reproduced Xu el al. 2015
16
22.42
ANN [BCT]
6.57
6.96
Reported Hejrati et al. 2017
Table A15: Full compression results on the F subset of the BONN EEG dataset.
35

---

Published as a conference paper at ICLR 2025
BONN S
CR
PRD
PRD-spec
RMSE 1
SNR
PSNR
Source
1.71
0.40
5.54
41.16
45.89
2.40
1.07
8.56
38.94
43.42
Base (SWEC)
6.72
4.63
26.51
30.91
35.10
Ours
20.91
18.55
77.48
18.39
24.14
64
56.48
50.38
188.22
7.17
14.59
0.79
0.57
3.47
58.20
56.62
5.56
2.72
24.41
40.40
39.47
Base [CHB]
19.70
17.29
76.47
22.01
25.24
Ours
16
38.51
35.99
138,30
12.83
18.44
64
74.53
77.03
246.71
4.25
12.14
53.88
66.61
179.43
18.66
15.08
48.06
58.86
161.23
14.29
16.06
Base [BCT]
58.85
66.20
191.14
8.46
14.13
Ours
16
67.96
76.13
223.31
5.30
12.86
90.94
95.46
289.01
1.35
10.23
2.56
1.06
8.63
38.64
42.38
3.32
1.34
11.78
35.35
40.06
GAN [SWEC]
6.14
3.64
23.34
30.22
35.25
Ours
16.14
11.32
60.02
19.46
26.44
64
57.16
39.31
187.63
6.45
14.47
1.18
0.88
4.96
51.26
52.11
3.84
3.03
16.08
41.12
41.97
GAN (CHB]
12.38
8.79
48.49
24.42
29.51
Ours
16
238.57
2555.31
896.74
14.64
12.48
64
72.99
83.32
240.56
4.55
12.35
55.59
71.96
180.73
13.06
14.69
44.07
58.14
147.30
11.98
16.73
GAN [BCT]
73.77
79.87
243.40
5.88
12.21
Ours
16
80.76
88.15
261.84
4.33
11.33
90.58
92.99
286.55
1.30
10.27
3.49
3.65
AAC
6,44
12.01
Reproduced Nguyen et al. 2017
13.86
40.75
4.93
NLSPIHT
Reproduced
Xu et al. 2015
16
23.03
ANN [BCI]
4.45
7.22
Reported Hejrati et al. 2017
Table A16: Full compression results on the S subset of the BONN EEG dataset.
36

---

Published as a conference paper at ICLR 2025
E
SUBJECTIVE EVALUATION OF THE COMPRESSION
We collect the subjective evaluations of an expert epileptologist on the quality of the signal re- construction for seizure detection. Below present the evaluations together with the evaluated samples, both for iEEG and EEG.
E.1 IEEG
The quality of the reconstruction iEEG signals allows us to push the compression ratio up to 64 without loss of Fl performance, as shown previously. For this reason, we also subjectively evaluate the performance the same regime.
Base model. Both original and reconstruction plausibly biological signals, with meaningful way to distinguish between the two without knowing of the comparison. Nonetheless, BrainCodec Base model can be seen acting as low pass filter. This has been judged not sufficiently influential, and would not impede seizure classification by a human expert.
GAN model. BrainCodec GAN is more successful in automatic seizure detection but is rated as having lower quality by the expert. It provides better reconstruction of higher frequencies but also introduces some spurious high-frequency oscillations which pollute the signal (especially noticeable in Figure A19 and A20).
E.2 EEG
EEG signals are noisier than their intracranial counterpart, making their compression more difficult as well.
In particular, 64x compression on EEG creates a significant low pass effect. Moreover, the signal obtains more stylized sinusoidal effect. Overall, 64x compression is rated as having significant quality drop with respect to the original signal by the expert.
For this reason, also evaluate an 8x compression. This achieves a higher fidelity level, compa- rable to the effects the 64x compression base model on iEEG. The expert evaluates the low-pass filtering effect not influential for seizure classification.
37

---

Published as a conference paper at ICLR 2025
Channel
Channel
N
2
2
Time (5)
Time (5)
Channel
Channel
2
2
4
Time (5)
Time (5)
5
3m ww
Channel
Channel
Channel
Channel
2
Time (5)
Time (s)
Figure A10: Reconstruction from samples of subject 2 of the CHB-MIT dataset by BrainCodec Base with 8x compression ratio.
38

---

Published as a conference paper at ICLR 2025
Channel
Channel
2
2
4
Time (5)
Time (5)
55
Channel
Channel
2
2
8
Time (S)
Time (s)
Channel
Channel
Channel
Channel
Time (5)
Time (s)
Figure A11: Reconstruction from samples of subject of the CHB-MIT dataset by BrainCodec Base
with 8x compression ratio.
39

---

Published as a conference paper at ICLR 2025
Channel
Channel
N
2
2
Time (5)
Time (5)
Channel
Channel
2
2
Time (5)
Time (5)
5
3 ww
Channel
Channel
Channel
Channel
2
Time (5)
Time (s)
Reconstruction from samples of subject of the CHB-MIT dataset by BrainCodec GAN with 8x compression ratio.
Figure A12:
40

---

Published as a conference paper at ICLR 2025
Channel
Channel
2
2
4
Time (5)
Time (5)
55
Channel
Channel
2
2
8
Time (S)
Time (s)
Channel
Channel w
2
Channel
Channel
2
Time (5)
Time (s)
Figure A13: Reconstruction from samples of subject of the CHB-MIT dataset by BrainCodec
GAN with 8x compression ratio.
41

---

Published as a conference paper at ICLR 2025
Channel
Channel
2
2
Time (5)
Time (5)
Channel
Channel
2
2
Time (5)
Time (5)
5
3 www
Channel
Channel
" wowmena
Channel
Channel
2
Time (5)
Time (s)
Figure A 14: Reconstruction from samples of subject 2 of the CHB-MIT dataset by BrainCodec Base
with x4x compression ratio.
42

---

Published as a conference paper at ICLR 2025
Channel
Channel
2
2
4
Time (5)
Time (5)
55
Channel
Channel
2
2
8
Time (S)
Time (s)
Channel
Channel
2
Channel
Channel
2
Time (5)
Time (s)
Figure A15: Reconstruction from samples of subject of the CHB-MIT dataset by BrainCodec Base
with x4x compression ratio.
43

---

Published as a conference paper at ICLR 2025
Channel
Channel
2
2
4 Time (5)
Time (5)
Channel
Channel
2
2
Time (5)
Time (s)
5
3 www
www.mm
Channel
Channel
M/
" wwwoohhoo
Channel
Channel
2
Time (5)
Time (s)
Figure A16: Reconstruction from samples of subject of the CHB-MIT dataset by BrainCodec
GAN with 64x compression ratio.
44

---

Published as a conference paper at ICLR 2025
Channel
Channel
2
2
2
4 Time (5)
Time (5)
55
Channel
Channel
2
2
8
Time
Time (s)
Amw
Channel
Channel
2
Channel
2 Channel
Time (5)
Time (s)
Figure A17: Reconstruction from samples of subject of the CHB-MIT dataset by BrainCodec
GAN with 64x compression ratio.
45

---

Published as a conference paper at ICLR 2025
Channel
Channel
Wmmm
Wamm
Vam
Time (s)
Time (s)
Figure A18: Reconstruction from samples of subject 2 of the SWEC dataset by BrainCodec GAN with x4x compression ratio.
2 Channel
Channel
2 w
Time (s)
Time (s)
Channel
Channel
2 Time (s)
Time (s)
Figure A19: Reconstruction from samples of subject 4 of the SWEC dataset by BrainCodec GAN
with 64x compression ratio.
Channel
Channel
Time (s)
Time (s)
Figure A20: Reconstruction from samples of subject 6 of the SWEC dataset by BrainCodec GAN with 64 compression ratio.
46

---

Published as a conference paper at ICLR 2025
Channel
Channel
Time (S)
Time (s)
Figure A21: Reconstruction from samples of subject 7 of the SWEC dataset by BrainCodec GAN with 64x compression ratio.
Channel
Channel
Wamy
V
Mwm
Time (s)
Time
Figure A22: Reconstruction from samples of subject 2 of the SWEC dataset by BrainCodec Base with 64 x compression ratio.
Channel
Channel
w
Time
Time
Channel
Channel
Time (s)
Time (s)
Figure A23: Reconstruction from samples of subject the SWEC dataset by BrainCodec Base with 64 compression ratio.
47

---

Published as a conference paper at ICLR 2025
Channel
Channel
Time (s)
Time (s)
Figure A24: Reconstruction from samples of subject the SWEC dataset by BrainCodec Base
with 64x compression ratio.
Channel
Channel
2
Time (s)
Time (s)
Figure A25; Reconstruction from samples of subject 7 the SWEC dataset by BrainCodec Base
with 64x compression ratio.
48


Reviews:
[{"review_id": "KzKSx9Lp1M", "reviewer": "Reviewer_5Spf", "summary": "This paper focuses on the neural signal compression. The authors propose the BrainCodec model for both EEG and iEEG data compression. The proposed method has been tested on several data sets, and  achieves superior reconstruction fidelity compared with other competing methods. The experiments further validate its effectiveness for downstream tasks.", "questions": "1.\tNeural signal compression has less been investigated. Real EEG/iEEG monitoring often requires real-time analysis. What are the application scenarios for their compression?\n2.\tPlease pay attention to the table format.", "limitations": "", "rating": 3, "confidence": 4, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "1.\tIt is a universal compression model for both iEEG and EEG.\n2.\tIt achieves high-fidelity compression of EEG signals up to a compression ratio of 64.\n3.\tIt has been validated both experimentally and being rated by the neurologists.", "weaknesses": "1.\tBraiCodec is developed based on the quantized autoencoder design. The methodology novelty is not clear. \n2.\tThe experimental validation is insufficient. The effectiveness of the loss functions and different modules are not examined. \n3.\tThe evaluation metrics of the compression performance are limited, and the rational of choice of some parameters for evaluation are not stated.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "uhKCt2fwMJ", "reviewer": "Reviewer_p69F", "summary": "BrainCodec leverages the higher signal-to-noise ratio (SNR) of iEEG data by training on iEEG and then transferring this model to compress noisier EEG data. The model achieves up to 64x compression with minimal loss of reconstruction fidelity, outperforming existing methods. Experimental results demonstrate that training on high-SNR iEEG data consistently provides better performance on EEG compression tasks than models trained directly on EEG. BrainCodec’s performance remains strong across various EEG and iEEG datasets, showing promise for reducing storage and transmission costs in clinical and research settings without compromising downstream task performance, such as seizure detection and motor imagery classification.", "questions": "Could you clarify the rationale behind not training BrainCodec on a combined dataset of both EEG and iEEG? Do you anticipate any limitations or challenges with such an approach?\n\nDid you consider other performance metrics beyond PRD and classification accuracy for assessing reconstruction fidelity?", "limitations": "", "rating": 8, "confidence": 4, "soundness": 3, "presentation": 2, "contribution": 4, "strengths": "The methodology is rigorously implemented, leveraging recent advancements in neural audio compression (e.g., quantized autoencoders) and adapted for EEG and iEEG data.BrainCodec’s performance is thoroughly validated across multiple datasets, including both iEEG (SWEC, MC) and EEG (CHB-MIT, BONN, BCI IV-2a), with comprehensive baseline comparisons. The cross-modality improvement, where a model trained on iEEG performs better on EEG than a model trained solely on EEG, adds to the literature, reinforcing the importance of high-SNR data for model training. The high compression ratios achieved (up to 64x without notable degradation) have immediate applications in reducing storage and transmission costs, relevant for clinical environments.", "weaknesses": "Figures could use refinement for clearer interpretation, especially when comparing compression ratios and PRD values. While the model’s effectiveness across modalities is demonstrated, the paper doesn’t explore the impact of training on a combined EEG and iEEG dataset, which could potentially yield a more robust generalizable model. In the future more baseline comparisons would be useful — perhaps across the Mother of all BCI Benchmarks (MOABB), or braindecode datasets would further validate this approach. Also, further clinical validation would be valuable to ascertain the practical application of this work in the clinical setting. The cross-modality improvement, where a model trained on iEEG performs better on EEG than a model trained solely on EEG, adds to the literature, reinforcing the importance of high-SNR data for model training.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "bw0npBSU0f", "reviewer": "Reviewer_Wj41", "summary": "The authors propose a method to map brain signals --- invasive (iEEG) and non-invasive (EEG) --- to representations that live in a lower-dimensional, discrete space. They do adapting a model designed for audio (Zeghidour et al., 2022 and Defossez et al., 2023): that model is a convolutional auto-encoder where the representation is quantized. The authors test the \"quality\" of the representations using two metrics: first, how well they can reconstruct the original signal and second, and how well the reconstructed signals predict downstream information. In both cases, compared to other methods, the authors are able to obtain higher metrics using lower-dimensional representations, which means effectively better compression.", "questions": "Could the authors address the points in the \"weaknesses\" section?", "limitations": "", "rating": 8, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "The paper is very clearly written and is impactful. The authors convincingly make the point the representations learnt using the cleaner iEEG signals are useful to reconstruct the noisier EEG signals, in fact, more so than if the representations were learnt using EEG signals in the first place. This is an instance of favorable generalization from one data modality (iEEG) to another (EEG). Their comparison of different cost functions for training, adversarial and non-adversarial, is interesting, especially as it does not conclude that adversarial training is always beneficial.", "weaknesses": "- The authors \"train the model on one single subject, and test the reconstruction on the remaining subjects\". I am surprised that the authors obtain near-zero relative error in Figures 3 and 4. In EEG, the differences between subjects can be quite high, due to different physiologies, electrode positions, and reponse delays. So one would expect training on one subject and testing on another to lead to low-quality reconstruction. Can the authors comment on this surprising point?\n\n- It would be relevant to include [1] in related works, as it uses a very similar model with the same name but applied to fMRI data. \n\n[1] BrainCodec: Neural fMRI codec for the decoding of cognitive brain states. Yuto Nishimura, Masataka Sawayama, Ayumu Yamashita, Hideki Nakayama, Kaoru Amano. 2024.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "8JhyULgdhm", "reviewer": "Reviewer_HbiL", "summary": "The authors introduce RVQ-based neural signal compressor, BrainCodec, which achieves a $64\\times$ compression on (i)EEG signals without a notable decrease in quality. The authors also indicate that clean data sources appear to have an outsized effect on the performance of DL model -- training BrainCodec on iEEG and then transferring to EEG yields higher reconstruction quality than training on EEG directly.\n\n**Dataset**: Two iEEG datasets (i.e., SWEC iEEG, MC iEEG), and three EEG datasets (i.e., CHB-MIT, BONN, BCI Competition IV-2a) are used for this study. The downstream classification tasks include 2-way seizure detection (on iEEG datasets) and 4-way motor imagery (on BCI Competition IV-2a).\n\n**Model**: The authors propose BrainCodec, which treats different channels independently. BrainCodec utilizes a stack of convolution layers to compress the raw (i)EEG signals into embeddings, and further quantizes them through Residual Vector Quantization.\n\n**Experiement**: The authors utilize the reconstructed (i)EEG signals for downstream classification tasks.", "questions": "None", "limitations": "", "rating": 8, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "**Significance**: This study highlights the importance of clean data for pre-training. The authors find that training BrainCodec on iEEG and then transferring to EEG yields higher reconstruction quality than training on EEG directly. This finding may help the development of some VQ-based EEG foundation models (e.g., LaBraM[1]), as iEEG signals can further improve the representation quality compared to EEG signals.\n\n**Clarity:** The text has a good structure and is well-written. The figures also help in understanding the method.\n\n**Reference**\n\n[1] Jiang W B, Zhao L M, Lu B L. Large brain model for learning generic representations with tremendous EEG data in BCI[J]. arXiv preprint arXiv:2405.18765, 2024.", "weaknesses": "**Major**\n\n1. It seems the compression ratio only depends on the depth of the Encoder (Line 201). How about the effect of different configurations of RVQ? Could the authors provide some ablation studies over the configurations of RVQ (i.e., the codex size, the dimensions of each code, etc.)?\n\n2. As AE+RVQ has a certain ability for representation learning, how about the classification performance from the quantized embeddings (after quantizer)? \n\n**Minor**\n\n1. I’m not sure whether the amount of iEEG datasets is enough, as the SWEC iEEG dataset only contains 14 hours of recording (across 15 subjects). Additional publicly available iEEG datasets the authors should be aware of:\n   - Brain TreeBank (https://neurips.cc/virtual/2024/poster/97751): Their dataset (https://braintreebank.dev/) contains 43 hours of iEEG recording (not preprocessed).\n   - Du-IN (https://arxiv.org/abs/2405.11459): Their dataset contains 36 hours of iEEG recording (after bipolar reference).\n\n    To further prove the advantage of pre-training on clean data source (i.e., iEEG) -- **training BrainCodec on iEEG and then transferring to EEG yields higher reconstruction quality than training on EEG directly**, could the authors provide results of the model pre-trained on both SWEC iEEG dataset and Brain TreeBank? Besides, could the authors provide the effect of different reference methods (e.g., laplacian/bipolar reference instead of median reference, Line 274)?\n\n2. More downstream classification can be included, e.g., 4 classification tasks in BrainBERT[1] based on the Brain TreeBank dataset.\n\n**Reference**:\n\n[1] Wang C, Subramaniam V, Yaari A U, et al. BrainBERT: Self-supervised representation learning for intracranial recordings[J]. arXiv preprint arXiv:2302.14367, 2023.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "rLXAe2K1rE", "reviewer": "Reviewer_cGqC", "summary": "This paper introduces BrainCodec, a novel neural network-based compressor for EEG and iEEG signals. BrainCodec demonstrates promising compression ratios of up to 64x while achieving relatively high reconstruction fidelity, particularly when transferring learning from iEEG to EEG.", "questions": "1) What plans do the authors have to conduct a more in-depth analysis comparing the baseline BrainCodec with its GAN-augmented version, particularly in terms of frequency-specific characteristics of the reconstructed signals and their impact on downstream tasks?\n\n2) How does the authors’ approach to evaluation change if they incorporate comparisons with established decoders from the literature, such as those cited in Zhang et al. (2023)? Would this increase the robustness and generalizability of the proposed compression technique?\n\n3) In light of the recommendation to replace PRD with a more objective measure of signal quality derived from downstream motor imagery classification performance, how do the authors intend to implement this evaluation? \n\n4) Given the suggestion to shift the emphasis from PRD to more direct assessments of classification accuracy, how might this impact the interpretation of BrainCodec's effectiveness in real-world applications? What additional data or analyses might be needed to support this shift in evaluation focus?\n\nReference:\nZhang, Y., Qiu, S., & He, H. (2023). Multimodal motor imagery decoding method based on temporal spatial feature alignment and fusion. Journal of Neural Engineering, 20(2), 026009.", "limitations": "", "rating": 6, "confidence": 5, "soundness": 4, "presentation": 4, "contribution": 3, "strengths": "The core contribution of training a compressor on high-SNR iEEG data and applying it to low-SNR EEG data is novel and directly addresses a critical challenge in neuroelectrophysiological signal processing. The demonstrated improvement in reconstruction fidelity through this transfer learning is a significant finding.", "weaknesses": "1) The reliance on PRD as the primary metric for evaluating reconstruction fidelity is inadequate. PRD, being a global measure, can mask localized distortions that may significantly affect downstream task performance. Subtle yet clinically relevant distortions in the reconstructed signals could easily go undetected by PRD, potentially impairing the accuracy of subsequent analyses.\n\n2) The ablation study is incomplete. While the authors mention exploring different architectural choices, they do not present the results of such explorations. A systematic investigation varying key architectural parameters (e.g., quantizer types, encoder/decoder depths and kernel sizes, activation functions) is necessary to understand their impact on compression and reconstruction quality, providing a stronger justification for the chosen architecture.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)