{"id":19252248,"url":"https://github.com/sccn/eeg-ssl","last_synced_at":"2025-04-15T21:51:22.590Z","repository":{"id":259171656,"uuid":"624565603","full_name":"sccn/eeg-ssl","owner":"sccn","description":"Apply Self-supervised Learning on NEMAR data","archived":false,"fork":false,"pushed_at":"2025-04-08T19:08:13.000Z","size":379740,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-08T20:23:18.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/sccn.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":"2023-04-06T18:55:25.000Z","updated_at":"2025-04-08T19:08:17.000Z","dependencies_parsed_at":"2025-01-13T20:25:53.720Z","dependency_job_id":"e2ae7a20-7be6-41e5-be4c-a9b4d7ee1a0e","html_url":"https://github.com/sccn/eeg-ssl","commit_stats":null,"previous_names":["sccn/eeg-ssl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Feeg-ssl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Feeg-ssl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Feeg-ssl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Feeg-ssl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sccn","download_url":"https://codeload.github.com/sccn/eeg-ssl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249161104,"owners_count":21222468,"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":[],"created_at":"2024-11-09T18:26:07.592Z","updated_at":"2025-04-15T21:51:22.584Z","avatar_url":"https://github.com/sccn.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eeg-ssl\nApply Self-supervised Learning on NEMAR and EEGDASH data\n\n## Installation\n- Install our fork of mne-python for latest EEGLAB import behavior: `pip install git+https://github.com/dungscout96/mne-python.git`\n- Install PyTorch for your respective system: https://pytorch.org/get-started/locally/\n- Install braindecode: `pip install braindecode`\n\nTo run model training, also install:\n- Install tensorboard: `pip install tensorboard`\n- Install torch lightning: `pip install lightning`\n\n## Run test model\n\nDownload example data\nhttps://drive.google.com/file/d/1KWEDoZOqyLojq0hQx8lUNTWSdZ5tBlTc/view?usp=sharing\n\nPlace the zip file in ./notebooks/data\n\nRun the notebook ./notebooks/HBN_braindecode.ipynb\n\n## Original video from Grandfort\n\nhttps://www.youtube.com/watch?v=gm3a7T2bmnc\n\n## Papers\nY. Benchetrit, H. Banville, and J.-R. King, “Brain decoding: toward real-time reconstruction of visual perception,” Mar. 14, 2024, arXiv: arXiv:2310.19812. doi: 10.48550/arXiv.2310.19812.\n\nA. Thual et al., “Aligning brain functions boosts the decoding of visual semantics in novel subjects,” Dec. 11, 2023, arXiv: arXiv:2312.06467. doi: 10.48550/arXiv.2312.06467.\n\nBanville, Hubert \u0026 Chehab, Omar \u0026 Hyvarinen, Aapo \u0026 Engemann, Denis-Alexander \u0026 Gramfort, Alexandre. (2020). Uncovering the structure of clinical EEG signals with self-supervised learning. Journal of Neural Engineering. 18. 10.1088/1741-2552/abca18. \nhttps://www.researchgate.net/publication/346857471_Uncovering_the_structure_of_clinical_EEG_signals_with_self-supervised_learning\n\nHubert Banville, Isabela Albuquerque, Aapo Hyvärinen, Graeme Moffat, Denis-Alexander Engemann, et al.. Self-supervised representation learning from electroencephalography signals. MLSP 2019 - IEEE 29th International Workshop on Machine Learning for Signal Processing, Oct 2019, Pittsburgh, United States. ⟨hal-02361350⟩\nhttps://hal.science/hal-02361350\n\n\n## Run experiment using Docker\nOn a machine with Nvidia GPU:\n\n```\ndocker run -v $(pwd):/app --rm -it --runtime=nvidia --gpus all --entrypoint bash dtyoung/eeg-ssl:linux\n```\n\nHere the path to the dataset is at `/mnt/nemar/child-mind-rest` and we assume that the command is run in the top-level directory of the cloned version of this repo.\n\n## Voyager install\n\n-  Download BIDS data and put it in the data folder. If you are downloading ds005505 for example, make sure the data is in data/ds005505/ (example of command scp -r arno@login.expanse.sdsc.edu:/expanse/projects/nemar/openneuro/ds005505 eeg-ssl/notebooks/data/)\n  \n-  Edit the file \"runs/config_RP.yaml\" and change the list of datasets under \"data\" to the data that is available to you (for example \"ds005505\") change also the \"data_dir\" entry to \"data\"\n\n-  Edit the file \"voyager.yaml\" and change the \"hostpath\" to you home folder. Also uncomment the first metadata name \"name: eeg-ssl-interactive\" and comment the jupyter one. Uncomment the args parameter \" [ \"while true; do sleep 30; done;\" ]\" and comment the one that is active (could be multiple lines, for example 4 lines).\n\n-  Start Kubernete\n\n```\nmodule load kubernetes/voyager/1.21.14\nkubectl apply -f ./voyager.yaml\nkubectl describe pod eeg-ssl-interactive\nkubectl logs pod eeg-ssl-interactive\nkubectl exec -it eeg-ssl-interactive  -- /bin/bash\n```\n\n- Once on the Kubernete, run the program\n\n```\npython main.py fit --config runs/config_RP.yaml\n```\n\n- Register on Weights and Biases https://wandb.ai/site/, and get a key at https://wandb.ai/authorize. At some point, the script above (after processing the data) will ask if you have an account, enter yes, and then copy your key. Once the script finishes, look at the results on weights and biases website.\n\n- Modify the network parameters in \"runs/config_RP.yaml\". Of importance are the number of epochs, the tau_pos_s value (10 second segment), the window_len_s (sub window of the segment, for example 2 seconds) and \"n_samples_per_dataset\" the number of sample to extract from each dataset (for example 100). This means that a window of 2 second will be extracted 100 times (at different latencies) from the 10 second segment.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Feeg-ssl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsccn%2Feeg-ssl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Feeg-ssl/lists"}