{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/adaattn-revisit-attention-mechanism-in","title":"AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer","arxiv_id":"2108.03647","date":"2021-08-08","proceeding":"ICCV 2021 10","authors":["Songhua Liu","Tianwei Lin","Dongliang He","Fu Li","Meiling Wang","Xin Li","Zhengxing Sun","Qian Li","Errui Ding"],"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.","url_abs":"https://arxiv.org/abs/2108.03647v2","url_pdf":"https://arxiv.org/pdf/2108.03647v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"adaattn-revisit-attention-mechanism-in","repo_url":"https://github.com/huage001/adaattn","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"adaattn-revisit-attention-mechanism-in","repo_url":"https://github.com/wzmsltw/adaattn","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"paddle","reach":{"status":"ok"}},{"paper_slug":"adaattn-revisit-attention-mechanism-in","repo_url":"https://github.com/gaetano-signorelli/Attention-Style-Transfer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null}],"tasks":[{"task_slug":"style-transfer","task_name":"Style Transfer"},{"task_slug":"video-style-transfer","task_name":"Video Style Transfer"}],"methods":[{"method_slug":"attentive-normalization","method_name":"Attentive Normalization"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/style-transfer-on-stylebench","task":"Style Transfer","dataset":"StyleBench","model":"AdaAttN","rank_in_archive_order":5,"of":7,"metrics":{"CLIP Score":"0.569"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2108.03647","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2108.03647"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gaetano-signorelli/Attention-Style-Transfer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wzmsltw/adaattn","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/huage001/adaattn","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/wzmsltw/AdaAttN","reach":{"status":"ok"}}],"summary":{"ran":3,"ran_fixture":2},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":2,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":4,"samples":[{"code_sha256_prefix":"4f2e5459ea18fa72","entry":"AdaAttN","repo":"huage001/adaattn","repo_kind":"official","path":"models/networks.py","file_url":"https://github.com/huage001/adaattn/blob/HEAD/models/networks.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4f2e5459ea18fa72"}},{"code_sha256_prefix":"0014631263abc63f","entry":"AdaptiveAttentionLayer","repo":"gaetano-signorelli/Attention-Style-Transfer","repo_kind":"listed","path":"src/architecture/layers/adaptive_attention_layer.py","file_url":"https://github.com/gaetano-signorelli/Attention-Style-Transfer/blob/HEAD/src/architecture/layers/adaptive_attention_layer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0014631263abc63f"}},{"code_sha256_prefix":"7445920a4db7720f","entry":"NormalizeLayer","repo":"gaetano-signorelli/Attention-Style-Transfer","repo_kind":"listed","path":"src/architecture/layers/adaptive_attention_layer.py","file_url":"https://github.com/gaetano-signorelli/Attention-Style-Transfer/blob/HEAD/src/architecture/layers/adaptive_attention_layer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7445920a4db7720f"}},{"code_sha256_prefix":"38eaf8511dc7bc9c","entry":"calc_mean_std","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"38eaf8511dc7bc9c"}},{"code_sha256_prefix":"19f218161cc28c54","entry":"mean_variance_norm","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"19f218161cc28c54"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}