Open spectroscopy for everyone

From raw spectra to deployed models — a comprehensive Python framework and desktop application for Near-Infrared Spectroscopy, built by researchers, shared with the world.

Start here

The library and the app

Most people meet nirs4all in one of two ways: the Python library that powers everything, or Studio, the no-code app built on top of it. Everything else — file readers, datasets, portable engines, a cross-language port — is the supporting ecosystem, mapped out further down.

nirs4all · Python Library

A comprehensive Python framework for Near-Infrared Spectroscopy analysis. Build declarative ML pipelines with 30+ preprocessing transforms, 15+ advanced PLS models, and multi-backend support for scikit-learn, TensorFlow, PyTorch, and JAX. Export trained pipelines as portable .n4a bundles ready for deployment.

nirs4all Studio · Desktop App

A modern desktop application for interactive spectral data exploration and model building. Features a drag-and-drop pipeline builder, real-time spectral visualization, SHAP variable importance analysis, and a native desktop experience powered by Electron — with GPU acceleration support on Windows, Linux, and macOS.

nirs4all Studio

See it in action

Interactive desktop application for exploring data, building pipelines, and analyzing results — no code required.

Capabilities

Everything spectroscopy needs

Built specifically for NIRS workflows — not generic ML tools adapted for spectra.

30+ Spectral Preprocessing Transforms

Comprehensive NIRS-specific preprocessing including wavelength-aware operators that automatically receive wavelength information.

SNVMSCSavitzky-Golay OSCEPOWavelet BaselineCARSMCUVE

15+ Advanced PLS Models

State-of-the-art Partial Least Squares variants with automatic operator selection via AOM-PLS for optimal model performance.

PLSPLS-DA NLPLSPLS-DA AOM-PLSFCK-PLSOPLS DiPLSMBPLSPCR

Multi-Backend Machine Learning

Unified API across all major ML frameworks. Swap backends without changing your pipeline code.

scikit-learnTensorFlow PyTorchJAXAutoGluon

Declarative Pipeline Syntax

Express complex workflows — branching, merging, hyperparameter sweeps, cross-validation — with a concise, readable list syntax. Parallel execution via joblib.

_or__range_branch mergeOptuna

SHAP Explainability

Full scikit-learn compatibility enables SHAP integration for spectral band importance visualization, prediction diagnostics, and model transparency.

SHAPVariable Importance sklearn compatible

Portable Model Bundles

Export entire trained pipelines as .n4a bundles for seamless deployment and sharing. Includes predict, explain, and retrain capabilities.

.n4a exportpredict() explain()retrain()
Real-world impact

Where NIRS makes a difference

Near-infrared spectroscopy provides rapid, non-destructive analysis across industries — from field to laboratory.

Agriculture & Crops

Crop quality assessment, soil composition analysis, and phenotyping for plant breeding programs.

Grain Quality Soil Analysis Phenotyping

Food Quality & Safety

Rapid authentication, composition analysis, and quality grading of food products and raw materials.

Authenticity Composition Grading

Research & Pharma

Pharmaceutical process monitoring, chemical analysis, and materials characterization in research laboratories.

Process Control QC/QA Materials
Get the library

Get started in seconds

Install the Python library from PyPI — no configuration required. Add optional extras for deep-learning backends. (For the no-code route, grab Studio instead.)

# Core library
pip install nirs4all

# With PyTorch backend
pip install nirs4all[torch]

# With TensorFlow backend
pip install nirs4all[tensorflow]

# All backends (sklearn + TF + PyTorch + JAX)
pip install nirs4all[all]

# GPU/CUDA acceleration
pip install nirs4all[all-gpu]
import nirs4all

# Run a pipeline on your spectral data
result = nirs4all.run(
    pipeline=[SNV(), PLSRegression(10)],
    dataset="data.csv"
)

# Inspect results
print(result.best_rmse)
print(result.top(5))

# Deploy the best model
result.export("best_model.n4a")

# Predict on new spectra
preds = nirs4all.predict("best_model.n4a", new_data)
import nirs4all

# Preprocessing variants × PLS sweep on n_components
pipeline_1 = [
    {"_or_": [SNV, MSC, Detrend]},
    {"model": {
        "type": PLSRegression,
        "param": {"n_components": {"_range_": [2, 20, 5]}
      }
    }
]

# Stacking: compare PLS vs RF in branches, then merge + meta-learner
pipeline_2 = [
    {"branch": [
        [SNV(), {"model": PLSRegression(10)}],
        [MSC(), {"model": RandomForestRegressor()}],
    ]},
    {"merge": "predictions"},
    {"model": Ridge()},  # meta-learner trained on stacked predictions
]

results = nirs4all.run(pipeline=[pipeline_1, pipeline_2], dataset="data.csv")
The full picture

One growing ecosystem

At the center sits nirs4all, the Python library. Around it: the no-code Studio app, in-browser demos, file & dataset tools, portable engines, a leakage-safe execution core — and an ongoing port to every language. Explore the live demos, or install any package below.

Python library
nirs4all Python
v0.9.3

The Python core of the ecosystem: declarative NIRS pipelines with 30+ spectral preprocessings, 15+ advanced PLS models, and a unified API over scikit-learn, TensorFlow, PyTorch and JAX. Train, explain, and export portable .n4a model bundles.

Desktop & web app
nirs4all Studio React · Electron
v0.7.0

The no-code application built on the library: a drag-and-drop pipeline builder, real-time spectral visualization, experiment tracking, and SHAP analysis — packaged with Electron for Windows, Linux and macOS, and runnable on the web.

PLS engine
nirs4all-methods C++ · C ABI
v0.99.0

A portable Partial Least Squares engine in C++17 with a stable C ABI (libn4m) and first-class bindings for Python, R, MATLAB/Octave, JavaScript/WebAssembly and Android — one numerical core, parity-checked across every language.

Adaptive models
nirs4all-aom Python · sklearn
v0.1.1

Operator-adaptive calibration models — AOM-PLS, POP-PLS and AOM-Ridge — that fold spectral preprocessing directly into the model and replace external preprocessing grid-search. scikit-learn compatible; companion code for the AOM-PLS paper.

File readers
nirs4all-formats Rust
v0.1.0

Rust-first, low-level readers for ~58 NIRS & spectroscopy format families. Content-sniffed, lossless, provenance-tracked records with Python, R, WebAssembly and C bindings — the messy vendor-file zoo turned into one clean data model. Try the full reader catalog right in the browser via the live demo.

Dataset bridge
nirs4all-io Python · Rust · R
v0.1.1

A dataset-assembly bridge: turn any input — a folder, a glob, vendor spectra plus a reference table, or a config — into a pipeline-ready dataset through resolve → infer → configure → materialize, with a score-based inference engine. Built on nirs4all-formats.

Reference datasets
nirs4all-datasets Python
v0.2.0

A Python library that transparently pulls curated, hand-picked NIRS test datasets from Dataverse — turning reproducible, DOI-citable benchmarks and lab experiments into a one-line import.

Execution core
dag-ml Rust · C ABI
v0.1.0-alpha

A leakage-safe, in-process DAG execution core. It owns the graph, phases, folds, out-of-fold joins, lineage, caching and deterministic RNG — exposed through a C ABI so any host language can drive reproducible ML pipelines.

Data contracts
dag-ml-data Rust · C ABI
v0.1.0-alpha

The data-contract and planning layer beneath dag-ml: typed, sample-aligned, multi-source data views, representation adapters, data plans, and schema fingerprints — the foundation that keeps pipelines reproducible.

Distributed execution
nirs4all-cluster Python
v0.0.1

A public alpha prototype for distributing nirs4all.run() across lab machines — FastAPI coordinator, SQLite queue, capability routing and crash-safe leases. It is a validation bench, not a production service.

Browser client
nirs4all-web WASM · JS
v0.1.0

The browser-native client: a full-WASM mini Studio that runs the whole NIRS loop — load spectra, build a pipeline from nirs4all-methods nodes, train, score and predict — entirely client-side, no Python.

Portable bindings
nirs4all-lite Rust · Python · R · WASM
v0.1.0

The canonical low-level distribution that aggregates dag-ml, dag-ml-data, formats, io, datasets and methods. It exposes native binding surfaces without adding parsers or methods; full upstream integrations and pipeline parity fixtures are the next hardening step.

New
nirs4all-arena

Reproducible, scored nirs4all pipelines run on curated reference datasets, published as a browsable benchmark resource. The design is taking shape; it is not a public submission platform.

Ecosystem_ 12 repos · open source
Install pick a package manager
# the library, the engines, the models & the data tools pip install nirs4all pip install nirs4all-methods pip install pls4all pip install nirs4all-aom pip install nirs4all-formats pip install nirs4all-io pip install nirs4all-datasets pip install nirs4all-lite
All packages now on PyPI. CRAN tarballs & binding zips → ↓ Releases.
# R — the whole stack, auto-built from source install.packages( c("n4m", "pls4all", "nirs4allformats", "nirs4allio", "nirs4alldatasets", "nirs4all"), repos = "https://gbeurier.r-universe.dev" )
Rebuilt on every release — no compiler needed.
CRAN — submission in progress.
CRAN-ready source tarballs (n4m, pls4all, nirs4allformats, nirs4allio, nirs4alldatasets, nirs4all) ship on each ↓ Releases. Until they land on CRAN, the R·universe tab installs the same packages.
One +n4m binding for both runtimes — unzip, addpath, go.
# JS / WASM bindings (the lite aggregate & datasets) npm install nirs4all npm install @nirs4all/datasets-wasm
The browser client also runs live as nirs4all-web (Explore).
Makers

The team

Researchers and engineers from the PHENOMEN team at CIRAD / UMR AGAP Institut, building open-source tools for spectroscopy science.

Gregory Beurier

Gregory Beurier

Co-founder & Lead Developer
CIRAD · UMR AGAP Institut
AI Modelization Dev Optimization
Denis Cornet

Denis Cornet

Co-founder & Product Owner
CIRAD · UMR AGAP Institut
Ecophysiology Data Science Chemometrics
Lauriane Rouan

Lauriane Rouan

Co-founder & Contributor
CIRAD · UMR AGAP Institut
Biostatistics Data Science Optimization
Home

Institutions

nirs4all is developed at CIRAD within the UMR AGAP Institut — a research center dedicated to plant genetics, genomics, and agro-resources.

The French Agricultural Research Centre for International Development — a research organization working with developing countries to tackle international agricultural and development challenges.

Visit CIRAD →

Amélioration Génétique et Adaptation des Plantes méditerranéennes et tropicales — a joint research unit focused on plant genetic improvement, genomics, and adaptation for Mediterranean and tropical species.

Visit UMR AGAP →
Adoption

They already use it

Research institutes, universities, and companies across Europe and Africa build their near-infrared spectroscopy workflows with nirs4all.

CNRS
University of Potsdam
IITA
CSIR Ghana
CNRA Côte d'Ivoire
Bowen University
Université de Parakou
Getade
Research

Publications

Research using nirs4all and related spectroscopic analysis.

2026
Tabular foundation models for robust calibration of near-infrared chemical sensing data
Reiter R., Cornet D., Michel F. et al.
arXiv preprint, 2026
2026
Reframing preprocessing selection as model-internal calibration in near-infrared spectroscopy: a large-scale benchmark of operator-adaptive PLS and Ridge models
Beurier G., Reiter R., Noûs C. et al.
arXiv preprint, 2026
2024
Convolutional neural network allows amylose content prediction in yam (Dioscorea alata L.) flour using near infrared spectroscopy
Houngbo M.E., Desfontaines L., Diman J.-L. et al.
Journal of the Science of Food and Agriculture, 104(8), 4915–4921, 2024
2024
Food quality profile of pounded yam and implications for yam breeding
Otegbayo B.O., Oroniran O., Tanimola A. et al.
Journal of the Science of Food and Agriculture, 104(8), 4635–4651, 2024
2024
NIRSpredict: a platform for predicting plant traits from near infra-red spectroscopy
Vaillant A., Beurier G., Cornet D. et al.
BMC Plant Biology, 24, Article 1100, 2024
2022
A perspective on plant phenomics: coupling deep learning and near-infrared spectroscopy
Vasseur F., Cornet D., Beurier G. et al.
Frontiers in Plant Science, 13, Article 836488, 2022
2021
Near-infrared spectroscopy (NIRS) applications for high throughput phenotyping (HTP) for cassava and yam: a review
Alamu E.O., Nuwamanya E., Cornet D. et al.
International Journal of Food Science & Technology, 56(3), 1491–1501, 2021
2021
Predicting quality, texture and chemical content of yam (Dioscorea alata L.) tubers using near infrared spectroscopy
Ehounou A.E., Cornet D., Desfontaines L. et al.
Journal of Near Infrared Spectroscopy, 29(3), 128–139, 2021
2019
Development of NIRS and molecular marker to improve breeding efficiency in greater yam (Dioscorea alata L.) for key quality traits
Ehounou A.E., Cormier F., Cornet D. et al.
International Conference on Applied Biochemistry and Biotechnology (ABB 2019), Macau, China
Cite this software
@software{beurier2025nirs4all,
  author  = {Gregory Beurier and Denis Cornet and Lauriane Rouan},
  title   = {NIRS4ALL: Open spectroscopy for everyone},
  url     = {https://github.com/GBeurier/nirs4all},
  version = {0.8.8},
  year    = {2026},
}
Search-ready answers

Frequently asked questions

Answers to the main questions researchers, engineers, and applied teams ask before adopting nirs4all for Near-Infrared Spectroscopy workflows.

What is nirs4all?

nirs4all is open-source Near-Infrared Spectroscopy software made of a Python library and a desktop application for preprocessing spectra, building chemometric and machine-learning pipelines, visualizing results, and deploying models.

Can I use nirs4all without coding?

Yes. nirs4all Studio provides a desktop interface for interactive exploration, pipeline building, experiment tracking, result analysis, and data inspection without needing to write code.

Which machine-learning and deep-learning backends does nirs4all support?

The nirs4all Python library supports multiple backends and integrations including scikit-learn, TensorFlow, PyTorch, JAX, and advanced chemometric workflows around Partial Least Squares models.

How do I install or download nirs4all?

You can install the Python library from PyPI with pip install nirs4all, and you can download nirs4all Studio for Windows, macOS, and Linux from the latest GitHub releases page.