FATE: Feature-Agnostic Transformer-based Encoder for learning generalized embedding spaces in flow cytometry data

Lisa Weijler, Florian Kowarsch, Michael Reiter, Pedro Hermosilla, Margarita Maurer-Granofszky, Michael N. Dworzak

Abstract

While model architectures and training strategies have become more generic and flexible with respect to different data modalities over the past years, a persistent limitation lies in the assumption of fixed quantities and arrangements of input features. This limitation becomes particularly relevant in scenarios where the attributes captured during data acquisition vary across different samples. In this work, we aim at effectively leveraging data with varying features, without the need to constrain the input space to the intersection of potential feature sets or to expand it to their union. We propose a novel architecture that can directly process data without the necessity of aligned feature modalities by learning a general embedding space that captures the relationship between features across data samples with varying sets of features. This is achieved via a set-transformer architecture augmented by feature-encoder layers, thereby enabling the learning of a shared latent feature space from data originating from heterogeneous feature spaces. The advantages of the model are demonstrated for automatic cancer cell detection in acute myeloid leukemia in flow cytometry data, where the features measured during acquisition often vary between samples. Our proposed architecture’s capacity to operate seamlessly across incongruent feature spaces is particularly relevant in this context, where data scarcity arises from the low prevalence of the disease.

The Challenge of Fixed-Feature Architectures

In traditional machine learning, models typically assume a fixed input dimension. If a model is trained on 10 specific features, it requires those exact 10 features in the same order for every subsequent sample. However, in clinical fields like Flow Cytometry (FCM)—which analyzes thousands of individual cells based on physical and chemical markers—this assumption is frequently violated.

Diagnostic protocols and marker "panels" vary across laboratories and medical institutions. To apply standard deep learning, researchers often resort to using only the "greatest common denominator" of features (discarding potentially vital data) or zero-padding missing values (introducing noise). This is especially detrimental for rare conditions like pediatric Acute Myeloid Leukemia (AML), where data is scarce and every marker counts. FATE was developed to overcome these constraints by learning from heterogeneous datasets with mismatched feature sets.

Methods: The FATE Architecture

FATE (Feature-Agnostic Transformer-based Encoder) treats features as an unordered set rather than a fixed vector. The architecture consists of two primary components:

  1. Feature-Encoder: Each cell is treated as a sequence of scalar values. To preserve the identity of these values, the model uses Nominal Feature Encodings. These are learned embeddings assigned to specific biological markers (e.g., CD34, CD117), allowing the model to understand the semantic meaning of a value regardless of its position in the input list.
  2. Set-Encoder: To handle the massive scale of FCM samples (tens of thousands of cells), FATE utilizes Induced Self-Attention Blocks (ISABs). This allows the model to efficiently capture complex relationships between different cell populations within a patient sample.
The FATE architecture overview, showing the Feature-Encoder and Set-Encoder pipeline for cancer cell detection.

Self-Supervised Pre-training with FATE-MAE

A key innovation is the FATE-MAE pre-training strategy, based on Masked Autoencoders. Unlike standard MAEs that mask image patches, FATE-MAE masks individual biological markers within a cell. The model is then tasked with reconstructing these missing values based on the remaining markers. This forces the network to learn a generalized latent space that captures the biological correlations between different features across diverse datasets.

The FATE-MAE pre-training strategy, where individual features are masked and reconstructed to learn generalized embeddings.

Datasets and Evaluation

The model was evaluated using several FCM datasets:

  • AML-MRD (Target): 71 samples from 12 pediatric AML patients, focused on detecting Measurable Residual Disease (residual cancer cells).
  • CONTROL & DIA: 418 samples used for supervised pre-training.
  • ALL-MRD: A public dataset of 338 samples from patients with B-cell Acute Lymphoblastic Leukemia (B-ALL), used to test cross-disease representation learning.

Key Results and Insights

  • Significant Performance Boost: When pre-trained using the FATE-MAE strategy, the model achieved an F1-score of 0.496, representing a 60% improvement over training from scratch (0.315).
  • Robustness to Heterogeneity: FATE outperformed the current state-of-the-art (Set Transformer) in scenarios with mismatched data. While the performance of standard models often drops when adding diverse datasets due to zero-padding noise, FATE’s performance improved as it successfully leveraged the additional information.
  • Optimal Masking: The authors found that a 25% masking ratio was optimal for pre-training. Higher ratios (e.g., 75%) deprived the model of the context necessary to reconstruct missing markers accurately.

Conclusion and Future Directions

FATE demonstrates that treating features as sets and employing feature-level masking can unlock the potential of heterogeneous clinical datasets. While the current target dataset is small, the model's ability to learn from "mismatched" data provides a path forward for rare disease research.

Future work will focus on analyzing attention weights to identify critical diagnostic markers, scaling the model to even larger diverse datasets, and optimizing data acquisition protocols based on the model's learned feature relationships.

Summary updated

BibTeX
@inproceedings{weijler2024fate,
  author = {Lisa Weijler and Florian Kowarsch and Michael Reiter and Pedro Hermosilla and Margarita Maurer-Granofszky and Michael N. Dworzak},
  title = {{FATE: Feature-Agnostic Transformer-based Encoder for learning generalized embedding spaces in flow cytometry data}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=IZZsDoiolC},
}
Figure