OverLoCK: An Overview-first-Look-Closely-next ConvNet with Context-Mixing Dynamic Kernels
- Publication
- CVPR 2025Conference
- First submitted to arXiv
- arXiv:2502.20087
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{classiccnnsoverlock2025,
title = {{OverLoCK: An Overview-first-Look-Closely-next ConvNet with Context-Mixing Dynamic Kernels}},
author = {Meng Lou and Yizhou Yu},
year = {2025},
eprint = {2502.20087},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2502.20087}
}
When we look at a photo, we rarely scan it cell by cell from the upper-left corner. We glance at it, recognize a capybara in a hot spring, then look back at the orange on its head. Cognitive science calls this top-down attention: first get a rough overview, then use it to guide a closer look.
Convolutional backbones work differently. A pyramid architecture downsamples layer by layer, and each layer can use only preceding results. Intermediate layers process features before they know what the whole image is about.
This paper comes from the University of Hong Kong, by Meng Lou and Yizhou Yu. They want a pure convolutional backbone that also sees the big picture before the details.
Defining the Problem
Intermediate Layers Need Direction
Using Grad-CAM on intermediate layers of Swin-T, ConvNeXt-T, and VMamba-T, the authors find that stage 3, farther from the classifier, often misses objects of the correct class. All three networks can capture long-range relationships, but their intermediate layers lack guidance from high-level semantics.
Earlier vision models have added top-down signals, usually recurrently: feed the final output back to an earlier layer and run it again. That requires another round of computation, an expensive choice for a backbone.
Kernels Cannot See Far Enough
The second issue is the operator. Once global semantics are available, the convolution kernel still needs a way to use them.
Both large kernels and ordinary dynamic convolutions see a region limited by kernel size. As input resolution grows, that region covers a smaller fraction of the image. Deformable convolution reaches farther, but spreading out sampling points loses convolution's local inductive bias. The authors want input-dependent weights that use global information while preserving local bias.
Solving the Problem
Split into Three Subnetworks

The authors split the network into three subnetworks, calling this the Deep-stage Decomposition Strategy (DDS):
- Base-Net: the usual first three stages, downsampling the image to and producing intermediate features.
- Overview-Net: a lightweight path that takes Base-Net's output straight down to , quickly forming a rough but semantic understanding of the whole image, called the context prior. This is the overview.
- Focus-Net: a deeper path starting from the same Base-Net output, guided by the context prior at every block. This is the closer look.
There are effectively two backbones: Base-Net plus Overview-Net, and Base-Net plus Focus-Net, sharing Base-Net. During pretraining, each path has its own classification head and loss. For downstream tasks, Overview-Net no longer needs extra supervision; the feature pyramid combines Base-Net's and features with Focus-Net's and .
The context prior keeps updating through Focus-Net. Each block concatenates it with the feature map, processes the combination, then splits it again and sends the updated prior onward. To keep the signal from fading, the original prior is added back each time: , with learnable scalars and .
Base-Net and Overview-Net use a Dilated RepConv from UniRepLKNet: a large kernel reparameterized with small dilated convolutions.
ContMix: Put the Whole Image into the Kernel
Focus-Net centers on a new dynamic convolution, ContMix (Context-Mixing Dynamic Convolution).

Walk through panel (a):
- A 1×1 convolution maps input to , giving one query vector at each of locations.
- A separate path adaptively average-pools into region centers, then applies a 1×1 convolution to obtain . The paper uses , giving 49 centers.
- Multiplying and gives an affinity matrix of size . Row records how similar location is to each of the 49 region centers.
- Linear layer maps each row from 49 numbers to , followed by softmax. This becomes that location's own kernel.
- Convolve the input with these kernels, using a dedicated one at every location.
Channels are divided into groups, each computing its own affinity and kernel, shared within that group. In OverLoCK's dynamic blocks, comes from the feature map and from the context prior. This is where Overview-Net's global understanding enters the kernels.
Step 4 is the key. Every kernel weight is computed from the relationship between one location and 49 centers across the image, so it contains global information. Yet the convolution still operates within a local neighborhood, preserving local inductive bias. Panel (b) illustrates this: the 3×3 grid stays in place, while region centers in the four corners determine its weights.
Write a minimal version to check this. Change a pixel at the upper left and see whether output at the lower right changes:
import torch
import torch.nn.functional as F
torch.manual_seed(0)
C, H, W = 8, 16, 16
S, K, G = 4, 3, 2 # 4×4 region centers, 3×3 dynamic kernels, 2 channel groups
Wq = torch.nn.Conv2d(C, C, 1)
Wk = torch.nn.Conv2d(C, C, 1)
Wd = torch.nn.Linear(S * S, K * K) # Map 16 similarities to 9 kernel weights
def contmix(x):
q = Wq(x[None])[0].flatten(1) # C × HW: queries at each location
k = Wk(F.adaptive_avg_pool2d(x[None], S))[0].flatten(1) # C × S²: region centers
out = []
for qg, kg, xg in zip(q.chunk(G), k.chunk(G), x.chunk(G)):
A = qg.T @ kg # HW × S²: similarity of each location to each center
D = Wd(A).softmax(-1) # HW × K²: a dedicated 3×3 kernel at each location
patches = F.unfold(xg[None], K, padding=K // 2)[0] # 3×3 neighbors around each location
patches = patches.view(C // G, K * K, H * W)
out.append((patches * D.T[None]).sum(1).view(C // G, H, W))
return torch.cat(out)
static = torch.nn.Conv2d(C, C, K, padding=K // 2, groups=C) # Ordinary 3×3 depthwise convolution
x = torch.randn(C, H, W)
x2 = x.clone()
x2[:, 0, 0] += 5.0 # Change only the upper-left pixel
with torch.no_grad():
for name, f in [("3×3 depthwise convolution", lambda t: static(t[None])[0]), ("ContMix (3×3)", contmix)]:
diff = (f(x2) - f(x))[:, 12, 12].abs().max().item() # Measure the output change at lower-right position (12, 12)
print(f"{name}: change in lower-right output {diff:.4f}")
3×3 depthwise convolution: change in lower-right output 0.0000
ContMix (3×3): change in lower-right output 0.0274
Both use 3×3 kernels, yet ordinary convolution cannot see the change 12 positions away; ContMix can. The upper-left pixel changes the first region center, changing every location's affinities and therefore the lower-right location's kernel.
The actual module is more complex. The official code includes a value projection and relative position bias. Half the groups use large kernels; the other half use small 5×5 kernels, with a Dilated RepConv branch in parallel. If the neighborhood-attention package NATTEN is installed, the dynamic-kernel application directly uses its CUDA operator: the weighted sum is identical to neighborhood attention's. The difference is where the weights come from. Neighborhood attention multiplies queries by neighboring keys; ContMix multiplies queries by region centers across the image.
Four Sizes
The four variants are XT, T, S, and B. T has 33M parameters and 5.5 GFLOPs; B has 95M and 16.7 GFLOPs. Base-Net's three stages use kernels 17, 15, and 13; Overview-Net uses 7; Focus-Net uses 13 and 7.
Discussion
ImageNet
Training on ImageNet-1K follows DeiT for 300 epochs. Throughput is measured on one L40S, at batch size 128 with 224×224 inputs:
| Model | Parameters | FLOPs | Throughput (images/s) | top-1 |
|---|---|---|---|---|
| ConvNeXt-T | 29M | 4.5G | 1507 | 82.1% |
| UniRepLKNet-T | 31M | 4.9G | 1094 | 83.2% |
| InternImage-T | 30M | 5.0G | 1084 | 83.5% |
| MogaNet-S | 25M | 5.0G | 766 | 83.4% |
| OverLoCK-T | 33M | 5.5G | 810 | 84.2% |
| ConvNeXt-S | 50M | 8.7G | 926 | 83.1% |
| ConvNeXt-B | 89M | 15.4G | 608 | 83.8% |
| OverLoCK-S | 56M | 9.7G | 480 | 84.8% |
| OverLoCK-B | 95M | 16.7G | 306 | 85.1% |
The abstract emphasizes that OverLoCK-T beats ConvNeXt-B with one third the parameters and FLOPs, and higher throughput, 810 versus 608. That is true.
Remember the T label, though. ConvNeXt-T handles 1507 images per second, while OverLoCK-T manages a little over half that. Similar-speed comparisons are fairer: ConvNeXt-S runs at 926 images/s and 83.1%; OverLoCK-T is a little over 10% slower and gains 1.1 percentage points.
Detection and Segmentation
Downstream gaps are larger than classification gaps. On COCO with Mask R-CNN trained for 12 epochs, OverLoCK-T gets 48.3 box AP, against 47.2 for InternImage-T and 44.2 for ConvNeXt-T. On ADE20K with UperNet, OverLoCK-T reaches 50.3 single-scale mIoU, against 48.6 for UniRepLKNet-T and 46.0 for ConvNeXt-T.
Detection and segmentation use much higher input resolutions than classification. ContMix keeps a fixed 7×7 set of region centers covering the full image at any size. This is where it pulls ahead of fixed-size large kernels.
Add One Thing at a Time
The authors start from a purely static convolutional network and add one component at a time. These experiments train only 120 epochs on ImageNet and 80K steps on ADE20K, so the values cannot be directly compared with the main tables:
| Model | FLOPs | top-1 | mIoU |
|---|---|---|---|
| Static baseline | 2.6G | 78.5% | 41.1 |
| Add recurrent feedback | 4.4G | 76.8% | 39.5 |
| Switch to three DDS subnetworks | 2.6G | 79.0% | 41.6 |
| Use ContMix dynamic blocks in Focus-Net | 2.6G | 80.0% | 42.9 |
| Add Overview-Net auxiliary loss | 2.6G | 80.2% | 43.1 |
| Reintroduce the original context prior at every block | 2.6G | 80.4% | 43.4 |
| Add gating (OverLoCK-XT) | 2.6G | 80.8% | 43.8 |
A few findings are clear.
- Recurrent feedback fails here: following AbsViT and feeding stage 4 back into stage 3 adds 70% compute and lowers accuracy.
- DDS helps at matched compute: top-1 and mIoU each gain 0.5, adding top-down guidance without another pass.
- ContMix is the largest step: replacing static blocks with dynamic ones adds 1.0 top-1 and 1.3 mIoU.
The appendix adds another comparison. Remove Overview-Net and use a standard four-stage pyramid, keeping the blocks unchanged: top-1 falls from 80.7% to 79.2% and mIoU from 43.8 to 41.9. That is the contribution of the top-down structure itself.
Against Other Dynamic Operators
To compare operators fairly, the authors build a separate Swin-shaped network and change only the token mixer, using 7×7 kernels or windows throughout:
| Operator | top-1 | ADE20K mIoU |
|---|---|---|
| DyConv | 77.5% | 36.3 |
| Involution | 78.3% | 37.5 |
| Shifted-window attention (Swin) | 78.4% | 37.4 |
| Neighborhood attention (NATTEN) | 78.6% | 38.1 |
| DCNv3 | 78.7% | 37.5 |
| ContMix | 78.8% | 39.0 |
Classification is close, with ContMix just 0.1 ahead of second place. At higher segmentation resolution, its lead ranges from 0.9 to 2.7.
An aside on softmax: ContMix uses it when generating kernels. Removing it in an appendix ablation changes top-1 from 80.8% to 80.5% and mIoU from 43.8 to 43.5, a small effect. In InternImage, replacing softmax with sigmoid destabilizes training; DCNv4 converges faster after removing softmax. Softmax carries very different weight across these dynamic operators.
Using It in Practice
The official code has several external dependencies. NATTEN is recommended for dynamic convolution; it runs without it, more slowly. Large kernels can use UniRepLKNet's iGEMM implementation. Detection and segmentation also need mmcv. Many GitHub issues concern installation.
The accelerated large-kernel implementation also depends on batch size. A user reports training becoming three times slower after enabling use_gemm. The author replies that the implementation has no advantage at small batches; disable it there, with no effect on accuracy. Another user training COCO on 4 A100s at total batch size 8 estimates 41 days. The authors take two or three days on 8 H800s and recommend larger batches and gradient checkpointing.
Conclusion
OverLoCK's two ideas can be considered separately. DDS uses a lightweight path to see the whole image, then sends that understanding to every later block. ContMix determines each location's kernel from its relationship to global region centers, while keeping convolution local. The former gains 0.5 at matched compute; the latter gains 1.0 or more, with larger gaps in detection and segmentation.
“See the big picture first” sounds like the headline idea, yet the ablations show that the largest contribution comes from ContMix putting global information into kernel weights. The top-down structure supplies that information; ContMix gives it somewhere to go.
To use it, prepare the environment first: NATTEN, the large-kernel CUDA extension, and mmcv. At small batch sizes, remember to turn use_gemm off, or it will only slow things down.