Container: Context Aggregation Network
Year: 2022

Abstract:
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 CONTAINER (CONText AggregatIon NEtwoRk), a general-purpose building block for multi-head context aggregation that can exploit long-range interactions a la Transformers while still exploiting the inductive bias of the local convolution operation leading to faster convergence speeds, often seen in CNNs. Our CONTAINER architecture achieves 82.7 % Top-1 accuracy on ImageNet using 22M parameters, +2.8 improvement compared with DeiT-Small, and can converge to 79.9 % Top-1 accuracy in just 200 epochs. 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 CONTAINER-LIGHT, 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 selfsupervised learning compared to DeiT on the DINO framework. Code is released at https://github.com/allenai/container.

heading: 1 Introduction
text: Convolutional neural networks (CNNs) have become the de facto standard for extracting visual representations, and have proven remarkably effective at numerous downstream tasks such as object detection [37], instance segmentation [22] and image captioning [1]. Similarly, in natural language processing, Transformers rule the roost [13, 43, 42, 4]. Their effectiveness at capturing short and long range information have led to state-of-the-art results across tasks such as question answering [45] and language understanding [58].
In computer vision, Transformers were initially employed as long range information aggregators across space (e.g., in object detection [5]) and time (e.g., in video understanding [61]), but these methods continued to use CNNs [34] to obtain raw visual representations. More recently however, CNN-free visual backbones employing Transformer modules [54, 14] have shown impressive performance on image classification benchmarks such as ImageNet [33]. The race to dethrone CNNs has now begun to expand beyond Transformers – a recent unexpected result shows that a multi-layer perceptron (MLP) exclusive network [52] can be just as effective at image classification.
35th Conference on Neural Information Processing Systems (NeurIPS 2021).
On the surface, CNNs [34, 8, 63, 23], Vision Transformers (ViTs) [14, 54] and MLP-mixers [52] are typically presented as disparate architectures. However, taking a step back and analyzing these methods reveals that their core designs are quite similar. Many of these methods adopt a cascade of neural network blocks. Each block typically consists of aggregation modules and fusion modules. Aggregation modules share and accumulate information across a predefined context window over the module inputs (e.g., the self attention operation in a Transformer encoder), while fusion modules combine position-wise features and produce module outputs (e.g., feed forward layers in ResNet).
In this paper, we show that the primary differences in many popular architectures result from variations in their aggregation modules. These differences can in fact be characterized as variants of an affinity matrix within the aggregator that is used to determine information propagation between a query vector and its context. For instance, in ViTs [14, 54], this affinity matrix is dynamically generated using key and query computations; but in the Xception architecture [8] (that employs depthwise convolutions), the affinity matrix is static – the affinity weights are the same regardless of position, and they remain the same across all input images regardless of size. And finally the MLP-Mixer [52] also uses a static affinity matrix which changes across the landscape of the input.
Along this unified view, we present CONTAINER (CONText AggregatIon NEtwoRk), a general purpose building block for multi-head context aggregation. A CONTAINER block contains both static affinity as well as dynamic affinity based aggregation, which are combined using learnable mixing coefficients. This enables the CONTAINER block to process long range information while still exploiting the inductive bias of the local convolution operation. CONTAINER blocks are easy to implement, can easily be substituted into many present day neural architectures and lead to highly performant networks whilst also converging faster and being data efficient.
Our proposed CONTAINER architecture obtains 82.7 % Top-1 accuracy on ImageNet using 22M parameters, improving +2.8 points over DeiT-S [54] with a comparable number of parameters. It also converges faster, hitting DeiT-S’s accuracy of 79.9 % in just 200 epochs compared to 300.
We also propose a more efficient model, named CONTAINER-LIGHT that employs only static affinity matrices early on but uses the learnable mixture of static and dynamic affinity matrices in the latter stages of computation. In contrast to ViTs that are inefficient at processing large inputs, CONTAINER-LIGHT can scale to downstream tasks such as detection and instance segmentation that require high resolution input images. Using a CONTAINER-LIGHT backbone and 12 epochs of training, RetinaNet [37] is able to achieve 43.8 mAP, while Mask-RCNN [22] is able to achieve 45.1 mAP on box and 41.3 mAP on instance mask prediction, improvements of +7.3, +6.9 and +6.6 respectively, compared to a ResNet-50 backbone. The more recent DETR and its variants SMCA-DETR and Deformable DETR [5, 19, 75] also benefit from CONTAINER-LIGHT and achieve 38.9, 43.0 and 44.2 mAP, improving significantly over their ResNet-50 backbone baselines.
CONTAINER-LIGHT is data efficient. Our experiments show that it can obtain an ImageNet Top-1 accuracy of 61.8 using just 10% of training data, significantly better than the 39.3 accuracy obtained by DeiT. CONTAINER-LIGHT also convergences faster and achieves better kNN accuracy (71.5) compared to DeiT (69.6) under DINO self-supervised training framework [6].
The CONTAINER unification and framework enable us to easily reproduce several past models and even extend them with just a few code and parameter changes. We extend multiple past models and show improved performance – for instance, we produce a Hierarchical DeiT model, a multi-head MLP-Mixer and add a static affinity matrix to the DeiT architecture. Our code base and models will be released publicly. Finally, we analyse a CONTAINER model containing both static and dynamic affinities and show the emergence of convolution-like local affinities in the early layers of the network.
In summary, our contributions include: (1) A unified view of popular architectures for visual inputs – CNN, Transformer and MLP-mixer, (2) A novel network block – CONTAINER, which uses a mix of static and dynamic affinity matrices via learnable parameters and the corresponding architecture with strong results in image classification and (3) An efficient and effective extension – CONTAINER-LIGHT with strong results in detection and segmentation. Importantly, we see that a number of concurrent works are aiming to fuse the CNN and Transformer architectures [36, 64, 40, 24, 55, 69, 64, 47], validating our approach. We hope that our unified view helps place these different concurrent proposals in context and leads to a better understanding of the landscape of these methods.

heading: 2 Related Work
text: Visual Backbones. Since AlexNet [33] revolutionized computer vision, a host of CNN based architectures have provided further improvements in terms of accuracy including VGG [46], ResNet [23], Inception Net [48], SENet [28], ResNeXt [63] and Xception [8] and efficiency including Mobile-net v1 [26], Mobile-net v2 [26] and Efficient-net v2 [50]. With the success of Transformers [56] in NLP such as BERT [13] and GPT [43], researchers have begun to apply them towards solving the long range information aggregation problem in computer vision. ViT [14]/DeiT [54] are transformers that achieve better performance on ImageNet than CNN counterparts. Recently, several concurrent works explore integrating convolutions with transformers and achieve promising results. ConViT [11] explores soft convolutional inductive bias for enhancing DeiT. CeiT [66] directly incorporates CNNs into the Feedforward module of transformers to enhance the learned features. PVT [60] proposes a pyramid vision transformer for efficient transfer to downstream tasks. Pure Transformer models such as ViT/DeiT however, require huge GPU memory and computation for detection [60] and segmentation [73] tasks, which need high resolution input. MLP-Mixer [52] shows that simply performing transposed MLP followed by MLP can achieve near state-of-the-art performance. We propose CONTAINER, a new visual backbone that provides a unified view of these different architectures and performs well across several vision tasks including ones that require a high resolution input.
Transformer Variants. Vanilla Transformers are unable to scale to long sequences or high-resolution images due to the quadratic computation in self-attention. Several methods have been proposed to make Transformer computations more efficient for high resolution input. Reformer [32], Clusterform [57], Adaptive Clustering Transformer [73] and Asymmetric Clustering [10] propose to use Locality Sensitivity Hashing to cluster keys or queries and reduce quadratic computation into linear computation. Lightweight convolution [62] explore convolution architectures for replacing Transformers but only explore applications in NLP. RNN Transformer [31] builds a connection between RNN and Transformer and results in attention with linear computation. Linformer [59] changes the multiplication order of key,query,value into query,value,key by deleting the softmax normalization layer and achieve linear complexity. Performer [9] uses Orthogonal Random Feature to approximate full rank softmax attention. MLIN [18] performs interaction between latent encoded nodes, and its complexity is linear with respect to input length. Bigbird [3] breaks the full rank attention into local, randomly selected and global attention. Thus the computation complexity becomes linear. Longformer [68] uses local Transformers to tackle the problem of massive GPU memory requirements for long sequences. MLP-Mixer [52] is a pure MLP architecture for image recognition. In the unified formulation we provide, MLP-Mixer can be considered as a single-head Transformer with static affinity matrix weight. MLP-Mixer can provide more efficient computation than vanilla transformer due to no need to calculate affinity matrix using key query multiplication. Efficient Transformers mostly use approximate message passing which results in performance deterioration across tasks. Lightweight Convolution [62], Involution [35], Synthesizer [51], and MUSE [71] explored the relationship between Depthwise Convolution and Transformer. Our CONTAINER unification performs global and local information exchange simultaneously using a mixture affinity matrix, while CONTAINER-LIGHT switches off the dynamic affinity matrix for high resolution feature maps to reduce computation. Although switching off the dynamic affinity matrix slightly hinders classification performance, CONTAINER-LIGHT still provides effective and efficient generalization to downstream tasks compared with popular backbones such as ViT and ResNet.
Transformers for Vision. Transformers enable high degrees of parallelism and are able to capture long-range dependencies in the input. Thus Transformers have gradually surpassed other architectures such as CNN [34] and RNN [25] on image [14, 5, 70], audio [2], multi-modality [17, 21, 20], and language understanding [13]. In computer vision, Non-local Neural Network [61] has been proposed to capture long range interactions to compensate for the local information captured by CNNs and used for object detection [27] and semantic segmentation [16, 29, 76, 67]. However, these methods use Transformers as a refinement module instead of treating the transformer as a first-class citizen. ViT [14] introduces the first pure Transformer model into computer vision and surpasses CNNs with large scale pretraining on the non publicly available JFT dataset. DeiT [54] trains ViT from scratch on ImageNet-1k and achieve better performance than CNN counterparts. DETR [5] uses Transformer as an encoder and decoder architecture for designing the first end-to-end object detection system. Taming Transformer [15] use Vector Quantization [41] GAN and GPT [43] for high quality highresolution image generation. Motivated by the success of DETR on object detection, Transformers have been applied widely on tasks such as semantic segmentation [74], pose estimation [65], trajectory
estimation [39], 3D representation learning and self-supervised learning with MOCO v3 [7] and DINO [6]. ProTo [72] verify the effective of transformer on reasoning tasks.

heading: 3 Methods
text: In this section we first provide a generalized view of neighborhood/context aggregation modules commonly employed in present neural networks. Then we revisit three major architectures – Transformer [56], Depthwise Convolution [8] and the recently proposed MLP-Mixer [52], and show that they are special cases of our generalized view. We then present our CONTAINER module in Sec 3.3 and its efficient version – CONTAINER-LIGHT in Sec 3.5.

heading: 3.1 Contextual Aggregation for Vision
text: Consider an input image X ∈ RC×H×W , where C and H ×W denote the channel and spatial dimensions of the input image, respectively. The input image is first flattened to a sequence of tokens {Xi ∈ RC |i = 1, . . . , N}, where N = HW and input to the network. Vision networks typically stack multiple building blocks with residual connections [23], defined as
Y = F(X, {Wi}) +X. (1)
Here, X and Y are the input and output vectors of the layers considered, and Wi represents the learnable parameters. F determines how information across X is aggregated to compute the feature at a specific location. We first define an affinity matrix A ∈ RN×N that represents the neighborhood for contextual aggregation. Equation 1 can be re-written as:
Y = (AV)W1 +X, (2)
where V ∈ RN×C is a transformation of X obtained by a linear projection V = XW2. W1 and W2 are the learnable parameters. Aij is the affinity value between Xi and Xj . Multiplying the affinity matrix with V propagates information across features in accordance with the affinity values.
The modeling capacity of such a context aggregation module can be increased by introducing multiple affinity matrices, allowing the network to have several pathways to contextual information across X. Let {Vi ∈ RN× CM |i = 1, . . . ,M} be slices of V, where M is the number of affinity matrices, also referred to as the number of heads. The multi-head version of Equation 2 is
Y = Concat(A1V1, . . . ,AMVM )W2 +X, (3)
where Am denotes the affinity matrix in each head. Different Am can potentially capture different relationships within the feature space and thus increase the representation power of contextual aggregation compared with a single-head version. Note that only spatial information is propagated during contextual aggregation using the affinity matrices; cross-channel information exchange does not occur within the affinity matrix multiplication, and that there is no non-linear activation function.

heading: 3.2 The Transformer, Depthwise Convolution and MLP-Mixer
text: Transformer [56], depthwise convolution [30] and the recently proposed MLP-Mixer [52] are three distinct building blocks used in computer vision. Here, we show that they can be represented within the above context aggregation framework, by defining different types of affinity matrices.
Transformer. In the self-attention mechanism in Transformers, the affinity matrix is modelled by the similarity between the projected query-key pairs. With M heads, the affinity matrix in head m, Asam can be written as
Asam = Softmax(QmKTm/ √ C/M), (4)
where Km,Qm are the corresponding key, query in head m, respectively. The affinity matrix in self-attention is dynamically generated and can capture instance level information. However, this introduces quadratic computational, which requires heavy computation for high resolution feature.
Depthwise Convolution. The convolution operator fuses both spatial and channel information in parallel. This is different from the contextual aggregation block defined above. However, depthwise convolution [30] which is an extreme case of group convolution performs disentangled convolution.
Considering the number of the heads from the contextual aggregation block to be equal to the channel size C, we can define the convolutional affinity matrix given the 1-d kernel Ker ∈ RC×1×k:
Aconvmij = { Ker[m, 0, |i− j|] |i− j| ≤ k 0 |i− j| > k , (5)
where Amij is the affinity value between Xi and Xj on head m. In contrast with the affinity matrix obtained from self-attention whose value is conditioned on the input feature, the affinity values for convolution are static – they do not depend on the input features, sparse – only involves local connections and shared across the affinity matrix.
MLP-Mixer The recently proposed MLP-Mixer [52] does not rely on any convolution or selfattention operator. The core of MLP-Mixer is the transposed MLP operation, which can be denoted as X = X+ (VTWMLP )T . We can define the affinity matrix as
Amlp = (WMLP )T , (6)
where WMLP represents the learnable parameters. This simple equation shows that the transposedMLP operator is a contextual aggregation operator on a single feature group with a dense affinity matrix. Comparing with self-attention and depthwise convolution, the transpose-MLP affinity matrix is static, dense and with no parameter sharing.
The above simple unification reveals the similarities and differences between Transformer, depthwise convolution and MLP-Mixer. Each of these building blocks can be obtained by different formulating different affinity matrices. This finding leads us to create a powerful and efficient building block for vision tasks – the CONTAINER.
3.3 The CONTAINER Block
As detailed in Sec 3.2, previous architectures have employed either static or dynamically generated affinity matrices – each of which provides its unique set of advantages and features. Our proposed building block named CONTAINER, combines both types of affinity matrices via a learnable parameter. The single head CONTAINER is defined as:
Y = ((α Dynamic︷ ︸︸ ︷ A(X) +β Static︷︸︸︷ A )V )W2 +X (7)
A(X) is dynamically generated from X while A is a static affinity matrix. We now present a few special cases of the CONTAINER block. In the following, L denotes a learnable parameter.
• α = 1, β = 0, A(x) = Asa: A vanilla Transformer block with self-attention (denoted sa). • α = 0, β = 1, M = C, A = Aconv: A depthwise convolution block. In depthwise convolution,
each channel has a different static affinity matrix. When M 6= C, the resultant block can be considered a Multi-head Depthwise Convolution block (MH-DW). MH-DW shares kernel weights.
• α = 0, β = 1, M = 1, A = Amlp: An MLP-Mixer block. When M 6= 1, we name the module Multi-head MLP (MH-MLP). MH-MLP splits channels into M groups and performs independent transposed MLP to capture diverse static token relationships.
• α = L, β = L, A(x) = Asa, A = Amlp: This CONTAINER block fuses dynamic and static information, but the static affinity resembles the MLP-Mixer matrix. We call this block CONTAINER-PAM (Pay Attention to MLP).
• α = L, β = L, A(x) = Asa, A = Aconv: This CONTAINER block fuses dynamic and static information, but the static affinity resembles the depthwise convolution matrix. This static affinity matrix contains a locality constraint which is shift invariant, making it more suitable for vision tasks. This is the default configuration used in our experiments.
The CONTAINER block is easy to implement and can be readily swapped into an existing neural network. The above versions of CONTAINER provide variations on the resulting architecture and its performance and exhibit different advantages and limitations. The computation cost of a CONTAINER block is the same as a vanilla Transformer since the static and dynamic matrices are linearly combined.
3.4 The CONTAINER network architecture
We now present a base architecture used in our experiments. The unification of past works explained above allows us to easily compare self-attention, depthwise convolution, MLP and multiple variations of the CONTAINER block, and we perform these comparison using a consistent base architecture.
Motivated by networks in past works [23, 60], our base architecture contains 4 stages. In contrast to ViT/DeiT which down-sample the image to a low resolution and keep this resolution constant, each stage in our architecture down-samples the image resolution gradually. Gradually down-sampling can retain image details, which is important for downstream tasks such as segmentation and detection. Each of the 4 stages contains a cascade of blocks. Each block contains two sub-modules, the first to aggregate spatial information (named spatial aggregation module) and the second to fuse channel information (named feed-forward module). In this paper, the channel fusion module is fixed to a 2-layer MLP as proposed in [56]. Designing a better spatial aggregation module is the main focus of this paper. The 4 stages contain 2, 3, 8 and 3 blocks respectively. Each stage uses patch embeddings which fuse spatial patches of size p × p into a single vector. For the 4 stages, the values of p are 4,4,2,2 respectively. The feature dimension within a stage remains constant – and is set to 128, 256, 320, and 512 for the four stages. This base architecture augmented with the CONTAINER block results in a similar parameter size as DeiT-S [54].
3.5 The CONTAINER-LIGHT network
We also present an efficient version known as CONTAINER-LIGHT which uses the same basic architecture as CONTAINER, but switches off the dynamic affinity matrix in the first 3 stages. The absence of the computation heavy dynamic attention at the early stages of computation help efficiently scale the model to process large image resolutions and achieve superior performance on downstream tasks such as detection and instance segmentation.
ACONTAINER-LIGHTm = { Aconvm Stage = 1, 2, 3 αAsam + βAconvm Stage = 4 , (8)
α and β are learnable parameters. In network stage 1, 2, 3, CONTAINER-LIGHT will switch off Asam .

heading: 4 Experiments
text: We now present experiments with CONTAINER for ImageNet and with CONTAINER-LIGHT for the tasks of object detection, instance segmentation and self-supervised learning. We also present appropriate baselines. Please see the appendix for details of the models, training and setup.

heading: 4.1 ImageNet Classification
text: Top-1 Accuracy. Table 1 compares several highly performant models within the CNN, Transformer, MLP, Hybrid and our proposed CONTAINER families. CONTAINER and CONTAINER-LIGHT outperform the pure Transformer models ViT [14] and DeiT [54] despite far fewer parameters. They outperform PVT [60] which employ a hierarchical representation similar to our base architecture. They also outperform the recently published state-of-the-art SWIN [40] (they outperform Swin-T which has more parameters). The best performing models continue to be from the EfficientNet [49] family, but we note that EfficientNet [49] and RegNet [44] apply an extensive neural architecture search, which we do not. Finally note that CONTAINER-LIGHT not only achieves a high accuracy but does so at lower FLOPs and much faster throughput than models with comparable capacities.
The CONTAINER framework allows us to easily reproduce past architectures but also to create effective extensions over past work (outlined in Sec 3.3), several of which are compared in Table 2. H-DeiT-S is a hierarchical version of DeiT-S obtained by simply using Asa within our hierarchical architecture and provides 1.2 gain. Conv-3 (naive convolution (conv) with 3× 3 kernel) aggregates spatial and channel information, where as Group Conv-3 splits input features and performs convs using different kernels – it is cheaper and more effective. When group size = channel dim., we get depth-wise conv. DW-3 is a depthwise convs with 3 by 3 kernel that only aggregates spatial information. Channel information is fused using 1× 1 convs. MH-DW-3 is a multi-head version of DW-3. MH-DW-3 shares kernel parameters within the same group. With fewer kernels, MH-DW-3 achieves comparable performance with DW-3. MLP is an implementation of transposed MLP for spatial propagation. MLP-LR stands for MLP with low-rank decompostion. MLP-LR provides better
Models that have fewer parameters than CONTAINER or upto 10% more parameters are highlighted.
performance with fewer parameters. MH-MLP-LR adds a multi-head mechanism over MLP-LR and provides further improvements. In contrast to the original MLP-Mixer [52], we do not add any non-linearity like GELU into CONTAINER as is specified in the contextual aggregation equation.
Data Efficiency. CONTAINER-LIGHT has a built-in shift-invariance and parameter sharing mechanism. As a result it is more data efficient in comparison to DeiT [54]. Table 3 shows that at the low data regime of 10%, CONTAINER-LIGHT outperforms DeiT by a massive 22.5 points.
Convergence Speed. Figure 1 (left) compares the convergence speeds of the two CONTAINER variants with a CNN and Transformer (DeiT) [54]. The inductive biases in the CNN enable it to converge faster than DeiT [54], but they eventually perform similarly at 300 epochs, suggesting that dynamic, long range context aggregation is powerful but slow to converge. CONTAINER combines the best of both and provides accuracy improvements with fast
convergence. CONTAINER-LIGHT converges as fast with a slight accuracy drop.
Emergence of locality. Within our CONTAINER framework, we can easily add a static affinity matrix to the DeiT architecture. This simple change (1 line of code addition), can provide a +0.5 Top-1
improvement from 79.9% to 80.4%. This suggests that static and dynamic affinity matrices provide complementary information. As noted in Sec 3.3, we name this CONTAINER-PAM.
It is interesting to visualize the learnt static affinities at different network layers. Figure 1 (right) displays these for 2 layers. Each matrix represents the static affinities for a single position, reshaped to a 2-d grid to resemble the landscape of the neighboring regions. Within Layer 1, we interestingly observe the emergence of local operations via the enhancement of affinity values next to the source pixel (location). These are akin to convolution operations. Furthermore, the affinity value for the source pixel is very small, i.e. at each location, the context aggregator does not use its current feature. We hypothesize that this is a result of the residual connection [23], thereby alleviating the need to include the source feature within the context. Note that in contrast to dynamic affinity, the learnt static matrix is shared for all input images. Notice that Layer 12 displays a more global affinity matrix without any specific interpretable local patterns.

heading: 4.2 Detection with RetinaNet
text: Since the attention complexity for CONTAINER-LIGHT is linear at high image resolutions (initial layers) and then quadratic, it can be employed for downstream tasks such as object detection which usually require high resolution feature maps. Table 4 compares several backbones applied to the RetinaNet detector [37] on the COCO dataset [38]. Compared to the popular ResNet-50 [23], CONTAINER-LIGHT achieves 43.8 mAP, an improvement of 7.0, 7.2 and 10.4 on APS , APM , and APL with comparable parameters and cost. The significant increase for large objects shows the benefits of global attention via the dynamic global affinity matrix in our model. CONTAINER-LIGHT also surpasses the large convolution-based backbone X-101-64 [63] and pure Transformer models with similar number of parameters such as PVT-S [60], ViL-S [69], and SWIN-T [40] by large
margins. Compared to large Transformer backbones such as ViL-M [69] and ViL-B [69], we achieve comparable performance with significantly fewer parameters and FLOPs.

heading: 4.3 Detection and Segmentation with Mask-RCNN
text: Table 4 also compares several backbones for detection and instance segmentation using the Mask R-CNN network [22]. As with the findings for RetinaNet [37], CONTAINER-LIGHT outperforms convolution and Transformer based approaches such as ResNet [23], X-101 [63], PVT [60], ViL [69] and recent state-of-the-art SWIN-T [40] and the recent hybrid approach BoT [47]. It obtains comparable numbers to the much larger ViL-B [69].
4.4 Detection with DETR Method mAP DETR-ResNet50 [5] 32.3
DETR-CONTAINER-LIGHT 38.9 DDETR w/o multi-scale-ResNet50 [75] 39.3 DDETR w/o multi-scale-CONTAINER-LIGHT 43.0 SMCA w/o multi-scale-ResNet50 [19] 41.0
SMCA w/o multi-scale-CONTAINER-LIGHT 44.2
Table 5: CONTAINER-LIGHT and ResNet-50 backbones with DETR and variants for object detection.
Table 5 shows that our model can consistently improve object detection performance compared to a ResNet-50 [23] backbone (comparable parameters and computation) on end-toend object detection using DETR [5]. We demonstrate large improvements with DETR [5], DDETR [75] as well as SMCA-DETR [19]. See appendix for APS , APM , and APL numbers.
All models in table 5 are trained using a 50 epochs schedule.
4.5 Self supervised learning Epochs → 20 40 60 80 100 DeiT [6] 52.0 63.3 66.5 68.9 69.6
CONTAINER-LIGHT 58.0 67.0 70.0 71.1 71.5
Table 6: CONTAINER-LIGHT and DeiT on DINO self-supervised learning.
We train DeiT [54] and CONTAINER-LIGHT for 100 epochs at the self supervised task of visual representation learning using the DINO framework [6]. Table 6 compares top-10 kNN accuracy for both backbones at different epochs of training. CONTAINER-LIGHT significantly outperforms DeiT with large improvements initially demonstrating more efficient learning.

heading: 5 Conclusion
text: In this paper, we have shown that disparate architectures such as Transformers, depth-wise CNNs and MLP-based methods are closely related via an affinity matrix used for context aggregation. Using this view, we have proposed CONTAINER, a generalized context aggregation building block that combines static and dynamic affinity matrices using learnable parameters. Our proposed networks, CONTAINER and CONTAINER-LIGHT show superior performance at image classification, object detection, instance segmentation and self-supervised representation learning. We hope that this unified view can motivate future research in the design of effective and efficient visual backbones.
Limitations: CONTAINER is very effective at image classification but cannot be directly applied to high resolution inputs. The efficient version CONTAINER-LIGHT, can be used for a variety of tasks. However, its limitation is that it is partially hand-crafted – the dynamic affinity matrix is switched off in the first 3 stages. Future work will address how to learn this using the task at hand.
Negative societal impact: This research does not have a direct negative societal impact. However, we should be aware that powerful neural networks, particularly image classification networks can be used for harmful applications like face and gender recognition.
Disclosure of Funding This work was partially supported by the Shanghai Committee of Science and Technology, China (Grant No. 21DZ1100100 and 20DZ1100800).

Review summaries:
The paper proposes an architecture that combines Self-Attention, Mixer and DWise Conv blocks for spatial aggregation/mixing; along with channel mixing MLPs. While there's a lot of mathematical notation and it was a bit hard for me to understand quickly, my understanding is that: basically, the paper says - you can combine self-attention (dynamic filters generated) with DWise Conv (static + local) OR self-attention with Mixer (static + global) - and calls the two models as Container and Container-PAM (PAM = Pay Attention to MLP). Paper also proposes a hybrid model called Container-Lite which is basically Container with first three stages just using DWise Conv and no self-attention (for speeds) - and they use this architecture for detection/segmentation (in a manner similar to BoTNet). There are plenty of experiments in the paper - ImageNet, COCO, Self-Supervised Learning, etc. and some unifying presentation around MLP-Mixer, ViT and DWise Convs. Main review in the review section.

This paper first provides a unified view on three existing network architectures: depthwise  CNNs, Transformers and MLP-Mixers. It then proposes Container and a light-weight version Container-Light, which combine CNNs and self-attention to aggregate spatial information. Experiments on ImageNet classification and COCO object detection verify the high modeling ability of Container.

The paper proposes a unified view between CNNs (but really just depthwise CNNs), ViTs, and MLP-Mixer models. In essence this unified view consists of having a*static + b*dynamic, where "static" is an input-independent learnable filter (for CNN and MLP-Mixer) and "dynamic" is an input-dependent filter as in self-attention, a/b are "switches".  In addition to this container model, the paper also suggests a "light" variant, where b=0 for all but the last stage, "stage" being the resnet-like definition. This variant is especially good for high-resolution tasks.