HyperAIHyperAI

Command Palette

Search for a command to run...

Koenderink Prize (Test of Time)ECCV 2026

실시간 스타일 전송 및 초해상도를 위한 지각적 손실

Justin Johnson Alexandre Alahi Li Fei-Fei

초록

본 논문에서는 입력 이미지를 출력 이미지로 변환하는 이미지 변환 문제를 다룬다. 최근의 이러한 문제들에 대한 방법들은 일반적으로 출력 이미지와 정답 이미지 사이의 픽셀 단위 손실을 사용하여 순방향 합성곱 신경망을 학습시킨다. 병렬 연구에서는 사전 학습된 네트워크에서 추출한 고수준 특성에 기반하여 지각적 손실 함수를 정의하고 최적화함으로써 고품질 이미지를 생성할 수 있음을 보여주었다. 본 논문은 두 접근법의 장점을 결합하여, 이미지 변환 작업을 위한 순방향 네트워크의 학습에 지각적 손실 함수를 사용하는 것을 제안한다. 이미지 스타일 전송에 대한 결과를 제시하는데, 여기서 순방향 네트워크는 Gatys 등이 제안한 최적화 문제를 실시간으로 해결하도록 학습된다. 최적화 기반 방법과 비교할 때, 본 네트워크는 유사한 질적 결과를 제공하면서도 속도가 세 자릿수만큼 빠르다. 또한 단일 이미지 초해상도에도 실험을 수행하여, 픽셀 단위 손실을 지각적 손실로 대체하면 시각적으로 만족스러운 결과를 얻을 수 있음을 확인하였다.

One-sentence Summary

Stanford University authors propose training feed-forward convolutional networks with perceptual loss functions based on high-level features from pretrained networks, achieving real-time style transfer that matches the qualitative results of Gatys et al.'s optimization-based method at three orders of magnitude faster speed while also improving single-image super-resolution.

Key Contributions

  • Feed-forward convolutional transformation networks are trained with perceptual loss functions computed from high-level features of pretrained convolutional networks instead of conventional per-pixel losses, combining fast feed-forward architectures with optimization-based perceptual image generation.

  • The approach is evaluated on image style transfer by training a feed-forward network to approximate the optimization objective of Gatys et al. in real time. The trained network gives qualitatively similar results while being three orders of magnitude faster than the optimization-based method.

  • On single-image super-resolution, replacing a per-pixel loss with a perceptual loss produces visually pleasing results and better reconstruction of fine details and edges.

Introduction

Many image transformation tasks, such as denoising, super-resolution, colorization, segmentation, and style transfer, involve mapping an input image to a structured output image. A common solution is to train a feedforward convolutional network with a per-pixel loss, which makes inference fast but can poorly reflect human-perceived differences, such as small misalignments or missing fine details. Optimization-based methods using perceptual losses improve output quality by comparing high-level features from a pretrained network, but they require slow test-time optimization. The authors address this gap by training feedforward networks directly with perceptual loss functions derived from a pretrained CNN. This approach preserves real-time inference while transferring semantic and perceptual knowledge from the loss network, yielding fast style transfer results and improved detail reconstruction in single-image super-resolution.

Method

The authors leverage a learning-based image transformation framework rather than optimizing each output image directly from an initial noise image. The system contains two main components: a trainable image transformation network fWf_WfW​ and a fixed loss network ϕ\phiϕ that defines the objective functions used during training. Refer to the framework diagram.

The transformation network is a deep residual convolutional network parameterized by weights WWW. Given an input image xxx, it produces an output image y^=fW(x)\hat{y}=f_W(x)y^​=fW​(x). The loss network ϕ\phiϕ is used to compute perceptual measurements between y^\hat{y}y^​ and target images such as a content target ycy_cyc​ or a style target ysy_sys​. The network is trained with stochastic gradient descent to minimize a weighted combination of loss functions:

W∗=arg⁡min⁡WEx,{yi}[∑i=1kλiℓi(fW(x),yi)].W^* = \arg \min_W \mathbf{E}_{x,\{y_i\}}\left[\sum_{i=1}^k \lambda_i \ell_i(f_W(x),y_i)\right].W∗=argWmin​Ex,{yi​}​[i=1∑k​λi​ℓi​(fW​(x),yi​)].

The loss network is pretrained for image classification and remains fixed during training. In the presented method, this loss network is typically a 16-layer convolutional classification network, and its learned feature representations serve as a perceptual metric for content and style. The key design insight is that a network trained for classification already contains informative intermediate features that correlate with human-perceived image similarity, so these features can be reused inside the loss function instead of relying only on raw pixel distance.

The transformation network follows fully convolutional architectural guidelines with residual blocks. It does not use pooling layers. Instead, downsampling and upsampling are performed with strided and fractionally strided convolutions. All non-residual convolutional layers are followed by spatial batch normalization and ReLU nonlinearities, except the output layer, which uses a scaled tanh⁡\tanhtanh activation to constrain the output pixel values. The first and final layers use 9×99 \times 99×9 kernels, while the remaining convolutional layers use 3×33 \times 33×3 kernels.

For style transfer, the network maps color images of size 3×256×2563 \times 256 \times 2563×256×256 to color images of the same size. For single-image super-resolution with upsampling factor fff, the network produces a high-resolution patch of size 3×288×2883 \times 288 \times 2883×288×288 from a low-resolution patch of size 3×288/f×288/f3 \times 288/f \times 288/f3×288/f×288/f. Because the architecture is fully convolutional, it can be applied to images of different resolutions at test time.

The downsampling and upsampling design is central to both efficiency and receptive field growth. In style transfer, the network uses two stride-2 convolutions to reduce spatial size, then several residual blocks, then two fractionally strided convolutions with stride 1/21/21/2 to restore the original resolution. For super-resolution, after a sequence of residual blocks, it applies log⁡2f\log_2 flog2​f convolutional layers with stride 1/21/21/2. This avoids using a fixed interpolation step for upsampling. Instead, the upsampling behavior is learned jointly with the rest of the transformation network.

Downsampling before the deep residual body has two practical benefits. First, it reduces computational cost. A 3×33 \times 33×3 convolution with CCC filters applied to a feature map of size C×H×WC \times H \times WC×H×W has the same computational cost as a 3×33 \times 33×3 convolution with DCDCDC filters applied to a feature map of size DC×H/D×W/DDC \times H/D \times W/DDC×H/D×W/D. Therefore, after downsampling, the network can use wider feature representations at similar cost. Second, downsampling enlarges the effective receptive field. Without downsampling, each 3×33 \times 33×3 convolution increases the effective receptive field by 2 pixels. After downsampling by a factor DDD, the same 3×33 \times 33×3 convolution increases the effective receptive field by 2D2D2D. This is important for style transfer because coherent style effects require large, spatially aware changes across the image.

The perceptual loss design uses the fixed loss network ϕ\phiϕ to compute both content and style objectives. Let ϕj(x)\phi_j(x)ϕj​(x) denote the activations at layer jjj of the loss network when processing image xxx. If layer jjj is convolutional, ϕj(x)\phi_j(x)ϕj​(x) is a feature map of shape Cj×Hj×WjC_j \times H_j \times W_jCj​×Hj​×Wj​. Instead of matching raw pixels between y^\hat{y}y^​ and a target image yyy, the feature reconstruction loss encourages similar feature representations:

ℓfeatϕ,j(y^,y)=1CjHjWj∥ϕj(y^)−ϕj(y)∥22.\ell_{\text{feat}}^{\phi,j}(\hat{y},y) = \frac{1}{C_j H_j W_j} \left\| \phi_j(\hat{y}) - \phi_j(y) \right\|_2^2.ℓfeatϕ,j​(y^​,y)=Cj​Hj​Wj​1​∥ϕj​(y^​)−ϕj​(y)∥22​.

Early layers in the pretrained classification network preserve low-level appearance details, so reconstructing from early layers tends to produce images that are very close to the original in color, texture, and local structure. Higher layers preserve content and global spatial organization while ignoring many fine texture details. Refer to the visual feature-reconstruction comparison across network depths.

The style reconstruction loss measures differences in texture, color statistics, and co-occurring feature patterns. It is defined using the Gram matrix of the feature map. For image xxx, the Gram matrix at layer jjj is a Cj×CjC_j \times C_jCj​×Cj​ matrix whose entries are

Gj,c,c′ϕ(x)=1CjHjWj∑h=1Hj∑w=1Wjϕj(x)h,w,cϕj(x)h,w,c′.G_{j,c,c'}^{\phi}(x) = \frac{1}{C_j H_j W_j} \sum_{h=1}^{H_j} \sum_{w=1}^{W_j} \phi_j(x)_{h,w,c} \phi_j(x)_{h,w,c'}.Gj,c,c′ϕ​(x)=Cj​Hj​Wj​1​h=1∑Hj​​w=1∑Wj​​ϕj​(x)h,w,c​ϕj​(x)h,w,c′​.

If ϕj(x)\phi_j(x)ϕj​(x) is interpreted as CjC_jCj​-dimensional features extracted at each spatial location, the Gram matrix approximates the uncentered covariance of those features across spatial positions. It captures which features activate together. The Gram matrix can be computed efficiently by reshaping ϕj(x)\phi_j(x)ϕj​(x) into a Cj×HjWjC_j \times H_jW_jCj​×Hj​Wj​ matrix ψ\psiψ and computing

Gjϕ(x)=ψψTCjHjWj.G_j^{\phi}(x) = \frac{\psi \psi^T}{C_j H_j W_j}.Gjϕ​(x)=Cj​Hj​Wj​ψψT​.

The single-layer style loss is then

ℓstyleϕ,j(y^,y)=∥Gjϕ(y^)−Gjϕ(y)∥F2.\ell_{\text{style}}^{\phi,j}(\hat{y},y) = \left\| G_j^{\phi}(\hat{y}) - G_j^{\phi}(y) \right\|_F^2.ℓstyleϕ,j​(y^​,y)=​Gjϕ​(y^​)−Gjϕ​(y)​F2​.

For style transfer from a set of layers JJJ, the style loss is summed over those layers:

ℓstyleϕ,J(y^,y)=∑j∈Jℓstyleϕ,j(y^,y).\ell_{\text{style}}^{\phi,J}(\hat{y},y) = \sum_{j \in J} \ell_{\text{style}}^{\phi,j}(\hat{y},y).ℓstyleϕ,J​(y^​,y)=j∈J∑​ℓstyleϕ,j​(y^​,y).

This formulation is useful because the Gram matrix is computed from feature statistics rather than spatially aligned pixel values. Therefore, the style loss remains well-defined even when the output image and the style target have different sizes. Minimizing this loss encourages the output image to reproduce the statistical appearance patterns of the style target while not requiring preservation of the exact spatial layout of that target.

In addition to perceptual losses, the method uses simple pixel-space objectives when needed. The pixel loss is the normalized squared Euclidean distance between the output and target image:

ℓpixel(y^,y)=1CHW∥y^−y∥22.\ell_{\text{pixel}}(\hat{y},y) = \frac{1}{CHW} \left\| \hat{y} - y \right\|_2^2.ℓpixel​(y^​,y)=CHW1​∥y^​−y∥22​.

This loss is appropriate when a ground-truth target image exists, such as in super-resolution. A total variation regularizer is also applied to the output to discourage excessive spatial noise and encourage smoother local structure.

For style transfer, the training setup usually uses one transformation network per style target. The content target is the input image xxx, and the style target ysy_sys​ controls the visual style of the output. The network is trained to minimize a weighted combination of feature reconstruction loss, style reconstruction loss, and total variation regularization. For super-resolution, the input xxx is the low-resolution image, the content target ycy_cyc​ is the high-resolution ground truth, and the style loss is typically omitted. One network is trained for each super-resolution factor.

The resulting training process shifts the computational burden from inference to training. Direct optimization generates one image at a time by repeatedly minimizing the same perceptual objective through the fixed loss network. The proposed method instead trains a feedforward transformation network so that, after training, style transfer or super-resolution can be performed by a single forward pass. The learned network is optimized against the same perceptual objective family used by iterative optimization methods, while also being able to generalize to larger input images than those used during training. This objective and generalization behavior is shown in the comparison of loss values during iterative optimization and output quality across resolutions.

Experiment

The experiments evaluate the approach on style transfer and single-image super-resolution. For style transfer, feed-forward networks trained on MS-COCO are compared with an optimization-based baseline, showing similar visual quality while greatly reducing inference time and preserving semantic content even at larger resolutions. For super-resolution, models trained with feature reconstruction loss are compared with pixel-loss and SRCNN baselines, demonstrating that perceptual features improve sharp edges and fine details despite possible increases in low-level artifacts.

For style transfer, the feed-forward network is much faster than the iterative optimization baseline while producing similar qualitative results. The speed advantage is large across multiple image resolutions and remains strong as resolution increases. Generates style-transfer results in a fraction of the time required by the baseline. Can be faster than a single optimization step of the baseline method. Maintains similar qualitative output quality despite a large runtime reduction.

Experiments compare a feed-forward network with an iterative optimization baseline for style transfer across multiple image resolutions. The results validate that the feed-forward model generates stylized images much faster while maintaining similar qualitative output, with the speed advantage remaining strong at higher resolutions and even exceeding a single optimization step of the baseline.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp