{"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/the-devil-is-in-the-details-window-based","title":"The Devil Is in the Details: Window-based Attention for Image Compression","arxiv_id":"2203.08450","date":"2022-03-16","proceeding":"CVPR 2022 1","authors":["Renjie Zou","Chunfeng Song","Zhaoxiang Zhang"],"abstract":"Learned image compression methods have exhibited superior rate-distortion performance than classical image compression standards. Most existing learned image compression models are based on Convolutional Neural Networks (CNNs). Despite great contributions, a main drawback of CNN based model is that its structure is not designed for capturing local redundancy, especially the non-repetitive textures, which severely affects the reconstruction quality. Therefore, how to make full use of both global structure and local texture becomes the core problem for learning-based image compression. Inspired by recent progresses of Vision Transformer (ViT) and Swin Transformer, we found that combining the local-aware attention mechanism with the global-related feature learning could meet the expectation in image compression. In this paper, we first extensively study the effects of multiple kinds of attention mechanisms for local features learning, then introduce a more straightforward yet effective window-based local attention block. The proposed window-based attention is very flexible which could work as a plug-and-play component to enhance CNN and Transformer models. Moreover, we propose a novel Symmetrical TransFormer (STF) framework with absolute transformer blocks in the down-sampling encoder and up-sampling decoder. Extensive experimental evaluations have shown that the proposed method is effective and outperforms the state-of-the-art methods. The code is publicly available at https://github.com/Googolxx/STF.","url_abs":"https://arxiv.org/abs/2203.08450v1","url_pdf":"https://arxiv.org/pdf/2203.08450v1.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":"the-devil-is-in-the-details-window-based","repo_url":"https://github.com/googolxx/stf","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"the-devil-is-in-the-details-window-based","repo_url":"https://github.com/VincentChandelier/STF-QVRF","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"image-compression","task_name":"Image Compression"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"stochastic-depth","method_name":"Stochastic Depth"},{"method_slug":"swin-transformer","method_name":"Swin Transformer"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"vision-transformer","method_name":"Vision Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-compression-on-kodak","task":"Image Compression","dataset":"kodak","model":"WACNN","rank_in_archive_order":6,"of":8,"metrics":{"BD-Rate over VTM-17.0":"-2.95"},"uses_additional_data":false},{"leaderboard":"/sota/image-compression-on-kodak","task":"Image Compression","dataset":"kodak","model":"STF","rank_in_archive_order":7,"of":8,"metrics":{"BD-Rate over VTM-17.0":"-2.48"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2203.08450","atlas_url":"https://app.syntology.ai/?focus=2203.08450","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.08450"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/googolxx/stf","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/VincentChandelier/STF-QVRF","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":3,"ran":5,"ran_honours":3,"ran_fixture":1,"unverified":3},"by_repo_kind":{"official":{"samples":15,"ran":12,"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":0,"samples":[{"code_sha256_prefix":"f2cea3e9848ae52d","entry":"conv","repo":"googolxx/stf","repo_kind":"official","path":"compressai/models/utils.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/models/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f2cea3e9848ae52d"}},{"code_sha256_prefix":"15eae621014906be","entry":"conv1x1","repo":"googolxx/stf","repo_kind":"official","path":"compressai/layers/layers.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/layers/layers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"15eae621014906be"}},{"code_sha256_prefix":"0cbeed6985b2cf30","entry":"conv3x3","repo":"googolxx/stf","repo_kind":"official","path":"compressai/layers/layers.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/layers/layers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0cbeed6985b2cf30"}},{"code_sha256_prefix":"a94389b554ddc179","entry":"find_named_buffer","repo":"googolxx/stf","repo_kind":"official","path":"compressai/models/utils.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/models/utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a94389b554ddc179"}},{"code_sha256_prefix":"feb29b32fc1ec50e","entry":"get_scale_table","repo":"googolxx/stf","repo_kind":"official","path":"compressai/models/cnn.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/models/cnn.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"feb29b32fc1ec50e"}},{"code_sha256_prefix":"1eca81f63e28f103","entry":"get_scale_table","repo":"googolxx/stf","repo_kind":"official","path":"compressai/models/stf.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/models/stf.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1eca81f63e28f103"}},{"code_sha256_prefix":"8e528b0db078ab0e","entry":"ste_round","repo":"googolxx/stf","repo_kind":"official","path":"compressai/ops/ops.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/ops/ops.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8e528b0db078ab0e"}},{"code_sha256_prefix":"8bc3a872b71e34f4","entry":"subpel_conv3x3","repo":"googolxx/stf","repo_kind":"official","path":"compressai/layers/layers.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/layers/layers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8bc3a872b71e34f4"}},{"code_sha256_prefix":"f6b2d702fc756d64","entry":"window_partition","repo":"googolxx/stf","repo_kind":"official","path":"compressai/models/stf.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/models/stf.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f6b2d702fc756d64"}},{"code_sha256_prefix":"565f4668acf5b8f4","entry":"window_partition","repo":"googolxx/stf","repo_kind":"official","path":"compressai/layers/win_attention.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/layers/win_attention.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"565f4668acf5b8f4"}},{"code_sha256_prefix":"fb32094c6dbece71","entry":"window_reverse","repo":"googolxx/stf","repo_kind":"official","path":"compressai/layers/win_attention.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/layers/win_attention.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fb32094c6dbece71"}},{"code_sha256_prefix":"7b0d02f75bf6b439","entry":"window_reverse","repo":"googolxx/stf","repo_kind":"official","path":"compressai/models/stf.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/models/stf.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7b0d02f75bf6b439"}},{"code_sha256_prefix":"0b4d7c9d1baaf828","entry":"find_named_module","repo":"googolxx/stf","repo_kind":"official","path":"compressai/models/utils.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/models/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0b4d7c9d1baaf828"}},{"code_sha256_prefix":"07f8484bf7fe9b22","entry":"lower_bound_bwd","repo":"googolxx/stf","repo_kind":"official","path":"compressai/ops/bound_ops.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/ops/bound_ops.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"07f8484bf7fe9b22"}},{"code_sha256_prefix":"9d2139d32f9bca32","entry":"lower_bound_fwd","repo":"googolxx/stf","repo_kind":"official","path":"compressai/ops/bound_ops.py","file_url":"https://github.com/googolxx/stf/blob/HEAD/compressai/ops/bound_ops.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9d2139d32f9bca32"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}