selfeeg


Nameselfeeg JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/MedMaxLab/selfEEG
SummarySelf-Supervised Learning for EEG
upload_time2024-03-13 16:33:23
maintainer
docs_urlNone
authorMedMax Team
requires_python>=3.8
licenseMIT
keywords deep learning self-supervised learning contrastive learning electroencephalography eeg
VCS
bugtrack_url
requirements pip pandas scikit-learn torch torchaudio torchvision tqdm
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="Images/LibraryLogo.png"
        alt="Picture"
        width="300"
        style="display: block; margin: 0 auto" />

<table>
<tr>
  <td>Latest Release</td>
  <td>
    <a href="https://pypi.org/project/selfeeg/">
    <img src="https://img.shields.io/pypi/v/selfeeg" alt="latest release" />
    </a>
    <a href="https://anaconda.org/pup_fede_cnd/selfeeg">
    <img src="https://anaconda.org/pup_fede_cnd/selfeeg/badges/version.svg" />
    </a>
    <a href="https://anaconda.org/pup_fede_cnd/selfeeg">
    <img src="https://anaconda.org/pup_fede_cnd/selfeeg/badges/latest_release_date.svg" />
    </a>
</tr>
<tr>
  <td>Build Status</td>
  <td>
    <a href="https://img.shields.io/readthedocs/selfeeg">
    <img src="https://img.shields.io/readthedocs/selfeeg" alt="documentation build status" />
    </a>
    <a href="https://github.com/MedMaxLab/selfEEG/actions/workflows/python-app.yml">
      <img src="https://github.com/MedMaxLab/selfEEG/actions/workflows/python-app.yml/badge.svg" alt="GitHub Actions Testing Status" />
    </a>
  </td>
</tr>
<tr>
  <td>License</td>
  <td>
    <a href="https://github.com/MedMaxLab/selfEEG/blob/main/LICENSE.md">
    <img src="https://img.shields.io/badge/License-MIT-yellow.svg"
        alt="license" />
    </a>
</td>
</tr>
<tr>
  <td>Publications</td>
  <td>
    <a href="https://joss.theoj.org/papers/ab7eaf53973996e7c8d49dada734de78">
        <img src="https://joss.theoj.org/papers/ab7eaf53973996e7c8d49dada734de78/status.svg">
    </a>
  </td>
</tr>
</table>


# What is selfEEG?
selfEEG is a pytorch-based library designed to facilitate self-supervised learning (SSL) experiments on electroencephalography (EEG) data. In selfEEG, you can find different functions and classes which will help you build an SSL pipeline, from the creation of the dataloaders, to the model's fine-tuning, passing by the definitions of custom data augmenters, models, and pretraining strategies.
In particular, selfEEG comprises of the following modules:

1. **dataloading** - collection of custom pytorch Dataset and Sampler classes as well as functions to split your dataset.
2. **augmentation** - collection of data augmentation with fully support on GPU as well as other classes designed to combine them.
3. **models** - collection of deep neural models widely used in the EEG analysis (e.g. DeepConvNet, EEGNet, ResNet, TinySleepNet, STNet, etc)
4. **ssl** - collection of self-supervised algorithms (e.g. SimCLR, SimSiam, MoCo, BYOL, etc) with a highly customizable fit method as well as a custom earlyStopper and a function for fine-tuning.
5. **losses** - collection of self-supervised learning losses.
6. **utils** - other useful functions to manage EEG data.

What makes selfEEG good? We have designed some modules keeping in mind EEG applications, but lots of functionalities can be easily exported on other types of signal as well!

What will you not find in selfEEG? SelfEEG isn't an EEG preprocessing library. You will not find functions to preprocess EEG data in the best possible way (no IC rejection or ASR). However, some simple operations like filtering and resampling can be performed with functions implemented in the utils and augmentation modules.
If you want to preprocess EEG data in a really good way, we suggest to take a look at:

- **MNE** (python based)
- **EEGLAB** (matlab based)
- **BIDSAlign** (an EEGLab extension provided by our team)


## installation
SelfEEG may be installed via pip (recommended):
```
pip install selfeeg
```
Additionally, optional but useful packages which we suggest to include in your environment, especially if you plan to work with jupyter, can be automatically installed with the following pip command:
```
pip install selfeeg[interactive]
```

SelfEEG can be also installed via conda by running the following command:
```
conda install -c Pup_Fede_Cnd -c pytorch selfeeg
```

**Good practice**

Although the dependency list is pretty short, it is strongly suggested to install selfEEG in a fresh environment. The following links provide a guide for creating a new Python virtual environment or a new conda environment:

1. [new virtual environment](https://docs.python.org/3/library/venv.html)
2. [new conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands)

In addition, if PyTorch, Torchvision and Torchaudio are not present in your environment, the previous commands will install the CPU_only versions of such packages.
If you have CUDA installed on your system, we strongly encourage you to first install PyTorch, Torchvision and Torchaudio by choosing the
right configuration, which varies depending on your OS and CUDA versions; then install selfEEG. The official PyTorch documentation provides an installation command selector, which is available at the following [link](https://pytorch.org/get-started/locally/).



## Dependencies
selfEEG requires the following packages to correctly work. If you want to use selfEEG by forking and cloning the project, be sure to install them:

- pandas >=1.5.3
- scipy >=1.10.1
- torch >= 2.0.0
- torchaudio >=2.0.2
- torchvision >=0.15.2
- tqdm

The following list was extracted via ``pipdeptree`` ([github repo](https://github.com/tox-dev/pipdeptree/tree/main)). Packages like ``numpy`` does not appear because they are dependencies of other listed packages.

Optional packages which we suggest to include in your environment are:

- jupyterlab
- scikit-learn
- seaborn (or simply matplotlib)
- MNE-Python


## Usage
in the Notebooks folder, you can find some notebooks which will explain how to properly use some modules. These notebooks are also included in the [official documentation](https://selfeeg.readthedocs.io/en/latest/index.html).


## Contribution Guidelines
If you'd like to **contribute** to selfEEG, please take a look at our [contributing guidelines](CONTRIBUTING.md).

If you also have suggestions regarding novel features to add, or simply want some **support** or **suggestions** on how to exploit this library in your SSL experiments, please consider writing to our research team.

[MedMax Team](mailto:manfredo.atzori@unipd.it&cc=federico.delpup@studenti.unipd.it,andrea.zanola@studenti.unipd.it,louisfabrice.tshimanga@unipd.it)

Our team is open to new collaborations!


## Requests and bug tracker
If you have some requests or you have noticed some bugs, use the [GitHub issues](https://github.com/MedMaxLab/selfEEG/issues) page to report them. We will try to solve reported major bugs as fast as possible.


## Authors and Citation
We have worked really hard to develop this library. If you use selfEEG during your research, please cite our work. It will help us to continue doing our research. We are working on a research paper to submit to the Journal of Open Source Software. Until then, you can cite the following [ArXiv preprint](https://arxiv.org/abs/2401.05405):

```bibtex
@misc{delpup2023selfeeg,
      title={SelfEEG: A Python library for Self-Supervised Learning in Electroencephalography},
      author={Federico Del Pup and Andrea Zanola and Louis Fabrice Tshimanga and Paolo Emilio Mazzon and Manfredo Atzori},
      year={2023},
      eprint={2401.05405},
      archivePrefix={arXiv},
      primaryClass={eess.SP}
}
```

Alternatively, you can cite the following [IEEE article](https://ieeexplore.ieee.org/document/10365170):

```bibtex
@article{delpup2023,
  author={Del Pup, Federico and Atzori, Manfredo},
  journal={IEEE Access},
  title={Applications of Self-Supervised Learning to Biomedical Signals: a Survey},
  year={2023},
  volume={11},
  number={},
  pages={144180-144203},
  doi={10.1109/ACCESS.2023.3344531}}
```

Contributors:
- Eng. Federico Del Pup
- M.Sc. Andrea Zanola
- M.Sc. Louis Fabrice Tshimanga
- Eng. Paolo Emilio Mazzon
- Prof. Manfredo Atzori

## License
SelfEEG is released under the
[MIT Licence](LICENSE.md)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MedMaxLab/selfEEG",
    "name": "selfeeg",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "Deep Learning,Self-Supervised Learning,Contrastive Learning,Electroencephalography,EEG",
    "author": "MedMax Team",
    "author_email": "federico.delpup@studenti.unipd.it",
    "download_url": "https://files.pythonhosted.org/packages/1e/31/4568c56b2b0ac3cdc4f9aca95fa5e46d5d0e99643f9c8af23415e4105ef5/selfeeg-0.1.1.tar.gz",
    "platform": null,
    "description": "<img src=\"Images/LibraryLogo.png\"\n        alt=\"Picture\"\n        width=\"300\"\n        style=\"display: block; margin: 0 auto\" />\n\n<table>\n<tr>\n  <td>Latest Release</td>\n  <td>\n    <a href=\"https://pypi.org/project/selfeeg/\">\n    <img src=\"https://img.shields.io/pypi/v/selfeeg\" alt=\"latest release\" />\n    </a>\n    <a href=\"https://anaconda.org/pup_fede_cnd/selfeeg\">\n    <img src=\"https://anaconda.org/pup_fede_cnd/selfeeg/badges/version.svg\" />\n    </a>\n    <a href=\"https://anaconda.org/pup_fede_cnd/selfeeg\">\n    <img src=\"https://anaconda.org/pup_fede_cnd/selfeeg/badges/latest_release_date.svg\" />\n    </a>\n</tr>\n<tr>\n  <td>Build Status</td>\n  <td>\n    <a href=\"https://img.shields.io/readthedocs/selfeeg\">\n    <img src=\"https://img.shields.io/readthedocs/selfeeg\" alt=\"documentation build status\" />\n    </a>\n    <a href=\"https://github.com/MedMaxLab/selfEEG/actions/workflows/python-app.yml\">\n      <img src=\"https://github.com/MedMaxLab/selfEEG/actions/workflows/python-app.yml/badge.svg\" alt=\"GitHub Actions Testing Status\" />\n    </a>\n  </td>\n</tr>\n<tr>\n  <td>License</td>\n  <td>\n    <a href=\"https://github.com/MedMaxLab/selfEEG/blob/main/LICENSE.md\">\n    <img src=\"https://img.shields.io/badge/License-MIT-yellow.svg\"\n        alt=\"license\" />\n    </a>\n</td>\n</tr>\n<tr>\n  <td>Publications</td>\n  <td>\n    <a href=\"https://joss.theoj.org/papers/ab7eaf53973996e7c8d49dada734de78\">\n        <img src=\"https://joss.theoj.org/papers/ab7eaf53973996e7c8d49dada734de78/status.svg\">\n    </a>\n  </td>\n</tr>\n</table>\n\n\n# What is selfEEG?\nselfEEG is a pytorch-based library designed to facilitate self-supervised learning (SSL) experiments on electroencephalography (EEG) data. In selfEEG, you can find different functions and classes which will help you build an SSL pipeline, from the creation of the dataloaders, to the model's fine-tuning, passing by the definitions of custom data augmenters, models, and pretraining strategies.\nIn particular, selfEEG comprises of the following modules:\n\n1. **dataloading** - collection of custom pytorch Dataset and Sampler classes as well as functions to split your dataset.\n2. **augmentation** - collection of data augmentation with fully support on GPU as well as other classes designed to combine them.\n3. **models** - collection of deep neural models widely used in the EEG analysis (e.g. DeepConvNet, EEGNet, ResNet, TinySleepNet, STNet, etc)\n4. **ssl** - collection of self-supervised algorithms (e.g. SimCLR, SimSiam, MoCo, BYOL, etc) with a highly customizable fit method as well as a custom earlyStopper and a function for fine-tuning.\n5. **losses** - collection of self-supervised learning losses.\n6. **utils** - other useful functions to manage EEG data.\n\nWhat makes selfEEG good? We have designed some modules keeping in mind EEG applications, but lots of functionalities can be easily exported on other types of signal as well!\n\nWhat will you not find in selfEEG? SelfEEG isn't an EEG preprocessing library. You will not find functions to preprocess EEG data in the best possible way (no IC rejection or ASR). However, some simple operations like filtering and resampling can be performed with functions implemented in the utils and augmentation modules.\nIf you want to preprocess EEG data in a really good way, we suggest to take a look at:\n\n- **MNE** (python based)\n- **EEGLAB** (matlab based)\n- **BIDSAlign** (an EEGLab extension provided by our team)\n\n\n## installation\nSelfEEG may be installed via pip (recommended):\n```\npip install selfeeg\n```\nAdditionally, optional but useful packages which we suggest to include in your environment, especially if you plan to work with jupyter, can be automatically installed with the following pip command:\n```\npip install selfeeg[interactive]\n```\n\nSelfEEG can be also installed via conda by running the following command:\n```\nconda install -c Pup_Fede_Cnd -c pytorch selfeeg\n```\n\n**Good practice**\n\nAlthough the dependency list is pretty short, it is strongly suggested to install selfEEG in a fresh environment. The following links provide a guide for creating a new Python virtual environment or a new conda environment:\n\n1. [new virtual environment](https://docs.python.org/3/library/venv.html)\n2. [new conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands)\n\nIn addition, if PyTorch, Torchvision and Torchaudio are not present in your environment, the previous commands will install the CPU_only versions of such packages.\nIf you have CUDA installed on your system, we strongly encourage you to first install PyTorch, Torchvision and Torchaudio by choosing the\nright configuration, which varies depending on your OS and CUDA versions; then install selfEEG. The official PyTorch documentation provides an installation command selector, which is available at the following [link](https://pytorch.org/get-started/locally/).\n\n\n\n## Dependencies\nselfEEG requires the following packages to correctly work. If you want to use selfEEG by forking and cloning the project, be sure to install them:\n\n- pandas >=1.5.3\n- scipy >=1.10.1\n- torch >= 2.0.0\n- torchaudio >=2.0.2\n- torchvision >=0.15.2\n- tqdm\n\nThe following list was extracted via ``pipdeptree`` ([github repo](https://github.com/tox-dev/pipdeptree/tree/main)). Packages like ``numpy`` does not appear because they are dependencies of other listed packages.\n\nOptional packages which we suggest to include in your environment are:\n\n- jupyterlab\n- scikit-learn\n- seaborn (or simply matplotlib)\n- MNE-Python\n\n\n## Usage\nin the Notebooks folder, you can find some notebooks which will explain how to properly use some modules. These notebooks are also included in the [official documentation](https://selfeeg.readthedocs.io/en/latest/index.html).\n\n\n## Contribution Guidelines\nIf you'd like to **contribute** to selfEEG, please take a look at our [contributing guidelines](CONTRIBUTING.md).\n\nIf you also have suggestions regarding novel features to add, or simply want some **support** or **suggestions** on how to exploit this library in your SSL experiments, please consider writing to our research team.\n\n[MedMax Team](mailto:manfredo.atzori@unipd.it&cc=federico.delpup@studenti.unipd.it,andrea.zanola@studenti.unipd.it,louisfabrice.tshimanga@unipd.it)\n\nOur team is open to new collaborations!\n\n\n## Requests and bug tracker\nIf you have some requests or you have noticed some bugs, use the [GitHub issues](https://github.com/MedMaxLab/selfEEG/issues) page to report them. We will try to solve reported major bugs as fast as possible.\n\n\n## Authors and Citation\nWe have worked really hard to develop this library. If you use selfEEG during your research, please cite our work. It will help us to continue doing our research. We are working on a research paper to submit to the Journal of Open Source Software. Until then, you can cite the following [ArXiv preprint](https://arxiv.org/abs/2401.05405):\n\n```bibtex\n@misc{delpup2023selfeeg,\n      title={SelfEEG: A Python library for Self-Supervised Learning in Electroencephalography},\n      author={Federico Del Pup and Andrea Zanola and Louis Fabrice Tshimanga and Paolo Emilio Mazzon and Manfredo Atzori},\n      year={2023},\n      eprint={2401.05405},\n      archivePrefix={arXiv},\n      primaryClass={eess.SP}\n}\n```\n\nAlternatively, you can cite the following [IEEE article](https://ieeexplore.ieee.org/document/10365170):\n\n```bibtex\n@article{delpup2023,\n  author={Del Pup, Federico and Atzori, Manfredo},\n  journal={IEEE Access},\n  title={Applications of Self-Supervised Learning to Biomedical Signals: a Survey},\n  year={2023},\n  volume={11},\n  number={},\n  pages={144180-144203},\n  doi={10.1109/ACCESS.2023.3344531}}\n```\n\nContributors:\n- Eng. Federico Del Pup\n- M.Sc. Andrea Zanola\n- M.Sc. Louis Fabrice Tshimanga\n- Eng. Paolo Emilio Mazzon\n- Prof. Manfredo Atzori\n\n## License\nSelfEEG is released under the\n[MIT Licence](LICENSE.md)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Self-Supervised Learning for EEG",
    "version": "0.1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/MedMaxLab/selfEEG/issues",
        "Documentation": "https://selfeeg.readthedocs.io/en/latest/index.html",
        "Homepage": "https://github.com/MedMaxLab/selfEEG",
        "Source Code": "https://github.com/MedMaxLab/selfEEG"
    },
    "split_keywords": [
        "deep learning",
        "self-supervised learning",
        "contrastive learning",
        "electroencephalography",
        "eeg"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c4f32ed45dd7c55ce7cfb262103f9c61a6632d8be7cdc35220f697b91ddb4120",
                "md5": "9ace5aa3d60ac0897962a8c4e7f74729",
                "sha256": "b2d77838ab3cfda2dfa49d1c8db5888467da5cd838ad54c26af62ed46a137fca"
            },
            "downloads": -1,
            "filename": "selfeeg-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ace5aa3d60ac0897962a8c4e7f74729",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 90563,
            "upload_time": "2024-03-13T16:33:09",
            "upload_time_iso_8601": "2024-03-13T16:33:09.451726Z",
            "url": "https://files.pythonhosted.org/packages/c4/f3/2ed45dd7c55ce7cfb262103f9c61a6632d8be7cdc35220f697b91ddb4120/selfeeg-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1e314568c56b2b0ac3cdc4f9aca95fa5e46d5d0e99643f9c8af23415e4105ef5",
                "md5": "af399156ddc13122a878d758bd9ec4ea",
                "sha256": "449284ab74e614786f68d73954fcb4f61cd1b8bb4e54167e6f9aabe558f6a680"
            },
            "downloads": -1,
            "filename": "selfeeg-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "af399156ddc13122a878d758bd9ec4ea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 105216,
            "upload_time": "2024-03-13T16:33:23",
            "upload_time_iso_8601": "2024-03-13T16:33:23.826404Z",
            "url": "https://files.pythonhosted.org/packages/1e/31/4568c56b2b0ac3cdc4f9aca95fa5e46d5d0e99643f9c8af23415e4105ef5/selfeeg-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-13 16:33:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MedMaxLab",
    "github_project": "selfEEG",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pip",
            "specs": [
                [
                    ">=",
                    "23.3"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "scikit-learn",
            "specs": [
                [
                    ">=",
                    "1.2.2"
                ]
            ]
        },
        {
            "name": "torch",
            "specs": [
                [
                    ">=",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "torchaudio",
            "specs": [
                [
                    ">=",
                    "2.0.2"
                ]
            ]
        },
        {
            "name": "torchvision",
            "specs": [
                [
                    ">=",
                    "0.15.2"
                ]
            ]
        },
        {
            "name": "tqdm",
            "specs": [
                [
                    ">=",
                    "4.65.0"
                ]
            ]
        }
    ],
    "lcname": "selfeeg"
}
        
Elapsed time: 0.20530s