# Deformable ConvNets v2: More Deformable, Better Results

Modulated deformable convolutions with feature mimicking focus features on object regions

Xizhou Zhu, Han Hu, Stephen Lin, Jifeng Dai · arXiv · 2018-11-27

- **Problem** Deformable ConvNets adapt sampling to object shape, but their spatial support often extends past the object. Irrelevant background then shapes the features.
- **Method** DCNv2 places deformable convolution in conv3 to conv5 and adds a learned modulation scalar to each sampling location. It also trains with a feature mimic loss that makes RoI features resemble R-CNN features from cropped images.
- **Results** DCNv2 reaches 43.3 APbbox with ResNet-50 Faster R-CNN on COCO 2017 test-dev. DCNv1 reaches 38.4 and the regular ConvNet reaches 35.1.

## Where deformable sampling spreads past the object

Deformable ConvNets (DCNv1) let convolutional sampling points and RoI bin positions move by learned offsets, so features can follow the shape of an object. The original analysis found that sampling points for an activation unit tend to gather on the object it lies on, yet they also spread beyond the object's boundary. On COCO, a harder benchmark than PASCAL VOC, this spread is more pronounced.

The authors read this as room to learn better deformable sampling, which is the gap the new version targets.

To measure the spread directly, the analysis uses three views of a node's spatial support: effective receptive field, effective sampling locations and error-bounded saliency regions. Effective sampling locations weight each sampling point by the gradient of the node with respect to that point, so a point that barely affects the node counts as weak.

An error-bounded saliency region is the smallest image region that reproduces the node response within a fixed error bound, found by progressively masking parts of the image. Because the error bound is fixed, these regions can be compared across networks.

The regular baseline is Faster R-CNN with ResNet-50 and aligned RoIpooling, and DCNv1 replaces the three 3×3 convolutions in conv5 and the RoI layer with deformable versions. For foreground nodes, the support covers the whole object, but it also includes background that is irrelevant to detection, while background nodes reach wider context.

In the 2fc head, bins on the object foreground receive larger gradients from the classification branch, and deformable RoIpooling puts a much larger share of its bins on the object than aligned RoIpooling does. Even so, the error-bounded saliency regions of both RoI variants stay partly off the object, so content outside the RoI still affects the prediction.

## More deformable layers and a modulation scalar

The first change is structural: deformable convolution is placed in every 3×3 convolution of conv3, conv4 and conv5 in ResNet-50, which gives 12 deformable layers. DCNv1 uses only three deformable layers, all in conv5. Applying deformable layers in conv3 to conv5 gives the best trade-off between accuracy and efficiency for COCO detection, and adding conv2 brought no further improvement.

The second change gives each sampling location two learned outputs: an offset with unconstrained range and a modulation scalar in the range \[0, 1\]. A separate convolution on the same input produces 3K channels, where the first 2K are the offsets and the remaining K pass through a sigmoid to become the modulation scalars. For each output position p, the modulated deformable convolution computes the following, where w\_k is the kernel weight, p\_k the fixed grid offset, Δp\_k the learned offset, and Δm\_k the modulation scalar, with bilinear interpolation at fractional positions.

\\\[ y(p)=\\sum\_{k=1}^{K} w\_k \\cdot x(p+p\_k+\\Delta p\_k)\\cdot \\Delta m\_k \\\] Since each sample is multiplied by its modulation scalar, a scalar near zero lets a location contribute almost nothing, which gives the layer control over its spatial support beyond offsets alone.

The offset-and-modulation convolution starts with zero weights, so each offset begins at 0 and each modulation scalar at 0.5, and its learning rate is 0.1 times that of the existing layers. Modulated deformable RoIpooling uses the same idea per bin: each of K bins (for example 7×7) averages sampled grid points (for example 2×2) after an offset and a modulation scalar are applied.

A sibling branch produces these values from RoI features passed through two 1024-D fc layers and a further fc layer with 3K outputs, whose weights start at zero. The bin output is written as follows, where p\_kj is the j-th grid location of bin k and n\_k is the number of grid cells in that bin. \\\[ y(k)=\\sum\_{j=1}^{n\_k} x(p\_{kj}+\\Delta p\_k)\\cdot \\Delta m\_k / n\_k \\\]

## How much more deformation modeling adds on COCO validation

The regular baseline with aligned RoIpooling reaches 34.7 APbbox for Faster R-CNN, and the DCNv1 baseline, which replaces the last three conv5 3×3 layers and the RoI layer, reaches 38.0.

Moving deformable convolution from conv5 alone to conv3 to conv5 with deformable RoIpooling raises Faster R-CNN APbbox from 38.0 to 41.0. Switching those layers to modulated deformable convolution and modulated deformable RoIpooling reaches 41.7 APbbox, which the paper gives as 3.7 points above DCNv1. The modulation step adds gains of 0.3 to 0.7 points in APbbox and APmask.

On Mask R-CNN, the enriched model reaches 43.1 APbbox and 37.3 APmask, which are 2.7 and 2.0 points above the DCNv1 baseline.

At shorter side 800, DCNv1 reaches 38.2 APbbox, and the modulated conv3 to conv5 model with modulated deformable RoIpooling reaches 40.8.

## Training the deformable head with a feature mimic loss

R-CNN classifies cropped image content, so its features are unaffected by context outside the region of interest, which makes it a useful teacher for focused features. The modulated deformable RoIpooling could in principle set its modulation scalars to exclude redundant context, but standard Faster R-CNN training does not learn this, so the authors add guidance.

The guidance is a feature mimic loss that makes the per-RoI features of Deformable Faster R-CNN resemble R-CNN features from cropped images. The loss is applied only to positive RoIs that overlap ground-truth objects, because background RoIs may need more context to avoid false positives.

During training an extra branch crops an RoI, resizes it to 224×224 pixels and runs the backbone on it to produce 14×14 feature maps. A modulated deformable RoIpooling over the whole patch feeds two 1024-D fc layers, which give the R-CNN feature f\_RCNN(b), and this is compared with f\_FRCNN(b) from the two fc layers of the Fast R-CNN head.

The feature mimic loss is based on cosine similarity and is summed over the RoIs in the set Ω, as follows. \\\[ L\_{mimic}=\\sum\_{b\\in\\Omega}\\bigl\[1-\\cos(f\_{RCNN}(b),f\_{FRCNN}(b))\\bigr\] \\\] Each image contributes 32 positive RPN proposals to Ω, a cross-entropy classification loss runs on the R-CNN head over the same RoIs, and both new terms carry 0.1 times the weight of the original Faster R-CNN losses.

The backbone, the modulated deformable RoIpooling and the two fc layers are shared between the two branches, while the classification heads are not. At inference only the Faster R-CNN network runs, so mimicking adds no computation at test time. In Mask R-CNN the mimic loss is applied to the RoI head's classification only, not to mask estimation.

## Which RoIs the mimic loss should cover

On the modulated deformable model, Faster R-CNN APbbox is 41.7 without mimicking and 43.1 when only foreground RoIs are mimicked. For Mask R-CNN, the foreground-only setting gives 44.3 APbbox and 38.3 APmask, against 43.1 and 37.3 without mimicking. Across these settings, the authors report improvements of about 1% to 1.4% in APbbox and APmask.

Mimicking both foreground and background RoIs gives 42.1 APbbox for Faster R-CNN, and mimicking background RoIs alone leaves it at 41.7. The authors explain that background RoIs benefit from context, so a focused mimic target does not help them.

On a regular ConvNet without deformable layers, mimicking foreground RoIs gives 35.0 APbbox against 34.7 without it. The authors report almost no accuracy gain from mimicking in the regular ConvNet. They suspect this reflects a limit on what regular ConvNets can represent, since their support does not concentrate on the object foreground even with the mimic loss.

## Backbone results on COCO test-dev

These results are on COCO 2017 test-dev, which is separate from the validation split used for the ablations. The DCNv2 entries use modulated deformable layers in conv3 to conv5 and modulated deformable RoIpooling with mimic supervision, while the DCNv1 entries change only conv5 and the RoI layer.

With ResNet-50, Faster R-CNN reaches 43.3 APbbox with DCNv2, against 38.4 for DCNv1 and 35.1 for the regular ConvNet. Mask R-CNN with ResNet-50 reaches 38.4 APmask with DCNv2, against 35.5 for DCNv1 and 32.4 for the regular ConvNet.

With ResNet-101, DCNv2 reaches 44.8 APbbox for Faster R-CNN against 41.4 for DCNv1, and with ResNeXt-101 it reaches 45.3 against 41.7. The authors report DCNv2 outperforming both the regular ConvNet and DCNv1 on all tested backbones.

## ImageNet classification with deformable layers

The classification runs pretrain DCNv2, DCNv1 and a regular ConvNet on ImageNet-1K, and they follow the settings of the ResNeXt work. In DCNv1 the conv5 3×3 layers become deformable, while in DCNv2 all 3×3 layers of conv3 to conv5 become modulated deformable.

With ResNet-50, top-1 accuracy is 76.5 for the regular ConvNet, 76.6 for DCNv1 and 78.2 for DCNv2, and top-5 is 93.1, 93.2 and 94.0. The authors state that the richer deformation modeling also benefits the classification task itself.

## Pretraining the offsets and modulation scalars

The fine-tuning comparison uses ResNet-101 and tests offsets and modulation scalars either initialized to zero or pretrained on ImageNet, with PASCAL VOC, ImageNet VID and COCO as targets. The semantic segmentation experiments use DeepLab-v1, and they do not include the mimicking module.

On PASCAL VOC detection, ImageNet pre-training raises AP50 from 83.7 to 84.9 and AP70 from 72.4 to 73.5, relative to zero initialization. On PASCAL VOC semantic segmentation, mIoU rises from 76.1 to 78.3. On ImageNet VID detection the score rises from 79.2 to 80.7.

On COCO detection the same pre-training changes APbbox only from 44.8 to 44.9. The authors suggest that COCO is large enough to learn the offsets and modulation scalars from scratch.

## Input resolution and multi-scale testing

The authors train and apply Faster R-CNN with ResNet-50 and ResNet-101 at shorter sides of 400, 600, 800, 1000, 1200 and 1400 pixels.

On COCO test-dev with ResNet-101, the best single-scale DCNv2 setting, at shorter side 1000, reaches 44.8 APbbox. Multi-scale testing of the same model, with test images from shorter side 400 to 1400 pixels in steps of 200, reaches 46.0 APbbox, a gain of 1.2 points. The regular ConvNet reaches 39.2 APbbox at its best single-scale setting and 41.2 with multi-scale testing.

## Limitations

In the mimicking ablations, only foreground RoIs gave a gain, and mimicking background RoIs did not improve Faster R-CNN APbbox. Mimicking gave almost no gain on a regular ConvNet. The mimicking ablations are reported only on COCO 2017 validation, and the mimicking module is not used for semantic segmentation.

The main ablations use one backbone, ResNet-50, which the authors take as the default. Multi-scale testing was run only with ResNet-101. ImageNet pre-training of the offsets and modulation scalars changes COCO APbbox only from 44.8 to 44.9.

## Paper info

- **Authors**: Xizhou Zhu, Han Hu, Stephen Lin, Jifeng Dai
- **Venue**: arXiv · Preprint
- **First published**: 2018-11-27
- **Added**: 2026-11-12
- **Updated**: 2018-11-28
- **Version**: v2
- **arXiv**: 1811.11168
- **Category**: cs.CV
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1811.11168v2) · [PDF ↗](https://arxiv.org/pdf/1811.11168v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Xizhou Zhu, Han Hu, Stephen Lin, Jifeng Dai (2018). Deformable ConvNets v2: More Deformable, Better Results. arXiv:1811.11168v2. https://arxiv.org/abs/1811.11168v2

**BibTeX**

```
@misc{zhu2018deformable,
  title = {{Deformable ConvNets v2: More Deformable, Better Results}},
  author = {Xizhou Zhu and Han Hu and Stephen Lin and Jifeng Dai},
  year = {2018},
  eprint = {1811.11168},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.11168v2}
}
```

## Other paper commentary

- [Swin Transformer V2: Scaling Up Capacity and Resolution](https://refivu.com/en/papers/376ea342-9ea9-46f8-8c71-84f23e529d90-swin-transformer-v2-scaling-up-capacity-and-resolution.md)
- [RepVGG: Making VGG-style ConvNets Great Again](https://refivu.com/en/papers/b7578ec8-e378-4286-b3a9-984d13d073c3-repvgg-making-vgg-style-convnets-great-again.md)
- [Loss Functions for Neural Networks for Image Processing](https://refivu.com/en/papers/e37574f3-bd03-49a6-929a-ac77f4fc8959-loss-functions-for-neural-networks-for-image-processing.md)
- [Albumentations: fast and flexible image augmentations](https://refivu.com/en/papers/b1ebb278-fa95-4faa-a782-1d7360e37984-albumentations-fast-and-flexible-image-augmentations.md)
- [Semantic Image Synthesis with Spatially-Adaptive Normalization](https://refivu.com/en/papers/7c8cce40-a7a4-49f2-a589-a9b074c36caa-semantic-image-synthesis-with-spatially-adaptive.md)
- [ByteTrack: Multi-Object Tracking by Associating Every Detection Box](https://refivu.com/en/papers/6d6f3415-7480-483d-afac-4b47286d13c9-bytetrack-multi-object-tracking-by-associating-every.md)
- [The Pile: An 800GB Dataset of Diverse Text for Language Modeling](https://refivu.com/en/papers/1672f861-b9aa-408b-8aba-b2d5d642c8c9-the-pile-an-800gb-dataset-of-diverse-text.md)
- [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation](https://refivu.com/en/papers/d3d2ade6-3bed-4a94-9439-088b61554b00-autogen-enabling-next-gen-llm-applications-via-multi.md)
- [Deeper Insights into Graph Convolutional Networks for Semi-Supervised Learning](https://refivu.com/en/papers/a2134edc-a5ef-48b2-9ec4-982cfed2a085-deeper-insights-into-graph-convolutional-networks-for-semi.md)
- [Pointer Sentinel Mixture Models](https://refivu.com/en/papers/8f7d0844-f517-4c18-ba24-8cd7dc616a74-pointer-sentinel-mixture-models.md)
- [Conditional Image Synthesis With Auxiliary Classifier GANs](https://refivu.com/en/papers/cbb27823-75f1-4fb6-b4c8-dcc645b1f162-conditional-image-synthesis-with-auxiliary-classifier-gans.md)
- [Estimating Continuous Distributions in Bayesian Classifiers](https://refivu.com/en/papers/318decb8-43d0-4596-b25f-944ca636af13-estimating-continuous-distributions-in-bayesian-classifiers.md)

## Terms in this paper

- [ImageNet](https://refivu.com/en/terms/5eadad128667-imagenet)
- [COCO](https://refivu.com/en/terms/41f3215c4f4a-coco)
- [Semantic segmentation](https://refivu.com/en/terms/00dfce7ec404-semantic-segmentation)
- [mIoU](https://refivu.com/en/terms/901dcc5384c2-miou)
- [Faster R-CNN](https://refivu.com/en/terms/6a6dc13482bb-faster-r-cnn)
- [Mask R-CNN](https://refivu.com/en/terms/6da881f24c0c-mask-r-cnn)
- [knowledge distillation](https://refivu.com/en/terms/b8544f4ba83e-knowledge-distillation)
- [instance segmentation](https://refivu.com/en/terms/c62f5b6c52fb-instance-segmentation)
- [PASCAL VOC](https://refivu.com/en/terms/f661ede6fa9d-pascal-voc)
- [R-CNN](https://refivu.com/en/terms/fce148b1175f-r-cnn)
- [deformable convolution](https://refivu.com/en/terms/2caf738356d7-deformable-convolution)
- [effective receptive field](https://refivu.com/en/terms/6c98eb295c30-effective-receptive-field)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/35e56c2e-a121-4396-98bf-2215bb94b651-deformable-convnets-v2-more-deformable-better-results)
