Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

A guide to convolution arithmetic for deep learning

Researchers derive output-size rules for convolution, pooling and transposed convolution

  • Problem Convolution output shape depends on input size, kernel, padding and stride together, which is hard to work out by hand.
  • Method The authors derive output-size formulas for each layer type, then rewrite each transposed convolution as an equivalent direct convolution.
  • Results The authors show that a stride-1 transposed convolution equals a direct convolution with padding k − 1.

Why layer shapes are hard to predict

Convolutional networks are central to modern deep learning, yet their layers are hard to reason about on paper. The output shape of a convolutional layer depends on the input shape, the kernel shape, the zero padding and the strides together. Fully-connected layers avoid this, because their output width stays fixed whatever the input size is.

Pooling adds a further layer of complexity, and transposed convolutions have spread across recent work. Their relation to ordinary convolutions has been explained with uneven clarity, which is the gap this guide targets.

The guide sets two aims: explain how convolutional layers relate to transposed convolutional layers, and give an intuitive picture of how input shape, kernel shape, padding, stride and output shape interact in convolution, pooling and transposed convolution. The results are kept independent of any framework, so they apply to Theano, Torch, TensorFlow and Caffe alike.

Discrete convolution as a sliding kernel

The key idea is that one small kernel of weights slides over every position of the input, so each output unit depends on only a few inputs. This matters because images, sound and similar data have axes where order matters, while a plain affine layer treats all axes alike. A discrete convolution keeps that ordering, and it reuses the same weights at every location.

At each position the kernel elements are multiplied with the input elements they overlap, and the products are summed to give one output value. Repeating this with different kernels builds as many output feature maps as needed. With several input feature maps, each one is handled by its own kernel slice, and the results are added elementwise.

Stride sets how far the kernel moves between positions, and a larger stride is equivalent to keeping only some of the outputs. The guide keeps the name convolution even though signal processing separates it from cross-correlation, since the kernel is learned anyway.

Output size with unit strides

The output size can be counted as the number of places the kernel can take along an axis. Each one-step move adds a position, and the starting position adds one more. With no padding and stride 1 this gives o = (i − k) + 1, so a 3×3 kernel over a 4×4 input yields a 2×2 output.

Padding adds p zeros on each side, which changes the effective input size from i to i + 2p. That gives o = (i − k) + 2p + 1 for stride 1. For example, a 4×4 kernel over a 5×5 input with p = 2 follows the same rule.

A common choice is half padding, which keeps the output equal to the input when k is odd. With k = 2n + 1, using p = ⌊k/2⌋ = n and stride 1 makes o = i. Figure 2.3 shows the case i = 5, k = 3 and p = 1.

Full padding goes the other way and grows the output. With p = k − 1 and stride 1, o = i + (k − 1). Every partial or complete overlap of the kernel with the input is counted, which is why this is called full padding. Figure 2.4 shows the case i = 5, k = 3 and p = 2.

Strides and the floor function

With stride s, the kernel jumps by s between positions, so the number of steps is divided by s. The output size is the number of steps plus one, which gives o = ⌊(i − k)/s⌋ + 1 when there is no padding. The floor appears because the last jump can stop before the kernel reaches the far edge, leaving some input units unused.

Padding enters by replacing i with i + 2p, which gives the general case o = ⌊(i + 2p − k)/s⌋ + 1. Where i + 2p − k is a multiple of s, the floor makes several input sizes share one output size, and this happens only when s > 1. Figure 2.6 uses i = 5 and Figure 2.7 uses i = 6, both with k = 3, s = 2 and p = 1, and they produce the same output size.

The authors note that this ambiguity doesn't affect convolutions but complicates transposed convolutions.

Pooling reuses the same arithmetic

Pooling slides a window across the input and feeds its contents to a function, often the maximum or the average. Unlike a convolution, it replaces the weighted sum with that function, but the sliding geometry is the same. Because the geometry is shared, the convolution relations can be reused, and only the repeated function changes.

Pooling involves no zero padding, so the output size is o = ⌊(i − k)/s⌋ + 1 for any type of pooling. Figure 1.6 shows max pooling with a 3×3 window on a 5×5 input at 1×1 strides. Average pooling in Figure 1.5 uses the same geometry, but its outputs are means.

Convolution as a matrix and its transpose

Unroll the input and output into vectors, and a convolution becomes a sparse matrix C whose non-zero entries are kernel weights. The backward pass multiplies the error by C transposed, so the same kernel supplies both passes.

A transposed convolution goes the other way, from 4 dimensions to 16 while keeping the same connectivity. It does this by swapping the forward and backward passes, so the forward step multiplies by C transposed. The same kernel defines a direct or a transposed convolution depending on which passes are used. Frameworks usually implement it as the gradient of a direct convolution with respect to that convolution's input.

The authors avoid the term deconvolution, since it denotes an inverse rather than this operation.

Transposed convolution as a padded direct convolution

The simplest picture treats the transposed input as the output of some direct convolution, and asks for the shape of the original map. A 3×3 kernel over a 4×4 input with stride 1 gives a 2×2 output, so its transpose maps a 2×2 input to a 4×4 output.

The kernel and stride stay the same, but the transposed input is now zero padded. The padding is chosen so that the first kernel placement touches only the top-left pixel, which means padding equals kernel size minus one. The same reasoning gives Relationship 8, so with s = 1 and p = 0 the transposed padding is k − 1 and o′ = i′ + (k − 1).

This equivalent is much less efficient, since the zero multiplications are wasteful, and software normally skips them.

Padded convolutions in transposed form

Since the transpose of an unpadded convolution behaves like a fully padded one, the transpose of a padded one should use less padding. Relationship 9 gives p′ = k − p − 1 and o′ = i′ + (k − 1) − 2p for stride 1. Figure 4.2 shows i = 5, k = 4 and p = 2, which is equivalent to a 4×4 kernel over a 6×6 input padded with a 1×1 border.

Half-padded convolutions have the same input and output size, so their transpose should also be half-padded. With k = 2n + 1, p = n and stride 1, the transposed version keeps p′ = p and o′ = i′. Figure 4.3 covers i = 5, k = 3 and p = 1.

The transpose of a fully padded convolution is an unpadded one. With p = k − 1 and stride 1, the transposed padding is zero and o′ = i′ − (k − 1). Figure 4.4 gives i = 5, k = 3 and p = 2, equivalent to a 3×3 kernel over a 7×7 input without padding.

Strided transposed convolutions

Figure 4.5 shows i = 5, k = 3 and s = 2 with no padding. Its equivalent is a 3×3 kernel over a 2×2 input with one zero inserted between units, padded by a 2×2 border.

Relationship 12 covers p = 0 and i − k a multiple of s. In Figure 4.5 the stretched input has size 3 for an original input of size 2.

With padding p, Relationship 13 requires i + 2p − k to be a multiple of s, with p′ = k − p − 1 and o′ = s(i′ − 1) + k − 2p.

Its output size is o′ = s(i′ − 1) + a + k − 2p. Figure 4.7 applies this to i = 6, k = 3, s = 2 and p = 1, with a = 1.

Dilated convolutions widen the kernel

A dilated kernel inserts spaces between its elements, controlled by a dilation rate d. Usually d − 1 spaces go between kernel elements, so d = 1 gives an ordinary convolution. This widens the receptive field without adding weights, which helps when several dilated layers are stacked. The authors point to WaveNet, which uses such layers to condition raw audio on a long past context.

The effective kernel size is k + (k − 1)(d − 1), and substituting it into the formula gives Relationship 15. Relationship 15 reads o = ⌊(i + 2p − k − (k − 1)(d − 1))/s⌋ + 1. Figure 5.1 shows a 3×3 kernel over a 7×7 input with d = 2, s = 1 and p = 0.

Limits of the analysis

The derivations use 2-D convolutions with square inputs, square kernels, and equal stride and padding along both axes. The authors state that the results carry over to N-D and non-square cases, but the worked examples all use the square 2-D setting.

A transposed convolution isn't the inverse of a convolution, so it doesn't recover the original input. It only returns a feature map with the same width and height. Emulating it with a direct convolution is always possible but needs many zero rows and columns, which makes it much less efficient.

The guide reports no benchmark numbers, and its figures are worked examples of the output-size formulas.

Paper info

Authors
Vincent Dumoulin, Francesco Visin
Venue
arXiv · Preprint
First published
2016-3-23
Added
2026-11-12
Updated
2018-1-11
Version
v2
arXiv
1603.07285
Category
stat.ML · cs.LG · cs.NE
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

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

Vincent Dumoulin, Francesco Visin (2016). A guide to convolution arithmetic for deep learning. arXiv:1603.07285v2. https://arxiv.org/abs/1603.07285v2

BibTeX
@misc{dumoulin2016guide,
  title = {{A guide to convolution arithmetic for deep learning}},
  author = {Vincent Dumoulin and Francesco Visin},
  year = {2016},
  eprint = {1603.07285},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1603.07285v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up