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

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

5 May 2021arXiv:2105.01883archive 2025-07-28

Xiaohan Ding, Chunlong Xia, Xiangyu Zhang, Xiaojie Chu, Jungong Han, Guiguang Ding

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.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 14 code samples harvested from 3 repositories linked to this paper: 10 ran (of which 0 constructed an object rather than computing a result; 8 with no instrument failure: 0 honoured, 0 violated, 8 with no contract checked; 2 where Syntology's instrument failed) · 4 unverified. Where Syntology's instrument failed: 2 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: official repository: 3 samples from 1 repository, 2 ran (0 with no instrument failure; 2 where Syntology's instrument failed); community (archive-listed): 11 samples from 2 repositories, 8 ran (8 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 2 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

DingXiaoH/RepMLP officialmentioned in papermentioned on GitHubpytorchSyntology: 3 samples, 2 ran (2 instrument-failed) · 1 unverified report
DingXiaoH/DiverseBranchBlock mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Diverse Branch Block: Building a Convolution as an Inception-like Unit (arXiv:2103.13425; that paper's own run record: 11 ran (of which 3 constructed an object rather than computing a result; 4 with no instrument failure: 1 honoured, 0 violated, 3 with no contract checked; 7 where Syntology's instrument failed) · 9 unverified); nothing checks that they implement this paper's method. report
DingXiaoH/GSM-SGD mentioned on GitHubtfMITSyntology: 2 samples, 2 ran (0 instrument-failed) · 0 unverified report
DingXiaoH/ResRep mentioned on GitHubpytorchMITSyntology: 9 samples, 6 ran (0 instrument-failed) · 3 unverified report
ShawnDing1994/AOFP mentioned on GitHubtfSyntology: not harvested report
xmu-xiaoma666/External-Attention-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified), RepVGG: Making VGG-style ConvNets Great Again (arXiv:2101.03697; that paper's own run record: 13 ran (of which 7 constructed an object rather than computing a result; 8 with no instrument failure: 0 honoured, 0 violated, 8 with no contract checked; 5 where Syntology's instrument failed) · 3 unverified), Involution: Inverting the Inherence of Convolution for Visual Recognition (arXiv:2103.06255; that paper's own run record: 7 ran (of which 7 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 0 violated, 7 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified; every one of the 7 samples that ran constructed an object rather than computing a result) and 4 more (every one in this page's JSON twin); nothing checks that they implement this paper's method. report
xmu-xiaoma666/RepMLP-pytorch mentioned on GitHubpytorchApache-2.0Syntology: not harvested report
BR-IDL/PaddleViT paddleSyntology: not harvested report
Mind23-2/MindCode-112 mindsporeSyntology: not harvested report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

14 samples harvested: 10 ran (of which 0 constructed an object rather than computing a result; 8 with no instrument failure: 0 honoured, 0 violated, 8 with no contract checked; 2 where Syntology's instrument failed) · 4 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

2ran · our draft was wrong
8ran
4unverified

Licence: 0 of the 14 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 3 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

DingXiaoH/RepMLP official repository 3 samples, 2 ran (2 instrument-failed) · 1 unverified
conv_bn in 88 papers repmlpnet.py ran · our draft was wrong MIT (permissive) · 7186655759897af6 · report fixture: signature in_channels:int/0/int, out_channels:int/0/int, kernel_size:int/0/int, stride:int/0/int, padding:int/0/int, groups:int/0/int · returned Sequential · level recorded 2026-09-22
conv_bn_relu in 20 papers repmlpnet.py ran · our draft was wrong MIT (permissive) · 18483b4d73618baa · report fixture: signature in_channels:int/0/int, out_channels:int/0/int, kernel_size:int/0/int, stride:int/0/int, padding:int/0/int, groups:int/0/int · returned Sequential · level recorded 2026-09-22
fuse_bn repmlpnet.py unverified MIT (permissive) · c1e5b17d52a4eaa8 · report
DingXiaoH/GSM-SGD community (archive-listed) 2 samples, 2 ran (0 instrument-failed) · 0 unverified
get_baseconfig_by_epoch base_config.py ran MIT (permissive) · 5bf521e2a90d2830 · report fixture: signature network_type:str/0/str, dataset_name:str/0/str, dataset_subset:str/0/str, global_batch_size:int/0/int, num_node:int/0/int, weight_decay:float/0/float, optimizer_type:str/0/str, momentum:float/0/float, max_epochs:int/0/int, base_lr:float/0/float, lr_epoch_boundaries:list/1/int, lr_decay_factor:float/0/float, linear_final_lr:float/0/float, warmup_epochs:int/0/int, warmup_method:str/0/str, warmup_factor:float/0/float, ckpt_iter_period:int/0/int, tb_iter_period:int/0/int, output_dir:str/0/str, tb_dir:str/0/str, save_weights:bool/0/bool, device:str/0/str, weight_decay_bias:float/0/float, bias_lr_factor:float/0/float, init_weights:NoneType/0/?, val_epoch_period:int/0/int, grad_accum_iters:int/0/int, deps:NoneType/0/?, se_reduce_scale:int/0/int · returned BaseConfigByEpoch · level recorded 2026-09-25
load_cuda_data gsm/gsm_train.py ran MIT (permissive) · dffbc817a4437a57 · report fixture: signature data_loader:ImageNetDataLoader/0/?, dataset_name:str/0/str · returned tuple · level recorded 2026-09-25
DingXiaoH/ResRep community (archive-listed) 9 samples, 6 ran (0 instrument-failed) · 3 unverified
calculate_mi1_flops rr/resrep_scripts.py ran MIT (permissive) · f480268edf8cc940 · report fixture: signature deps:ndarray/1/int · returned float32 · level recorded 2026-09-25
fuse_conv_bn rr/resrep_convert.py ran MIT (permissive) · ca447da2f48abbae · report fixture: signature save_dict:dict/0/?, pop_name_set:set/0/?, kernel_name:str/0/str · returned tuple · level recorded 2026-09-25
get_con_flops rr/resrep_scripts.py ran MIT (permissive) · c6b81931ddcaf8b2 · report fixture: signature input_deps:int/0/int, output_deps:int/0/int, h:int/0/int, w:int/0/int, kernel_size:int/0/int, groups:int/0/int · returned int · level recorded 2026-09-25
get_cur_num_deactivated_filters rr/resrep_util.py ran MIT (permissive) · c615970236fd8e3c · report fixture: signature origin_deps:ndarray/1/int, cur_deps:ndarray/1/int, follow_dict:dict/0/? · returned int64 · level recorded 2026-09-25
resrep_get_deps_and_metric_dict rr/resrep_util.py ran MIT (permissive) · 854695e3e20a0fff · report fixture: signature origin_deps:ndarray/1/int, model:callable/0/?, pacesetter_dict:dict/0/? · returned tuple · level recorded 2026-09-25
resrep_get_layer_mask_ones_and_metric_dict rr/resrep_util.py ran MIT (permissive) · 2249cf3b5f3510fd · report fixture: signature model:callable/0/? · returned tuple · level recorded 2026-09-25
calculate_resnet_bottleneck_flops rr/resrep_scripts.py unverified MIT (permissive) · 4f77c99e445c50d0 · report
fold_conv rr/resrep_convert.py unverified MIT (permissive) · 683ccc67b0312bd0 · report
get_baseconfig_by_epoch base_config.py unverified MIT (permissive) · 15826dfdec9eddac · report

Tasks

Face RecognitionImage ClassificationSemantic Segmentation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet RepMLP-Res50 Number of params 52.77M #823 of 1060 Archive leaderboard report
Image Classification ImageNet RepMLP-Res50 Top 1 Accuracy 78.60% #823 of 1060 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Convolution

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections