Authors: [Isabelle Hoxha, Sylvain Chevallier, Arnaud Delorme, Michel-Ange Amorim]
Contact: isabellehoxha[at]gmail.com
This repository contains the code used to preprocess EEG data, perform multivariate decoding analyses, and model behavioral data for the study:
Modality-specific predictive templates in pre-stimulus EEG activity
The project investigates anticipatory neural activity and its role in perceptual decision-making using EEG and computational modeling. In particular, it focuses on how pre-stimulus brain activity encodes modality-specific expectations and how these anticipatory states influence subsequent decision processes.
- src/ — scripts
- stats/ — files for statistical tests run outside of Python
- figures/ — figures of the paper
- results/ — files generated by the scripts
Python 3.11
Main dependencies:
- numpy
- scipy
- pandas
- scikit-learn
- mne
- matplotlib
- seaborn
- pyddm
The corresponding data can be found at https://zenodo.org/records/19595833
python src/ERP_analysis.py
will reproduce the figures and processing for the ERP analysis shown in the paper.
For the link between pre- and post-stimulus activity, run src/link_pre_post.py
Decoding is done in 3 steps:
- src/gridsearch.py will perform the gridsearch on the frequency bands explored
- src/cued_decoding_full.py will then get the test accuracy on cued trials
- src/uncued_semisupervised.py will fit uncued data using a model trained on cued trials
Intersubject variability analysis can be performed using src/intersubject_variability.py
The code src/DDM_fits.py fits diffusion decision models.
The figures can be found in the corresponding folder, and are generated with the scripts mentioned above.
The dataset is available on Zenodo
Due to size constraints, data are not included in this repository.
- Random seeds are fixed where relevant
- Cross-validation procedures use stratified splits
- Frequency band selection is performed on training data only
- Final models are evaluated on held-out test sets
- Decoding is performed on time-domain EEG signals after band-pass filtering
- Filtering is causal, preventing contamination from post-stimulus activity
- Frequency band selection is performed at the group level
- Analyses are designed to avoid circularity and ensure proper generalization
To reproduce the main results:
- Download the dataset
- Run the scripts :)
This code is released under the GPL-3.0 license.
To be announced soon! In the mean time, you can cite our preprint:
Hoxha, I., Chevallier, S., Delorme, A., & Amorim, M.-A. (2023). EEG anticipatory activity depends on sensory modality [Preprint]. Neuroscience. https://doi.org/10.1101/2023.09.27.559806