hvEEGNet: exploiting hierarchical VAEs on EEG data for neuroscience applications

arXiv:2312.00799 · eess.SP, cs.LG · Submitted 2023-11-20 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Electrical Engineering. The day in electrical engineering: signals, systems and the hardware that carries them.

Rosa: We're looking at the paper: "hvEEGNet: exploiting hierarchical VAEs on EEG data for neuroscience applications".

Paper summary: Rosa: So we're talking about this paper called "hvEEGNet: exploiting hierarchical VAEs on EEG data for neuroscience applications." It’s trying to use two variational autoencoder models to get really high-fidelity EEG reconstruction and also create latent representations that scientists can use for brain stuff.

Dev: That sounds complicated, but the main idea is tackling the problems of getting good EEG reconstructions and getting useful latent spaces for neuroscience research.

Rosa: Right, so they're using a hierarchical VAE, which is an evolution of a standard one, by adding multiple layers to each latent space. It’s designed specifically for EEG data where things are messy.

Dev: The training loss function they use is LV AE which is the sum of the KL divergence between two distributions and the reconstruction error. That means they balance making sure their model learns a good representation with how accurately it reconstructs the original signal, which is Eq of p theta x z >

Taro: So, for this specific version called vEEGNet-ver3, they quantified that reconstruction error using dynamic time warping similarity score. That’s a way to measure how close two time series are when they are slightly shifted in time >

Rosa: And the paper claims that hvEEGNet reconstructs EEG data with very high fidelity, outperforming most previous solutions, including vEEGNet-ver3. It seems much better at reconstructing the EEG segment overall >

Dev: They say this improvement is visible in both domains they look at, which suggests it's a significant step forward in handling that signal variability and noise >

Taro: But the paper also looked into how good the training data quality and size affect the model. They found that hvEEGNet failed to reconstruct some EEG data from test sessions S2 and S5 because of issues with the input data itself >

Rosa: That’s a key point, because they didn't blame the model for that failure; it was actually about the quality of the raw EEG recordings, like saturation during acquisition >

Dev: So if you look at this paper, it shows that even good deep learning models can struggle if the input data is corrupted in specific ways >

Taro: And they did provide an explanation for that failure by pointing out specific EEG segments and channels where the raw EEG data was actually corrupted, like when it got saturated during the acquisition phase >

Rosa: Once trained properly, hvEEGNet also has this ability to look for outliers. They use a kNN algorithm on a matrix made from averaging normalized dynamic time warping scores across all their training runs for each pair task repetition channel >

Dev: So they can use this model as an automatic detector for noisy EEG segments, like those caused by artifacts >

Taro: That means if you feed it new data, it can flag the parts that look like noise or artifacts >

Rosa: Their training dynamics also vary depending on the subject. They found that subject S3 reached an optimal model very quickly, in about fifteen epochs >

Dev: They also established a relationship between how long they train and the distribution of their input training set, defining a transition point based on when the global average error showed its maximal slope >

Taro: The paper seems to be opening up new research questions about what exactly drives the relationship between training these deep learning models and the quality of the input data >

Rosa: In conclusion, this work by Giulia Cisottoa, Alberto Zancanarob, Italo F. Zoppisa, and Sara L. Manzonia presents hvEEGNet: exploiting hierarchical VAEs on EEG data for neuroscience applications >

Dev: The paper shows that this model provides a very high-fidelity reconstruction of EEG data compared to previous methods like vEEGNet-ver3 >

Taro: It also gives us tools, like the anomaly detection capability, which could be useful for identifying artifacts in larger EEG datasets later on >

Rosa: Ultimately, this research opens up new fundamental questions about the link between how these deep learning models are trained and what kind of input data they need to succeed >

Conclusion: Rosa: So we're wrapping up the talk on hvEEGNet, which is this model that uses two variational autoencoders to reconstruct EEG data really accurately and create those latent representations for neuroscience work.

Dev: Yeah, it’s about taking those two models and adding a hierarchical structure so you get better latent spaces, making it more robust for what you want to do with the brain data.

Rosa: The authors are focusing on how this hierarchical setup helps them achieve much higher fidelity reconstruction than older methods we've seen.

Dev: They use a specific loss function called LV AE which balances trying to get a good representation in the latent space against how closely it reconstructs the original EEG signal using something called dynamic time warping similarity score.

Rosa: And what they found is that this approach gives them very high-fidelity reconstructions, outperforming vEEGNet version three and other models we've looked at before.

Dev: That’s impressive when you look at the actual comparison in Table three where their reconstruction error falls much lower than the other methods.

Rosa: But they also talked about a big caveat, which is that the quality of your input EEG data really matters for this model to work correctly.

Dev: They found that if you feed it certain test sessions, like S2 and S5 data, where the raw recordings were corrupted during acquisition—like maybe saturation—the model just couldn't reconstruct those parts.

Rosa: So the implication here is that even a sophisticated AI model has limits when the input signal itself is fundamentally flawed by noise or bad recording conditions.

Dev: It also showed they built in an anomaly detection capability using kNN on those similarity scores across all their training runs, which means once it’s trained, you can use it to automatically flag noisy EEG segments later on.

Rosa: So we’ve seen how this model reconstructs data and how it can spot bad data during testing, but the next big question is what this actually means for how we use these latent representations in actual neuroscience studies.

Department of Informatics, Systems, and Communication, University of Milan-Bicocca · Department of Information Engineering, University of Padova

eess.SP, cs.LG

Submitted: 2023-11-20

Updated: 2023-11-20

DOI: 10.3389/fninf.2024.1459970

Code: https://github.com/Maghoumi/pytorch-softdtw-cuda

License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/

Importance score: 91/100

The gist: hvEEGNet is proposed as two variational autoencoder models to target high-fidelity EEG reconstruction and provide latent representations for neuroscience applications.<ref:2312.00799#pg1,two…

Key concepts

Variational Autoencoder (VAE)
A VAE is a type of deep learning model designed to learn a probabilistic mapping between input EEG data and a compressed latent space. It learns how to reconstruct the original data from this compressed representation, which is essential for generating meaningful representations for neuroscience applications.
Hierarchical Latent Space
hvEEGNet evolves the standard VAE by incorporating multiple layers of latent spaces. This hierarchical structure allows the model to capture different levels of complexity in EEG data, leading to a richer and more detailed latent representation compared to simpler models.
Dynamic Time Warping (DTW)
DTW is a similarity score used here to measure how well the reconstructed EEG data matches the original input. It accounts for temporal distortions, meaning it measures similarity even if the timing of events in the reconstructed signal is slightly shifted relative to the original.

Terminology

Summary

hvEEGNet is proposed as two variational autoencoder models to target high-fidelity EEG reconstruction and provide latent representations for neuroscience applications. p. 0<ref:2312.00799#pg1,two variational autoencoder models to target the problem of high-fidelity EEG reconstruction and provide latent representations for neuroscience applications>. p. 0

Model Architecture and Loss Function

The common overall architecture of both models is the VAE, which learns a probabilistic mapping between input data and a latent space.<ref:2312.00799#pg1>. The training loss function adopted for the VAE is LV AE = LKL + LR = −KL[qϕ(zx)p(z)] + Eq(pθ(xz)). p. 9<ref:2312.00799#pg1,the training loss function adopted for the VAE is LV AE = LKL + LR = −KL[qϕ(zx)p(z)] + Eq(pθ(xz))>. p. 9 For vEEGNet-ver3, the reconstruction error LR of the VAE loss function was quantified by the dynamic time warping (DTW) similarity score. p. 0<ref:2312.00799#pg1>. The hierarchical VAE, hvEEGNet, is an evolution of a standard VAE enriched by a hierarchical latent space with multiple layers implementing a latent space each. p. 1<ref:2312.00799#pg1>.

Reconstruction Performance and Fidelity

hvEEGNet was found to reconstruct the EEG data with very high-fidelity, outperforming most previous solutions (including vEEGNet-ver3).<ref:2312.00799#pg1,hvEEGNet was found to reconstruct the EEG data with very high-fidelity, outperforming most previous solutions (including our vEEGNet-ver3)>. p. 0 In comparison, hvEEGNet is much better in reconstructing the EEG segment, and this can be very clearly appreciated in both domains. p. 3<ref:2312.00799#pg1>. The reconstruction ability of our models after proper training was evaluated on the test set by means of the same normalized DTW similarity score.<ref:2312.00799#pg1>. Table 3 reports the average (± standard deviation) reconstruction error for vEEGNet-ver3 and hvEEGNet, as expressed in terms of normalized DTW similarity score. p. 3<ref:2312.00799#pg1>.

Impact of Training Data Quality

The investigation into the training behaviour of our models related it with the quality and the size of the input EEG dataset.<ref:2312.00799#pg2,we investigated the training behaviour of our models and related it with the quality and the size of the input EEG dataset>. p. 1 The results showed that hvEEGNet failed to reconstruct some EEG data belonging to the test sessions of S2 and S5. p. 0<ref:2312.00799#pg4>. This failure could not be addressed to the poorness of the model, but rather to the input data quality. p. 1<ref:2312.00799#pg4>. The paper provides an explanation for this failure by identifying specific EEG segments and channels where the raw EEG data were corrupted (e. p. 1g., by saturation during the acquisition phase). p. 1<ref:2312.00799#pg3>.

Anomaly Detection Capabilities

Once the hvEEGNet model is properly trained, it can be looked into its ability to identify outliers.<ref:2312.00799#pg3>. The kNN algorithm was employed on the matrix E given by all values obtained by averaging the normalized DTW scores across the training runs for each pair task repetition-channel.<ref:2312.00799#pg3>. The model can effectively be employed as an automatic detector for noisy (e. p. 1g., artefactual) EEG segments. p. 0<ref:2312.00799#pg5>.

Training Dynamics and Optimization

The training time needed to reach an optimal model varies from subject to subject, with S3 reaching an optimal model very rapidly in about 15 epochs.<ref:2312.00799#pg7>. The paper empirically proved that there is a relationship between the training time and the distribution of the input training set. p. 1<ref:2312.00799#pg7>. The transition point to check if a subject-independent characterization of the training behaviour can be obtained was defined as the number of epochs where the global average error showed the maximal slope.<ref:2312.00799#pg3>.

Conclusion and Future Directions

In conclusion, hvEEGNet brings to a very high-fidelity reconstruction, outperforming our previous solutions as well as the other state-of-the-art models.<ref:2312.00799#pg4>. This work opens new fundamental research questions regarding the relationship between DL-based models training and the quality of the input data. p. 1<ref:2312.00799#pg5>. In future, hvEEGNet could be used as anomaly (e. p. 1g., artefact) detector in large EEG datasets to support the domain experts. p. 1<ref:2312.00799#pg2,in the future, hvEEGNet could be used as anomaly (e. p. 1g., artefact) detector in large EEG datasets to support the domain experts>. p. 1 The proposed approach intends to adhere to the best scientific methodological practises of new AI methods applied to the medical domain. p. 2<ref:2312.00799#pg5>.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Dynamic time warping helps variational autoencoders learn time-series, allowing for a more suitable measure of similarity between two time-series compared to standard mean square error (MSE). This enables the model to better learn to reconstruct EEG data and be more robust to nonlinear transformations of time-series.

  2. Hierarchical VAE allows for high-fidelity reconstruction by using multiple latent spaces, where each is trained to encode different levels of detail in the input data. This structure helps solve the issue where standard VAEs suffer from the lack of accuracy in details reconstruction, given by the trade-off between the reconstruction loss and the Kullback-Leibler divergence contributions.

  3. hvEEGNet can be used as an anomaly detector in large EEG datasets to support domain experts by identifying samples that are very poorly reconstructed, verified by large values of the DTW similarity score between the reconstructed EEG sample and the original one.

Sources

Related papers