Skip to main content
QUICK REVIEW

[Paper Review] ConTNet: Why not use convolution and transformer at the same time?

Haotian Yan, Zhe Li|arXiv (Cornell University)|Apr 27, 2021
Advanced Neural Network ApplicationsComputer Science44 references62 citations
TL;DR

ConTNet blends standard transformer encoders with convolutional layers to enlarge receptive fields; achieves high ImageNet accuracy with less compute than DeiT and improves downstream dense prediction tasks.

ABSTRACT

Although convolutional networks (ConvNets) have enjoyed great success in computer vision (CV), it suffers from capturing global information crucial to dense prediction tasks such as object detection and segmentation. In this work, we innovatively propose ConTNet (ConvolutionTransformer Network), combining transformer with ConvNet architectures to provide large receptive fields. Unlike the recently-proposed transformer-based models (e.g., ViT, DeiT) that are sensitive to hyper-parameters and extremely dependent on a pile of data augmentations when trained from scratch on a midsize dataset (e.g., ImageNet1k), ConTNet can be optimized like normal ConvNets (e.g., ResNet) and preserve an outstanding robustness. It is also worth pointing that, given identical strong data augmentations, the performance improvement of ConTNet is more remarkable than that of ResNet. We present its superiority and effectiveness on image classification and downstream tasks. For example, our ConTNet achieves 81.8% top-1 accuracy on ImageNet which is the same as DeiT-B with less than 40% computational complexity. ConTNet-M also outperforms ResNet50 as the backbone of both Faster-RCNN (by 2.6%) and Mask-RCNN (by 3.2%) on COCO2017 dataset. We hope that ConTNet could serve as a useful backbone for CV tasks and bring new ideas for model design

Motivation & Objective

  • Motivate creating a backbone that captures long-range dependencies without the data-hungry, hyper-parameter sensitive transformers.
  • Introduce a ConTNet architecture that interleaves transformer encoders with 3x3 convolutions.
  • Show that ConTNet trains with standard ConvNet pipelines and data augmentations.
  • Demonstrate improvements on image classification and downstream dense prediction tasks.

Proposed method

  • Introduce ConTNet as a stack of ConT blocks, each containing two standard transformer encoders (STE) and a 3x3 convolution.
  • Embed STEs in a patch-wise manner: split the feature map into patches, flatten to sequences, apply STE with positional encoding, then reshape back to feature maps.
  • Use alternating STE andConv layers to jointly capture global and local features, with residual connections.
  • Provide four architectural variants (ConT-Ti, S, M, B) with progressively larger depth/width and configurable patch sizes (7x7 and 14x14).
  • Define the patch-wise STE operation: y^p_{mn} = STE(x^p_{mn}) where STE = FFN(MHSA(x^p_{mn} + PE)).
  • Discuss training regimes that show ConTNet is robust and can be optimized like standard ConvNets (e.g., ResNet) and with data augmentation tricks similar to DeiT/ViT comparisons.

Experimental results

Research questions

  • RQ1Can a convolution–transformer hybrid backbone outperform pure ConvNets and pure Vision Transformers on ImageNet under similar training conditions?
  • RQ2Does embedding STE within ConvNet architectures improve robustness and transfer to dense prediction tasks without requiring massive pretraining?
  • RQ3What are the effects of patch size, learning rates, and grouping on ConTNet’s performance and efficiency?

Key findings

  • ConTNet achieves 81.8% top-1 accuracy on ImageNet with ConT-B, matching DeiT-B while requiring ~40% fewer FLOPs.
  • On ImageNet without extra tricks, ConTNet variants outperform ResNets at similar budgets (e.g., ConT-M surpasses ResNet-50; ConT-B exceeds ResNet-101 by 0.3%).
  • With strong data augmentation, ConTNet consistently outperforms ResNet baselines across budgets (e.g., ConT-B 81.8% vs Res-101 80.0%).
  • As backbones for detection/segmentation, ConT-M improves Faster-RCNN, FCOS, and RetinaNet (e.g., AP gains of +2.6 to +4.3 points depending on task).
  • Instance segmentation and semantic segmentation also benefit (Mask-RCNN: bbox MAP +2.3, seg MAP +3.4; Cityscapes mIOU: PSPNet+ConT-M +1.16%).
  • Ablations show patch-wise positional encoding is beneficial; patch sizes of 7 and 14 with alternating config perform best (Table 9).
  • Group convolution degrades accuracy relative to standard convolution; depthwise separable convolution offers a favorable efficiency/accuracy trade-off (Table 11).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.