This project implements a pipeline for processing and analyzing EEG (Electroencephalography) data, specifically focusing on speech and language tasks. The pipeline includes data extraction from BIDS-formatted datasets, preprocessing of EEG signals, and training of machine learning models for classification tasks.
-
Data Extractor (
src/data_extractor.py)NeuralDatasetExtractor: Extracts EEG data from BIDS-formatted datasets.WordSyllableDataExtractor: Processes and saves word and syllable data.
-
Dataset Loader (
src/dataset_loader.py)VowelDataset: Loads and categorizes vowel data from processed EEG signals.
-
Model Trainer (
src/trainer.py)ModelTrainer: Handles the training and evaluation of machine learning models.
-
Configuration (
src/config.py)- Contains global configuration settings for the project.
-
Clone the repository:
git clone [repository-url] -
Install required dependencies:
pip install -r requirements.txt -
Set up the BIDS-formatted EEG dataset in the directory specified in
config.py.
-
Data Extraction:
from src.data_extractor import extractWordSyllableDataForAllSubjects extractWordSyllableDataForAllSubjects( speechType='Overt', languageElement='Word', eventType='Start', trialPhase='Stimulus', presentationMode='Audio' )
-
Load Dataset:
from src.dataset_loader import VowelDataset dataset = VowelDataset( subjectId='01', sessionId='01', speechType='Overt', languageElement='Word', eventType='Start', trialPhase='Stimulus', presentationMode='Audio' )
-
Train Model:
from src.trainer import ModelTrainer from your_model_file import YourModel X, y = dataset.vowelData model = YourModel() trainer = ModelTrainer() trainer.trainModel(model, X, y)
Adjust settings in src/config.py to match your environment and dataset structure:
bidsDir: Path to the BIDS-formatted datasetdataDir: Path for storing processed datatminandtmax: Time window for epoch extraction
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- MNE-Python for EEG data processing
- scikit-learn for machine learning tools