RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Recognition

Xiaohan Ding, Chunlong Xia, Xiangyu Zhang, Xiaojie Chu, Jungong Han +1 more
5/5/2021
cs.CVcs.AIcs.LG

Official code: DingXiaoH/RepMLP (306 stars, MIT, last commit 2023-02-10).

Abstract

We propose RepMLP, a multi-layer-perceptron-style neural network building block for image recognition, which is composed of a series of fully-connected (FC) layers. Compared to convolutional layers, FC layers are more efficient, better at modeling the long-range dependencies and positional patterns, but worse at capturing the local structures, hence usually less favored for image recognition. We propose a structural re-parameterization technique that adds local prior into an FC to make it powerful for image recognition. Specifically, we construct convolutional layers inside a RepMLP during training and merge them into the FC for inference. On CIFAR, a simple pure-MLP model shows performance very close to CNN. By inserting RepMLP in traditional CNN, we improve ResNets by 1.8% accuracy on ImageNet, 2.9% for face recognition, and 2.3% mIoU on Cityscapes with lower FLOPs. Our intriguing findings highlight that combining the global representational capacity and positional perception of FC with the local prior of convolution can improve the performance of neural network with faster speed on both the tasks with translation invariance (e.g., semantic segmentation) and those with aligned images and positional patterns (e.g., face recognition). The code and models are available at https://github.com/DingXiaoH/RepMLP.

View on arXivView PDF

Code Implementations(1)

DingXiaoH/RepMLPOfficial100%
MIT

RepMLPNet: Hierarchical Vision MLP with Re-parameterized Locality (CVPR 2022)

30644PythonMay 5, 20213 years agoMIT

Similar Papers

Cite this paper

@article{ding2021repmlp,
  title  = {RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Recognition},
  author = {Xiaohan Ding and Chunlong Xia and Xiangyu Zhang and Xiaojie Chu and Jungong Han and Guiguang Ding},
  year   = {2021},
  eprint = {2105.01883},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.01883}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2105.01883.svg)](https://codeofpaper.com/paper/2105.01883)

Discussion