Wang, Dai, Chen, Huang, Li, Zhu, Hu, Lu, Lu, Li, Wang, Qiao (Shanghai AI Lab / Tsinghua / SenseTime) — CVPR 2023

InternImage: Deformable Convolutions at Scale

A convolution-based vision foundation model that matches and beats large ViTs — by replacing the rigid 3×3 kernel with DCNv3, a learnable operator that samples where the content is and weights what it finds. Scaled to ~1B parameters, it set new records on COCO detection, ADE20K segmentation, and Places365.

Prerequisites: Convolution basics + Softmax + Bilinear interpolation (we re-derive it). That's it.
10
Chapters
9+
Simulations
2
Code Labs

Chapter 0: The Rigid-Kernel Problem

You're building a detector. In the image is a bicycle, photographed from the side. A bicycle is mostly empty space — two thin wheel rims, a frame, handlebars — wrapped around a large rectangular hole. To recognize "wheel," a neuron must gather evidence from a thin curved ring of pixels. To recognize "bicycle," a neuron higher up must connect the front wheel to the back wheel, which might be 200 pixels apart.

A standard 3×3 convolution cannot do either gracefully. Its receptive field is a fixed 3×3 grid of adjacent pixels. It samples the same nine offsets — (-1,-1), (-1,0), … (1,1) — at every spatial location, regardless of what the image contains. Over a thin curved rim, most of those nine samples land on background. To connect two wheels 200 pixels apart, you must stack dozens of 3×3 layers until the receptive field finally grows large enough — and even then the connection is indirect, diluted through many intermediate features.

This is the central tension the paper opens with. In 2020–2022, Vision Transformers (ViTs) had pulled ahead of CNNs on large-scale recognition. The community's explanation was that ViTs enjoy two properties convolutions lack:

Long-range dependence
Self-attention connects any patch to any other patch in one step (path length O(1)). A 3×3 conv only sees its immediate neighbors.
&
Adaptive spatial aggregation
Attention weights are computed from the input — they change per image. A conv kernel is a fixed weight tensor, identical for every image and every location.

InternImage's thesis is a direct rebuttal: you do not need self-attention to get those two properties. A convolution can have both — if you make the sampling locations learnable (long range) and the aggregation weights input-dependent (adaptive). The operator that does this is DCNv3 (Deformable Convolution v3), and an entire foundation-model backbone built from it is InternImage.

Rigid grid vs. content-following samples

Left: a standard 3×3 conv samples the same fixed grid everywhere — over a thin diagonal edge, most taps hit background. Right: a deformable conv can move its taps onto the structure. Drag the slider to bend the sampling pattern toward the edge and watch how many taps land on signal vs. background.

Deform toward edge 0.00
Property3×3 ConvSelf-Attention (ViT)DCNv3
Receptive fieldFixed 3×3, grows only by depthGlobal from layer 1Long-range, learned per location
Sampling locationsFixed integer gridAll positions (dense)Learned fractional offsets
Aggregation weightsFixed kernel (input-independent)Input-dependent (Q·K softmax)Input-dependent modulation
Cost in tokensO(N) — linearO(N²) — quadraticO(N) — linear
Inductive biasStrong locality & translationWeak (learned from data)Locality + learned flexibility
The bet, in one line: Keep convolution's two superpowers — linear O(N) cost and a built-in locality prior — but inject attention's two superpowers — long-range reach and input-dependent weighting. The result is a sparse operator: each output reads only K = 3×3 = 9 sampled points (not all N positions like attention), yet those 9 points can be anywhere and are weighted by content. That is the whole paper in a sentence; the next nine chapters make it precise.

Why does this matter beyond beating ViT on a leaderboard? Because detection and segmentation backbones are deployed at enormous scale, and the O(N²) memory of attention is brutal at high resolution. A 2048×2048 input has >4 million tokens at stride 4; the full attention matrix is unthinkable. A linear-cost operator that still captures long-range structure is the practical sweet spot — and InternImage demonstrates it scales cleanly to ~1 billion parameters (InternImage-H), reaching 65.4 AP on COCO test-dev detection, 62.9 mIoU on ADE20K segmentation, and 61.2% top-1 on Places365 at the time of publication.

Let's build the operator from the ground up, starting with where ordinary convolution comes from.

According to InternImage, which two properties did ViTs have that ordinary convolutions lacked — and how does DCNv3 supply both?

Chapter 1: From Convolution to Deformable

Write a standard convolution as a sum over a fixed set of offsets. For an output location p0 and a 3×3 kernel, define the grid R = {(-1,-1), (-1,0), …, (1,1)} — nine offsets. With kernel weights wk and input feature map x:

y(p0) = ∑k=1K wk · x(p0 + pk)

Here K = 9, pk ranges over R, and wk is a learned weight (one per kernel tap, per output channel). Two things about this equation are frozen: the offsets pk are integers fixed at every location, and the weights wk are the same for every image.

Deformable convolution v1 (Dai et al., 2017) unfroze the first frozen thing: it added a learned offset Δpk to each tap, predicted from the input by a small offset-network:

y(p0) = ∑k=1K wk · x(p0 + pk + Δpk)

Now each tap can move. Because Δpk is generally fractional, x(·) at a non-integer location is read by bilinear interpolation (Chapter 2). DCNv2 (Zhu et al., 2019) unfroze a second thing by adding a per-tap scalar modulation mk ∈ [0,1], letting the operator turn a tap down or off:

y(p0) = ∑k=1K wk · mk · x(p0 + pk + Δpk)

InternImage's DCNv3 makes three more changes — and the cleanest way to see them is to notice what is still wrong with DCNv2 at scale. We'll preview them here and derive each carefully:

1. Separate w into depthwise + pointwise
DCNv2's dense wk couples every input channel to every output channel per tap — cost explodes. DCNv3 borrows from separable convolution: a shared depthwise term handles spatial aggregation, a pointwise 1×1 handles channels.
2. Multi-group offsets & modulation
Split channels into G groups; each group gets its own offsets and its own modulation. Like multi-head attention, different groups learn different sampling patterns (one tracks edges, another texture).
3. Softmax-normalize the modulation
DCNv2's mk is an independent sigmoid in [0,1] per tap, which is unstable when scaled to billions of parameters. DCNv3 normalizes the K modulation values with a softmax so they sum to 1 — a proper convex aggregation, exactly like attention weights.

A 1×1 worked example: why the offset matters

Take a tiny 1-D signal x = [0, 0, 9, 0, 0] (a spike at index 2), and a single output at p0 = 0 with one tap (K=1, w=1). A rigid conv with offset 0 reads x(0) = 0 — it completely misses the spike. Give the tap a learned offset Δp = +2: it now reads x(0 + 0 + 2) = x(2) = 9. The same weight, the same compute — but by moving the sample, the operator captured the signal a rigid kernel was blind to. That single degree of freedom is the entire idea; the rest is bookkeeping for fractional offsets, channels, and stability.

v1 → v2 → v3: what each version unfroze

Click through the four operators. Watch which terms are fixed (gray) and which are learned/input-dependent (colored), and how the 3×3 tap cloud changes from a rigid grid to a content-shaped, weighted constellation.

Standard Conv
Common misconception: "Deformable conv learns a different kernel shape and freezes it." No — the offsets Δpk and modulations mk are predicted from the input by a sub-network at every forward pass. They are not parameters baked in at training time; they are activations that depend on the current image at the current location. That is precisely what "adaptive spatial aggregation" means and why it mimics attention rather than a fancier static filter.
In y(p₀) = ∑k wk mk x(p₀ + pk + Δpk), which quantities are input-dependent (recomputed per image/location) rather than fixed parameters?

Chapter 2: Deformable Sampling & Bilinear Reads

An offset Δpk is a real-valued 2-vector, so p0 + pk + Δpk almost never lands on an integer pixel. We need to read x at a fractional location, and we need it differentiable so gradients can flow back to the offset network. The answer is bilinear interpolation, and deriving it by hand is the most important skill in this whole paper.

Let the target location be p = (px, py), fractional. It sits inside a unit square whose four integer corners are the floor and ceil of each coordinate. Write x0 = ⌊px⌋, y0 = ⌊py⌋, x1 = x0+1, y1 = y0+1, and the fractional parts a = px − x0, b = py − y0 (both in [0,1)). The four corner values are the actual stored pixels. Bilinear interpolation is a weighted average where each corner's weight is the area of the opposite sub-rectangle:

x(p) = (1−a)(1−b)·x(x0,y0) + a(1−b)·x(x1,y0) + (1−a)b·x(x0,y1) + ab·x(x1,y1)

Read it as: the closer p is to a corner (small distance → the opposite area is large), the more that corner contributes. The four weights are non-negative and sum to 1 — (1−a)(1−b) + a(1−b) + (1−a)b + ab = (1−a+a)(1−b+b) = 1. It is a convex combination, so x(p) always lies in the convex hull of the four corners (no overshoot).

Fully worked numerical example

Suppose the four corners of the unit cell are

x(0,0)=10,   x(1,0)=20,   x(0,1)=30,   x(1,1)=40

and we want the value at p = (0.25, 0.75). Then a = 0.25, b = 0.75, so 1−a = 0.75, 1−b = 0.25. Plug in term by term:

Sum = 1.875 + 1.25 + 16.875 + 7.5 = 27.5. Sanity check: p is near the top-left region (high y, low x), so the value should lean toward x(0,1)=30 and x(1,1)=40 — and 27.5 does. The weights summed to 0.1875+0.0625+0.5625+0.1875 = 1.0, as required.

Why bilinear, and why it is differentiable

Each corner weight is a smooth (piecewise-linear) function of a and b, hence of px and py, hence of the predicted offset Δp. So ∂x(p)/∂Δp exists almost everywhere — the offset network receives a gradient that says "shift the sample this way to increase the loss-reducing signal." This is the hinge that lets the network learn where to look by gradient descent. A nearest-neighbor read would be piecewise-constant (zero gradient everywhere), and the offsets could never train.

Boundary handling: if a sampled point lands outside the feature map, the standard convention (and the DCN CUDA kernel) treats out-of-bounds corners as zero. The interpolation formula is unchanged; missing corners simply contribute 0. This is why an offset that wanders off the image edge produces a faded (partial) value rather than crashing.

Bilinear sampling, by area weights

Drag the sample point inside the unit cell. The four corner contributions update live; each corner's bar is the area of the opposite rectangle times that corner's value. The interpolated read is the sum — always inside [min, max] of the corners.

a (x-frac) 0.25 b (y-frac) 0.75
python
# Bilinear read of feature map x at one fractional point p=(px,py)
import numpy as np

def bilinear(x, px, py):
    H, W = x.shape
    x0, y0 = int(np.floor(px)), int(np.floor(py))
    x1, y1 = x0 + 1, y0 + 1
    a, b = px - x0, py - y0                # fractional parts
    def get(yy, xx):                        # zero-pad out of bounds
        if 0 <= yy < H and 0 <= xx < W: return x[yy, xx]
        return 0.0
    return ((1-a)*(1-b)*get(y0,x0) + a*(1-b)*get(y0,x1)
          + (1-a)*b*get(y1,x0) + a*b*get(y1,x1))

x = np.array([[10,20],[30,40]], dtype=float)
print(bilinear(x, 0.25, 0.75))   # 27.5  (matches the hand calc)
Common misconception: "The four bilinear weights depend on which corner values are largest." They do not. The weights (1−a)(1−b), a(1−b), (1−a)b, ab depend only on the fractional position (a, b), never on the pixel values. The position decides the blend; the pixels decide the result. Confusing the two is the classic off-by-corner bug.
Why must deformable convolution use bilinear interpolation rather than rounding the offset to the nearest integer pixel?

Chapter 3: The DCNv3 Operator

Now we assemble the full DCNv3 equation. With G groups (we cover groups in Chapter 4; here read G=1 for clarity), K sampling points, depthwise weights and softmax-normalized modulations, the operator computing one output location p0 is:

y(p0) = ∑g=1Gk=1K wg · mgk · xg(p0 + pk + Δpgk)

Compare this to DCNv2 (Chapter 1) and read off the three deliberate differences DCNv3 introduces. Each is a specific engineering decision with a reason:

TermDCNv2DCNv3Why the change
Weight wDense wk of shape [Cin, Cout] per tapDepthwise wg (shared across taps within a group) + a separate pointwise 1×1Decouples spatial mixing (depthwise) from channel mixing (pointwise) — the separable-conv trick — cutting params & FLOPs so it scales to 1B
Offsets ΔpOne field, all channels sharePer-group field ΔpgkDifferent groups specialize in different sampling geometries (like attention heads)
Modulation mPer-tap sigmoid in [0,1], independentPer-group softmax over the K taps: ∑k mgk = 1Bounds the aggregation as a convex combination → stable training at scale; no exploding magnitudes
The softmax modulation is the quiet hero. In DCNv2 each mk is an independent sigmoid; nothing stops all of them from saturating to 1, which lets the summed response grow without bound as you scale depth and width — a known cause of training instability. DCNv3 normalizes the K modulations with a softmax, so they form a probability distribution over the K taps that always sums to 1. Now the operator is doing exactly what attention does: a convex, input-dependent weighted average of sampled values. This single change is what lets DCN scale to a billion parameters without diverging.

Worked example: one DCNv3 output with K=3

Single group, K=3 taps. Suppose the three taps (after offsets & bilinear reads) returned sampled values v = [2, 8, 4], the depthwise weight w = 1, and the modulation network produced pre-softmax logits z = [0, 2, 1]. First, softmax the logits:

Then the output is w · ∑k mk vk = 1 · (0.090·2 + 0.665·8 + 0.245·4) = 0.180 + 5.320 + 0.980 = 6.480. Because the modulations sum to 1, the output is a weighted average of the sampled values — it always lies in [min v, max v] = [2, 8]. The tap that the network deemed most relevant (the one reading 8, logit 2) dominates, exactly as a high attention weight would.

Data flow with real tensor shapes

Concretely, for an input feature map of shape [B, H, W, C] (channels-last, as the official kernel uses), a DCNv3 layer with G groups and K=9 produces, from a small projection of the input:

Offset field Δp
Shape [B, H, W, G×K×2] — an (x,y) offset per group, per tap, per location
Modulation m (pre-softmax)
Shape [B, H, W, G×K] — softmax over the K axis within each group
Sample + aggregate
Bilinearly read the K points per group from the value features [B,H,W,C], weight by m, sum → output [B, H, W, C]

The output spatial size equals the input (stride-1 DCNv3 inside a block; downsampling happens in separate stem/downsample layers). The operator is O(H·W·C·K) — linear in the number of pixels, because each output reads only K=9 points regardless of image size. That is the decisive contrast with self-attention's O((HW)²).

DCNv3 forward, step by step

Walk the four stages on one output location: (1) predict offsets & logits, (2) bend the K taps and bilinearly sample, (3) softmax the modulations, (4) weighted sum. Click "Next Step" and watch the tap cloud, the modulation bars, and the running output.

Step 0/4 — Ready
python
# One DCNv3 output location, single group, NumPy (no autograd, for clarity)
import numpy as np

def softmax(z):
    e = np.exp(z - z.max()); return e / e.sum()

# Suppose the sub-network already gave us, for this location:
sampled = np.array([2., 8., 4.])   # K=3 bilinear reads at bent taps
logits  = np.array([0., 2., 1.])   # pre-softmax modulation logits
w       = 1.0                        # depthwise weight (shared over taps)

m = softmax(logits)               # [0.090, 0.665, 0.245], sums to 1
y = w * np.dot(m, sampled)       # convex combo  ->  6.48
print(round(float(y), 3))           # 6.48
Common misconception: "DCNv3 replaces convolution with attention." It does not compute Q·K similarities and it does not look at all positions. It reads a sparse set of K=9 learned points and weights them by a content-predicted softmax. It keeps O(N) cost and the locality prior of convolution; it borrows only the spirit of attention (input-dependent, normalized weighting). That distinction is exactly why it scales to high resolution where dense attention cannot.
What does normalizing the K modulation values with a softmax (instead of independent sigmoids) buy DCNv3?

Chapter 4: Groups & Weight Sharing

A single offset field forces every channel to sample the same K locations. But different channels encode different things — one channel might respond to vertical edges, another to skin texture, another to large flat regions. They should be allowed to look in different places. DCNv3 solves this exactly the way multi-head attention does: split the channels into G groups, and give each group its own offsets and its own modulations.

Channels C → G groups of C/G channels each. Group g has its own Δpgk and mgk.

Within a group, all C/G channels share that group's K offsets and K modulations (this is the weight sharing). Across groups, the patterns differ. The parallel is exact:

ConceptMulti-Head AttentionDCNv3 Groups
Splitting unith headsG groups
Per-unit specializationEach head: own Q/K/V projectionEach group: own offsets & modulation
What is shared inside a unitOne attention pattern over its subspaceOne sampling pattern over its channels
RecombinationConcat heads → WOConcat groups → pointwise 1×1

Why share weights within a group at all?

Parameter economy and a useful prior. If every channel had its own offset field, the offset sub-network would output C×K×2 numbers per location — enormous and prone to overfitting. Sharing a group's offsets across its C/G channels assumes those channels want similar spatial structure (a reasonable prior, since grouped channels tend to co-activate), and it shrinks the offset head to G×K×2 outputs. G is a small knob: the paper finds more groups help, because they add sampling diversity at modest cost — the same reason multi-head beats single-head attention.

Worked example: counting offset outputs

Take C=64 channels, K=9 taps. With G=1 the offset head must emit 1×9×2 = 18 offset numbers and 1×9 = 9 modulation logits per location — one sampling pattern shared by all 64 channels. With G=4 it emits 4×9×2 = 72 offsets and 4×9 = 36 logits — four independent patterns, each shared by 16 channels. The cost grew 4× on the tiny offset head (negligible vs. the value path), but the model gained four distinct ways to look around. That is a great trade, which is why InternImage configurations use multiple groups and increase G with model size.

G sampling patterns, one per group

Each colored constellation is one group's K=9 learned taps, sampling its own slice of channels. Drag the slider to add groups; notice how more groups cover more of the object (edges, interior, far context) — exactly the diversity multi-head attention provides.

Groups G 3
Why this is "convolution," not "attention," despite the parallels: the groups still aggregate a fixed-size sparse neighborhood (K points) with a locality prior baked in by the base grid pk. Attention has no such prior — it must learn locality from data, which is why ViTs are data-hungry. DCNv3 keeps the prior and adds flexibility, which is why InternImage trains efficiently and beats ViTs especially in the data-and-compute regime of detection/segmentation.
Common misconception: "Groups mean the K taps are split into G smaller kernels." No — every group has its own complete set of K=9 taps. Groups partition the channels, not the taps. Each group runs a full K-tap deformable sample over its channel slice; the G results are concatenated back to C channels.
What is the role of the G groups in DCNv3, and what is shared within a group?

Chapter 5: The Basic Block & Stem

DCNv3 is the operator; InternImage is the network built around it. The design deliberately mirrors a modern Transformer block (like ViT/Swin) but with DCNv3 in the mixing slot — so we get a fair, apples-to-apples comparison where only the token-mixer differs.

The basic block

Each InternImage block is a residual stack with two sub-layers, each preceded by LayerNorm (pre-norm), exactly like a Transformer:

x → LN → DCNv3 → + x
Token mixer: the DCNv3 operator does adaptive spatial aggregation (the "attention" slot)
x → LN → MLP (FFN) → + x
Channel mixer: a two-layer pointwise MLP with GELU (the standard FFN), expansion ratio ~4

Both sub-layers use residual connections. The first replaces self-attention with DCNv3; the second is the ordinary position-wise FFN found in every Transformer. This is the key structural claim: swap the mixer, keep everything else — so any performance difference is attributable to DCNv3 vs. attention, not to other architectural tricks.

The stem and downsampling (hierarchical, 4 stages)

Like Swin and ConvNeXt, InternImage is hierarchical: it produces feature maps at 4 resolutions (strides 4, 8, 16, 32) so it can serve as a drop-in backbone for FPN-based detectors and segmentation heads, which need multi-scale features. The pipeline:

Stem
Two stride-2 3×3 convs (each + LN + GELU): image [H,W,3][H/4, W/4, C]. A patchify-style downsample to stride 4.
4 stages of blocks
Stage i = a stack of basic blocks at channel width Ci. Between stages, a stride-2 3×3 downsample conv halves H,W and (typically) doubles C.
Multi-scale output
Feature maps at strides {4, 8, 16, 32} feed an FPN / Mask2Former / UperNet head for detection & segmentation.

Worked example: tracing one image through the stem

Input image 224×224×3. Stem conv #1 (stride 2, pad 1, 3×3) → 112×112×(C/2). Stem conv #2 (stride 2) → 56×56×C. That is stride 4 (224/56 = 4), matching the standard backbone convention — a 56×56 = 3136-token grid at width C entering stage 1. After stage 1's downsample: 28×28 (stride 8). Stage 2: 14×14 (stride 16). Stage 3: 7×7 (stride 32). The four stage outputs are precisely the pyramid levels P2–P5 that an FPN expects. No special head surgery is needed — InternImage plugs into the existing detection/segmentation ecosystem unchanged.

InternImage block & 4-stage pyramid

Top: the residual block (LN → DCNv3 → add, LN → MLP → add). Bottom: the hierarchical stem & 4 stages with resolutions and strides. Click "Highlight" to step through and read the tensor shape at each stage.

Stem: [H/4, W/4, C]
Common misconception: "InternImage is a plain CNN with a clever filter, so it isn't hierarchical or Transformer-like." It is fully hierarchical (4 stages, strides 4–32) and adopts the Transformer block layout wholesale — pre-LN, residual mixer + residual FFN, GELU. The only thing it changes is the mixer: DCNv3 instead of self-attention. That controlled swap is the experimental backbone of the whole paper.
How is the InternImage basic block structured relative to a standard Transformer block?

Chapter 6: Scaling Deformable Conv to 1B

Designing one block is easy; making a family of models that scales predictably from tens of millions to ~1 billion parameters is the hard part, and historically the part CNNs lost to ViTs. InternImage scales along two axes with explicit rules so the family stays well-behaved.

Two scaling rules

Depth (number of blocks per stage) and width (channels C) are grown together, with the group count G tied to width so each group keeps a sensible channel slice. The InternImage variants span a wide range:

VariantChannels C (stage 1)ParamsRole
InternImage-T (Tiny)64~30MResNet-50 / Swin-T tier
InternImage-S (Small)80~50MSwin-S tier
InternImage-B (Base)112~97MSwin-B tier
InternImage-L (Large)160~220MLarge ViT tier
InternImage-XL192~335MBeyond ConvNeXt-XL
InternImage-H (Huge)320~1.08BFoundation-scale, SOTA backbone

What breaks at a billion params, and the two fixes

Two specific failure modes appear only at extreme scale, and InternImage-H addresses each:

Instability of the modulation
Already fixed structurally: the softmax normalization of mgk (Chapter 3) keeps the aggregation bounded, which is what makes 1B-scale training converge where DCNv2's independent sigmoids would diverge.
&
Co-adaptation & pretraining hunger
For InternImage-H the authors share/decouple the offset & modulation weights across neighboring layers and pretrain at scale on a large curated dataset, so the billion-param backbone has enough signal to fill its capacity.

The pretraining recipe (briefly)

InternImage-H is not trained from scratch on the target task. It is pretrained on large-scale image data (the authors assemble a sizable classification corpus, ~400M+ images in their largest setting) and then fine-tuned on detection (COCO) and segmentation (ADE20K). This is the standard foundation-model playbook — pretrain broad, fine-tune narrow — and is part of why InternImage is framed as a vision foundation model, not just an architecture. The linear O(N) cost is what makes pretraining at high resolution on hundreds of millions of images affordable; an O(N²) attention backbone at the same resolution would be far costlier.

The scaling thesis validated: the headline empirical result is that DCNv3-based InternImage scales as smoothly as — and at the top end better than — large ViTs, while keeping linear cost. This directly refutes the prior belief that CNNs plateau and only attention scales. The operator-level change (learnable, normalized, grouped sampling) is what unlocked it.
Params vs. accuracy: the scaling curve

Schematic scaling: accuracy rises with parameter count and does not plateau through InternImage-H (~1B). Drag to move along the curve; the model variant and its tier read out. The curve illustrates the paper's claim that deformable-conv backbones scale like ViTs.

Model size InternImage-T
Common misconception: "Scaling DCN to 1B is just stacking more of the same block." The naive stack diverges. The enablers are specific: the softmax-normalized modulation (bounded aggregation), grouped offsets (capacity without a parameter blow-up on the value path), separable depthwise/pointwise weights (FLOP economy), and large-scale pretraining. Remove any one and the billion-parameter model trains worse or not at all.
Which design choice is most directly responsible for letting DCN-based models train stably at the ~1B-parameter scale (InternImage-H)?

Chapter 7: Results & Ablations

The paper's empirical case rests on three pillars: classification, detection, and segmentation — plus controlled ablations isolating why DCNv3 works.

Headline numbers

BenchmarkMetricInternImage resultSignificance
COCO detection (test-dev)box AP65.4 AP (InternImage-H)New SOTA at publication, surpassing the best ViT-based detectors
ADE20K segmentationmIoU62.9 mIoU (InternImage-H)New SOTA on the standard scene-parsing benchmark
Places365 classificationtop-161.2%Strong scene-recognition result for the foundation backbone
ImageNet-1K classificationtop-1competitive with / above Swin & ConvNeXt at matched sizeConfirms the operator is strong even on pure classification

The crucial comparison is matched-budget: at equal parameter count, InternImage-T/S/B beat Swin-T/S/B and ConvNeXt-T/S/B on detection and segmentation. The gains are larger on dense-prediction tasks (detection, segmentation) than on classification — which is exactly what the theory predicts, since long-range adaptive sampling matters most when you must localize objects, not just label whole images.

Ablations — isolating the mechanism

The paper removes one ingredient at a time. The qualitative findings (the ones to remember):

Effective receptive field (the visual proof)

A striking qualitative result: the effective receptive field (ERF) of InternImage is large and adaptive — it expands to cover the relevant object, not a fixed circular blob centered on the pixel. Visualizations show the sampled points clustering on the foreground object (a cat's whole body, a car's full outline) rather than spreading uniformly. This is direct evidence that the learned offsets do what the math promised: gather evidence from where the content is.

Ablation: knock out one ingredient

Toggle each DCNv3 ingredient off and watch the schematic accuracy bar drop. The largest fall comes from freezing the offsets (losing long-range adaptive sampling); softmax modulation and multiple groups each contribute meaningfully too.

All ingredients on
Reading the ablation correctly: the offsets are the headline ingredient (they supply long-range adaptive sampling, the thing ViTs were praised for). But softmax modulation and groups are what make it scale — without them the operator works at small size yet degrades or destabilizes when pushed to hundreds of millions of parameters. The paper's contribution is the combination, tuned for scale.
Common misconception: "InternImage wins because it has more parameters than the ViTs it beats." The matched-budget comparisons control for this: at equal params, InternImage outperforms Swin and ConvNeXt on dense prediction. The advantage is the operator, not the size — and the size only confirms it scales further than the CNN baselines could.
On which kind of task does InternImage show the largest advantage over equally-sized Swin/ConvNeXt, and why?

Chapter 8: DCNv3 Explorer

This is the payoff: a live, multi-control DCNv3 operator on a synthetic feature map. You control the input content, the learned offset strength, the modulation temperature, and the number of groups — and watch the sampled taps move, the modulation weights redistribute, and the aggregated output change. Everything below is computed from the actual equations of Chapters 2–4.

Interactive DCNv3 on a feature map

The grid is a feature map with a movable bright object. The colored constellations are each group's K=9 deformable taps. The bars are the (softmax) modulation weights for the selected group. Move the object, bend the offsets toward it, sharpen/soften the modulation, and add groups — the live output (top-right) is the convex-weighted aggregate of the bilinearly-sampled values.

Object X 0.65 Object Y 0.35
Offset strength 0.70 Mod. temp 1.0
Groups 3

Things to try, and what they reveal:

The whole paper, in one widget: learnable offsets buy long-range reach, softmax modulation buys bounded adaptive weighting, and groups buy diversity — all at O(N) cost, all visible as you drag. If you can predict how each slider moves the output before you move it, you understand DCNv3.

Chapter 9: Limitations & Connections

DCNv3 and InternImage are not the end of the story. Knowing where the operator strains is as important as knowing where it shines.

Limitations

Where DCNv3 sits in the lineage

DCN v1 / v2 (2017–2019)
Learnable offsets, then per-tap modulation — the seeds of adaptive sampling
Global self-attention — the long-range/adaptive properties DCNv3 set out to match without O(N²)
This paper: InternImage / DCNv3 (CVPR 2023)
A convolutional foundation model with both properties, at linear cost, scaled to ~1B
DINOv2 & modern detection (DETR, RF-DETR)
DCNv3 also underpins Deformable-DETR-style decoders; InternImage is a backbone for these heads

Related lessons on Engineermaxxing

LessonWhy read it next
Attention Is All You Need (Veanor)The operator DCNv3 was designed to rival — understand softmax aggregation here first
Vision Transformer (Veanor)The ViT baseline InternImage matches/beats; the patchify stem & hierarchy comparison
DETR (Veanor) & RF-DETR (Veanor)Deformable attention in detection decoders; where an InternImage backbone plugs in
Convolutional Networks (Gleam)The standard conv DCNv3 generalizes — receptive fields, kernels, separable convolution
Detection & Segmentation (Gleam)The dense-prediction tasks where DCNv3's adaptive sampling pays off most
Vision Transformer (Gleam)From-zero intuition for self-attention on images, the contrast point

Cheat sheet

ConceptOne-line summary
Core problemConvs lack long-range & adaptive aggregation; attention has both but costs O(N²)
DCNv3 equationy(p₀) = ∑gk wg mgk xg(p₀ + pk + Δpgk)
Deformable samplingBilinearly read the feature map at learned fractional offsets — differentiable, so offsets train
ModulationSoftmax over the K taps (per group) → bounded convex weighting; the key to stable scaling
GroupsSplit channels into G groups, each with own offsets/modulation — like multi-head attention
WeightsSeparable: depthwise (spatial) + pointwise 1×1 (channels) for FLOP economy
CostO(N) in pixels: each output reads only K=9 points, any image size
BlockTransformer layout, mixer swapped: LN→DCNv3→+, LN→MLP→+
BackboneHierarchical, 4 stages, strides 4/8/16/32 — FPN-ready for detection/segmentation
ScaleInternImage-T (~30M) → InternImage-H (~1B); scales like ViTs at linear cost
Results65.4 AP COCO, 62.9 mIoU ADE20K, 61.2% Places365 (InternImage-H, at publication)
Closing thought: InternImage is a counter-narrative. When the field had largely concluded that attention was the only path to scalable vision, this paper showed that the properties people wanted — long range and adaptivity — are not exclusive to attention. Bake them into a convolution at the operator level, normalize for stability, group for diversity, and the humble conv scales to a billion parameters and reclaims the leaderboard. The lesson generalizes: when an architecture wins, ask which property it has, not which name it goes by — then engineer that property into the operator you can afford to scale.