Counting is almost all you need

Ofek Akerman, Haim Isakov, Reut Levi, Vladimir Psevkin, Yoram Louzoun

Research output: Contribution to journalArticlepeer-review


The immune memory repertoire encodes the history of present and past infections and immunological attributes of the individual. As such, multiple methods were proposed to use T-cell receptor (TCR) repertoires to detect disease history. We here show that the counting method outperforms two leading algorithms. We then show that the counting can be further improved using a novel attention model to weigh the different TCRs. The attention model is based on the projection of TCRs using a Variational AutoEncoder (VAE). Both counting and attention algorithms predict better than current leading algorithms whether the host had CMV and its HLA alleles. As an intermediate solution between the complex attention model and the very simple counting model, we propose a new Graph Convolutional Network approach that obtains the accuracy of the attention model and the simplicity of the counting model. The code for the models used in the paper is provided at:

Original languageEnglish
Article number1031011
JournalFrontiers in Immunology
StatePublished - 2022


  • T cells
  • attention
  • graphs
  • immune repertoire
  • immunology
  • machine learning
  • repertoire classification

All Science Journal Classification (ASJC) codes

  • Immunology and Allergy
  • Immunology


Dive into the research topics of 'Counting is almost all you need'. Together they form a unique fingerprint.

Cite this