# Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network

Sub-pixel convolution lets a CNN upscale video in real time

Wenzhe Shi, Jose Caballero, Ferenc Huszár, Johannes Totz, Andrew P. Aitken, Rob Bishop and 2 more · arXiv · 2016-9-16

- **Problem** Recent CNN super-resolution methods first enlarge the low-resolution input with bicubic interpolation, so every layer runs at high resolution. That is slow and adds no new information.
- **Method** ESPCN extracts features at low resolution and learns its own upscaling filters. Its final sub-pixel convolution layer produces r² channels per position, and a rearrangement step spreads them into high-resolution pixels without interpolation.
- **Results** ESPCN averaged 28.11 dB at scale 3, compared to 27.98 for SRCNN 9-5-5 ImageNet. It runs about an order of magnitude faster than earlier CNN methods.

## Why upscaling before the network costs so much

Single image super-resolution is ill-posed, because the blurring and subsampling that create the low-resolution image destroy high-frequency detail that can't be simply inverted. Recent CNN methods handle the size mismatch by enlarging the low-resolution input to the target size first, usually with bicubic interpolation, and only then running the network.

This is costly, because processing speed in a convolutional network depends directly on the input resolution, so every layer runs on the enlarged image. Bicubic interpolation also adds no new information, so the computation spent on the enlarged image doesn't help solve the reconstruction problem.

Learned upscaling filters had appeared only in a footnote of Dong et al. \[6\], and the option was not explored inside the network. Dong et al. also noted that well-optimized convolution implementations don't easily produce outputs larger than their inputs. The authors reverse the usual order: the resolution rises only at the very end, and the network works on low-resolution feature maps until then.

## Keeping features at low resolution until the last layer

The core idea is to do feature extraction on the low-resolution image and let one final layer write the high-resolution pixels. That final layer is a convolution whose output has r² times C channels at each low-resolution position, and a rearrangement step spreads those channels over an r-by-r block of high-resolution pixels. Because the rearrangement only moves values, no interpolation filter is applied to the image.

The authors call this final layer a sub-pixel convolution layer.

The reasoning is that each feature map gets its own learned upscaling filter, instead of one fixed filter applied to the input image. The network therefore learns the low-resolution to high-resolution mapping together with its processing, which the authors see as richer than a single fixed filter. Working at low resolution also lets the filters be smaller while covering the same context.

The mathematics behind this is that a fractional-stride convolution in low-resolution space activates exactly r² groups of filter weights, and the weights falling between pixels are never computed.

## From low-resolution feature maps to the output image

In the experiments the first layer uses 5×5 filters with 64 maps, the second uses 3×3 filters with 32 maps, and the final layer uses a filter of size 3. For a network with L layers, the first L minus 1 layers compute the following, where the weights W\_l and biases b\_l are learned: \\\[ f^{1}(I\_{LR}) = \\varphi(W\_1 \* I\_{LR} + b\_1), \\qquad f^{l}(I\_{LR}) = \\varphi(W\_l \* f^{l-1}(I\_{LR}) + b\_l) \\\] The final layer doesn't output an image directly, because it produces r²C channels that the PS operator then reshapes into the image: \\\[ I\_{SR} = f^{L}(I\_{LR}) = \\mathrm{PS}\\big(W\_L \* f^{L-1}(I\_{LR}) + b\_L\\big) \\\] Its weight tensor has shape n\_{L-1} × r²C × k\_L × k\_L, and no nonlinearity follows it, so the activation acts only in the earlier layers.

The index rule of the PS operator is what turns the channels into pixels: \\\[ \\mathrm{PS}(T)\_{x,y,c} = T\_{\\lfloor x/r \\rfloor,\\ \\lfloor y/r \\rfloor,\\ C\\cdot r\\cdot \\mathrm{mod}(y,r) + C\\cdot \\mathrm{mod}(x,r) + c} \\\] For an output pixel at (x, y, c), the low-resolution position comes from integer division by r, and the channel comes from the sub-pixel offsets mod(x, r) and mod(y, r).

So each of the r² sub-pixel offsets reads its own group of C channels, and the image is assembled without interpolation. When k\_L = k\_s / r and mod(k\_s, r) = 0, this layer equals a sub-pixel convolution in low-resolution space with a filter of size k\_s.

## Training the network on ImageNet patches

The final models are trained on 50,000 randomly selected ImageNet images. Each HR image is blurred with a Gaussian filter and subsampled by the scale factor to make its LR partner, which mimics a camera's point spread function. Training uses 17r × 17r sub-images cut from the HR ground truth, and a separate network is trained for each scale factor.

The sub-images are cut with strides chosen so that every pixel of the original image serves as ground truth exactly once.

The network is trained to minimise the pixel-wise mean squared error between the reconstructed HR image and the ground-truth HR image. The sum runs over the rH by rW output pixels and is divided by r²HW, which is the same number of pixels. Because PS is a fixed rearrangement, it doesn't have to run during training. Instead, the training targets are pre-shuffled so the network output already has the shape the layer would produce before PS, which the authors say makes training a factor of \\(\\log\_2 r^2\\) faster than a deconvolution layer and r² times faster than upscaling before convolution.

Training starts at a learning rate of 0.01 and decays to 0.0001 whenever the cost improvement falls below a threshold. The last layer learns 10 times slower, as in SRCNN. Training stops after 100 epochs without improvement in the cost. On a K2 GPU, training for scale 3 takes about three hours on 91 images and about seven days on ImageNet images.

## Does learned upscaling help when the setup is matched?

To isolate the sub-pixel layer, the authors compare against SRCNN's standard 9-1-5 model, with relu as the activation for both and two training sets of 91 images and ImageNet images. Moving from 91 images to ImageNet raised ESPCN by +0.33 and SRCNN by +0.07 in mean PSNR. With 91 training images, ESPCN with relu averaged 27.76 dB, the same as SRCNN on 91 images.

On ImageNet, ESPCN with relu averaged 28.09 dB, compared to 27.83 dB for SRCNN trained on ImageNet.

The authors read this as ESPCN gaining much more from extra training images than SRCNN does, at a similar parameter count. With 91 images the two designs tie, so in this table the advantage shows up only with ImageNet training.

## Choosing tanh over relu

For the final model the authors use tanh instead of relu as the activation. They tested tanh on ESPCN models trained with 91 images and with ImageNet images. The authors state that Table 1 suggests tanh performs better than relu for single image super-resolution.

The relu ImageNet average is 28.09 in Table 1, while the tanh ImageNet average is 28.11 in the extended-benchmark table. Those two tables use different SRCNN baselines, 27.83 and 27.98, so the tanh gain isn't read from one controlled table. Because the last layer has no activation, tanh shapes the hidden feature maps rather than the output values directly.

## Image results on the extended benchmark

On the extended benchmark at scale 3, ESPCN with tanh averaged 28.11 dB PSNR, compared to 27.98 for SRCNN 9-5-5 ImageNet and 28.07 for TNRD. On Set5, TNRD scored 33.17, compared to 33.13 for ESPCN. The authors suggest TNRD may gain from a trainable nonlinearity despite its bicubic input, an idea they say could also be explored in ESPCN.

At scale 4, the averages are 26.53 dB for ESPCN, 26.38 dB for SRCNN and 26.45 dB for TNRD. The +0.15 dB image gain in the paper is this comparison against SRCNN 9-5-5, a model the authors describe as having more parameters. For the difference from SRCNN, the authors report a paired t-test p-value below 0.01, and the table caption gives no such test for TNRD.

## Video results frame by frame

For video, the network runs on each frame separately, and the authors compare against bicubic interpolation and SRCNN 9-5-5 ImageNet. The authors argue that the speed is what makes per-frame processing practical.

On the Xiph database, ESPCN averaged 33.92 dB at scale 3 and 31.67 dB at scale 4. SRCNN scored 33.86 and 31.47 on the same videos. Both margins are small, though the table marks the difference from SRCNN as significant at a p-value below 0.01.

On the Ultra Video Group database, ESPCN averaged 40.35 dB at scale 3 and 37.91 dB at scale 4. SRCNN averaged 40.21 and 37.52 on those videos. The +0.39 dB video gain in the paper is at scale 4, and the Ultra Video Group averages differ by that amount.

The authors say the video gains look larger than the image gains, and they possibly attribute this to differences between the datasets.

## Run time on images and video

For the cross-method comparison in Figure 2, each method ran on a single CPU core clocked at 2.0 GHz, with mean PSNR and run time measured on Set14. Convolutional methods, including ESPCN, ran in a Python/Theano implementation, while other methods used the Matlab code their authors provided.

The authors say ESPCN runs about an order of magnitude faster than the fastest published methods they tested. Against SRCNN 9-5-5 ImageNet, the authors state that ESPCN has 2.5 times smaller total parameters. They also state that the number of convolutions per image is r × r times smaller than for SRCNN.

At scale 4 the times are 0.434 s for SRCNN and 0.029 s for ESPCN. These per-frame times are the basis for the authors' claim that the network handles HD video in real time.

## Limitations

Image and video tests use only the luminance channel of the YCbCr colour space. The video model handles each frame alone, and the future-work section assumes that neighbouring frames share most of their content. Temporal information from those neighbouring frames is therefore unused for now.

Video results compare only against bicubic interpolation and SRCNN, so TNRD is absent from the video tables. TNRD and SRCNN numbers come from the Matlab code and models the original authors provided, and results known to be worse than TNRD aren't shown. The paired t-test statements in the tables cover SRCNN only, not TNRD.

The run-time comparison mixes platforms: Figure 2 uses one CPU core, the 4.7 ms figure uses a K2 GPU, and the video timings name no hardware. The authors chose Set14 for the single-core comparison, and they say their results lead on the larger BSD datasets.

## Paper info

- **Authors**: Wenzhe Shi, Jose Caballero, Ferenc Huszár, Johannes Totz, Andrew P. Aitken, Rob Bishop, Daniel Rueckert, Zehan Wang
- **Venue**: arXiv · Preprint
- **First published**: 2016-9-16
- **Added**: 2026-11-11
- **Updated**: 2016-9-23
- **Version**: v2
- **arXiv**: 1609.05158
- **Category**: cs.CV · stat.ML
- **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/1609.05158v2) · [PDF ↗](https://arxiv.org/pdf/1609.05158v2)

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

Wenzhe Shi, Jose Caballero, Ferenc Huszár, Johannes Totz, Andrew P. Aitken, Rob Bishop, Daniel Rueckert, Zehan Wang (2016). Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network. arXiv:1609.05158v2. https://arxiv.org/abs/1609.05158v2

**BibTeX**

```
@misc{shi2016real,
  title = {{Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network}},
  author = {Wenzhe Shi and Jose Caballero and Ferenc Huszár and Johannes Totz and Andrew P. Aitken and Rob Bishop and Daniel Rueckert and Zehan Wang},
  year = {2016},
  eprint = {1609.05158},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1609.05158v2}
}
```

## Other paper commentary

- [DINOv2: Learning Robust Visual Features without Supervision](https://refivu.com/en/papers/7e38faf5-df28-456e-b030-fb3b41cff096-dinov2-learning-robust-visual-features-without-supervision.md)
- [Deformable Convolutional Networks](https://refivu.com/en/papers/578e91c5-050a-4482-bf73-97db86a8865f-deformable-convolutional-networks.md)
- [TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation](https://refivu.com/en/papers/28bfb581-8f1f-42dd-ab0d-1b3c56282f6a-transunet-transformers-make-strong-encoders-for-medical.md)
- [Accurate Image Super-Resolution Using Very Deep Convolutional Networks](https://refivu.com/en/papers/8f850d36-527c-4a2a-8e8a-5d7766bd5c35-accurate-image-super-resolution-using-very-deep.md)
- [Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps](https://refivu.com/en/papers/d3437c7c-4a6a-4f65-b699-3116ccfbfdee-deep-inside-convolutional-networks-visualising-image.md)
- [Enhanced Deep Residual Networks for Single Image Super-Resolution](https://refivu.com/en/papers/755b4a71-c6fa-4954-b300-73653bb1c2b2-enhanced-deep-residual-networks-for-single-image-super.md)
- [Graph Neural Networks: A Review of Methods and Applications](https://refivu.com/en/papers/a985ee6a-3fda-41af-b6ea-0451377e5861-graph-neural-networks-a-review-of-methods-and.md)
- [Distributed Representations of Sentences and Documents](https://refivu.com/en/papers/f945f364-5ce3-4c12-bc05-c40bf55f4f8d-distributed-representations-of-sentences-and-documents.md)
- [An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling](https://refivu.com/en/papers/b568511a-a3c8-42b3-9fd2-bd1b072662ac-an-empirical-evaluation-of-generic-convolutional-and.md)

## Terms in this paper

- [ImageNet](https://refivu.com/en/terms/5eadad128667-imagenet)
- [PSNR](https://refivu.com/en/terms/fcbb9b8276a7-psnr)
- [mean squared error](https://refivu.com/en/terms/e8df98e6d7b7-mean-squared-error)
- [Set14](https://refivu.com/en/terms/e149cff83a15-set14)
- [Set5](https://refivu.com/en/terms/10c3b328190e-set5)
- [SRCNN](https://refivu.com/en/terms/6a9cf6ae7c80-srcnn)
- [bicubic interpolation](https://refivu.com/en/terms/95c584919371-bicubic-interpolation)
- [ESPCN](https://refivu.com/en/terms/fd8976dd133e-espcn)
- [Deconvolution layer](https://refivu.com/en/terms/da56ed1ecb1a-deconvolution-layer)
- [sub-pixel convolution layer](https://refivu.com/en/terms/080ee17f48da-sub-pixel-convolution-layer)
- [Tanh](https://refivu.com/en/terms/437185c5b2a9-tanh)
- [TNRD](https://refivu.com/en/terms/a21a2a998b15-tnrd)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/c2c293f4-dc72-4731-8795-3cf7b87f96e1-real-time-single-image-and-video-super-resolution)
