Skip to main content

Python package that provides a full range of functionality to process and analyze vibrational spectra (Raman, SERS, FTIR, etc.).

Project description


DOI License: MIT made-with-python Maintenance

BoxSERS, a powerful and ready-to-use python package providing several tools for the analysis of vibrational spectra (Raman, FTIR, SERS, etc.), including features for data augmentation, dimensional reduction, spectral correction and both supervised and unsupervised machine learning.

Table of contents

BoxSERS Installation


From PypY

pip install boxsers

From Github

pip install git+https://github.com/ALebrun-108/BoxSERS.git

Requirements


Listed below are the main modules needed to operate the codes:

  • Sklearn
  • Scipy
  • Numpy
  • Pandas
  • Matplotlib
  • Tensor flow (GPU or CPU)

Label information

The labels associated with the spectra can be either integer values (single column) or binary values (multiple columns).

####Example of labels for three classes that correspond to three bile acids:

Bile acid Integer label (1 column) Binary label (3 columns)
Cholic acid 0 [1 0 0]
Lithocholic acid 1 [0 1 0]
Deoxycholic acid 2 [0 0 1]

Included Features


Module misc_tools

This module provides functions for a variety of utilities.

  • data_split : Randomly splits an initial set of spectra into two new subsets named in this function: subset A and subset B.

  • ramanshift_converter : Converts wavelength [nm] to Raman shifts [cm-1].

  • wavelength_converter : Convert Raman shifts [cm-1] to wavelengths [nm].

  • load_rruff : Export a subset of Raman spectra from the RRUFF database in the form of three related lists containing Raman shifts, intensities and mineral names.

Module visual_tools

This module provides different tools to visualize vibrational spectra quickly.

  • spectro_plot : Returns a plot with the selected spectrum(s)

  • random_plot : Plot a number of randomly selected spectra from a set of spectra.

  • distribution_plot : Return a bar plot that represents the distributions of spectra for each classes in a given set of spectra

Module preprocessing

This module provides functions to preprocess vibrational spectra. These features improve spectrum quality and can improve performance for machine learning applications.

  • als_baseline_cor : Subtracts the baseline signal from the spectrum(s) using an Asymmetric Least Squares estimation.

  • intensity_normalization : Normalizes the spectrum(s) using one of the available norms in this function.

  • savgol_smoothing : Smoothes the spectrum(s) using a Savitzky-Golay polynomial filter.

  • cosmic_filter : Applies a median filter to the spectrum(s) to remove cosmic rays.

  • spectral_cut : Subtracts or sets to zero a delimited spectral region of the spectrum(s).

  • spline_interpolation : Performs a one-dimensional interpolation spline on the spectra to reproduce them with a new x-axis.

Module data_augmentation

This module provides funtions to generate new spectra by adding different variations to existing spectra.

  • aug_mixup : Randomly generates new spectra by mixing together several spectra with a Dirichlet probability distribution.

  • aug_noise : Randomly generates new spectra with Gaussian noise added.

  • aug_multiplier : Randomly generates new spectra with multiplicative factors applied.

  • aug_offset : Randomly generates new spectra shifted in intensity.

  • aug_xshift : Randomly generates new spectra shifted in wavelength.

  • aug_linslope : Randomly generates new spectra with additional linear slopes

Module dimension_reduction

This module provides different techniques to perform dimensionality reduction of vibrational spectra.

  • SpectroPCA : Principal Component Analysis (PCA) model object.

Module clustering

This module provides unsupervised learning models for vibrational spectra cluster analysis.

  • SpectroKmeans : K-Means clustering model.

  • SpectroGmixture : Gaussian mixture probability distribution model.

Module classification

This module provides supervised learning models for vibrational spectra classification.

  • SpectroRF : Random forest classification model.

  • SpectroSVM : Support Vector Machine classification model.

  • SpectroLDA : Linear Discriminant Analysis classification model

Module neural_networks

This module provides neural network model specifically designed for the classification of vibrational spectra.

  • SpectroCNN : Convolutional Neural Network (CNN) for vibrational spectra classification.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boxsers-1.0.3.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

boxsers-1.0.3-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file boxsers-1.0.3.tar.gz.

File metadata

  • Download URL: boxsers-1.0.3.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.8

File hashes

Hashes for boxsers-1.0.3.tar.gz
Algorithm Hash digest
SHA256 0ebb932627be64ebc66588d6ca787552f235c46b703c143291a10aa5cd3d78f4
MD5 0f4a9eeab0fac5e47f8500b0cbd0478c
BLAKE2b-256 79ef0edf0dfe21b3ae66a7c40a22d347af56d32812a528640171649e1557ca39

See more details on using hashes here.

File details

Details for the file boxsers-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: boxsers-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.8

File hashes

Hashes for boxsers-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3451e20961a4dc949b1b0b97ccf84bcc3f4a171e4be6eb0aee2486435676da70
MD5 045400e65563fd31780c824208e80b94
BLAKE2b-256 783dd38f77d0acc01c744570e087297cd66eac8861a8bd8e0ec54fb42c444a01

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page