# Efficient Compression of Mass Spectrometry Images via Contrastive Learning-Based Encoding

**Authors:** Piotr Radziński, Jakub Skrajny, Maurycy Moczulski, Michał A. Ciach, Dirk Valkenborg, Benjamin Balluff, Anna Gambin

PMC · DOI: 10.1021/acs.analchem.4c06913 · Analytical Chemistry · 2025-07-21

## TL;DR

This paper presents a new method to compress mass spectrometry images using contrastive learning, preserving important diagnostic data while reducing storage needs.

## Contribution

The novel contrastive learning-based encoding algorithm enables efficient compression of mass spectrometry imaging data without losing critical information.

## Key findings

- The method significantly reduces data size while maintaining diagnostic accuracy in segmentation tasks.
- Encoded images achieved the same or higher segmentation accuracy compared to raw images.
- Compression allows for practical use of t-SNE in mass spectrometry imaging analysis.

## Abstract

In this study, we introduce a novel encoding algorithm
utilizing
contrastive learning to address the substantial data size challenges
inherent in mass spectrometry imaging. Our algorithm compresses MSI
data into fixed-length vectors, significantly reducing storage requirements
while maintaining crucial diagnostic information. Through rigorous
testing on data sets, including mouse bladder cross sections and biopsies
from patients with Barrett’s esophagus, we demonstrate that
our method not only reduces the data size but also preserves the essential
features for accurate analysis. Segmentation tasks performed on both
raw and encoded images using traditional k-means
and our proposed iterative k-means algorithm show
that the encoded images achieve the same or even higher accuracy than
the segmentation on raw images. Finally, reducing the size of images
makes it possible to perform t-SNE, a technique intended for frequent
use in the field to gain a deeper understanding of measured tissues.
However, its application has so far been limited by computational
capabilities. The algorithm’s code, written in Python, is available
on our GitHub page https://github.com/kskrajny/MSI-Segmentation.

## Linked entities

- **Diseases:** Barrett’s esophagus (MONDO:0013662)
- **Species:** Mus musculus (taxon 10090)

## Full-text entities

- **Diseases:** Barrett's esophagus (MESH:D001471)
- **Chemicals:** t (MESH:D014316)
- **Species:** Mus musculus (house mouse, species) [taxon 10090], Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12311889/full.md

## Figures

4 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12311889/full.md

## References

19 references — full list in the complete paper: https://tomesphere.com/paper/PMC12311889/full.md

---
Source: https://tomesphere.com/paper/PMC12311889