Introduction
In oncological surgery, the precision of tissue removal is paramount. Surgeons aim to achieve "clear margins"—ensuring no cancerous cells remain at the edge of the excised tissue—while preserving as much healthy tissue as possible. Traditionally, verifying margins requires postoperative pathology, which can take days. Rapid Evaporative Ionization Mass Spectrometry (REIMS), often deployed via the "iKnife," offers a potential real-time solution by analyzing the metabolic "smoke" generated during tissue cauterization. However, the development of robust machine learning models for REIMS is hindered by the scarcity of high-quality labeled surgical data.
The Challenge of Data Scarcity in Surgical Mass Spectrometry
While REIMS provides a real-time metabolic fingerprint, annotating these spectra is a laborious and destructive process. Expert pathologists must perform point-burns on excised tissue to create ground-truth labels, leading to a significant bottleneck in training data. To overcome this, researchers have developed FACT (Foundation model for Assessing Cancer Tissue margins), the first foundation model specifically designed for intraoperative mass spectrometry.
Methodology: The FACT Architecture
The core innovation of FACT lies in its architecture and training strategy, which adapts models originally designed for audio processing. The researchers observed that REIMS spectra, which represent variations in ion intensity across a range of mass-to-charge (m/z) ratios, share structural similarities with audio Mel-spectrograms.
Model Components
- Backbone: FACT utilizes a Swin Transformer encoder adapted from the CLAP (Contrastive Language-Audio Pretraining) framework.
- Tokenization: Similar to Vision Transformers, FACT partitions the spectrum into non-overlapping 64-bin windows, treating these segments as tokens.
- Supervised Contrastive Pretraining: The model is trained using a "triplet loss" strategy. This approach optimizes the embedding space by pulling "positive" samples (same tissue class) closer to an "anchor" while pushing "negative" samples (different tissue class) further away. This is particularly effective for distinguishing "hard negatives"—benign tissues that metabolically resemble cancer.
- Finetuning: After pretraining, the model is finetuned with a Multi-Layer Perceptron (MLP) head for final classification using cross-entropy loss.
Experimental Results
The model was evaluated using a proprietary dataset from 13 surgical clinics, including over 10,000 unlabeled in vivo spectra and nearly 700 labeled ex vivo samples of Basal Cell Carcinoma and benign tissue.
As shown in the table above, FACT achieved state-of-the-art performance, reaching an AUROC of 82.4% and a Balanced Accuracy of 77.5%. It significantly outperformed traditional methods like PCA/LDA and other deep learning architectures such as CLIP and DreaMS. Notably, the model's inference time is approximately 72ms, making it well-suited for real-time surgical guidance where the iKnife typically outputs data at a 1Hz frequency.
Discussion and Future Directions
The success of FACT demonstrates that cross-modality transfer—applying audio-based architectures to mass spectrometry—is a viable path for medical AI. The supervised contrastive approach proved superior to standard self-supervised methods in this low-data clinical regime.
Future work may involve leveraging the text-audio origins of the CLAP backbone to allow surgeons to query the model using natural language prompts or improving robustness to the signal-to-noise variations inherent in biological sampling. By providing a foundation for spectral analysis, FACT paves the way for more accurate, real-time decision support in the operating room.
Summary updated