Automated identification of cell populations in flow cytometry data with transformers

Matthias Wödlinger, Michael Reiter, Lisa Weijler, Margarita Maurer-Granofszky, Angela Schumich, Elisa O. Sajaroff, Stefanie Groeneveld-Krentz, Jorge G. Rossi, Leonid Karawajew, Richard Ratei, Michael N. DworzakComputers in Biology and Medicine 2021 · OpenReview

Introduction

Acute Lymphoblastic Leukemia (ALL) is the most common childhood cancer. Monitoring treatment response requires measuring Minimal Residual Disease (MRD)—the tiny fraction of leukemic "blast" cells surviving therapy. The current gold standard, Multiparameter Flow Cytometry (FCM), generates high-dimensional data for millions of cells. However, analysis typically requires "manual gating," a time-consuming and subjective process where experts draw boundaries on 2D plots. Automated methods often struggle with data scale or fail to capture the global context of a sample.

Methods: FlowFormer and Induced Attention

The authors introduce FlowFormer, a neural network based on the Transformer architecture. While Transformers excel in NLP, they face two hurdles in FCM: quadratic memory requirements $O(N^2)$ and an inherent sensitivity to input order. Since FCM data is an unordered "bag of cells," standard Transformers are inefficient.

To solve this, FlowFormer employs Induced Attention Blocks (IndAttnBlock). Instead of every cell attending to every other cell, the model uses a small set of learnable "inducing points" as a bottleneck. This reduces complexity to linear $O(N)$, allowing the model to process entire samples at once while remaining permutation invariant.

FlowFormer architecture featuring Induced Attention Blocks (IndAttnBlock) for linear complexity.

Datasets

The model was evaluated on four public datasets of bone marrow samples from pediatric B-ALL patients:

  • Vienna (vie14 & vie20): 519 samples collected over a decade.
  • Berlin (bln): 72 samples.
  • Buenos Aires (bue): 65 samples.

These datasets represent real-world challenges, featuring different clinical centers, equipment, and staining protocols.

Key Results

FlowFormer achieved a median $F_1$ score of 0.94 on the Vienna dataset, consistently outperforming state-of-the-art Gaussian Mixture Models (GMMs).

Comparison of ground truth manual gating versus FlowFormer predictions across various marker channels.

Key advantages include:

  • Global Context: By looking at the entire sample, the model understands "normal" cell distributions to better identify rare blasts.
  • Efficiency: With only ~27,000 parameters, the model is incredibly lightweight.
  • Speed: FlowFormer is 600x faster than GMMs, processing a sample in 5ms and handling ~150 samples per second on a standard GPU.
  • Generalization: The model generalizes well across laboratories, with performance further boosting after minimal local fine-tuning.

Limitations and Future Work

The model tends to slightly overestimate MRD values when blast counts are very low, a common challenge due to data noise. Future work will explore data augmentation to simulate device variations and applying this set-based approach to other single-cell data types like mass spectrometry.

Summary updated

BibTeX
@misc{wodlinger2021automated,
  author = {Matthias Wödlinger and Michael Reiter and Lisa Weijler and Margarita Maurer-Granofszky and Angela Schumich and Elisa O. Sajaroff and Stefanie Groeneveld-Krentz and Jorge G. Rossi and Leonid Karawajew and Richard Ratei and Michael N. Dworzak},
  title = {{Automated identification of cell populations in flow cytometry data with transformers}},
  year = {2021},
  eprint = {2108.10072},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.10072},
}
Figure