UniRepLKNet: A Universal Perception Large-Kernel ConvNet for Audio, Video, Point Cloud, Time-Series and Image Recognition
- Publication
- CVPR 2024Conference
- First submitted to arXiv
- arXiv:2311.15599
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{reparameterizationunireplknet2023,
title = {{UniRepLKNet: A Universal Perception Large-Kernel ConvNet for Audio, Video, Point Cloud, Time-Series and Image Recognition}},
author = {Xiaohan Ding and Yiyuan Zhang and Yixiao Ge and Sijie Zhao and Lin Song and Xiangyu Yue and Ying Shan},
year = {2023},
eprint = {2311.15599},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2311.15599}
}
After RepLKNet expanded convolution kernels to 31×31, large kernels became a hot topic. SLaK split them into bands to reach 51×51, and others brought large kernels to detection, segmentation, and other tasks.
First author Xiaohan Ding also authored RepLKNet and RepVGG. Now at Tencent AI Lab, he and researchers from the Chinese University of Hong Kong revisit the architecture of large-kernel networks. They find that most existing designs simply inherit someone else's architecture: RepLKNet follows Swin Transformer, SLaK follows ConvNeXt, and ConvNeXt itself uses medium-sized 7×7 kernels. Architectures designed specifically for large kernels remain little explored.
The paper asks another question too. Transformers have established themselves in images, speech, point clouds, and time series. Can convolutional networks compete beyond images?
Defining the Problem
One 3×3 Layer Does Three Jobs
The authors start with an old issue in small-kernel networks. Adding a layer to a network built from 3×3 convolutions does three things at once:
- Expands the receptive field
- Raises the abstraction level of spatial features, for example from corners and textures to object shapes
- Deepens the network, adding parameters and nonlinearities to increase expressive capacity
Small-kernel networks have to stack layers to enlarge their receptive fields, tying these three jobs together. Large kernels can see widely without greater depth. A few large-kernel layers already give a sufficiently large effective receptive field, leaving compute for more efficient structures to handle the second and third jobs.
The authors argue that large-kernel networks should design these three jobs separately. The next four guidelines all follow from this starting point.
Solving the Problem
Baseline Architecture

Start with the experimental baseline. It has four stages with , , , and channels and blocks, just like ConvNeXt-T. Each block resembles ConvNeXt: a depthwise convolution followed by an FFN with GRN. BatchNorm replaces LayerNorm so it can be merged into the convolution at inference. The first stage uses 3×3 kernels; the other three use 13×13.
During architecture exploration, ImageNet training lasts only 100 epochs, followed by ADE20K segmentation with UperNet. The authors emphasize segmentation because large kernels' benefits are more apparent downstream; ImageNet accuracy alone can hide the difference.
Guideline 1: Deepen with Cheap Structures
With large kernels handling the receptive field, extra depth can come from structures that require no wide spatial computation. The authors add a small structure to each block, trying four options:
| Added structure | Throughput (images/s) | ImageNet | ADE20K mIoU |
|---|---|---|---|
| None | 1954 | 81.2% | 45.1 |
| Bottleneck (1×1, DW 3×3, 1×1) | 1716 | 81.5% | 46.3 |
| Two 1×1 convolutions | 1745 | 81.3% | 46.2 |
| Two DW 3×3 convolutions | 1659 | 81.3% | 45.4 |
| SE Block | 1863 | 81.6% | 46.5 |
The SE Block provides both channel interaction and spatial aggregation. Its spatial aggregation is global average pooling, which is cheap, giving the best result and the highest speed among the additions.
Guideline 2: Reparameterize with Small Dilated Convolutions
RepLKNet already found that a large kernel benefits from a small parallel kernel during training to capture small-scale patterns. After training, BN is merged into the convolutions and the small kernel is zero-padded and added to the large one, leaving one layer for inference.
This paper takes that one step further. Beyond small-scale patterns, there are sparse patterns: a feature-map pixel may relate more strongly to pixels several positions away than to its immediate neighbors. Dilated convolution is well suited to this. At dilation , adjacent sampling points have pixels between them.

The figure uses as an example; the actual network uses . The lower half is the key: a convolution at dilation is equivalent to a sparse kernel of size with zeros inserted between the weights. As a convolution kernel, it can be added to the large kernel.
First, verify that a dilated convolution and its expanded sparse kernel compute exactly the same result:
import torch
import torch.nn.functional as F
def dilate(w, r):
"""Expand k×k weights by inserting r-1 zeros between neighboring weights."""
c, _, k, _ = w.shape
size = (k - 1) * r + 1
big = torch.zeros(c, 1, size, size)
big[:, :, ::r, ::r] = w
return big
torch.manual_seed(0)
c = 4
x = torch.randn(1, c, 32, 32)
w = torch.randn(c, 1, 3, 3)
y_dilated = F.conv2d(x, w, padding=3, dilation=3, groups=c) # 3×3 convolution at dilation 3
y_sparse = F.conv2d(x, dilate(w, 3), padding=3, groups=c) # Expanded 7×7 sparse kernel
print("Expanded kernel:", tuple(dilate(w, 3).shape[-2:]), "nonzero entries", int((dilate(w, 3)[0] != 0).sum()))
print("Maximum difference between the two methods:", f"{(y_dilated - y_sparse).abs().max():.1e}")
Expanded kernel: (7, 7) nonzero entries 9
Maximum difference between the two methods: 0.0e+00
Now follow the paper's defaults. Beside the main 13×13 kernel are five parallel branches, with sizes and dilations . During training, compute them separately and sum the outputs. Before inference, expand each branch, pad it to 13×13, and add it to the main kernel:
K = 13
branches = [(5, 1), (7, 2), (3, 3), (3, 4), (3, 5)] # (kernel size k, dilation r)
w_main = torch.randn(c, 1, K, K)
w_small = [torch.randn(c, 1, k, k) for k, _ in branches]
# Training: one 13×13 plus five small dilated convolutions, computed separately and summed
y_train = F.conv2d(x, w_main, padding=K // 2, groups=c)
for (k, r), w in zip(branches, w_small):
y_train += F.conv2d(x, w, padding=r * (k - 1) // 2, dilation=r, groups=c)
# Before inference: expand and pad every branch to 13×13, then add to the main kernel
merged = w_main.clone()
for (k, r), w in zip(branches, w_small):
big = dilate(w, r)
pad = (K - big.shape[-1]) // 2
merged += F.pad(big, [pad] * 4)
print(f"{k}×{k}, dilation {r} → equivalent {big.shape[-1]}×{big.shape[-1]}")
y_infer = F.conv2d(x, merged, padding=K // 2, groups=c)
print("Output magnitude:", f"{y_train.abs().max():.1f}")
print("Maximum difference after merging into one 13×13:", f"{(y_train - y_infer).abs().max():.1e}")
5×5, dilation 1 → equivalent 5×5
7×7, dilation 2 → equivalent 13×13
3×3, dilation 3 → equivalent 7×7
3×3, dilation 4 → equivalent 9×9
3×3, dilation 5 → equivalent 11×11
Output magnitude: 59.9
Maximum difference after merging into one 13×13: 2.7e-05
Six convolutions merge into one, leaving only rounding error from the changed order of floating-point additions. In the actual module, each branch also has BN. Before inference, fold BN's scale and shift into the convolution weights and biases, just as in RepVGG.
Does this help? The authors compare two non-dilated variants with the same branch count: one keeps the same kernel sizes ; the other keeps the same effective sizes . All three become the same 13×13 kernel at inference. Only training differs:
| Reparameterization | ImageNet | ADE20K mIoU |
|---|---|---|
| None | 81.44 ± 0.04% | 45.78 ± 0.05 |
| Small dilated convolutions | 81.63 ± 0.02% | 46.37 ± 0.10 |
| Same kernel sizes, no dilation | 81.55 ± 0.01% | 46.07 ± 0.07 |
| Same effective sizes, no dilation | 81.59 ± 0.02% | 46.17 ± 0.04 |
The dilated version performs best, adding 0.6 mIoU over no reparameterization. The authors interpret this as a benefit from dilated convolutions' ability to capture sparse patterns. Adding small kernels alone, or adding a range of receptive-field sizes, is less effective.
Guideline 3: Choose Kernel Size for the Downstream Task
Next, how large should each stage's kernel be?
| Kernels by stage | Throughput (images/s) | ImageNet | ADE20K mIoU |
|---|---|---|---|
| 3, 13, 13, 13 (baseline) | 1863 | 81.6% | 46.5 |
| 3, 11, 11, 11 | 1876 | 81.6% | 45.5 |
| 3, 15, 15, 15 | 1851 | 81.7% | 45.9 |
| 3, 3, 13, 13 | 2006 | 81.7% | 46.1 |
| 13, 13, 13, 13 | 1547 | 81.6% | 44.9 |
ImageNet accuracy barely changes, staying around 81.6%, while mIoU ranges from 44.9 to 46.5. Classification alone would suggest that kernel size matters little.
Strangely, increasing kernels to 15, or also using 13 in the first stage, lowers mIoU. The authors suspect UperNet. It combines early and late backbone features, assuming early features carry local information. Large early kernels make those features less local, and the combination becomes less useful.
To test this, the authors let UperNet use only the fourth stage's output, evaluating the final features in isolation. Here, size 15 gives the highest mIoU, 42.7. Using 13 in the first stage gives 42.4, matching the baseline; size 11 is lowest at 41.9. Large kernels preserve feature quality, but make early features less suited to UperNet.
Kernel size therefore depends on the downstream component. For common image tasks, the authors default to 13×13 in the middle and higher stages.
Guideline 4: Add Small Kernels When Adding Depth
Finally, scaling the model. The authors increase stage 3 from 9 to 27 blocks. Should the extra 18 also use large kernels? A block with a Dilated Reparam Block is called a LarK Block; one with DW 3×3 is a SmaK Block:
| Stage 3 composition | Throughput (images/s) | ImageNet | ADE20K mIoU |
|---|---|---|---|
| 9 LarK (original shallow variant) | 1863 | 81.6% | 46.5 |
| 27 LarK | 1145 | 82.3% | 49.0 |
| 14 LarK and 13 SmaK, alternating | 1229 | 82.3% | 48.8 |
| 9 LarK and 18 SmaK | 1264 | 82.3% | 48.8 |
| As above, removing DW 3×3 from SmaK | 1289 | 82.2% | 47.8 |
Using large kernels throughout adds only 0.2 mIoU and costs nearly 10% in speed. Nine large-kernel blocks already sustain the receptive field; small kernels suffice for the extra depth.
The last row is revealing. Removing SmaK's 3×3 convolution brings only a small speed gain but loses one mIoU point. These small kernels contribute little to the receptive field, yet build higher levels of spatial abstraction—the second job discussed at the start.
The final UniRepLKNet follows this arrangement. From size S upward, stage 3 has 9 LarK and 18 SmaK blocks, with two SmaK blocks after each LarK, as shown in the architecture figure. The smallest T uses 9 plus 9.
Discussion
Images
First, results trained only on ImageNet-1K. Throughput is measured on an A100 at batch size 128:
| Model | Parameters | Throughput (images/s) | top-1 |
|---|---|---|---|
| SLaK-T | 30M | 1312 | 82.5% |
| InternImage-T | 30M | 1292 | 83.5% |
| UniRepLKNet-T | 31M | 1804 | 83.2% |
| ConvNeXt-S | 50M | 1182 | 83.1% |
| UniRepLKNet-S | 56M | 1265 | 83.9% |
UniRepLKNet-T scores 0.3 percentage points below InternImage-T but runs 40% faster. The largest variant, UniRepLKNet-XL, pretrained on ImageNet-22K at resolution 384, reaches 88.0%, matching InternImage-XL, with throughput of 131 versus 114.
Downstream results are good too. On ADE20K, UniRepLKNet-T gets 48.6 mIoU with single-scale testing, against 46.0 for ConvNeXt-T; XL reaches 55.6 with multi-scale testing. On COCO, XL achieves 56.4 box AP.
Other Modalities
To use the same network on other data, the authors take a direct approach: arrange each kind of data as a tensor. Change only the first layer's input channel count ; everything else stays the same.
- Speech: treat a spectrogram with time bins and frequency bins as a single-channel image.
- Time series: use Corrformer's embedding layer to project into a latent space, then reshape into a single-channel two-dimensional map.
- Point clouds: use a few convolution layers to produce projection maps from X, Y, and Z views, forming a three-channel 224×224 image.
- Video: arrange 16 frames of 224×224 into a 4×4 grid, making one large 896×896 image.
The video approach is particularly blunt. Temporal relationships between frames rely entirely on kernels crossing tile boundaries.
Here are the four modalities together:
| Task | UniRepLKNet-S | Comparison |
|---|---|---|
| Speech command recognition (Speech Commands V2) | 98.5%, 55.5M, no pretraining | Audio-MAE 98.3%, 86.2M, AudioSet-2M pretraining |
| Global temperature prediction (MSE, lower is better) | 7.602 | Corrformer 7.709 |
| 3D shape classification (ModelNet-40 OA) | 93.2% | DGCNN, KPConv 92.9% |
| Action recognition (Kinetics-400) | 54.8%, no pretraining | MViTv2-B 81.2%, ImageNet-1K pretraining |
Speech, time series, and point clouds match or slightly outperform purpose-built models. Video lags far behind, and the authors acknowledge the gap to specialized video models. Their comparisons are with the likewise general-purpose ImageBind (50.0%) and Meta-Transformer (47.3%), both of which also use substantial pretraining data.
Kernel size matters here too. With the same preprocessing and training setup, substitute other convolutional networks:
| Model (kernel size) | Speech | Video |
|---|---|---|
| ResNet-101 (3) | 73.6% | 41.3% |
| ConvNeXt-S (7) | 94.3% | 48.5% |
| UniRepLKNet-S (11) | 94.7% | 51.7% |
| UniRepLKNet-S (13) | 98.5% | 54.8% |
ResNet-101 gets just 73.6% on speech; with a kernel of size 13, the result reaches 98.5%. Spectrograms and frame grids both need a wide view at once, exactly where large kernels help.
The Cost
The authors state one limitation in the conclusion: dilated branches require more training resources. Each of the five branches computes its own convolution and BN. They merge into one at inference, but that training work remains.
Inference speed also depends on the implementation. Large-kernel depthwise convolution needs the official accelerated implementation. When a user reports slow training on GitHub, the author's first question is whether that implementation is installed. Another user measures on a 4090 and finds UniRepLKNet-S no faster than ConvNeXt-B. The author replies that the paper measures on an A100; the speed ranking depends on hardware.
Conclusion
UniRepLKNet's four guidelines share one idea. Large kernels provide the wide view, small kernels build levels of abstraction, and cheap structures such as SE add depth. Give each operation its own job instead of asking one operation to do all three.
The Dilated Reparam Block can be used on its own. Attach several small dilated branches during training, then merge them into a large kernel for inference. The deployment side sees the same operation. The code above contains all the kernel-merging logic; add BN fusion to complete it.
The multimodal experiments are more surprising. Treat spectrograms as images and arrange video frames in grids, add no specialized design, and a convolutional network can still match or slightly beat Transformers on several of their home grounds.