Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EEG Data Processing and Analysis Pipeline

Overview

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.

Tools and Technologies

Python NumPy Pandas scikit-learn MNE

Key Components

  1. Data Extractor (src/data_extractor.py)

    • NeuralDatasetExtractor: Extracts EEG data from BIDS-formatted datasets.
    • WordSyllableDataExtractor: Processes and saves word and syllable data.
  2. Dataset Loader (src/dataset_loader.py)

    • VowelDataset: Loads and categorizes vowel data from processed EEG signals.
  3. Model Trainer (src/trainer.py)

    • ModelTrainer: Handles the training and evaluation of machine learning models.
  4. Configuration (src/config.py)

    • Contains global configuration settings for the project.

Setup and Installation

  1. Clone the repository:

    git clone [repository-url]
    
  2. Install required dependencies:

    pip install -r requirements.txt
    
  3. Set up the BIDS-formatted EEG dataset in the directory specified in config.py.

Usage

  1. Data Extraction:

    from src.data_extractor import extractWordSyllableDataForAllSubjects
    
    extractWordSyllableDataForAllSubjects(
        speechType='Overt',
        languageElement='Word',
        eventType='Start',
        trialPhase='Stimulus',
        presentationMode='Audio'
    )
  2. Load Dataset:

    from src.dataset_loader import VowelDataset
    
    dataset = VowelDataset(
        subjectId='01',
        sessionId='01',
        speechType='Overt',
        languageElement='Word',
        eventType='Start',
        trialPhase='Stimulus',
        presentationMode='Audio'
    )
  3. 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)

Configuration

Adjust settings in src/config.py to match your environment and dataset structure:

  • bidsDir: Path to the BIDS-formatted dataset
  • dataDir: Path for storing processed data
  • tmin and tmax: Time window for epoch extraction

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

  • MNE-Python for EEG data processing
  • scikit-learn for machine learning tools

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages