[Paper Review] Container: Context Aggregation Network
Container unifies CNN, Transformer, and MLP paradigms via static and dynamic affinity matrices to perform multi-head context aggregation, achieving strong image classification and competitive downstream task performance with efficient training.
Convolutional neural networks (CNNs) are ubiquitous in computer vision, with a myriad of effective and efficient variations. Recently, Transformers -- originally introduced in natural language processing -- have been increasingly adopted in computer vision. While early adopters continue to employ CNN backbones, the latest networks are end-to-end CNN-free Transformer solutions. A recent surprising finding shows that a simple MLP based solution without any traditional convolutional or Transformer components can produce effective visual representations. While CNNs, Transformers and MLP-Mixers may be considered as completely disparate architectures, we provide a unified view showing that they are in fact special cases of a more general method to aggregate spatial context in a neural network stack. We present the \model (CONText AggregatIon NEtwoRk), a general-purpose building block for multi-head context aggregation that can exploit long-range interactions \emph{a la} Transformers while still exploiting the inductive bias of the local convolution operation leading to faster convergence speeds, often seen in CNNs. In contrast to Transformer-based methods that do not scale well to downstream tasks that rely on larger input image resolutions, our efficient network, named \modellight, can be employed in object detection and instance segmentation networks such as DETR, RetinaNet and Mask-RCNN to obtain an impressive detection mAP of 38.9, 43.8, 45.1 and mask mAP of 41.3, providing large improvements of 6.6, 7.3, 6.9 and 6.6 pts respectively, compared to a ResNet-50 backbone with a comparable compute and parameter size. Our method also achieves promising results on self-supervised learning compared to DeiT on the DINO framework. Code is released at \url{https://github.com/allenai/container}.
Motivation & Objective
- Provide a unified view of CNN, Transformer, and MLP architectures as context-aggregation variants.
- Introduce the Container building block that mixes static and dynamic affinity matrices for efficient long-range context.
- Demonstrate Container and Container-Light performance on ImageNet, object detection, instance segmentation, and self-supervised learning.
- Show convergence speed and data efficiency advantages over pure Transformer backbones.
Proposed method
- Define a general context-aggregation framework with an affinity matrix A capturing neighborhood relations.
- Show how Transformer, depthwise convolution, and MLP-Mixer fit as special cases with different affinity matrices.
- Introduce Container as a learnable mix of dynamic (A(X)) and static (A) affinities with learnable coefficients (alpha, beta).
- Provide Container-Light, which switches off dynamic affinity in early stages for high-resolution downstream tasks.
- Describe a 4-stage base architecture with patch embeddings and two sub-modules per block (spatial aggregation and channel fusion).
- Evaluate on ImageNet, object detection (RetinaNet, Mask R-CNN, DETR), and self-supervised learning (DINO).
Experimental results
Research questions
- RQ1Can a unified affinity-based context-aggregation block reproduce or surpass CNN/Transformer/MLP backbones across vision tasks?
- RQ2Does combining static and dynamic affinity matrices yield superior performance and convergence vs. using either alone?
- RQ3How do Container and Container-Light perform on classification and high-resolution downstream tasks compared to state-of-the-art backbones?
- RQ4What data efficiency and convergence benefits arise from the proposed framework?
- RQ5What qualitative patterns emerge in learned static affinities across layers?
Key findings
- Container achieves 82.7% Top-1 accuracy on ImageNet with 22M parameters, outperforming DeiT-S by 2.8 points.
- Container converges to 79.9% Top-1 in 200 epochs vs. 300 for DeiT-S.
- Container-Light enables strong downstream performance, e.g., RetinaNet 43.8 mAP, Mask-RCNN 45.1 mAP (box) and 41.3 mAP (mask) with ResNet-50–equivalent compute.
- Container-Light improves DETR and SMCA-DETR variants over ResNet-50 baselines (e.g., 38.9 mAP with DETR-Container-Light).
- In self-supervised learning (DINO), Container-Light outperforms DeiT in kNN accuracy across training epochs (e.g., 71.5 vs. 69.6 at 100 epochs).
- Static-affinity extensions (Container-Pam) provide small but consistent gains, and locality emerges in early layers resembling convolutions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.