Token Classification
Transformers
Safetensors
iona-denoising
mass-spectrometry
proteomics
tandem-mass-spectrometry
denoising
iona
custom_code
Instructions to use Gaolaboratory/iona-denoise-100m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gaolaboratory/iona-denoise-100m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Gaolaboratory/iona-denoise-100m", trust_remote_code=True)# Load model directly from transformers import AutoModelForTokenClassification model = AutoModelForTokenClassification.from_pretrained("Gaolaboratory/iona-denoise-100m", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
iona-denoise-100m
iona-denoise-100m scores every peak of a tandem mass spectrum (MS/MS) as signal or noise. It is the Iona 100m encoder with a per-peak classification head, fine-tuned for noise-peak detection.
Model details
- Architecture: Iona encoder (13 layers, hidden size 800, 10 heads) plus a two-layer classification head (hidden size 512). 101.2M 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-100m" # 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-100m). - 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 2.
- 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.9495 | 0.9499 |
| AUROC | 0.9424 | 0.9431 |
| F1 (logit ≥ 0) | 0.8769 | 0.8769 |
| Per-spectrum AUROC (mean) | – | 0.9477 |
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
- 2