Table of Contents
Fetching ...

SpecBridge: Bridging Mass Spectrometry and Molecular Representations via Cross-Modal Alignment

Yinkai Wang, Yan Zhou Chen, Xiaohui Chen, Li-Ping Liu, Soha Hassoun

TL;DR

SpecBridge presents a novel spectra-to-molecule retrieval framework that treats structure identification as a geometry-preserving alignment problem. By freezing a pretrained molecular foundation model and mapping spectra into its latent space via a lightweight residual mapper, it achieves state-of-the-art retrieval on MassSpecGym and robust scalability to large candidate pools like Spectraverse and MSnLib. The approach relies on a dense alignment loss and geometric regularization, avoiding end-to-end cross-modal training and explicit molecule generation. This yields data-efficient learning, rapid inference, and preserved chemical semantics, with practical implications for high-throughput metabolomics annotation and open-world molecular retrieval.

Abstract

Small-molecule identification from tandem mass spectrometry (MS/MS) remains a bottleneck in untargeted settings where spectral libraries are incomplete. While deep learning offers a solution, current approaches typically fall into two extremes: explicit generative models that construct molecular graphs atom-by-atom, or joint contrastive models that learn cross-modal subspaces from scratch. We introduce SpecBridge, a novel implicit alignment framework that treats structure identification as a geometric alignment problem. SpecBridge fine-tunes a self-supervised spectral encoder (DreaMS) to project directly into the latent space of a frozen molecular foundation model (ChemBERTa), and then performs retrieval by cosine similarity to a fixed bank of precomputed molecular embeddings. Across MassSpecGym, Spectraverse, and MSnLib benchmarks, SpecBridge improves top-1 retrieval accuracy by roughly 20-25% relative to strong neural baselines, while keeping the number of trainable parameters small. These results suggest that aligning to frozen foundation models is a practical, stable alternative to designing new architectures from scratch. The code for SpecBridge is released at https://github.com/HassounLab/SpecBridge.

SpecBridge: Bridging Mass Spectrometry and Molecular Representations via Cross-Modal Alignment

TL;DR

SpecBridge presents a novel spectra-to-molecule retrieval framework that treats structure identification as a geometry-preserving alignment problem. By freezing a pretrained molecular foundation model and mapping spectra into its latent space via a lightweight residual mapper, it achieves state-of-the-art retrieval on MassSpecGym and robust scalability to large candidate pools like Spectraverse and MSnLib. The approach relies on a dense alignment loss and geometric regularization, avoiding end-to-end cross-modal training and explicit molecule generation. This yields data-efficient learning, rapid inference, and preserved chemical semantics, with practical implications for high-throughput metabolomics annotation and open-world molecular retrieval.

Abstract

Small-molecule identification from tandem mass spectrometry (MS/MS) remains a bottleneck in untargeted settings where spectral libraries are incomplete. While deep learning offers a solution, current approaches typically fall into two extremes: explicit generative models that construct molecular graphs atom-by-atom, or joint contrastive models that learn cross-modal subspaces from scratch. We introduce SpecBridge, a novel implicit alignment framework that treats structure identification as a geometric alignment problem. SpecBridge fine-tunes a self-supervised spectral encoder (DreaMS) to project directly into the latent space of a frozen molecular foundation model (ChemBERTa), and then performs retrieval by cosine similarity to a fixed bank of precomputed molecular embeddings. Across MassSpecGym, Spectraverse, and MSnLib benchmarks, SpecBridge improves top-1 retrieval accuracy by roughly 20-25% relative to strong neural baselines, while keeping the number of trainable parameters small. These results suggest that aligning to frozen foundation models is a practical, stable alternative to designing new architectures from scratch. The code for SpecBridge is released at https://github.com/HassounLab/SpecBridge.
Paper Structure (55 sections, 6 equations, 5 figures, 9 tables)

This paper contains 55 sections, 6 equations, 5 figures, 9 tables.

Figures (5)

  • Figure 1: The SpecBridge Framework. We formulate structure identification as a geometric alignment problem. (Left) Training: The spectral encoder (top) is initialized from DreaMS and partially fine-tuned (indicated by gradient) to map inputs into the embedding space of a frozen ChemBERTa molecular encoder (bottom, indicated by snowflake). A lightweight Residual Projection Mapper aligns the spectral representation to the fixed molecular target using a direct regression objective. (Right) Inference: Retrieval is performed by projecting the query spectrum into the shared space and ranking pre-computed candidate embeddings via fast cosine similarity search.
  • Figure 2: Sensitivity to candidate pool size on Spectraverse. SpecBridge performance when limiting each per-query candidate pool to at most $N$ candidates ($N\in\{128,256,512,1024\}$) versus using the full PubChem-derived pool (all). We report Recall@1/5/20 (top) and MRR (bottom). Larger pools increase retrieval difficulty and reduce both recall and MRR.
  • Figure 3: Validation MRR vs. Training Steps. We compare training stability under strictly matched settings: both methods employ the exact same frozen ChemBERTa molecular encoder and fine-tuned DreaMS spectral encoder. The Alignment objective (Blue) demonstrates smooth, monotonic convergence, whereas the Contrastive objective (Orange) exhibits significant volatility despite using the same fixed target space.
  • Figure 4: Cosine-similarity separation. Histogram of cosine similarities between each query spectrum embedding and its ground-truth molecule (blue) versus non-target candidate molecules (orange) from the retrieval pool.
  • Figure 5: Distribution of Maximum Candidate Similarity. Histograms of the maximum Tanimoto similarity between the ground truth and the hardest decoy.