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

Perceptual Losses for Real-Time Style Transfer and Super-Resolution

Perceptual losses enable real-time style transfer

  • Problem Per-pixel losses miss perceptual differences between images, while optimization-based perceptual methods take hundreds of iterations per image. Real-time use was therefore out of reach.
  • Method The authors train a feed-forward network with perceptual losses computed by a frozen VGG-16. Instead of a per-pixel error, the network learns to match high-level features in a single pass.
  • Results The style transfer network took 0.015s per 256×256 image, compared to 15.86s for 500 iterations of the baseline. Its outputs look similar to the baseline's.

Why per-pixel losses and slow optimization both fall short

Super-resolution, colorization and segmentation all map an input image to an output image, and a common recipe trains a feed-forward network with a per-pixel loss. Such a network is cheap at test time, because producing an output takes one pass through it. The weak point is the loss itself: two images that look alike to a person can score far apart when compared pixel by pixel.

This matters most for super-resolution, where fine detail has to be inferred from a visually ambiguous low-resolution input.

Perceptual losses, built on feature differences from a pretrained classifier, avoid this pixel-by-pixel mismatch. So far they have mainly served to generate images by optimization, and inference then means solving an optimization problem for each image. Gatys et al's style transfer is the clearest case: its quality is high, but each stylized image typically needs around 500 iterations, and every iteration passes forward and backward through the loss network.

The question the authors ask is whether a network can learn that optimization once and then answer in a single pass.

Training one network against fixed perceptual losses

The key idea is to keep the feed-forward network and change only its training signal. Instead of a per-pixel error, the network is trained with losses that compare high-level features from a classifier that stays frozen. Because that classifier already encodes perceptual and semantic information, the transformation network inherits this knowledge rather than learning it from scratch.

The system has two parts: an image transformation network \(f_W\) with weights \(W\), and a loss network \(\phi\). The transformation network maps an input \(x\) to an output \(\hat{y} = f_W(x)\), and several loss functions \(\ell_i\) compare \(\hat{y}\) with targets \(y_i\). Training uses stochastic gradient descent on a weighted sum of these losses, written as \[ W^* = \arg\min_W \mathbb{E}_{x,\{y_i\}}\Big[\sum_i \lambda_i \ell_i(f_W(x), y_i)\Big] \] where the weights \(\lambda_i\) set the mix of the terms.

Only \(W\) is updated, and the loss network stays fixed throughout training.

For style transfer the content target is the input image, and the authors train one network per style target. So the style is fixed in each trained network's weights, and the network doesn't take a new style at run time. For super-resolution the content target is the ground-truth high-resolution image, the style loss isn't used, and there is one network per upsampling factor.

The network body uses five residual blocks, and it has no pooling layers. Downsampling and upsampling both use strided convolutions, and non-residual layers are followed by spatial batch normalization and ReLU, except the output layer. The output layer uses a scaled tanh, which keeps output pixels in the range [0, 255]. Because the network is fully convolutional, the trained model can be applied to images of any resolution at test time.

For style transfer, two stride-2 convolutions downsample the input before the residual blocks, and two stride-1/2 layers upsample it afterwards. The second argument concerns receptive fields: after downsampling by D, each extra 3×3 layer grows the effective receptive field by 2D instead of 2. Residual connections make the identity mapping easy to learn, which suits transformations whose output should share structure with the input.

Super-resolution differs in its upsampling: rather than enlarging the input with bicubic interpolation first, the network ends with log2 f stride-1/2 convolutions learned jointly with the rest. The input is a low-resolution patch of size 3 × 288/f × 288/f, and the output is a high-resolution patch of size 3 × 288 × 288.

Feature, style and pixel losses

The loss network is a 16-layer VGG network pretrained on ImageNet, used in every experiment. Let \(\phi_j(x)\) be the activations at layer \(j\), a feature map of shape \(C_j \times H_j \times W_j\). The feature reconstruction loss is the squared Euclidean distance between these activations for output and target, normalized by \(C_j H_j W_j\): \[ \ell^{\text{feat}}_{\phi,j}(\hat{y},y) = \frac{1}{C_j H_j W_j}\,\lVert \phi_j(\hat{y}) - \phi_j(y)\rVert_2^2 \] Matching early layers gives images close to the target pixel by pixel, while matching higher layers keeps content and spatial layout but lets color, texture and exact shape drift.

The style loss starts from the Gram matrix of a layer, whose entries are \(G^{\phi}_j(x)_{c,c'} = \frac{1}{C_j H_j W_j}\sum_{h}\sum_{w}\phi_j(x)_{h,w,c}\,\phi_j(x)_{h,w,c'}\). Each entry measures how strongly two channels activate together across the spatial grid, which captures style without spatial layout. The style loss is the squared Frobenius norm of the difference between the Gram matrices of output and style target: \[ \ell^{\text{style}}_{\phi,j}(\hat{y},y) = \lVert G^{\phi}_j(\hat{y}) - G^{\phi}_j(y)\rVert_F^2 \] Because the Gram matrices have the same shape whatever the image size, this loss stays defined when output and target differ in size, and a set of layers \(J\) is handled by summing the per-layer losses.

The pixel loss is the normalized squared distance \(\ell_{\text{pixel}}(\hat{y},y) = \lVert \hat{y}-y\rVert_2^2 / CHW\), and it can only be used when a ground-truth target exists. A total variation regularizer \(\ell_{TV}(\hat{y})\) is added to encourage spatial smoothness in the output. Style transfer uses the feature loss at relu2_2 and the style loss at relu1_2, relu2_2, relu3_3 and relu4_3, while super-resolution uses the feature loss at relu2_2 only.

Style transfer: matching the optimization baseline, much faster

The authors reimplemented the Gatys et al baseline, starting from white noise and optimizing with L-BFGS. Unconstrained optimization often leaves pixels outside [0, 255], so the baseline was run with projected L-BFGS that clips the image at every iteration, which matches the constraint on the network's output. Most baseline runs converged within 500 iterations.

The transformation networks were trained on 80k MS-COCO images resized to 256 × 256, with a batch size of 4 for 40,000 iterations and Adam at a learning rate of 1 × 10⁻³. The total variation strength was chosen per style between 1 × 10⁻⁶ and 1 × 10⁻⁴ by cross-validation, and training took roughly 4 hours on a single GTX Titan X GPU.

On 50 MS-COCO validation images with The Muse as the style image, the authors recorded the baseline's objective at each iteration and the network's objective per image. The network's objective is comparable to the value reached after 50 to 100 iterations of the baseline. The same comparison at 512×512 and 1024×1024 gives a similar picture, so the network keeps minimizing the objective on images larger than its 256×256 training size.

At 256×256 the network took 0.015s per image, compared to 15.86s for 500 iterations of the baseline, a speedup of 1060x. At 512×512 the network processes images at 20 FPS, which the authors take as enough for real-time style transfer or video. The gain comes from replacing hundreds of forward and backward passes through VGG-16 with one forward pass of the transformation network.

Qualitatively the outputs look similar to the baseline, with the same λ values used for both methods on the same content images from MS-COCO 2014 validation. The authors read the results as showing that the network keeps people and animals more than background, which they attribute to VGG-16 features selective for those objects.

Super-resolution: finer edges with a lower PSNR and SSIM

The authors argue that ×4 and ×8 super-resolution need semantic reasoning, so they train with a feature reconstruction loss instead of the per-pixel loss usually used. PSNR is equivalent to the per-pixel loss, so a model trained with a per-pixel loss should win on PSNR, which is why the authors state their aim is qualitative.

The models were trained on 288×288 patches from 10k MS-COCO images, with low-resolution inputs made by Gaussian blur with σ = 1.0 and bicubic downsampling. Training ran for 200k iterations with a batch size of 4 and Adam at 1 × 10⁻³, followed by histogram matching against the low-resolution input. The pixel-loss models use the same data, architecture and training, so differences between the two losses are isolated.

The models were evaluated on Set5, Set14 and BSD100 with PSNR and SSIM computed on the Y channel after conversion to YCbCr. At ×4, the feature-loss model reconstructs sharp edges and fine details such as eyelashes better than the compared methods. A slight cross-hatch pattern visible under magnification lowers its PSNR and SSIM relative to the baseline methods.

Its background trees stay diffuse, which the authors take as a sign that the model is more aware of image semantics. The pixel-loss model produces fewer visual artifacts and higher PSNR, but the feature-loss model reconstructs fine details better, which the authors weigh as the more pleasing result.

Limitations and untested settings

PSNR and SSIM rely only on low-level pixel differences and assume additive Gaussian noise, and both correlate poorly with human judgement of visual quality. The super-resolution comparison covers only ×4 and ×8, and SRCNN appears only at ×4. The objective comparison uses 50 MS-COCO validation images and a single style image, The Muse. Each style transfer network is trained for one style target, so a new style needs a new network.

Only VGG-16 was used as the loss network, and colorization and semantic segmentation were not tested. Whether loss networks trained on other tasks or datasets change the semantic knowledge transferred is left for future work.

Paper info

Authors
Justin Johnson, Alexandre Alahi, Li Fei-Fei
Venue
arXiv · Preprint
First published
2016-3-27
Added
2026-11-11
Updated
2016-3-27
Version
v1
arXiv
1603.08155
Category
cs.CV · cs.LG
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

Justin Johnson, Alexandre Alahi, Li Fei-Fei (2016). Perceptual Losses for Real-Time Style Transfer and Super-Resolution. arXiv:1603.08155v1. https://arxiv.org/abs/1603.08155v1

BibTeX
@misc{johnson2016perceptual,
  title = {{Perceptual Losses for Real-Time Style Transfer and Super-Resolution}},
  author = {Justin Johnson and Alexandre Alahi and Li Fei-Fei},
  year = {2016},
  eprint = {1603.08155},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1603.08155v1}
}

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