New Python, R and WASM share one method engine and portable trained models · Studio 0.15.2 · Watch the 5-minute tour

Open spectroscopy for everyone

From raw spectra to deployed models — a Python library, an R package and in-browser WebAssembly bindings built on one native method engine, and a visual desktop app for exploring data, building pipelines, and comparing models.

Updating from Studio 0.12? Run the new installer — your settings, workspaces and linked datasets are kept.

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
Where we make the difference

The library and the app

Most people meet nirs4all through the Python library or Studio, the no-code desktop app. Behind both, the same native method engine also powers the R package and the WebAssembly client, and the portable aggregate (nirs4all-core), shared UI, file readers, datasets and execution core remain independently usable.

nirs4all · Python library

The Python reference implementation — declarative NIRS pipelines, the 208 native methods of nirs4all-methods as scikit-learn classes, multi-backend training, and portable .n4a bundles, executed by the leakage-safe DAG-ML backend.

Backends
Get started in seconds
# 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")

nirs4all Studio · Desktop app

Explore spectra, build pipelines, and compare models in the no-code desktop app. Studio 0.15.2 runs on a native backend with a bundled, pinned Python runtime, and its editor offers every nirs4all-methods estimator as a node, saved in the portable recipe format shared with Python, R and the web client. Choose the installer for your operating system or use Docker.

Runs on
No code, just clicks
Studio · Playground nirs4all Studio — Playground See it in action →
Python · R · WebAssembly

One method engine, three languages

Every numerical method is implemented once, in the portable C++ engine nirs4all-methods. Its 208 methods reach Python, R and the browser through the same typed roles — transformer, selector, regressor, classifier, sample filter, splitter and augmenter — so a pipeline is written once and a trained model moves between languages.

Python · PyPI

nirs4all · Python library

The reference implementation. Native methods are scikit-learn classes that run directly in nirs4all pipelines, next to scikit-learn, PyTorch, TensorFlow or JAX models.

# pip install nirs4all
import nirs4all
from n4m import roles
from sklearn.model_selection import KFold

result = nirs4all.run(
    pipeline=[
        roles.SNV(),
        KFold(5),
        {"model": roles.PLSRegression(
            n_components=10)},
    ],
    dataset="data.csv",
)
R · R-universe

nirs4all · R package

The same engine from R, through the n4m package, with R learner controllers (ranger, glmnet, xgboost, torch…) and a native DAG-ML path for cross-validation, selection, refit and replay.

install.packages("nirs4all",
  repos = c(
    "https://gbeurier.r-universe.dev",
    "https://cloud.r-project.org"))
library(nirs4all)

fit <- nirs4all_fit_role_recipe(
  "recipe.json", X, y)
nirs4all_predict(fit, X_new)
nirs4all_export_trained_pipeline(
  fit, "model.json")
JavaScript · WebAssembly

nirs4all · in the browser

The engine compiled to WebAssembly. Pipelines train and predict entirely client-side — no server, no Python — as in the web client, which saves its models in the same portable format.

// npm install nirs4all @nirs4all/methods
import { N4mRolePipeline }
  from "nirs4all";

// a model trained in Python or R
const model = await
  N4mRolePipeline.fromJSON(envelope);
const { data } =
  model.predict({ X, rows, cols });
Same recipe

Write a pipeline once

A JSON or YAML recipe of n4m:<method id> steps runs unchanged in Python, R and the browser, and Studio saves its pipelines in the same format.

Same trained model

Train anywhere, predict everywhere

A trained pipeline exports its fitted native states in one checksummed envelope; the other languages predict the same values from it, or retrain the same recipe on new data. The engine checks column names and order before predicting, and leaves training rows out of exports unless you opt in. A shared cross-language test fixture checks it on every release.

{ "pipeline": [
    "n4m:preprocessing.scatter.snv",
    { "class": "n4m:filters.y_outlier",
      "params": { "threshold": 2.0 } },
    { "class": "n4m:models.pls.pls_regression",
      "params": { "n_components": 10 } }
] }
Five-minute tour

The ecosystem in motion

An animated walkthrough — spectra from dozens of instrument formats, preprocessing and PLS pipelines, leakage-safe cross-validation and model selection, reproducible replay, and sharing across Python, R and the browser. English and French subtitles.

5 min 13 · 1080p · no soundtrack · Download the MP4 (37 MB)

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

Advanced PLS Models

State-of-the-art Partial Least Squares variants, including operator-adaptive AOM and POP models, computed by the portable nirs4all-methods engine — the same numbers in Python, R and the browser.

PLSPLS-DAOPLS AOM-PLSPOP-PLSFCK-PLS DiPLSMBPLSPLS-GLM PLS-CoxPCR

Multi-Backend Machine Learning

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

scikit-learnTensorFlow PyTorchJAXAutoGluon

Declarative, Leakage-Safe Pipelines

Express branching, merging, sweeps and stacking in a concise list syntax. DAG-ML runs it: every candidate model is scored on identical folds with out-of-fold predictions, the best is selected deterministically, stacked models learn only from nested out-of-fold predictions, and the winner is refit and replayable. Pipelines of native methods run entirely inside DAG-ML, with no Python callbacks and the same scores.

_or__range_branch mergestackingOOFOptuna

SHAP Explainability

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

SHAPVariable Importance sklearn compatible

Portable Trained Models

Export trained pipelines as .n4a bundles to predict, explain and retrain them — or as a cross-language envelope of native states that Python, R and the browser all replay.

.n4a exportpredict() explain()retrain()Python ↔ R ↔ WASM
nirs4all Studio

See it in action

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

The full picture

One growing ecosystem

It began with nirs4all, the Python scientific oracle. Reproducible graph execution now lives in dag-ml, typed data planning in dag-ml-data, and every numerical method in the portable nirs4all-methods engine — which is what lets the same pipelines and trained models run in Python, R and the browser. nirs4all-core is the portable aggregate, Studio the desktop application, and every specialist package remains available on its own.

01
Reference oracle

nirs4all Python

Where the behavior is defined, tested and explained — the Python source of truth for scientific parity and .n4a exports.

02
User-facing surfaces

Studio, Web & UI

Studio is the desktop app, nirs4all-web is the client-side WASM app, and nirs4all-ui keeps their React interface shared.

03
Portable aggregate · v1

core aggregate

nirs4all-core packages the cross-language stack; with the R package and the browser client, recipes and trained models move between languages.

PythonRWASMRustMATLAB
Live ecosystem status — releases, registries, documentation, and CI across the project family cockpit →
Python oracle
nirs4all Python
v1.4.7

The Python oracle/reference implementation for the ecosystem: declarative NIRS pipelines over the native nirs4all-methods operators, and a unified API over scikit-learn, TensorFlow, PyTorch and JAX. Train, explain, and export portable .n4a bundles or cross-language model envelopes.

Desktop app
nirs4all Studio React · Electron
v0.15.2

Visual tools for exploring datasets, creating pipelines, running experiments, and inspecting predictions. A native backend with a bundled Python runtime, pipeline nodes generated from the nirs4all-methods catalog, one installer per operating system and a Docker image.

R package
nirs4all R
v0.7.2

The R product package: composable NIRS pipelines on the native nirs4all-methods engine (n4m) with R learner controllers, a native DAG-ML path, and recipes and trained models shared with Python and the browser.

Guided lab workflow
quali-nirs4all React · WASM
Beta

A guided mini-studio for NIRS analysis laboratories. It helps lab technicians assess spectral data health and repeats, select samples for HPLC or wet chemistry, calibrate models, qualify prediction reliability, and monitor model drift — all locally in the browser through the nirs4all WASM stack.

Connected spectrometer app
nirs4all-device Mobile · BLE
Prototype

A prototype phone and tablet workbench for Bluetooth-connected NIRS spectrometers: organize field sessions, capture and inspect spectra, apply quality gates, and run portable inference locally. The hardware design files and build guide for a DIY NIRS device will be available soon.

Shared UI package
nirs4all-ui React · TypeScript
v0.1.15

The shared React UI and visual-system package for Studio, Web, and custom hosts: reusable presentational components, runtime status view models, score helpers, default CSS tokens, generated brand metadata/assets, and packaged motion motifs, while host apps keep routing, data fetching, execution, icons, and app state ownership.

Method engine
nirs4all-methods C++ · C ABI
v1.3.4

The portable NIRS method engine: 213 catalogued methods in C++17 behind a stable C ABI (libn4m), 208 of them through generic typed roles — transformers, selectors, regressors, classifiers, sample filters, splitters and augmenters — with a native manifest and a portable fitted state. The same classes are generated for Python, R, JavaScript/WebAssembly and Rust; MATLAB/Octave and Android bindings cover the classic API.

Adaptive models
nirs4all-aom Python · sklearn
v0.10.4

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.2.11

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.2.6

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.3.11

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.3.41

A leakage-safe, in-process DAG execution core. It owns the graph, phases, folds, out-of-fold joins, lineage, caching and deterministic RNG, and runs multi-model campaigns: many candidate pipelines scored on identical folds, deterministic selection, stacking with nested out-of-fold predictions, HPO, refit and replay. Its controllers for the nirs4all-methods roles derive from the Methods manifest; everything is exposed through a C ABI, Python and WebAssembly.

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

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.1.4

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

Browser client
nirs4all-web WASM · JS
v0.4.1

The browser-native client at web.nirs4all.org. It runs in the page through WASM: load spectra, build a pipeline from the nirs4all-methods catalog, train, score and predict — entirely client-side, with no Python runtime and no server-side analysis. Models are saved as portable native states that Python and R can replay.

Portable V1 aggregate
nirs4all-core Rust · Python · R · WASM
v0.4.5

The published portable aggregate for the reproducible cross-language stack gathers dag-ml, dag-ml-data, formats, IO, datasets, and methods behind one coherent V1 integration surface, and reads and writes the trained-model envelope shared by Python, R and WebAssembly.

New
nirs4all-benchmarks
v0.1.6

Reproducible, scored nirs4all pipelines run on curated reference datasets, published as a browsable benchmark resource with interactive dataviz (leaderboards, effect analysis, 3D landscapes, clustered pipeline graphs). An early prototype — currently a static client-side demo; a live meta-analysis service is planned.

Pipeline library
nirs4all-repository
v0.1.12

A public beta catalogue of pre-configured nirs4all & dag-ml pipeline recipes stored with provenance, checksums, reference dataset hints, and per-recipe evaluation status. Treat published entries as draft/community recipes unless their catalogue record is marked validated.

Repro publishing
nirs4all-papers
v0.2.3

An early prototype that turns a finished experiment into a self-contained reproduction document — an auto-generated methods & bibliography report alongside an in-browser page that re-runs the exact pipeline, on the bundled data or your own.

Provider clients
nirs4all-providers Python
v0.2.11

The dependency-light, soft-importing provider client layer over nirs4all-datasets and nirs4all-repository. Benchmarks and papers keep their own public APIs. It stays read-side only, with optional-dependency contracts and local export helpers, without owning NIRS, ML, IO, parsing, or write-back logic.

Migration toolkit
nirs4all-tools Python · CLI
v0.0.7

The published V1 preservation toolkit for legacy content: read-only inspection, dry-run, resumable copy-only output and checksum verification. Code 0 means successful preservation; semantic conversion fails closed with code 20, and code 10 is reserved for a future best-effort transform.

Ecosystem_ 22 projects · 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-papers # repro-document publisher (prototype)
The main V1 line is published on PyPI. Specialist packages keep independent release cadences; the version badges above resolve against their public registries when online.
# R preview/subset packages, auto-built from source install.packages( c("n4m", "pls4all", "nirs4allformats", "nirs4allio", "nirs4alldatasets", "nirs4all"), repos = "https://gbeurier.r-universe.dev" )
The nirs4all R package runs the same Methods roles, recipes and trained-model envelopes as Python and WASM. R-universe builds from source and can lag GitHub/PyPI/npm/crates by a few hours after a release; CRAN submission is still pending.
CRAN — release-candidate preview.
Source tarballs for the R subset (n4m, pls4all, nirs4allformats, nirs4allio, nirs4alldatasets, nirs4all) are handled through Releases/R·universe while CRAN publication remains gated.
Methods bindings are a subset surface for both runtimes; aggregate MATLAB/Octave packaging remains RC-gated.
# JS / WASM bindings and shared React UI npm install nirs4all @nirs4all/methods npm install nirs4all-ui npm install @nirs4all/datasets-wasm
nirs4all 1.4.7, nirs4all-core 0.4.5, dag-ml 0.3.41, dag-ml-data 0.2.13, Methods 1.3.4 and nirs4all-ui 0.1.15 form the current published line. nirs4all for R 0.7.2 is available on R-universe, and nirs4all-web 0.4.1 runs client-side. Studio 0.15.2 remains the published desktop release with its own pinned runtime.
How it fits together

From spectra to shared models

The whole pipeline, end to end — every box is a package you can use on its own, and the provider layer offers one read surface over datasets and repository. Hover or tap a node to see what it does and where to get it.

Every node is a real package — hover, tap or focus to open it.

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.

Research

Publications

The reference publication for nirs4all, followed by research using the software and related spectroscopic analysis.

2026
nirs4all: Canonical, content-addressed workflows for reproducible near-infrared calibration
Beurier G., Rouan L., Cornet D.
Chemometrics and Intelligent Laboratory Systems, 279, Article 105880, 2026
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 nirs4all
@article{beurier2026nirs4all,
  author  = {Gregory Beurier and Lauriane Rouan and Denis Cornet},
  title   = {nirs4all: Canonical, content-addressed workflows for reproducible near-infrared calibration},
  journal = {Chemometrics and Intelligent Laboratory Systems},
  volume  = {279},
  pages   = {105880},
  year    = {2026},
  doi     = {10.1016/j.chemolab.2026.105880},
  url     = {https://doi.org/10.1016/j.chemolab.2026.105880},
}
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 an open-source Near-Infrared Spectroscopy ecosystem. The Python library is the reference implementation; an R package and WebAssembly bindings share its native method engine (nirs4all-methods), so the same recipes and trained models work in Python, R and the browser. DAG-ML provides leakage-safe, reproducible execution, and Studio is the no-code desktop application.

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?

Install the Python library with pip install nirs4all, the R package from R-universe with install.packages("nirs4all", repos = c("https://gbeurier.r-universe.dev", "https://cloud.r-project.org")), and the JavaScript/WebAssembly packages with npm install nirs4all @nirs4all/methods. For Studio, open the 0.15.2 release page: one installer each for Windows, macOS and Linux, plus a Docker image.

Can I use nirs4all from R or in a web browser?

Yes. The R package and the WebAssembly bindings use the same native method engine as the Python library. A JSON or YAML recipe of n4m:<method id> steps runs unchanged in Python, R and the browser, and a pipeline trained in one language exports its fitted native states so the others predict the same values from it. web.nirs4all.org runs pipelines entirely in the browser.

What changed in nirs4all v1?

nirs4all keeps the Python API and scientific behavior as the reference while reproducible graph execution and typed data contracts move onto dag-ml and dag-ml-data. nirs4all-core is the portable aggregate, Studio provides the desktop experience, and the specialist packages remain independently usable.