AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer

Songhua Liu, Tianwei Lin, Dongliang He, Fu Li, Meiling Wang +4 more
8/8/2021
cs.CV

Official code: Huage001/AdaAttN (249 stars, Apache-2.0, last commit 2024-03-24). 1 more implementation below.

Abstract

Fast arbitrary neural style transfer has attracted widespread attention from academic, industrial and art communities due to its flexibility in enabling various applications. Existing solutions either attentively fuse deep style feature into deep content feature without considering feature distributions, or adaptively normalize deep content feature according to the style such that their global statistics are matched. Although effective, leaving shallow feature unexplored and without locally considering feature statistics, they are prone to unnatural output with unpleasing local distortions. To alleviate this problem, in this paper, we propose a novel attention and normalization module, named Adaptive Attention Normalization (AdaAttN), to adaptively perform attentive normalization on per-point basis. Specifically, spatial attention score is learnt from both shallow and deep features of content and style images. Then per-point weighted statistics are calculated by regarding a style feature point as a distribution of attention-weighted output of all style feature points. Finally, the content feature is normalized so that they demonstrate the same local feature statistics as the calculated per-point weighted style feature statistics. Besides, a novel local feature loss is derived based on AdaAttN to enhance local visual quality. We also extend AdaAttN to be ready for video style transfer with slight modifications. Experiments demonstrate that our method achieves state-of-the-art arbitrary image/video style transfer. Codes and models are available.

View on arXivView PDF

Code Implementations(2)

Huage001/AdaAttNOfficial100%
Apache-2.0

Officially unofficial PyTorch re-implementation of paper: AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer, ICCV 2021.

24934Shell, PythonAug 6, 20212 years agoApache-2.0
style-transfer
wzmsltw/AdaAttNOfficial100%

Official PaddlePaddle implementation of AdaAttN

250Aug 11, 20215 years ago

Similar Papers

Cite this paper

@article{liu2021adaattn,
  title  = {AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer},
  author = {Songhua Liu and Tianwei Lin and Dongliang He and Fu Li and Meiling Wang and Xin Li and Zhengxing Sun and Qian Li and Errui Ding},
  year   = {2021},
  eprint = {2108.03647},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2108.03647}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2108.03647.svg)](https://codeofpaper.com/paper/2108.03647)

Discussion