Convolutional networks are supposed to treat every location the same way, but they don't. At the image border, the filter overlaps the artificial zeros added around the frame ("zero-padding"), and networks learn to read this edge signal as a map of where they are in the image. This is sometimes useful, since detectors and instance segmenters use it to tell objects apart by position. It is sometimes harmful: it creates center bias, blind spots near edges, and accuracy that drops as objects move toward the frame boundary. Deformable convolution is a popular layer whose sampling points can shift away from the regular 3×3 grid by learned, input-dependent amounts. It adds a route to the border that nobody has examined. A shifted sampling point can land outside the frame. When it does, the interpolation routine returns a value set by the implementation, usually zero. So a deformable layer can reach the border from far inside the image, much as a very large kernel does, and it can learn when to do so.
This note proposes to test that hypothesis directly and then fix what it predicts. The central claim is that in deformable networks, much of the absolute-position signal flows through out-of-frame samples in the deformable layers, not only through the padding of ordinary convolutions. If so, the standard remedies applied to the ordinary layers (reflect padding, partial-convolution padding, input sizes chosen for symmetric padding) will leave most of the leak intact. We then propose a simple sampler that accounts for how much of each sample actually falls on real pixels. This removes the leak, and we measure whether detection and segmentation accuracy survive once position is either removed or supplied explicitly.
What is known and what is missing
The motivating evidence comes from rigid CNNs. How much Position Information Do Convolutional Neural Networks Encode? trains a small readout on frozen features to predict pixel coordinates. A pretrained ResNet152 reaches Spearman correlations of 0.933 (horizontal) and 0.951 (vertical) on natural images and about 0.97 on Gaussian noise, and the signal disappears when padding is removed. Position, Padding and Predictions explains this as triangulation: deep units measure their distance to the four borders as their receptive field grows. An Investigation on The Position Encoding in Vision-Based Dynamics Prediction shows the mechanism in its barest form. With all-zero inputs, layer biases combined with zero-padding produce a ramp that encodes coordinates. A dynamics model then gets short-term error 2.97, against 2.72 with real images, and the error rises to 144.34 when reflect padding removes the contrast at the border. That last result constrains our design: a sampler that copies border pixels should destroy the leak on uniform inputs.
The harms are documented by Mind the Pad, which links asymmetric padding to blind spots and fixes them statically, and by SI-Score, which shows CNN accuracy falling as objects move from the center on a 21×21 location grid. Scaling Up Your Kernels to 31×31 and ParCNetV2 show that kernels large enough to touch the border from anywhere turn padding into a global position code. That observation is the analogy behind our hypothesis, because a deformable offset is a learnable way to reach that far.
On the deformable side, Deformable Convolutional Networks introduced learned offsets with bilinear interpolation. Deformable ConvNets V2 added a learned per-sample weight in [0, 1] (the "modulation") to stop samples from straying into background. Neither analyzes samples that leave the frame. YOLACT++ puts deformable layers into a backbone whose prototype masks, per YOLACT, rely on border-derived position. It uses the layers only as an accuracy booster and never asks where their offsets point. Partial Convolution based Padding supplies our method: it rescales each output by the fraction of the window on real pixels. It assumes a rigid window, however, and does not define that fraction for fractional, moving samples. The closest existing work therefore either studies position leakage in rigid networks or uses deformable layers without looking at the border. No paper measures whether deformable sampling is itself a position channel.
Core Claim
We make three predictions, each of which can be falsified. First, in a ResNet-50 with modulated deformable layers in stages 3–5 (the DCNv2 setup), a coordinate readout will stay accurate even when every ordinary convolution uses reflect or partial-convolution padding, because the deformable sampler still returns zeros out of frame. Second, near the border a measurable fraction of deformable samples will land outside the frame, and the modulation will keep their weights well above zero. That would mean the network uses the cliff at the border rather than suppressing it. Third, replacing the sampler with a validity-normalized version will collapse the readout on noise inputs while costing little detection accuracy, and adding explicit coordinate channels will recover whatever accuracy is lost. The third prediction would show that the network needs position but does not need it to arrive through the border.
Research Program
The first part of the work is measurement. For each deformable layer we record the distribution of sampling locations as a function of distance to the frame edge. We report the share of bilinear weight that falls outside the frame and the modulation values attached to those samples. We repeat this on natural images, on Gaussian noise, and on constant inputs, following the synthetic-input protocol of the dynamics-prediction study. We then train coordinate readouts on frozen features under a factorial design. One factor is the padding of the ordinary layers: zero, reflect, partial-convolution, or mirror padding with 225×225 inputs. The other factor is the out-of-frame behavior of the deformable sampler: return zero, clamp to the edge, or validity-normalize. This design separates the two sources of position information. We also compute Mind the Pad's zero-input foveation maps for both rigid and deformable models, to see whether deformable layers move or sharpen the line-shaped artifacts at the border.
The second part is the fix. Each deformable sample $n$ reads from four neighboring pixels with bilinear weights. Let $v_n \in [0,1]$ be the total weight of those four taps that lies on real pixels, with $v_n = 1$ for a sample fully inside the frame. Let $m_n$ be the learned modulation and $w_n$ the kernel weight, and let $\tilde{x}_n$ be the interpolated value with out-of-frame taps set to zero. The normalized output is
$$ y(p_0) = \frac{\sum_n m_n}{\sum_n m_n v_n + \epsilon}\sum_n w_n\, m_n\, \tilde{x}_n , $$
where $\epsilon$ is a small constant to avoid division by zero. On a rigid grid with $m_n = 1$, this reduces to the partial-convolution ratio. It is differentiable in the offsets, so the network can still learn where to sample, but the output carries no information about how much of the window fell off the image. Paired with partial-convolution padding in the ordinary layers, this gives a backbone with no implicit border channel. We then add CoordConv-style coordinate planes as an explicit, controllable position input and compare.
Baselines
The naive reference is a rigid ResNet-50 with zero-padding and the standard training recipe. On COCO with Faster R-CNN it gives the 36.0% AP that Deformable ConvNets V2 reports. It anchors both the leakage measurements and the accuracy scale.
The strongest existing method is stock DCNv2 on the same detector. It reports 42.4% box AP on COCO 2017 with a ResNet-50 backbone, in Deformable ConvNets V2. It is the model whose leak we hypothesize and the accuracy we must not lose. We retrain it ourselves with the same schedule, data, augmentation, and seeds as every variant, so that border-region metrics are comparable. Beating it on the question we pose means one of two outcomes. The normalized-sampler model matches overall AP within seed noise while lowering coordinate-readout correlation on noise inputs substantially and narrowing the gap between border-region and center-region AP. Or, with explicit coordinates added, it exceeds DCNv2 on border-region AP at equal overall AP.
The padding-fix baselines apply partial-convolution padding (Partial Convolution based Padding), which reports up to 1.25 border mIoU gain on Cityscapes over zero-padding, and the 225×225 mirror-padding recipe from Mind the Pad to the ordinary layers of the DCNv2 backbone. These are the most plausible "already solved" answers, so they get identical tuning. The key ablation is the edge-clamp sampler, which isolates whether normalization matters or merely keeping samples on the image is enough. A further ablation keeps the deformable layers but freezes their offsets at zero, which separates "deformable sampling" from "extra modulation weights." We also train a rigid model with spatial-aware random-shift augmentation, the remedy used by SiamRPN++, under the same epoch budget.
Why not just…?
Why not just switch the ordinary layers to partial-convolution or reflect padding? Our hypothesis is precisely that this leaves the deformable sampler's zeros in place. The factorial readout experiment decides it. If readout correlation on noise drops to the level of a padding-free rigid net when only the ordinary layers are changed, our central claim is wrong. The project then reduces to reporting that existing fixes suffice for deformable nets, which is still a useful negative result.
Why not just clamp the sampling coordinates to the frame? Clamping is the strongest threat, because it is one line of code. The dynamics-prediction result suggests it will remove the cliff on uniform inputs, since clamping is replicate padding for samples, which drove error from 2.97 to 144.34 there. It may, however, smear border pixels on natural images, and it does not tell the layer that it saw fewer real pixels. If clamping matches the normalized sampler on both leakage and border AP, we will recommend clamping and drop the new sampler. The diagnosis remains the contribution.
Why not just add coordinate channels and stop caring about the leak? Explicit coordinates do not remove the implicit channel; they add a second one. On Translation Invariance in CNNs argues that position should be supplied explicitly and only when needed, which requires first closing the implicit route. Our design includes coordinates only in the condition where the leak is closed, so we can tell whether accuracy depends on position itself or on the border-based way it is delivered.
Why not just use random-shift augmentation? It teaches invariance from data but leaves the mechanism intact at test time. The SI-Score location grid and the border-region AP breakdown will show whether augmentation flattens the location-accuracy curve as well as the architectural change does.
Proposed Experiments
The leakage study uses ImageNet-pretrained rigid and DCNv2 ResNet-50 backbones under the factorial design above. It reports horizontal and vertical Spearman correlation of the coordinate readout on natural images and Gaussian noise. The reference is the 0.933/0.951/≈0.97 figures for rigid ResNet152 from How much Position Information Do Convolutional Neural Networks Encode?, and we predict DCNv2 with reflect-padded ordinary layers stays near the rigid zero-padded level. The constant-input test on the SimB dynamics benchmark replaces the dynamics model's backbone convolutions with deformable ones. It reports short-term error with all-zero inputs across sampler modes, testing whether the deformable sampler alone can rebuild the coordinate ramp that reflect padding destroyed. Accuracy experiments cover COCO 2017 detection with Faster R-CNN, broken down into AP for boxes within a fixed margin of the frame edge versus elsewhere, and Cityscapes semantic segmentation reporting border mIoU, as in partial-convolution padding. Location robustness uses SI-Score's 21×21 grid on classifiers trained under each condition. We found no reported numerical result on Lacuna for SI-Score accuracy, so our rigid baseline will set the reference curve.
Three checks are decisive. The claim stands if, first, readout correlation on noise remains high for DCNv2 when only the ordinary layers are de-padded and collapses when the sampler is normalized. Second, out-of-frame samples near the border carry modulation values not driven toward zero. Third, the normalized model plus coordinates matches 42.4%-level AP in our retraining while reducing the gap between border and center AP. If the first check fails, the hidden-path hypothesis is refuted. If the third fails without coordinates but succeeds with them, the networks need position but not the border to supply it.
References
- How much Position Information Do Convolutional Neural Networks Encode?
- Position, Padding and Predictions: A Deeper Look at Position Information in CNNs
- An Investigation on The Position Encoding in Vision-Based Dynamics Prediction
- Mind the Pad - CNNs Can Develop Blind Spots
- SI-Score: An image dataset for fine-grained analysis of robustness to object location, rotation and size
- Scaling Up Your Kernels to 31×31: Revisiting Large Kernel Design in CNNs
- ParCNetV2: Oversized Kernel with Enhanced Attention
- Deformable Convolutional Networks
- Deformable ConvNets V2: More Deformable, Better Results
- YOLACT++: Better Real-time Instance Segmentation
- YOLACT: Real-time Instance Segmentation
- Partial Convolution based Padding
- SiamRPN++: Evolution of Siamese Visual Tracking With Very Deep Networks
- On Translation Invariance in CNNs: Convolutional Layers Can Exploit Absolute Spatial Location