Downloads · 30 days
0
spektran/spektran-baselines-v0
spektran-baselines-v0 is a tabular regression model from spektran. Use it for the tabular regression task on the model card, and read the license before you ship it in a product. It is set up for sklearn. The card lists the license as apache-2.0.
Pre-trained baseline model weights for the SPEKTRAN optical gas sensing benchmark. 25 baselines across 5 modalities (TDLAS, NDIR, CRDS, FTIR, DOAS) and 9 benchmark tasks.
Downloads · 30 days
0
Access
Public
Updated Aug 12, 2026
Repo size
408 KB
Likes
0
Public
Click a slice to open those files.
.npz213 KB · 51%
From the Hugging Face model README
Pre-trained baseline model weights for the SPEKTRAN optical gas sensing benchmark. 25 baselines across 5 modalities (TDLAS, NDIR, CRDS, FTIR, DOAS) and 9 benchmark tasks.
| Checkpoint | Task | Modality | Model | Key Metric |
|---|---|---|---|---|
ridge-t1-da/ | T1 Concentration | TDLAS DA | Ridge | 2.80 ppm MAE |
cnn1d-t1-da/ | T1 Concentration | TDLAS DA | CNN1D | 16.79 ppm MAE |
ridge-t4-wms/ | T4 WMS Concentration | TDLAS WMS | Ridge | 12.46 ppm MAE |
ridge-t9-temperature/ | T9 Temperature | TDLAS DA | Ridge | 7.03 K MAE |
Train any baseline from scratch with one command:
pip install spektran[dev]
spektran train --baseline ridge # T1 concentration
spektran train --baseline cnn1d # T1 CNN
spektran train --baseline transformer # T1 Transformer
spektran train --baseline ridge_crds # T1 CRDS
spektran train --baseline ridge_ftir # T1 FTIR
spektran train --baseline ridge_doas # T1 DOAS
spektran list baselines --json # List all 25
| Baseline | Type | Params |
|---|---|---|
| Ridge Regression | Linear | ~201 |
| 1D CNN | Deep Learning | ~50K |
| Patchified Transformer | Deep Learning | ~100K |
| Random Forest / GBR | Ensemble | ~1M |
| MLP (BPNN) | Deep Learning | ~50K |
| BiLSTM | RNN | ~60K |
| CNN-LSTM-Attention | Hybrid | ~80K |
| PINN | Physics-Informed | ~50K |
| SpektralNet | TDLAS-native | ~45K |
| Voigt Fit (LM) | Classical physics | 0 (no training) |
| Baseline | Type |
|---|---|
| Wing-Anchored Polynomial | Classical |
| 1D U-Net | Deep Learning |
| LSTM-DAE | Autoencoder |
| Baseline | Type |
|---|---|
| Ridge (WMS) | Linear |
| CNN (WMS) | Deep Learning |
| Transformer (WMS) | Deep Learning |
| Baseline | Type |
|---|---|
| Moving Average | Classical |
| TCN | Deep Learning |
| Baseline | Type |
|---|---|
| PCA + Mahalanobis | Statistical |
| Baseline | Type |
|---|---|
| Ridge (Cross-Modality) | Linear |
| Baseline | Type |
|---|---|
| Ridge (Multi-Species) | Linear |
| Baseline | Type |
|---|---|
| Ridge (Temperature) | Linear |
| Baseline | Modality | Type |
|---|---|---|
| Ridge (CRDS) | CRDS | Linear |
| Ridge (FTIR) | FTIR | Linear |
| Ridge (DOAS) | DOAS | Linear |
import numpy as np
from huggingface_hub import hf_hub_download
# Download weights
path = hf_hub_download("spektran/spektran-baselines-v0", "ridge-t1-da/weights.npz")
data = np.load(path)
# Predict concentration from raw scan
X_scaled = (raw_scan - data["scaler_mean"]) / data["scaler_scale"]
concentration_ppm = X_scaled @ data["coef"] + data["intercept"][0]
import torch
import torch.nn as nn
from huggingface_hub import hf_hub_download
norm_path = hf_hub_download("spektran/spektran-baselines-v0", "cnn1d-t1-da/normalization.npz")
model_path = hf_hub_download("spektran/spektran-baselines-v0", "cnn1d-t1-da/model.pt")
norm = np.load(norm_path)
state = torch.load(model_path, weights_only=True)
model = nn.Sequential(
nn.Conv1d(1, 16, 15, stride=2, padding=7), nn.ReLU(),
nn.Conv1d(16, 32, 9, stride=2, padding=4), nn.ReLU(),
nn.Conv1d(32, 64, 5, stride=2, padding=2), nn.ReLU(),
nn.AdaptiveAvgPool1d(8), nn.Flatten(),
nn.Linear(64 * 8, 64), nn.ReLU(), nn.Linear(64, 1),
)
model.load_state_dict(state)
pip install spektran[dev] scikit-learn torch
spektran train --baseline ridge --json # Auto-generates data + trains + evaluates
spektran train --baseline cnn1d --json
spektran train --baseline ridge_crds --json
import subprocess, json
# Discover baselines
result = subprocess.run(["spektran", "list", "baselines", "--json"],
capture_output=True, text=True)
baselines = json.loads(result.stdout)
# Train and evaluate
result = subprocess.run(["spektran", "train", "--baseline", "ridge", "--json"],
capture_output=True, text=True)
scores = json.loads(result.stdout)
@software{spektran2026,
title = {SPEKTRAN: Synthetic ML Training Data for Optical Gas Sensing},
url = {https://github.com/spektran/spektran},
doi = {10.5281/zenodo.21790394},
version = {0.6.0},
year = {2026},
}