Online Interactive Figure¶
EEG-GAN uses Generative Adversarial Networks (GANs) to create trial-level synthetic EEG samples. We can then use these samples as extra data to train whichever classifier we want to use (e.g., Support Vector Machine, Neural Network).
Data Augmentation¶
Although we have shown GANs to be successful in augmenting classification performance, we have not thoroughly tested it's impact compared to any benchmarks... until now. The following plot will allow you to visualize the performance of our classifications across many analyses:
Non-Augmented: These are the data untouched
- Empirical: This is non-augmented data. A baseline to test augmentation
- Oversampled: This technique simply duplicates samples to increase training
Generative Augmentation: These are generative models that are used to create 'synthetic participants', which increases the training dataset size.
- GAN-Augmented: This is augmentation using GANs via the EEG-GAN package
- VAE-Augmented: This is augmentation using variational autoencoders
Transformation Augmentation: These are standard transformations of the data that are traditionally used to augment datasets for classification.
- Gaussian-Augmented: Adding guassian noise to samples
- Flip-Augmented: Flip the polarity/sign of the data
- Reverse-Augmented: Reverses the timeseries
- Smooth-Augmented: Removes portions of the data
Using This Interactive Plot¶
The plot will default to a bar chart including all aforementioned analyses/augmentations across 5 classifiers (neural network, support vector machine, logistic regression, random forest, k-nearest neighbors) and 4-7 sample sizes (5, 10, 15, 20, 30, 60, 100) for the corresponding dataset.
You will see a dropdown to select the Dataset, a series of checkboxes to include or remove a data augmentation technique, two dropdown for more fine-tuned comparisons, and a checkbox to format the plots. For the comparisons, if one is selected then the plots on the right will be their absolute performance. If two are selected, then the plots will show the difference between the two.
Try it out!
###############################################
## IMPORT MODULES ##
###############################################
#Download and unzip dataset and functions if in Google Colab
try: #If in Google Colab
import google.colab #Test if in Google Colab
import urllib.request #Package for downloading files
import os #Package for interacting with the operating system
import shutil
if not os.path.isdir('Classification Results'): #If the dataset isn't downloaded
print('Downloading dataset and functions...')
urllib.request.urlretrieve("https://github.com/AutoResearch/EEG-GAN/raw/manuscript-results/classification/classification_results.zip", "classification_results.zip") #Download the dataset
urllib.request.urlretrieve("https://raw.githubusercontent.com/AutoResearch/EEG-GAN/manuscript-results/classification/main_plot_functions.py", "main_plot_functions.py") #Download the functions
!unzip classification_results #Unzip the dataset
#Move task classification folders out of parent and delete parent directory
root = '.'
for filename in os.listdir(os.path.join(root, 'classification_results')):
shutil.move(os.path.join(root, 'classification_results', filename), os.path.join('.', filename))
os.rmdir(os.path.join(root, 'classification_results'))
except:
pass
#Import the functions
from main_plot_functions import InteractivePlot
#Create the interactive plot
interactive_plot = InteractivePlot()