Container
A four-stage image backbone that aggregates context like a convolution early and adds self-attention in the last stage.
Image classification · 400 operations Checked
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
- Task
- Image classification
- Parameters
- 20.6M
- Operations
- 400
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2021
- Cited by
- 46 (as of 24 October 2026)
- Authors
- Peng Gao, Jiasen Lu, Hongsheng Li and others
- Source
- GitHub: allenai/container
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m15419
- Graph hash
- 1bf8b4444c65d6f959cb82e6fae1b96d50a1a8c09bf0e6195a0f0ca038f87a4c
- Skeleton hash
- ef953f35f0c518f8cdef8f7c42e175389f3704c7206a3f9dc29ea861dca2693f
- Architecture hash
- 9f5fd31ac09b469a36ce17e5505cffe188c9cf336ef5e29f8fb7bef5e3bcb2b8
- Diagram SHA-256
- bc942fd69a5b7d6bc5e18fd087c9b22beea69a356991c51dfd576934ddbb04bb
- 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
What it is
Container is an image backbone that grew out of a unified view of vision networks: the paper shows that CNNs, Transformers and MLP-Mixers are special cases of one general method of aggregating spatial context. The view rests on an affinity matrix, which decides how information moves between a query position and its context. In a convolution the affinity values are static, local and shared, while self-attention generates them from the input.
A Container block uses both kinds at once and combines them with learnable mixing coefficients. The base network has 4 stages containing 2, 3, 8 and 3 blocks. This model is Container-Light, the efficient version, which keeps that layout but switches off the dynamic affinity matrix in the first 3 stages. Dropping the costly dynamic attention early is what lets it scale to large image resolutions for detection and instance segmentation.
As the backbone of a RetinaNet detector on the COCO dataset, the paper reports 43.8 mAP for Container-Light. It also reports an ImageNet top-1 accuracy of 61.8 when training on 10% of the data, against 39.3 for DeiT. The authors name one limitation themselves: Container-Light is partially hand-crafted, because the choice to switch off the dynamic matrix in the first 3 stages is fixed in advance.
Key idea. The paper shows that convolutions, self-attention and MLP-Mixer layers differ mainly in their affinity matrix, and builds a block that mixes static and dynamic affinities with learnable weights.
- Container
- Container-Light
- context aggregation network
- vision backbone
- image classification
- affinity matrix
- hybrid convolution attention
- container_v1_light
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{gao2021containercontextaggregationnetwork,
title={Container: Context Aggregation Network},
author={Peng Gao and Jiasen Lu and Hongsheng Li and Roozbeh Mottaghi and Aniruddha Kembhavi},
year={2021},
eprint={2106.01401},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2106.01401},
}