Skip to content

SPEKTRAN

The MNIST of Gas Sensing
Open-source simulation engine + ML benchmark for optical spectroscopy

Try the Demo Install Leaderboard


What's Inside

  • 10 Molecules


    CH4, H2O, CO2, CO, NH3, NO, NO2, SO2, HCl, HF — HITRAN line-by-line physics with TIPS partition functions

  • Advanced Line Shapes


    Voigt profile and Hartmann-Tran Profile (HTP) with speed-dependent broadening, Dicke narrowing, and correlation

  • WMS Chain


    1f–4f lock-in demodulation, 2f/1f calibration-free ratio, etalon fringes in the time-domain chain

  • 14+ Virtual Instruments


    Laser scan nonlinearity, thermal chirp, RIN, etalon fringes, window contamination, beam wander, ADC quantization

  • 2 Modalities


    TDLAS (direct absorption + wavelength modulation) and NDIR (Planck source + bandpass filter)

  • 9 Benchmark Tasks


    Concentration regression, denoising, cross-instrument, WMS, drift, OOD, cross-modality, multi-species, temperature


Quick Start

from datasets import load_dataset
ds = load_dataset("spektran/spektran-ch4-v0")
pip install spektran
from spektran.physics import simulate_absorbance

nu, absorbance = simulate_absorbance(
    molecule="CH4", concentration_ppm=100.0,
    temperature_K=296.0, pressure_atm=1.0,
    path_length_m=10.0,
    wavenumber_start_cm1=6046.0, wavenumber_end_cm1=6048.0,
)
spektran generate configs/datasets/ch4-t1-train-v0.yaml --out data
spektran benchmark --task T1-concentration \
    --truth data/test.h5 --predictions preds.csv

Key Results

The flagship finding

Model complexity correlates with instrument overfitting. Ridge degrades 1.31x, Transformer 1.46x, CNN 1.82x on held-out instruments — can you build a model that breaks this pattern?

Model T1 MAE (ppm) T3 Degradation
Ridge regression 2.84 1.31x
Patchified Transformer 7.39 1.46x
1D CNN 15.58 1.82x

View full leaderboard


GitHub Dataset
PyPI Pre-trained Baselines
Interactive Demo CITATION.cff