Skip to main content

InstaNovo-FM

A self-supervised foundation model for proteomics tandem mass spectra

PyPI version License DOI Open In Colab

The official code repository for InstaNovo-FM, a self-supervised foundation model for bottom-up proteomics. Unlike existing proteomics models that are trained for a single supervised task (peptide identification, de novo sequencing, or fragment-intensity prediction), InstaNovo-FM is an encoder-only transformer trained to reconstruct masked regions of tandem mass spectra without using any peptide-sequence labels. The resulting frozen embeddings form a unified representation space that transfers across datasets, instruments, and acquisition methods.

Publication: Learning from tandem mass spectra at scale with a self-supervised foundation model for proteomics, bioRxiv, 3 September 2026. doi:10.64898/2026.09.03.747733

Highlights

  • Annotation-free pretraining. Learns transferable spectral representations from raw MS/MS spectra with a physics-aware masked-reconstruction objective, without peptide sequence labels at any pretraining stage.
  • Trained at scale. A diverse corpus of ~1.63 billion MS/MS spectra (1,625,276,573 scans) with 184.6 million high-confidence peptide-spectrum matches at 1% FDR, assembled from 92 public PRIDE submissions via an LLM-assisted metadata curation pipeline spanning 72 organisms and diverse instrumentation, fragmentation and digestion regimes.
  • One encoder, many tasks. The same pretrained encoder drives database-free identification and spectrum rescue, PTM and glycan detection, and run-level classification straight from frozen embeddings, with no retraining.
  • Interpretable. Attention and integrated-gradients analysis show the model recovers real fragmentation chemistry: ion-ladder complementarity, isotope and neutral-loss relationships, and chemically defined off-database ions.

Model at a glance

Property Value
Architecture Encoder-only transformer
Model dimension 768
Layers / heads 12 / 12 (head dim 64)
Feedforward dimension 3072
Parameters ~89.5M
Peak encoding Multi-scale sinusoidal ($m/z$) + MLP (intensity)
Masking Thompson-span masking with isotope co-masking (~30% fragment-group budget)
Reconstruction objective Hierarchical classification over a 0.2 Da $m/z$ grid (group + offset)
Spectrum embedding Mean-pooled final-layer peak-token hidden states

Reproducing the figures

The three notebooks in notebooks/ regenerate the paper figures from the committed inputs in data/, no checkpoint or GPU needed.

./setup_kernel.sh   # uv sync --group figures, then registers a Jupyter kernel

Then open a notebook and select the InstaNovo-FM (figures) kernel.

Installation

We support Python 3.10–3.13 and use uv for dependency management.

git clone https://github.com/instadeepai/InstaNovo-FM.git
cd InstaNovo-FM

uv sync                    # model, dataset pipeline and evaluation harness
uv sync --group figures    # when you want to reproduce the figures
uv sync --extra interpret  # for UMAP visualization

Quick start

Everything is driven by module entry points and Hydra configs from src/instanovo_fm/configs/.

Load a pretrained checkpoint

from instanovo_fm.model.encoder import FoundationModel

FoundationModel.get_pretrained()
# ['instanovo-fm-v0.1.0', 'instanovo-fm-lcfm-ts-pa-v0.1.0', ...]

model, config = FoundationModel.from_pretrained("instanovo-fm-v0.1.0")

The ids differ only by training corpus, masking strategy and whether the pairwise attention bias is on, so describe_pretrained says which is which:

FoundationModel.describe_pretrained("instanovo-fm-v0.1.0")
# {'remote': '...', 'corpus': 'LCFM', 'masking': 'thompson_span with isotope co-masking',
#  'pairwise_bias': False, 'layers': 12, 'model_dimension': 768, 'parameters': '89.5M', ...}

FoundationModel.describe_pretrained()          # every checkpoint, keyed by id

The corpus field names a confidence tier of the pretraining corpus. They nest, from everything that was collected down to only the most confidently identified spectra:

tier what it is
ACFM All Confidence — every MS/MS scan in the corpus, ~1.63B, the vast majority with no peptide annotation at all. What the self-supervised objective can learn from.
LCFM Low Confidence — the labelled subset: 184.6M PSMs at run-specific 1% FDR. "Low" means least-stringently filtered, not unreliable, and it is the broadest labelled tier.
MCFM Medium Confidence — a nested subset of LCFM, ranked by a composite confidence score and thresholded.
HCFM High Confidence — the strictest subset, nested inside MCFM.

The released checkpoints are trained on LCFM, with one MCFM model for the corpus-scale comparison. HCFM is used for evaluation rather than pretraining, and ACFM is not released.

id corpus masking PA bias layers params
instanovo-fm-v0.1.0 LCFM Thompson-span no 12 89.5M
instanovo-fm-lcfm-ts-pa-v0.1.0 LCFM Thompson-span yes 12 89.5M
instanovo-fm-lcfm-sa-nopa-v0.1.0 LCFM signal-aware no 12 89.5M
instanovo-fm-lcfm-sa-pa-v0.1.0 LCFM signal-aware yes 12 89.5M
instanovo-fm-mcfm-90k-v0.1.0 MCFM Thompson-span no 9 40M

The first row is the published model: every TS-noPA number in the paper comes from it. The next three complete the masking/attention-bias factorial, and the last is the corpus-scale comparison baseline.

The de novo sequencers — the foundation encoder plus an InstaNovo decoder — load the same way, from DownstreamDeNovo:

from instanovo_fm.downstream.de_novo_sequencing.model import DownstreamDeNovo

DownstreamDeNovo.describe_pretrained()
model, config = DownstreamDeNovo.from_pretrained("instanovo-fm-denovo-v0.1.0")
id encoder notes
instanovo-fm-denovo-v0.1.0 fine-tuned the published sequencer, benchmarked against IN v1.2, Casanovo and XuanjiNovo
instanovo-fm-denovo-frozen-v0.1.0 frozen retains ~85% of the fine-tuned peptide recall
instanovo-fm-denovo-scratch-v0.1.0 from scratch the no-pretraining control

All three run 2.5M steps at batch size 128, warming up over the first 100K steps to a learning rate of 5e-5; the fine-tuned variant unfreezes the encoder at step 100K.

By id, the checkpoint is downloaded from this repository's Releases and cached under ~/.cache/instanovo-fm/. A path or a .ckpt filename loads from disk instead:

model, config = FoundationModel.from_pretrained("checkpoints/model_best.ckpt")

The registry is src/instanovo_fm/models.json. It covers the published model, the four cells of the masking/attention-bias factorial, the MCFM scaling baseline, and the three de novo sequencers — see Pretrained weights & data for the licence they carry.

Extract embeddings and run the evaluation tasks

uv run python -m instanovo_fm.eval.embed_evaluation \
  --config-name foundational_local

The spectrum embedding is the mean of the final-layer hidden states over the non-padding peak tokens, excluding the latent token. Downstream tasks live in src/instanovo_fm/eval/embed_eval_tasks/: linear probes, duplicate retrieval, clustering, attention and integrated-gradients attribution. Each is runnable the same way.

Train

uv run python -m instanovo_fm.trainer.train \
  --config-name foundational_local

Downstream applications

InstaNovo-FM's frozen embeddings are designed to be reused across tasks. Examples demonstrated in the paper:

  • De novo peptide sequencing: fine-tune or attach a decoder, competitive with supervised baselines on held-out biological datasets.
  • Database-free identification & rescue: retrieve peptide identities for query spectra via embedding nearest-neighbours, including spectra unassigned by database search.
  • PTM & glycan analysis: linear probes on frozen embeddings detect phosphorylation and glycosylation and resolve coarse glycan composition.
  • Run-level classification: aggregate per-spectrum embeddings to classify technical and biological run conditions (e.g. digestion enzyme, treatment) without any peptide identifications.

TODO: add links to example notebooks / tutorials for each application.

Pretrained weights & data

  • Pretraining corpus: InstaDeepAI/InstaNovo on HuggingFace, under EMBL-EBI terms of use. Assembled from 92 public PRIDE submissions, with accessions in assets/table_s1_accessions.txt, and uniformly reprocessed with FragPipe (v22.0) / MSFragger (v4.1). The confidence tiers are described under Load a pretrained checkpoint. Each of the three labelled tiers — LCFM, MCFM and HCFM — ships in two forms: splits/ holds the quality-filtered, peptide-disjoint 80/10/10 partitions the model was trained and evaluated on, and by_project/ holds the tier before filtering and splitting, one directory per accession, so alternative partitions can be derived. The central peptide registry of split assignments ships alongside, so the partitions can be reproduced and extended. ACFM itself is not released.
  • Model checkpoints: attached to the v0.1.0 release under CC BY-NC-SA 4.0 (see License). Eight in all — five foundation models and three de novo sequencers — registered in models.json and loaded by id with from_pretrained, which caches under ~/.cache/instanovo-fm/. See Load a pretrained checkpoint.
  • Embeddings: Not yet available. An interactive explorer for the frozen embedding space is hosted at instadeepai.github.io/InstaNovo-FM (goes live with the repository).

Repository structure

InstaNovo-FM/
├── src/instanovo_fm/
│   ├── configs/          # Hydra configs (model, dataset, evaluation, accelerate)
│   ├── data/             # data processing, masking, metadata and analysers
│   ├── model/            # peak encoder, transformer encoder, prediction heads
│   ├── trainer/          # training loop, losses, checkpointing
│   ├── eval/             # evaluation harness and embed_eval_tasks/
│   └── utils/
├── scripts/
│   ├── preprocessing/    # raw-file conversion, modification labelling, parquet IO
│   ├── splitting/        # tier construction, peptide-disjoint splits, shuffling
│   ├── verification/     # metadata, mass and normalisation checks
│   └── release/          # HuggingFace upload, dataset card, audit scripts
├── notebooks/            # figure-reproduction notebooks (figure_1, figure_3, figure_4)
├── data/                 # committed inputs for those notebooks
├── assets/               # accession list, modification dictionaries, residue masses
├── config/               # plotting configuration
├── docker/               # baseline-model images (Casanovo, XuanjiNovo)
├── docs/                 # design and operational notes
├── tests/                # unit and integration tests
├── pyproject.toml
├── uv.lock
├── setup_kernel.sh
├── CITATION.cff
├── LICENSE.md
└── README.md

Documentation

An interactive explorer for the frozen embedding space, including a figure viewer and a UMAP browser over ~100,000 held-out LCFM spectra, is hosted at instadeepai.github.io/InstaNovo-FM.

Design and operational notes live in docs/. A hosted docs site is planned. (TODO: add docs site URL.) Until then, the guides live in docs/:

Tutorials: start here

How-to guides: task-oriented

Explanation: background

Reference

  • instanovo-fm --help, and instanovo-fm train|evaluate|denovo --help for per-command options.
  • Configs live in src/instanovo_fm/configs/, every setting is overridable with Hydra syntax on the command line.

For developers

Development

uv sync --group dev        # pytest, ruff, mypy and pre-commit
uv run pytest

pre-commit install        # ruff, ruff-format, mypy, whitespace and key-leak hooks
pre-commit run --all-files

ruff and mypy in the dev group are pinned to the versions .pre-commit-config.yaml uses, so a local run and CI use the same tool versions.

Contributions are welcome. Please open an issue to discuss substantial changes before submitting a pull request. (TODO: add CONTRIBUTING.md and issue/PR templates.)

Citation

If you use InstaNovo-FM in your research, please cite:

@article{instanovofm,
  title   = {Learning from tandem mass spectra at scale with a self-supervised foundation model for proteomics},
  author  = {Nieuwoudt, Mechiel and Reverenna, Marco and Patel, Divanisha and Catzel, Rachel and Houngue, Isaac H.J.
             and Daniel, Jemma and Eloff, Kevin and Santos, Alberto and Lopez Carranza, Nicolas and Jenkins, Timothy P.
             and Van Goey, Jeroen and Kalogeropoulos, Konstantinos},
  year    = {2026},
  journal = {bioRxiv},
  doi     = {10.64898/2026.09.03.747733},
  url     = {https://www.biorxiv.org/content/10.64898/2026.09.03.747733v1},
  note    = {Preprint}
}

License

artifact licence
Code in this repository Apache License 2.0
Model checkpoints CC BY-NC-SA 4.0: attribution, non-commercial, share-alike
Corpus-production code (Figshare) CC BY 4.0
Dataset (InstaDeepAI/InstaNovo) EMBL-EBI terms of use, the spectra derive from public PRIDE submissions

The Apache-2.0 grant covers this repository's source alone. It does not extend to the third-party binary packages an install fetches, some of which are proprietary. See THIRD_PARTY_NOTICES.md.

Dependencies are pinned to the versions used for the manuscript results to support reproducibility, rather than automatically receiving later patch releases. A vulnerability scan will therefore report real findings; SECURITY.md enumerates them with a reachability assessment, and vex.openvex.json publishes the same assessment in machine-readable OpenVEX form. If you are deploying this code rather than reproducing the paper with it, do not use these pins.

Acknowledgements

Developed by:

Built on public proteomics data from the PRIDE repository and the broader open-proteomics community.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

instanovo_fm-0.1.0.tar.gz (27.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

instanovo_fm-0.1.0-py3-none-any.whl (873.3 kB view details)

Uploaded Python 3

File details

Details for the file instanovo_fm-0.1.0.tar.gz.

File metadata

  • Download URL: instanovo_fm-0.1.0.tar.gz
  • Upload date:
  • Size: 27.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for instanovo_fm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d932a3359be9068793002f73357cf59110dcf1e193fee8a0e05cea3bf21cc57f
MD5 d466ee88f8f4cc3d05b0259efb95a01e
BLAKE2b-256 9a3bd3b68d6a52b37c58ef4411c8fbe2b883d47459860254fa7fe1cd30974a7b

See more details on using hashes here.

File details

Details for the file instanovo_fm-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: instanovo_fm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 873.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for instanovo_fm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99ffd1292c1601b1e2aced0d182677c2e6f51fd852071c2910b26f8461616a19
MD5 96fb6e55c685e33d127b02eab17dd940
BLAKE2b-256 0500aab299c9ee8b3428d4ff0189e3474744fd55760d312846269dc00e9aa08a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page