This repository contains a collection of scripts and data for classifying imagined speech from EEG data. The project is built around the Emotiv EpocX headset and its Cortex API. It includes components for data acquisition, processing, and analysis.
cortex.py: A Python wrapper for the Emotiv Cortex API. It handles the connection to the headset, session management, and data streaming.main.py: A FastAPI application that provides a simple API to control the recording process. It usescortex.pyto interact with the headset and saves the data to thedatadirectory.index.htmlandcortex.js: A simple web interface for running the experiments and collecting data.
produce_dataset.py: This is the main script for processing the raw EEG data. It uses themnelibrary to perform the following steps:- Filtering the data to specific frequency bands (e.g., gamma, beta, etc.).
- Epoching the data around the speech events.
- Applying PCA for dimensionality reduction.
- Saving the processed data as
.npzfiles.
- Jupyter Notebooks: The repository contains several Jupyter notebooks for exploratory data analysis, visualization, and building machine learning models. Some of the key notebooks are:
analyze.ipynb: For analyzing the processed data.simple_classifier.ipynb: For building a simple classifier for the imagined speech task.denoise.ipynb: For experimenting with different denoising techniques.
datadirectory: This directory contains the raw EEG data collected from the experiments..npzfiles: These files contain the processed data, ready to be used for training machine learning models.
While this repo is not set up to be run by a user, here are some of the files that can be run:
main.py: This will start the FastAPI server for data acquisition.produce_dataset.py: This will process the raw data and create the datasets.- The Jupyter notebooks can be run to analyze the data and train models.