Initial commit

main
Juraj Novosad 2 weeks ago
commit 7471526dd6

1
.gitattributes vendored

@ -0,0 +1 @@
*.png filter=lfs diff=lfs merge=lfs -text

@ -0,0 +1,53 @@
## Manifool
https://arxiv.org/abs/1711.09115
This method was used in article [Data Augmentation with manifold exploring](https://arxiv.org/pdf/1901.04420), which is relevant to eeg research.
**Geometric robustness of deep networks: analysis and improvement**
The manifool paper discusses creation of an algorithm to measure geometric invariance of deep networks. Then discusses how to make the networks better at managing those transformations. Authors try to search for minimal fooling transformation to measure the invariance of a NN. Then they do fine tuning on transformed examples.
First preliminaries. Lets say we have a set of transformations $\Tau$. Then small $\Tau$ is a transformation which belongs to $\Tau$. Now how to measure how the effect of transformation, respectivelly we are looking for a metric which would quantitatively measure how much does transformation change sample. Lets look at some metrics applicable for this problem:
* Measure l<sup>2</sup> distance between transformation matrices. This doesn't reflect the semantics of transformations such as rotation vs translation.
* Squared L<sup>2</sup> distance, difference between two transformed images. . This is better since it is dependent on sample. Tho not good enough.
* Length of the shortest curve between two transformations, geodesic distance. This metric is the one used in manifool algorithm.
![image](images/Pasted_image_20250319153406.png)
As you can see the metric is between two transformations. The first transformation is always identity transformation, we will call it e.
Manifool in particular tries to find minimal transformation, with minimal distance from e, which leads to misclassification.
Then the invariance score of classifier is calculateg as an average minimal fooling transformation.
![image](images/Pasted_image_20250319194746.png)
**Manifool algorithm**
Algorithm to find minimal fooling transformation. The main idea is to iteratively move from image towards decision boundary of the classifier, while staying on the transformation manifold.
Each iteration is composed of two steps:
* Choosing the movement direction
* Mapping the movement onto manifold
![image](images/Pasted_image_20250319200254.png)
This iteratively continues until hitting classification boundary of classifier.
Choosing movement direction and length.
Lets imagine binary classifier k(x) = sign(f(x)), where f: R<sup>n</sup> -> R is an arbitrary differentiable classification function. In paper for simplicity authors consider x for which label is 1. Therefore assuming f(x) > 0, for this example. Then to reach decision boundary in shortest way we need to choose direction which maximaly reduces f(x) therefore moving against derivation of f in x, opposite of gradient. Then some serious math is involved, I need more time to fully grasp it.
**Experiments**
In the experiments, the invariance score for minimal transformations, defined in (5), is calculated by finding fooling transformation examples using ManiFool for a set of images, and computing the average of the geodesic distance of these examples.
On the other hand, to calculate the invariance against random transformations, we generate a number of random transformations with a given geodesic distance r for each image in a set and calculate the misclassification rate2 of the network for the transformed images.
**My summary**
We can take pretrained model. Then make dataset tailored to that dataset which will contain minimal fooling samples. That dataset will be used to fine tune.
## Data Augmentation with Manifold Exploring Geometric Transformations for Increased Performance and Robustness
https://arxiv.org/pdf/1901.04420
Authors did create dataset with images lying on decision boundary to maximize variance to which network is exposed to during training.
Models used were: ResNet, VGG16, InceptionV3.
Comparing
* no augmentation
* random augmentation - rotational and horizontal flipping
* manifool
* Random erasing - replaces random patches of image with gaussian noise
GAN architecture was used to generate synthetic images.
Not exactly an EEG paper, but methods can be used for BCI I thinnk

@ -0,0 +1,122 @@
## Electroencephalography Signal Processing: A Comprehensive Review and Analysis of Methods and Techniques
https://pmc.ncbi.nlm.nih.gov/articles/PMC10385593/
published july 2023
Review of articles related to eeg signal processing. This paper discusses the entire process from acquisition, denoising, feature extraction, classification and application.
Presents a table of EEG applications and references to papers where it was researched.
**Denoising**
Methods to suppress strong signals caused by eye movement, blinking, heart activity.
* Regression method - During acquisition electro-oculogram is recorded concurrently with eeg signal. Using regression we can assume which signals are noise. Not good enough.
* Blind source separation - Technique that separates source signals from mixed signals without prior knowledge of the original signals. Uses an BSS algorithm to decompose the eeg signal into its sources. The noise sources are then identified and eliminated. Harder to separate emg signals from source. PCA can be used, has good results.
* Canonical correlation analysis - Good with signals contaminated with muscle artifacts. More effective than ICA. Possible to use to distinguish brain activity and muscle activity.
* Wavelet transform - Data often contain irregularities. Wavelet transform to analyze non-stationary signals. Divides EEG signal into wavelet components. Noisy components are removed and signal is reconstructed from other components. Can be combined with ICA, had success.
* Empirical mode decomposition - Decompose signal into a set of intristic mode functions and a monotonic residual. One of the advantages of EMD is its ability to extract local amplitude, phase, and frequency content from the resulting components. EMD is also adaptive and efficient and, when combined with other techniques, it can lead to new advancements in the denoising of EEG signals.
Table with different techniques and their results, Table 2.
Metrics for denoising: mean squared error (MSE), root mean squared error (RMSE), signal-to-noise ratio (SNR), and percentage root mean square difference (PRD).
**Feature engineering**
Deep NN, adversarial generative networks (GAN) have been tried. Problem is interpretability. XAI based Smooth-Grad used to recognize emotions, seizures.
* Time-frequency analysis - Establish link between time and frequency domain. Sliding window of signal is analyzed using techniques of signal processing such as analysis of variance, waveform parameter analysis, wave identification, histogram analysis, correlation analysis. Used SVD to predict seizures. Or CNN to optimize Wigner-Ville distribution as an input without parameters. Falls short in analyzing high-order information.
* High-Order spectral analysis - Good to analyze high-order information. Capable of suppressing gaussian noise and producing spectral structures that reflect more information. Principal component features are extracted using PCA on the 15 high-order spectra(HOS) features. Also uses SVM with gaussian kernel. This method achieved accuracy of 95%
* Nonlinear dynamics analysis - Usage of non-linear techniques such as Lyapunov exponent. Interesting algorithm equal symbolic entropy
**Classification**
Traditional methods like Bayesian, decision tree, k-nearest neighbors, support vector machine, random forest, etc. Those methods sort of work. Mainly classifying epilepsy, motor imagery and stroke prediction.
In motor imagery adding Gaussian noise to improve recognition rates. KNN achieved best score in such tasks, used linear discrimination analysis to reduce dimensions. Later combining SVM, LDA and ANN in voting mechanism to improve accuracy.
Decision trees, random forests, and multi-layer perceptron are popularly used to predict gender from the obtained data. Random forest classifier performs best with the EEG of negative emotions.
**Deep Learning**
Data is denoised, extracted features and on that is Deep learning model trained. Used for stroke detection, pretty promising they say, better than logistic regression.
Models like GoogleNet and AlexNet have been used, where AlexNet outperformed GoogleNet in detecting sleep disorders.
**Challenges**
* Denoise from sources like eye blink, muscle movement
* EEG signals are non stationary, their statistical properties change over time
* Hard to locate exact source of specific signal
* The data vary depending on placement of reference electrode
* Deep NN have problem with interpretability
* Differences between different people
## A generic framework for adaptive EEG-based BCI training and operation
https://arxiv.org/abs/1707.07935
## EEG Data Augmentation Method for Identity Recognition Based on SpatialTemporal Generating Adversarial Network
https://www.mdpi.com/2079-9292/13/21/4310
Authors propose end-to-end EEG data augmentation method based on spatial-temporal generative adversarial(STGAN) network. Discriminator uses temporal feature encoding (todo learn about it more [here](https://medium.com/@raphael.schoenenberger_95380/encoding-temporal-features-part-1-f26d08feebd8)) and a spatial feature encoder in parallel. Good for global dependencies across channels and time of EEG. GAN improves quality and diversity of augmented EEG data. Conducted on BCI-IV2A dataset. Frechet inception distance was used to evaluate data quality. Compared with deep learning models: EEGNET, ShalowConvNet and DeepConvNet. Approach with STGAN was better in terms of data quality.
## Enhancing the decoding accuracy of EEG signals by the introduction of anchored-STFT and adversarial data augmentation method
https://www.nature.com/articles/s41598-022-07992-w
Article consults using EEG for BCI. Authors propose method called anchored Short Time Fourier Transform (anchored-STFT) to mitigate impact of noise coming from EEG by design.
Proposed method is advancement of STFT, minimizes the trade-off between temporal and spectral resolution presented by STFT.
They also propose data augmentation method derived from l2-norm fast gradient sign method, called gradient norm adversarial augmentation (GNAA). Also proposed CNN architecture, named SkipNet for classification of EEG signals.
This paper proposes complete pipeline to process EEG to BCI. This solution outperforms current SOTA methods. Trained on BCI Competition IV dataset 2b and 2a.
Comparison algorithms for feature extraction were used common spatial pattern (CSP), short time fourier transform (STFT), wavelet transform(WT). Algorithms for classification were compared with linear discriminant analysis(LDA), Bayesian classifier and SVM.
It was noted that CNN should be invariant to translation, like images. What is interesting thought.
The introduction mentions articles about image representation of EEG data. The transform to images can be done using wavelet transform in article 'A novel simplified convolutional neural network classification algorithm of motor imagery EEG signals based on deep learning'.
Proposed anchored-STFT uses multiple windows of variable size for the transformation.
Authors solve challenge with not enough data by leveraging generative model-based data augmentation method called Gradient Norm adversarial augmentation (GNAA).
Uses shallow CNN called SkipNet with fewer trainable parameters and skip connections.
![images](images/Pasted_image_20250305210703.png)
GNAA is developed in a way to pick most pivoting features. It calculates gradient, which is direction to decision boundary. Training input is then perturbed towards the direction of decision boundary.
Used on datasets: BCI competition IV 2a, BCI competition IV 2b, BCI competition II dataset III
![images](images/Pasted_image_20250305212954.png)
## A novel deep learning approach for classification of EEG motor imagery signals
https://iopscience.iop.org/article/10.1088/1741-2560/14/1/016003
BCI usage of EEG data. They used CNN and stacked autoencoders(SAE) to classify EEG motor imagery signals. Input which combines time, frequency and location is fed into 1D convolutional and one-max pooling. Somehow EEG data are converted to images. Usage of STFT on floating window of 2 seconds. Output of CNN is fed to SAE
Good results were shown.
Somehow we could leverage methods proposed here.
## Data augmentation for deep-learning-based electroencephalography
https://www.sciencedirect.com/science/article/pii/S0165027020303083?via%3Dihub
Authors try to augment EEG data for better results using them in deep learning.
It is only review. This papers discusses methods for DA:
* noise addition
* GAN
* sliding window
* sampling
* fourier transform
* recombination of segmentation
Then it is tested on various tasks, such as: seizure detection, sleep stages, motor imagery etc.
## Data Augmentation with Manifold Exploring Geometric Transformations for Increased Performance and Robustness
https://arxiv.org/abs/1901.04420
Authors propose novel augmentation technique that improves robustness to random transformations, both affine and projective. Inspired by ManiFool, the augmentation is performed by a line-search manifold-exploration method that learns affine geometric transformations that lead to the misclassification on an image, while ensuring that it remains on the same manifold as the training data.
This augmentation method populates any training dataset with images that lie on the border of the manifolds between two-classes and maximizes the variance the network is exposed to during training.
In 2019 it outperformed GANs. TODO research ManiFool.
Augmented data were used to train ResNet, VGG16 and InceptionV3.
ManiFool augmentation led to significant increase in performance.
Very perspective.
## Data Augmentation for Deep Neural Networks Model in EEG Classification Task: A Review
https://www.frontiersin.org/journals/human-neuroscience/articles/10.3389/fnhum.2021.765525/full
A really good review.
## Improving classification performance of motor imagery BCI through EEG data augmentation with conditional generative adversarial networks
https://www.sciencedirect.com/science/article/pii/S0893608024005896?via%3Dihub
Authors propose novel data augmentation framework using conditional generative adversarial networks (cGAN). They tested it on datasets BCI comptetition IV IIa and III IVa. They then used SOTA classifiers and three other different data augmentation methods. It was shown that data augmentation positively impact classification performance.
Note difference between augmenting raw EEG data and features. Where augmentation of raw data can lead to superior results because it includes complex temporal dynamics and hidden patterns which may not be represented in features.
This paper nicely explains usage of GAN in EEG data.
![image](images/Pasted_image_20250306093940.png)
## Methods of EEG Signal Features Extraction Using Linear Analysis in Frequency and Time-Frequency Domains
https://pmc.ncbi.nlm.nih.gov/articles/PMC4045570/
Review of methods used to extract features from EEG data. Algorithmic methods, not much of neural is described.
TODO:
- find augmentation methods worth of trying
- find example architecture for classification BCI
- find metrics to evaluate feature quality and their semantic

BIN
images/Pasted_image_20250305210703.png (Stored with Git LFS)

Binary file not shown.

BIN
images/Pasted_image_20250305212954.png (Stored with Git LFS)

Binary file not shown.

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11850bac810514776fd81ca46c6048c8a676cafc20cd1c00bd3125977d0d0cdf
size 1860817

BIN
images/Pasted_image_20250319153406.png (Stored with Git LFS)

Binary file not shown.

BIN
images/Pasted_image_20250319194746.png (Stored with Git LFS)

Binary file not shown.

BIN
images/Pasted_image_20250319200254.png (Stored with Git LFS)

Binary file not shown.
Loading…
Cancel
Save