emsigma


Nameemsigma JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/poyentung/sigma
Summaryspectral interpretation using gaussian mixtures and autoencoder
upload_time2023-11-08 22:29:12
maintainer
docs_urlNone
authorPo-Yen Tung
requires_python>=3.10
licenseGNU GPLv3
keywords hyperspectral imaging analysis energy dispersive x-ray spectroscopy scanning electron microscopy gaussain mixture autoencoder non-negative matrix factorization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Description

**Spectral Interpretation using Gaussian Mixtures and Autoencoder (SIGMA)** is an open-source Python library for phase identification and spectrum analysis for energy dispersive x-ray spectroscopy (EDS) datasets. The library mainly builds on the [**Hyperspy**](https://hyperspy.org/), [**Pytorch**](https://pytorch.org/), and [**Scikit-learn**](https://scikit-learn.org/stable/). The publication is available [**here**](https://doi.org/10.1002/essoar.10511396.1).<br />

**(UPDATE v0.2.0)** SIGMA now supports [**UMAP**](https://umap-learn.readthedocs.io/en/latest/index.html#) for dimensionality reduction and [**HDBSCAN**](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.HDBSCAN.html) for clustering.

**Try your dataset on SIGMA with Colab in the cloud:** 
| Type of data  | Support format | Colab link    
 :---: | :---: | :---:
| SEM | `.bcf` `.hspy` | <a href="https://colab.research.google.com/github/poyentung/sigma/blob/master/tutorial/colab/tutorial_colab_sem.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|
| TEM | `.emi`/`.ser` `.emd`| <a href="https://colab.research.google.com/github/poyentung/sigma/blob/master/tutorial/colab/tutorial_colab_tem_emi_emd.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
| Images | `.tif` `.png` | <a href="https://colab.research.google.com/github/poyentung/sigma/blob/master/tutorial/colab/tutorial_colab_image.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|

This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 101005611: [**The EXCITE Network**](https://excite-network.eu/). If analysis using SIGMA forms a part of published work please cite the [manuscript](https://doi.org/10.1029/2022GC010530).

## Installation
1. Create a [**Python>=3.10**](https://www.python.org/) environment with [**conda**](https://docs.conda.io/en/latest/):
```bash
conda create -n sigma python=3.10
conda activate sigma
```

2. Install **SIGMA** with [**pip**](https://pypi.org/project/pip/):
```bash
pip install emsigma
```

3. Use the notebook in the tutorial folder to run **SIGMA**.
```bash
jupyter-lab
```

## Workflow of SIGMA
1. A neural network autoencoder is trained to learn good representations of elemental pixels in the 2D latent space. <br />
<div align="left">
  <img width="650" alt="Autoencoder" src="https://user-images.githubusercontent.com/29102746/163899500-34ac68e2-9a38-44d9-a869-e40c024c420b.png">
</div><br />

2. The trained encoder is then used to transform high-dimensional elemental pixels into low-dimensional representations, followed by clustering using Gaussian mixture modeling (GMM) in the informative latent space.<br />
<div align="left">
  <img width="650" alt="GMM" src="https://user-images.githubusercontent.com/29102746/163899758-6bd61544-fa91-44ac-8647-d249982b6607.png"> 
</div><br />

3. Non-negative matrix factorization (NMF) is applied to unmix the single-phase spectra for all clusters.<br />
<div align="left">
  <img width="650" alt="NMF" src="https://user-images.githubusercontent.com/29102746/163899763-0fb4f835-3380-4504-9f3a-bb33089421f8.png">  
</div><br />

In such a way, the algorithm not only identifies the locations of all unknown phases but also isolates the background-subtracted EDS spectra of individual phases.

## User-friendly GUI
### Check .bcf file
An example of checking the EDS dataset and the sum spectrum.
<details open>
<summary>Demo with Colab</summary>

![Demo-check_EDS_dataset](https://user-images.githubusercontent.com/29102746/159283425-00a6e8a6-3274-4495-9ab6-ca0e9a844277.gif)

</details>

### Dimensionality reduction and clustering
An example of analysing the latent space using the graphical widget.
<details open>
<summary>Demo with Colab</summary>

![Screen Recording 2022-02-22 at 12 09 38 PM](https://user-images.githubusercontent.com/29102746/159275323-45ad978a-7dcf-40d9-839b-d58979bb0101.gif)

</details>

### Factor analysis on cluster-wise spectra
A demo of acquiring Background-substracted spectrum using Factor Analysis (FA).
<details open>
<summary>Demo with Colab</summary>
  
![Demo-NMF](https://user-images.githubusercontent.com/29102746/159292227-1e82402c-2429-4c81-8245-8798c426ea0f.gif)

</details>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/poyentung/sigma",
    "name": "emsigma",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "hyperspectral imaging analysis,energy dispersive x-ray spectroscopy,scanning electron microscopy,gaussain mixture,autoencoder,non-negative matrix factorization",
    "author": "Po-Yen Tung",
    "author_email": "pyt21@cam.ac.uk",
    "download_url": "https://files.pythonhosted.org/packages/9f/29/6801555aa7749bdc93c0545d1c8a517658b25ad5363d311eb5b874fae0dc/emsigma-0.2.1.tar.gz",
    "platform": null,
    "description": "## Description\n\n**Spectral Interpretation using Gaussian Mixtures and Autoencoder (SIGMA)** is an open-source Python library for phase identification and spectrum analysis for energy dispersive x-ray spectroscopy (EDS) datasets. The library mainly builds on the [**Hyperspy**](https://hyperspy.org/), [**Pytorch**](https://pytorch.org/), and [**Scikit-learn**](https://scikit-learn.org/stable/). The publication is available [**here**](https://doi.org/10.1002/essoar.10511396.1).<br />\n\n**(UPDATE v0.2.0)** SIGMA now supports [**UMAP**](https://umap-learn.readthedocs.io/en/latest/index.html#) for dimensionality reduction and [**HDBSCAN**](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.HDBSCAN.html) for clustering.\n\n**Try your dataset on SIGMA with Colab in the cloud:** \n| Type of data  | Support format | Colab link    \n :---: | :---: | :---:\n| SEM | `.bcf` `.hspy` | <a href=\"https://colab.research.google.com/github/poyentung/sigma/blob/master/tutorial/colab/tutorial_colab_sem.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>|\n| TEM | `.emi`/`.ser` `.emd`| <a href=\"https://colab.research.google.com/github/poyentung/sigma/blob/master/tutorial/colab/tutorial_colab_tem_emi_emd.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> |\n| Images | `.tif` `.png` | <a href=\"https://colab.research.google.com/github/poyentung/sigma/blob/master/tutorial/colab/tutorial_colab_image.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>|\n\nThis project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 101005611: [**The EXCITE Network**](https://excite-network.eu/). If analysis using SIGMA forms a part of published work please cite the [manuscript](https://doi.org/10.1029/2022GC010530).\n\n## Installation\n1. Create a [**Python>=3.10**](https://www.python.org/) environment with [**conda**](https://docs.conda.io/en/latest/):\n```bash\nconda create -n sigma python=3.10\nconda activate sigma\n```\n\n2. Install **SIGMA** with [**pip**](https://pypi.org/project/pip/):\n```bash\npip install emsigma\n```\n\n3. Use the notebook in the tutorial folder to run **SIGMA**.\n```bash\njupyter-lab\n```\n\n## Workflow of SIGMA\n1. A neural network autoencoder is trained to learn good representations of elemental pixels in the 2D latent space. <br />\n<div align=\"left\">\n  <img width=\"650\" alt=\"Autoencoder\" src=\"https://user-images.githubusercontent.com/29102746/163899500-34ac68e2-9a38-44d9-a869-e40c024c420b.png\">\n</div><br />\n\n2. The trained encoder is then used to transform high-dimensional elemental pixels into low-dimensional representations, followed by clustering using Gaussian mixture modeling (GMM) in the informative latent space.<br />\n<div align=\"left\">\n  <img width=\"650\" alt=\"GMM\" src=\"https://user-images.githubusercontent.com/29102746/163899758-6bd61544-fa91-44ac-8647-d249982b6607.png\"> \n</div><br />\n\n3. Non-negative matrix factorization (NMF) is applied to unmix the single-phase spectra for all clusters.<br />\n<div align=\"left\">\n  <img width=\"650\" alt=\"NMF\" src=\"https://user-images.githubusercontent.com/29102746/163899763-0fb4f835-3380-4504-9f3a-bb33089421f8.png\">  \n</div><br />\n\nIn such a way, the algorithm not only identifies the locations of all unknown phases but also isolates the background-subtracted EDS spectra of individual phases.\n\n## User-friendly GUI\n### Check .bcf file\nAn example of checking the EDS dataset and the sum spectrum.\n<details open>\n<summary>Demo with Colab</summary>\n\n![Demo-check_EDS_dataset](https://user-images.githubusercontent.com/29102746/159283425-00a6e8a6-3274-4495-9ab6-ca0e9a844277.gif)\n\n</details>\n\n### Dimensionality reduction and clustering\nAn example of analysing the latent space using the graphical widget.\n<details open>\n<summary>Demo with Colab</summary>\n\n![Screen Recording 2022-02-22 at 12 09 38 PM](https://user-images.githubusercontent.com/29102746/159275323-45ad978a-7dcf-40d9-839b-d58979bb0101.gif)\n\n</details>\n\n### Factor analysis on cluster-wise spectra\nA demo of acquiring Background-substracted spectrum using Factor Analysis (FA).\n<details open>\n<summary>Demo with Colab</summary>\n  \n![Demo-NMF](https://user-images.githubusercontent.com/29102746/159292227-1e82402c-2429-4c81-8245-8798c426ea0f.gif)\n\n</details>\n",
    "bugtrack_url": null,
    "license": "GNU GPLv3",
    "summary": "spectral interpretation using gaussian mixtures and autoencoder",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/poyentung/sigma"
    },
    "split_keywords": [
        "hyperspectral imaging analysis",
        "energy dispersive x-ray spectroscopy",
        "scanning electron microscopy",
        "gaussain mixture",
        "autoencoder",
        "non-negative matrix factorization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9f296801555aa7749bdc93c0545d1c8a517658b25ad5363d311eb5b874fae0dc",
                "md5": "4067a176bd210178cebc8e6e487a6595",
                "sha256": "6d400cb807ad5a6e5c0973b7fe62edcb3888b6701c3a8a0b46c4757012e7c0d9"
            },
            "downloads": -1,
            "filename": "emsigma-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4067a176bd210178cebc8e6e487a6595",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 44601,
            "upload_time": "2023-11-08T22:29:12",
            "upload_time_iso_8601": "2023-11-08T22:29:12.240138Z",
            "url": "https://files.pythonhosted.org/packages/9f/29/6801555aa7749bdc93c0545d1c8a517658b25ad5363d311eb5b874fae0dc/emsigma-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-08 22:29:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "poyentung",
    "github_project": "sigma",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "emsigma"
}
        
Elapsed time: 0.13187s