MAESTRO: Masked Encoding Set Transformer with Self-Distillation

Matthew Eric Lee, Jaesik Kim, Matei Ionita, Jonghyun Lee, Michelle L. McKeague, Yonghyun Nam, Irene Khavin, Yidi Huang, Victoria Fang, Sokratis Apostolidis, Divij Mathew, Shwetank, Ajinkya Pattekar, Zahabia Rangwala, Amit Bar-Or, Benjamin A Fensterheim, Benjamin A. Abramoff, Rennie L. Rhee, Damian Maseda, Allison R Greenplate, John Wherry, Dokyoon KimICLR 2025

Introduction

In immunology, cytometry is the premier tool for profiling individual cells, capable of measuring tens of proteins across hundreds of thousands of cells per sample. However, analyzing this data at scale presents significant challenges for traditional machine learning. Two major hurdles stand in the way: variable set sizes (samples can range from 10,000 to over a million cells) and permutation invariance (the arbitrary order of cells in a data matrix should not affect the model's output).

Currently, researchers rely heavily on "manual gating"—a labor-intensive, expert-driven process of drawing boundaries around cell populations on 2D plots—or simple clustering algorithms. These methods often fail to capture the holistic, system-level signature of the immune system. Enter MAESTRO (Masked Encoding Set TRansformer with Self-DistillatiOn), a self-supervised framework designed to transform massive, variable-sized sets of cytometry data into compact, informative vector representations without requiring manual labels.

Methodology

MAESTRO treats a patient sample as a mathematical set, building its architecture on three core pillars:

  1. Efficient Set Attention: The model utilizes a Set Transformer architecture featuring Induced Set-Attention Blocks (ISAB). While standard attention scales quadratically ($O(N^2)$) with the number of cells—making it computationally impossible for millions of cells—ISAB reduces this complexity to $O(NM)$ by using a small number of "inducing points" ($M$) to summarize the set.
  2. Non-Random Block Masking (NRBM): Standard masked autoencoders hide data points at random. Because cytometry data contains many highly similar cells, random masking is too easy to solve. NRBM instead selects a reference cell and masks its "neighbors" in the protein-expression space. This forces the model to learn complex relationships between different cell types rather than merely interpolating between redundant cells.
  3. Self-Distillation Framework: MAESTRO employs a student-teacher setup. The Teacher network (an exponential moving average of the student) processes the full set of cells to create a stable target representation. The Student network sees only a masked subset and attempts to match the teacher’s output while simultaneously reconstructing the hidden cells.
The MAESTRO architecture featuring the student-teacher distillation and masking workflow.

To handle the reconstruction of an unordered set, MAESTRO uses Sinkhorn Optimal Transport (SOT) as a loss function, which finds the best permutation-invariant match between original and predicted cells.

Data & Experimental Setup

The researchers evaluated MAESTRO on a massive real-world cohort comprising 1,514 whole blood cytometry samples. These samples spanned 14 different studies and 11 clinical phenotypes, including Healthy, Acute COVID, Sepsis, and Lymphoma. Sample sizes ranged from roughly 11,000 to over 1.3 million cells, with each cell characterized by 30 distinct protein markers.

Key Findings & Insights

By encoding an entire sample into a single vector, MAESTRO successfully captures "milieu" effects—how different cell populations interact or shift in proportion—which cell-level models typically miss.

Remarkably, the model can accurately reconstruct cell populations even when up to 90% of the data is masked. This suggests MAESTRO has learned a deep, underlying "grammar" of how immune cells co-occur and interact.

UMAP visualizations showing MAESTRO's ability to reconstruct original masked cell populations (red) into predicted cells (blue).

When benchmarked against manual gating, K-means clustering, and other set-based models (like Deep Sets and OTKE), MAESTRO demonstrated superior performance:

  • Clinical Prediction: In linear probing tasks, MAESTRO achieved top-tier accuracy in classifying disease diagnosis (Accuracy: 0.923) and sex, and was the most accurate at predicting patient age (MAE: 6.70 years).
  • Cell-Type Retrieval: Despite never being explicitly trained on labels for "T-cells" or "B-cells," MAESTRO’s latent representations accurately retrieved the proportions of 16 different cell types, outperforming all other unsupervised methods.
  • Ablation Success: Removing either the masking or the self-distillation modules significantly degraded performance, confirming that both components are essential for learning robust biological features.

Limitations and Future Directions

Despite its strong performance, MAESTRO faces a few hurdles. Training the model requires significant computational resources, taking approximately 156 hours on multiple high-end A100 GPUs. Additionally, like many Transformer-based architectures, it operates as a "black box," making it difficult to pinpoint exactly which protein markers or cell interactions drive a specific clinical prediction. Finally, the current iteration is designed for fixed protein panels. Future work will focus on adapting the model to handle missing markers and integrating multi-modal data, such as single-cell RNA sequencing.

Summary updated

BibTeX
@inproceedings{lee2025maestro,
  author = {Matthew Eric Lee and Jaesik Kim and Matei Ionita and Jonghyun Lee and Michelle L. McKeague and YONGHYUN NAM and Irene Khavin and Yidi Huang and Victoria Fang and Sokratis Apostolidis and Divij Mathew and Shwetank and Ajinkya Pattekar and Zahabia Rangwala and Amit Bar-Or and Benjamin A Fensterheim and Benjamin A. Abramoff and Rennie L. Rhee and Damian Maseda and Allison R Greenplate and John Wherry and Dokyoon Kim},
  title = {{MAESTRO: Masked Encoding Set Transformer with Self-Distillation}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=FEZOLWexPb},
}
Figure