Token Classification
Transformers
Safetensors
iona-denoising
mass-spectrometry
proteomics
tandem-mass-spectrometry
denoising
iona
custom_code
Instructions to use Gaolaboratory/iona-denoise-200m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gaolaboratory/iona-denoise-200m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Gaolaboratory/iona-denoise-200m", trust_remote_code=True)# Load model directly from transformers import AutoModelForTokenClassification model = AutoModelForTokenClassification.from_pretrained("Gaolaboratory/iona-denoise-200m", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
iona-denoise-200m
iona-denoise-200m scores every peak of a tandem mass spectrum (MS/MS) as signal or noise. It is the Iona 200m encoder with a per-peak classification head, fine-tuned for noise-peak detection.
Model details
- Architecture: Iona encoder (16 layers, hidden size 1024, 16 heads) plus a two-layer classification head (hidden size 512). 203.4M parameters in total.
- Input: a centroided spectrum given as parallel
mzandintensityarrays, with at most 512 peaks. - Output: one logit per peak. Noise is the positive class, so
sigmoid(logit)is the predicted probability that a peak is noise.
Usage
The checkpoint includes its modeling code, so it loads with trust_remote_code=True. You need
torch, transformers, sentence-transformers and pytorch-metric-learning installed.
import torch
from transformers import AutoModelForTokenClassification, AutoProcessor
repo = "path/to/iona-denoise-200m" # this repository's Hub ID, or a local copy
processor = AutoProcessor.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForTokenClassification.from_pretrained(repo, trust_remote_code=True).eval()
mz = [175.119, 262.151, 363.198, 476.282]
intensity = [1200.0, 5300.0, 800.0, 2400.0]
inputs = processor(mz, intensity, return_tensors="pt")
with torch.no_grad():
noise_prob = torch.sigmoid(model(**inputs).logits.float()) # (batch, peaks)
keep = (noise_prob < 0.5) & inputs["attention_mask"].bool()
Pass raw intensity values; the processor normalizes them. To denoise whole mzML files, use the
iona-denoise command from the Iona package.
Training
- Pretraining: masked-intensity modeling on about 100 million consensus tandem mass spectra for 540,423 steps (see
iona-base-200m). - Fine-tuning: per-peak noise classification on a dataset of MS/MS spectra with per-peak noise labels, 4 epochs, learning rate 2e-4 (0.5× for the encoder) with cosine decay, effective batch size 12, bf16, seed 1.
- Checkpoint selection: the best of 3 seeds across the pretraining checkpoints available at this scale, by validation AUPRC. The test split wasn't used for selection.
Evaluation
On the validation and test splits of the noise-labeled dataset. The splits share no peptides with the training split or with each other.
| Metric | Validation | Test |
|---|---|---|
| AUPRC | 0.9526 | 0.9524 |
| AUROC | 0.9459 | 0.9459 |
| F1 (logit ≥ 0) | 0.8803 | 0.8793 |
| Per-spectrum AUROC (mean) | – | 0.9508 |
Limitations
- Inputs must be centroided spectra with between 1 and 512 peaks. Longer spectra were excluded from training and evaluation.
- The model was fine-tuned and evaluated on one dataset. Performance on other instruments, fragmentation methods or sample types hasn't been characterized.
- Downloads last month
- 4