selfeeg


Nameselfeeg JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/MedMaxLab/selfEEG
SummarySelf-Supervised Learning for EEG
upload_time2024-06-24 16:44:27
maintainerNone
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>
</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 that will help you build
an SSL pipeline, from the creation of the dataloaders to the model's fine-tuning,
covering other important aspects such as 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.
3. **augmentation** - collection of data augmentation with fully support on GPU
   as well as other classes designed to combine them.
5. **models** - collection of deep neural models widely used in the EEG analysis
   (e.g., DeepConvNet, EEGNet, ResNet, TinySleepNet, STNet, etc)
7. **ssl** - collection of self-supervised algorithms with a highly customizable
   fit method  (e.g., SimCLR, SimSiam, MoCo, BYOL, etc) and other useful objects
   such as a custom earlyStopper or a fine-tuning function.
9. **losses** - collection of self-supervised learning losses.
10. **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**](https://mne.tools) (python based)
- [**EEGLAB**](https://sccn.ucsd.edu/eeglab) (matlab based)
- [**BIDSAlign**](https://github.com/MedMaxLab/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](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**, 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](https://doi.org/10.21105/joss.06224) published in the Journal of
Open Source Software (JOSS).
It would help us to continue our research.

```bibtex
@article{DelPup2024,
  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 = {2024},
  publisher = {The Open Journal},
  journal = {Journal of Open Source Software}
  volume = {9},
  number = {95},
  pages = {6224},
  doi = {10.21105/joss.06224},
  url = {https://doi.org/10.21105/joss.06224}
}
```

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": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "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/be/95/84c2bf53606c9e000b003aa1887e08ac232a0f7ee0351288aac7225d045b/selfeeg-0.2.0.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</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\n(SSL) experiments on electroencephalography (EEG) data.\nIn selfEEG, you can find different functions and classes that will help you build\nan SSL pipeline, from the creation of the dataloaders to the model's fine-tuning,\ncovering other important aspects such as the definitions of custom data augmenters,\nmodels, and pretraining strategies.\nIn particular, selfEEG comprises of the following modules:\n\n1. **dataloading** - collection of custom pytorch Dataset and Sampler classes\n   as well as functions to split your dataset.\n3. **augmentation** - collection of data augmentation with fully support on GPU\n   as well as other classes designed to combine them.\n5. **models** - collection of deep neural models widely used in the EEG analysis\n   (e.g., DeepConvNet, EEGNet, ResNet, TinySleepNet, STNet, etc)\n7. **ssl** - collection of self-supervised algorithms with a highly customizable\n   fit method  (e.g., SimCLR, SimSiam, MoCo, BYOL, etc) and other useful objects\n   such as a custom earlyStopper or a fine-tuning function.\n9. **losses** - collection of self-supervised learning losses.\n10. **utils** - other useful functions to manage EEG data.\n\nWhat makes selfEEG good? We have designed some modules keeping in mind EEG\napplications, but lots of functionalities can be easily exported on other\ntypes of signal as well!\n\nWhat will you not find in selfEEG? SelfEEG isn't an EEG preprocessing library.\nYou will not find functions to preprocess EEG data in the best possible way\n(no IC rejection or ASR). However, some simple operations like filtering and\nresampling can be performed with functions implemented in the utils and\naugmentation modules. If you want to preprocess EEG data in a really good way,\nwe suggest to take a look at:\n\n- [**MNE**](https://mne.tools) (python based)\n- [**EEGLAB**](https://sccn.ucsd.edu/eeglab) (matlab based)\n- [**BIDSAlign**](https://github.com/MedMaxLab/BIDSAlign)\n  (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\nenvironment, especially if you plan to work with jupyter, can be automatically\ninstalled 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\nselfEEG in a fresh environment. The following links provide a guide for creating a\nnew 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\nenvironment, the previous commands will install the CPU_only versions of such\npackages.\nIf you have CUDA installed on your system, we strongly encourage you to first\ninstall PyTorch, Torchvision and Torchaudio by choosing the\nright configuration, which varies depending on your OS and CUDA versions;\nthen, install selfEEG.\nThe official PyTorch documentation provides an installation command selector,\nwhich 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.\nIf you want to use selfEEG by forking and cloning the project,\nbe 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\n[pipdeptree](https://github.com/tox-dev/pipdeptree/tree/main).\nPackages like ``numpy`` does not appear because they are dependencies\nof 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\nproperly use some modules.\nThese notebooks are also included in the\n[official documentation](https://selfeeg.readthedocs.io/en/latest/index.html).\n\n\n## Contribution Guidelines\nIf you'd like to **contribute** to selfEEG,\nplease take a look at our [contributing guidelines](CONTRIBUTING.md).\n\nIf you also have **suggestions** regarding novel features to add, or simply\nwant some **support**, 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,\nuse the [GitHub issues](https://github.com/MedMaxLab/selfEEG/issues) page to report\nthem. 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.\nIf you use selfEEG during your research, please cite\n[our work](https://doi.org/10.21105/joss.06224) published in the Journal of\nOpen Source Software (JOSS).\nIt would help us to continue our research.\n\n```bibtex\n@article{DelPup2024,\n  title = {SelfEEG: A Python library for Self-Supervised Learning in Electroencephalography},\n  author = {Federico Del Pup and\n            Andrea Zanola and\n            Louis Fabrice Tshimanga and\n            Paolo Emilio Mazzon and\n            Manfredo Atzori},\n  year = {2024},\n  publisher = {The Open Journal},\n  journal = {Journal of Open Source Software}\n  volume = {9},\n  number = {95},\n  pages = {6224},\n  doi = {10.21105/joss.06224},\n  url = {https://doi.org/10.21105/joss.06224}\n}\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 [MIT Licence](LICENSE.md)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Self-Supervised Learning for EEG",
    "version": "0.2.0",
    "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": "4b6bd609dcbb4b0dcd799d9e8675eb39d69dee1803c99eb974501b8d4b44d376",
                "md5": "79612670f6bd7a271ed44662cbf52a7e",
                "sha256": "db5f52580ee0e07d8a5fc0bcdcd79213ac8384e38158aa1a840fc45d1509e22e"
            },
            "downloads": -1,
            "filename": "selfeeg-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "79612670f6bd7a271ed44662cbf52a7e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 116730,
            "upload_time": "2024-06-24T16:44:25",
            "upload_time_iso_8601": "2024-06-24T16:44:25.506764Z",
            "url": "https://files.pythonhosted.org/packages/4b/6b/d609dcbb4b0dcd799d9e8675eb39d69dee1803c99eb974501b8d4b44d376/selfeeg-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be9584c2bf53606c9e000b003aa1887e08ac232a0f7ee0351288aac7225d045b",
                "md5": "0cf84a206cb7a6e81f22bd478b0e95e8",
                "sha256": "9e55261fd2771a3662642e6d7e3ae50fdbe3a97820f6e041447f328637fecf78"
            },
            "downloads": -1,
            "filename": "selfeeg-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0cf84a206cb7a6e81f22bd478b0e95e8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 120761,
            "upload_time": "2024-06-24T16:44:27",
            "upload_time_iso_8601": "2024-06-24T16:44:27.596430Z",
            "url": "https://files.pythonhosted.org/packages/be/95/84c2bf53606c9e000b003aa1887e08ac232a0f7ee0351288aac7225d045b/selfeeg-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-24 16:44:27",
    "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.24057s