Back to paper library
Paper notesarXiv 2025CVPR 2025

OverLoCK

See the Big Picture First

Original paper

OverLoCK: An Overview-first-Look-Closely-next ConvNet with Context-Mixing Dynamic Kernels

Paper authors

Meng Lou · Yizhou Yu

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}
}
On this page

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

Figure 3 from the paper: Base-Net at the bottom takes a photo of a capybara with an orange on its head through three Embedding and Basic Block groups, reducing resolution from H/4 to H/16. Overview-Net at the upper left follows Base-Net with one Embedding and several Basic Blocks, reducing directly to H/32 and producing a green cube labeled Context Prior. Focus-Net at the upper right also receives Base-Net's output and passes through Dynamic Block, Embedding, and Dynamic Block, from H/16 to H/32. Red context guidance flow arrows deliver the context prior to each Focus-Net Dynamic Block.
Figure 3 from Lou and Yu, taken from PDF page 4, CC BY 4.0. The original caption is omitted.

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 H/16×W/16H/16\times W/16 and producing intermediate features.
  • Overview-Net: a lightweight path that takes Base-Net's output straight down to H/32H/32, 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 H/4H/4 and H/8H/8 features with Focus-Net's H/16H/16 and H/32H/32.

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: Pi+1=αPi′+βP0P_{i+1}=\alpha P'_i+\beta P_0, with learnable scalars α\alpha and β\beta.

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).

Figure 5 from the paper: (a) the ContMix pipeline. Input X passes through a 1×1 convolution and reshaping to form Q. Another path uses adaptive average pooling and a 1×1 convolution to form K. Transposed Q multiplies K, producing a G×HW×S² affinity matrix A, with one row outlined in yellow dashes. That row passes through linear layer W_d and softmax to become a G×1×K² vector, reshaped into a K×K globally aware kernel, then multiplied elementwise with input and summed. A parallel K×K RepConv branch is added to the output. (b) a capybara in a hot spring divided into four regions, each with a colored star at its center. A central 3×3 grid has nine blue globally aware weights, with dashed red lines from the four region centers to the grid center.
Figure 5 from Lou and Yu, taken from PDF page 5, CC BY 4.0. The original caption is omitted.

Walk through panel (a):

  1. A 1×1 convolution maps input XX to QQ, giving one query vector at each of HWHW locations.
  2. A separate path adaptively average-pools XX into S×SS\times S region centers, then applies a 1×1 convolution to obtain KK. The paper uses S=7S=7, giving 49 centers.
  3. Multiplying QQ and KK gives an affinity matrix AA of size HW×S2HW\times S^2. Row ii records how similar location ii is to each of the 49 region centers.
  4. Linear layer WdW_d maps each row from 49 numbers to K2K^2, followed by softmax. This becomes that location's own K×KK\times K kernel.
  5. Convolve the input with these kernels, using a dedicated one at every location.

Channels are divided into GG groups, each computing its own affinity and kernel, shared within that group. In OverLoCK's dynamic blocks, QQ comes from the feature map and KK 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 K×KK\times K 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:

Python
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}")
Text
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:

Table: selected rows from the paper's Table 2 and appendix Table I.
ModelParametersFLOPsThroughput (images/s)top-1
ConvNeXt-T29M4.5G150782.1%
UniRepLKNet-T31M4.9G109483.2%
InternImage-T30M5.0G108483.5%
MogaNet-S25M5.0G76683.4%
OverLoCK-T33M5.5G81084.2%
ConvNeXt-S50M8.7G92683.1%
ConvNeXt-B89M15.4G60883.8%
OverLoCK-S56M9.7G48084.8%
OverLoCK-B95M16.7G30685.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:

Table: selected rows from the paper's Table 6.
ModelFLOPstop-1mIoU
Static baseline2.6G78.5%41.1
Add recurrent feedback4.4G76.8%39.5
Switch to three DDS subnetworks2.6G79.0%41.6
Use ContMix dynamic blocks in Focus-Net2.6G80.0%42.9
Add Overview-Net auxiliary loss2.6G80.2%43.1
Reintroduce the original context prior at every block2.6G80.4%43.4
Add gating (OverLoCK-XT)2.6G80.8%43.8

A few findings are clear.

  1. Recurrent feedback fails here: following AbsViT and feeding stage 4 back into stage 3 adds 70% compute and lowers accuracy.
  2. DDS helps at matched compute: top-1 and mIoU each gain 0.5, adding top-down guidance without another pass.
  3. 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:

Table: selected rows from the paper's Table 7.
Operatortop-1ADE20K mIoU
DyConv77.5%36.3
Involution78.3%37.5
Shifted-window attention (Swin)78.4%37.4
Neighborhood attention (NATTEN)78.6%38.1
DCNv378.7%37.5
ContMix78.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.