{"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/accurate-image-restoration-with-attention","title":"Accurate Image Restoration with Attention Retractable Transformer","arxiv_id":"2210.01427","date":"2022-10-04","proceeding":null,"authors":["Jiale Zhang","Yulun Zhang","Jinjin Gu","Yongbing Zhang","Linghe Kong","Xin Yuan"],"abstract":"Recently, Transformer-based image restoration networks have achieved promising improvements over convolutional neural networks due to parameter-independent global interactions. To lower computational cost, existing works generally limit self-attention computation within non-overlapping windows. However, each group of tokens are always from a dense area of the image. This is considered as a dense attention strategy since the interactions of tokens are restrained in dense regions. Obviously, this strategy could result in restricted receptive fields. To address this issue, we propose Attention Retractable Transformer (ART) for image restoration, which presents both dense and sparse attention modules in the network. The sparse attention module allows tokens from sparse areas to interact and thus provides a wider receptive field. Furthermore, the alternating application of dense and sparse attention modules greatly enhances representation ability of Transformer while providing retractable attention on the input image.We conduct extensive experiments on image super-resolution, denoising, and JPEG compression artifact reduction tasks. Experimental results validate that our proposed ART outperforms state-of-the-art methods on various benchmark datasets both quantitatively and visually. We also provide code and models at https://github.com/gladzhang/ART.","url_abs":"https://arxiv.org/abs/2210.01427v4","url_pdf":"https://arxiv.org/pdf/2210.01427v4.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":"accurate-image-restoration-with-attention","repo_url":"https://github.com/gladzhang/art","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"image-restoration","task_name":"Image Restoration"},{"task_slug":"image-super-resolution","task_name":"Image Super-Resolution"},{"task_slug":"jpeg-compression-artifact-reduction","task_name":"Jpeg Compression Artifact Reduction"},{"task_slug":"super-resolution","task_name":"Super-Resolution"}],"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":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2210.01427","atlas_url":"https://app.syntology.ai/?focus=2210.01427","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.01427"}},"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":"deterministic:regex_extraction","url":"https://github.com/gladzhang/ART","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gladzhang/art","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":4,"unverified":4},"by_repo_kind":{"official":{"samples":8,"ran":4,"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":"fe1598fcd19fedfc","entry":"Attention","repo":"gladzhang/art","repo_kind":"official","path":"basicsr/archs/art_arch.py","file_url":"https://github.com/gladzhang/art/blob/HEAD/basicsr/archs/art_arch.py","link_basis":"first_harvest_node","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":"fe1598fcd19fedfc"}},{"code_sha256_prefix":"04e6e6cd08c7fada","entry":"DynamicPosBias","repo":"gladzhang/art","repo_kind":"official","path":"basicsr/archs/art_arch.py","file_url":"https://github.com/gladzhang/art/blob/HEAD/basicsr/archs/art_arch.py","link_basis":"first_harvest_node","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":"04e6e6cd08c7fada"}},{"code_sha256_prefix":"b0ea27d09b40fb2c","entry":"PatchEmbed","repo":"gladzhang/art","repo_kind":"official","path":"basicsr/archs/art_arch.py","file_url":"https://github.com/gladzhang/art/blob/HEAD/basicsr/archs/art_arch.py","link_basis":"first_harvest_node","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":"b0ea27d09b40fb2c"}},{"code_sha256_prefix":"3e54d348693d9f3a","entry":"PatchUnEmbed","repo":"gladzhang/art","repo_kind":"official","path":"basicsr/archs/art_arch.py","file_url":"https://github.com/gladzhang/art/blob/HEAD/basicsr/archs/art_arch.py","link_basis":"first_harvest_node","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":"3e54d348693d9f3a"}},{"code_sha256_prefix":"9220ac25e46711c1","entry":"ART","repo":"gladzhang/art","repo_kind":"official","path":"basicsr/archs/art_arch.py","file_url":"https://github.com/gladzhang/art/blob/HEAD/basicsr/archs/art_arch.py","link_basis":"first_harvest_node","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":"9220ac25e46711c1"}},{"code_sha256_prefix":"35553a2372f582dc","entry":"ARTTransformerBlock","repo":"gladzhang/art","repo_kind":"official","path":"basicsr/archs/art_arch.py","file_url":"https://github.com/gladzhang/art/blob/HEAD/basicsr/archs/art_arch.py","link_basis":"first_harvest_node","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":"35553a2372f582dc"}},{"code_sha256_prefix":"cce56a347b2404f9","entry":"BasicLayer","repo":"gladzhang/art","repo_kind":"official","path":"basicsr/archs/art_arch.py","file_url":"https://github.com/gladzhang/art/blob/HEAD/basicsr/archs/art_arch.py","link_basis":"first_harvest_node","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":"cce56a347b2404f9"}},{"code_sha256_prefix":"c5d02895fae0d2b3","entry":"ResidualGroup","repo":"gladzhang/art","repo_kind":"official","path":"basicsr/archs/art_arch.py","file_url":"https://github.com/gladzhang/art/blob/HEAD/basicsr/archs/art_arch.py","link_basis":"first_harvest_node","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":"c5d02895fae0d2b3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}