{"id":20319241,"url":"https://github.com/drammock/eeg-phone-coding","last_synced_at":"2025-09-13T15:46:41.353Z","repository":{"id":146724924,"uuid":"64333723","full_name":"drammock/eeg-phone-coding","owner":"drammock","description":"Research into the processing of native and foreign speech sounds using EEG.","archived":false,"fork":false,"pushed_at":"2019-01-05T01:49:01.000Z","size":27179,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T13:27:12.717Z","etag":null,"topics":["eeg","linguistics","machine-learning","phonology"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drammock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-27T18:49:57.000Z","updated_at":"2024-02-23T19:27:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"1854882c-9916-45df-a5bd-edb8f8cd2839","html_url":"https://github.com/drammock/eeg-phone-coding","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drammock%2Feeg-phone-coding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drammock%2Feeg-phone-coding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drammock%2Feeg-phone-coding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drammock%2Feeg-phone-coding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drammock","download_url":"https://codeload.github.com/drammock/eeg-phone-coding/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241820064,"owners_count":20025469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eeg","linguistics","machine-learning","phonology"],"created_at":"2024-11-14T18:45:40.304Z","updated_at":"2025-03-04T09:24:32.746Z","avatar_url":"https://github.com/drammock.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exploring speech sound coding using EEG\nExperiment to test performance of EEG signal classifiers trained on brain responses to CV-syllables using only English consonants, when tested on brain responses to held-out English and foreign consonant CV-syllables.\n\n## Preparation\n- `slide-prompts` folder: Generate textual prompts for recording foreign-language stimuli\n- `stimulus-generation` folder: Process audio recordings to generate stimuli\n\n## Data Collection\n- `run-experiment.py`: Run experiment and collect EEG data (done on a separate acquisition computer using BrainVision pyCorder software; no additional scripts associated with the recording process)\n\n## Analysis Pipeline\nScripts that are ancillary (not precursors to the next step in the pipeline) are indented.\n\n- `010-merge-eeg-raws.py`: convert BrainVision data format to `mne.io.Raw` objects; deal with subjects who have two separate recordings (due to equipment malfunction / restarting blocks); auto-add annotations to ignore between-block periods.\n- `015-reannotate.py`: interactive annotation of `Raw` files: to mark movement artifacts, bad channels, or other undesirable noise in the data.\n- `018-add-projectors.py`: detect blinks and add SSP projectors to remove blink artifacts. Also bandpass-filters the data.\n- `020-make-epochs.py`: epoching, baseline correction, and downsampling.\n    - `022-check-snr.py`: compares baseline power to evoked power, to assess how good a job the preprocessing did at data cleaning.\n    - `025-plot-erps.py`: sanity check that the ERPs look reasonable.\n- `030-dss.py`: run denoising source separation on epoched data.\n    - `031-validate-dss.py`: plot relative signal power per DSS component. Adjust parameter `[dss][n_components]` based on this plot.\n    - `032-plot-dss-topomap.py`: plot scalp topography of the DSS components.\n    - `035-find-redundant-features.py`: determine which phonological features are equivalent across different feature systems, so we don’t unnecessarily run redundant classifiers. Add parameter `[feature_mappings]` based on results of this script.\n- `036-munge-feature-sets.py`: combine all feature systems into a single spreadsheet. This determines the classifiers that will be trained and the labels they will get with their training data.\n- `037-time-domain-redux.py`: reduce correlation of time samples via PCA, and unroll channels (or DSS components) to make classifier-friendly unidimensional vector for each trial.\n    - `038-check-trial-counts.py`: sanity check that dropping noisy epochs did not cause too great an imbalance across phone types.\n- `039-make-parallel-jobfile.py`: generates the Bash lines that call the classification script with command line args for each subject and feature.\n- `040-classify.py`: The machine learning workhorse that runs the grid search / cross validation.\n    - `041a-aggregate-eers.py`: aggregates classifier EERs across features and subjects.\n    - `042-rank-classifier-performance.py`: Makes plots comparing classifier performance (EER) for each feature system.\n- Three scripts to convert classifier output into various kinds of confusion matrices:\n    - `050a-make-eer-confusion-matrices.py`: Make confusion matrices based on a fixed error rate for each feature, determined by that feature’s classifier’s “equal error rate” (EER).\n    - `050b-make-phone-confusion-matrices.py`: Make confusion matrices based on the phone-level error rates from classifying the held-out data.\n    - `050c-make-theoretical-confusion-matrices.py`: Make confusion matrices based on a fixed error rate across all features, for simulating robustness of feature systems to varying levels of noise.\n- Two scripts to order the rows/columns of the confusion matrices in informative ways:\n    - `052a-optimal-matrix-sorting.py`: Re-orders the rows/columns of confusion matrices using hierarchical clustering with “optimal leaf ordering”.\n    - `052b-featural-matrix.sorting.py`: Re-orders the rows/columns of confusion matrices using hierarchical clustering, with a custom implementation that constrains clustering based on across-subject mean EER for each feature.\n    - Some scripts for measuring the diagonality of the resulting matrices:\n        - `055-measure-diagonality.py`: Compute how much of the weight of each matrix lies near the diagonal.\n        - `056-plot-diagonality.py`: Plot diagonality values for each subject.\n        - `057-plot-snr-vs-diagonality.py`: Plot SNR vs diagonality.\n- `060-plot-confusion-matrices.py`: Plots grids of confusion matrices for comparing performance of the different feature systems.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrammock%2Feeg-phone-coding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrammock%2Feeg-phone-coding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrammock%2Feeg-phone-coding/lists"}