All models

xcit_large_24_p8_224

A vision transformer that attends across channels, not tokens, so cost grows linearly with image size.

Image classification · 1,332 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (22 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
XCiT
Parameters
188.9M
Operations
1,332
Framework
PyTorch
Recurrent
No
Published
2021
Authors
Alaaeldin El-Nouby, Hugo Touvron, Mathilde Caron and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m11275
Graph hash
cadc3f38df1bb4615a6f6180305fc79bb2ae85cff5d1b856923ca71c3afd668d
Skeleton hash
db803369b374706a4cf9ad7cac8cf944a857bdfca3b31266503444d6822e6475
Architecture hash
07a3e2f621616a8a99984e9a3d5f7bfe42aedc71032e2f7e3c70bd168c39094b
Diagram SHA-256
29a8cb4de2646f227d440249dbda3fd62ff502c7e5f7cba68b7ebaaab7bf962c
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

timm.create_model('xcit_large_24_p8_224', pretrained=False)

What it is

About this model's family

XCiT, the Cross-Covariance Image Transformer, is a vision transformer built on a transposed form of self-attention that operates across feature channels rather than tokens. The motivation is that ordinary self-attention gives global interactions between all tokens at a quadratic cost in time and memory, which hinders long sequences and high-resolution images.

Cross-covariance attention (XCA) bases the interactions on the cross-covariance matrix between keys and queries, and its complexity is linear in the number of tokens. The authors describe the result as combining the accuracy of conventional transformers with the scalability of convolutional architectures. They report results on image classification and self-supervised feature learning on ImageNet-1k, object detection and instance segmentation on COCO, and semantic segmentation on ADE20k.

The captured timm members run from xcit_nano_12 to xcit_large_24, each in p8 and p16 forms at 224 or 384 pixel input, and the code is the same as the official Facebook Research implementation with some minor adaptations.

Key idea. Cross-covariance attention: attention computed across channels instead of tokens, so cost grows linearly with the number of tokens.

  • xcit
  • cross-covariance image transformer
  • cross-covariance attention
  • xca
  • transposed attention
  • linear complexity transformer
  • xcit_nano
  • xcit_tiny
  • xcit_small
  • xcit_medium
  • xcit_large
  • facebook research
  • image classification

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{elnouby2021xcitcrosscovarianceimagetransformers,
      title={XCiT: Cross-Covariance Image Transformers}, 
      author={Alaaeldin El-Nouby and Hugo Touvron and Mathilde Caron and Piotr Bojanowski and Matthijs Douze and Armand Joulin and Ivan Laptev and Natalia Neverova and Gabriel Synnaeve and Jakob Verbeek and Hervé Jegou},
      year={2021},
      eprint={2106.09681},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2106.09681}, 
}