{"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/prompt-based-all-in-one-image-restoration","title":"Prompt-based Ingredient-Oriented All-in-One Image Restoration","arxiv_id":"2309.03063","date":"2023-09-06","proceeding":null,"authors":["Hu Gao","Depeng Dang"],"abstract":"Image restoration aims to recover the high-quality images from their degraded observations. Since most existing methods have been dedicated into single degradation removal, they may not yield optimal results on other types of degradations, which do not satisfy the applications in real world scenarios. In this paper, we propose a novel data ingredient-oriented approach that leverages prompt-based learning to enable a single model to efficiently tackle multiple image degradation tasks. Specifically, we utilize a encoder to capture features and introduce prompts with degradation-specific information to guide the decoder in adaptively recovering images affected by various degradations. In order to model the local invariant properties and non-local information for high-quality image restoration, we combined CNNs operations and Transformers. Simultaneously, we made several key designs in the Transformer blocks (multi-head rearranged attention with prompts and simple-gate feed-forward network) to reduce computational requirements and selectively determines what information should be persevered to facilitate efficient recovery of potentially sharp images. Furthermore, we incorporate a feature fusion mechanism further explores the multi-scale information to improve the aggregated features. The resulting tightly interlinked hierarchy architecture, named as CAPTNet, extensive experiments demonstrate that our method performs competitively to the state-of-the-art.","url_abs":"https://arxiv.org/abs/2309.03063v2","url_pdf":"https://arxiv.org/pdf/2309.03063v2.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":"prompt-based-all-in-one-image-restoration","repo_url":"https://github.com/Tombs98/CAPTNet","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"all","task_name":"All"},{"task_slug":"deblurring","task_name":"Deblurring"},{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"image-deblurring","task_name":"Image Deblurring"},{"task_slug":"image-restoration","task_name":"Image Restoration"},{"task_slug":"single-image-deraining","task_name":"Single Image Deraining"}],"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":[{"leaderboard":"/sota/deblurring-on-hide-trained-on-gopro","task":"Deblurring","dataset":"HIDE (trained on GOPRO)","model":"CAPTNet","rank_in_archive_order":4,"of":26,"metrics":{"PSNR (sRGB)":"31.86","SSIM (sRGB)":"0.949"},"uses_additional_data":false},{"leaderboard":"/sota/image-deblurring-on-gopro","task":"Image Deblurring","dataset":"GoPro","model":"CAPTNet","rank_in_archive_order":16,"of":55,"metrics":{"PSNR":"33.74","SSIM":"0.967"},"uses_additional_data":false},{"leaderboard":"/sota/single-image-deraining-on-rain100l","task":"Single Image Deraining","dataset":"Rain100L","model":"CAPTNet","rank_in_archive_order":6,"of":19,"metrics":{"PSNR":"39.22","SSIM":"0.981"},"uses_additional_data":false},{"leaderboard":"/sota/single-image-deraining-on-test1200","task":"Single Image Deraining","dataset":"Test1200","model":"CAPTNet","rank_in_archive_order":1,"of":14,"metrics":{"PSNR":"34.77","SSIM":"0.937"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.03063","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.03063"}},"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/Tombs98/CAPTNet","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran":11,"unverified":1},"by_repo_kind":{"official":{"samples":12,"ran":11,"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":12,"samples":[{"code_sha256_prefix":"b0a14f63a15e798e","entry":"calculate_psnr","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"cal.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/cal.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"b0a14f63a15e798e"}},{"code_sha256_prefix":"cd7e5b7320aed3d2","entry":"flow_warp","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"utils/arch_utils.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/utils/arch_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"cd7e5b7320aed3d2"}},{"code_sha256_prefix":"930cddf0a4d80ab1","entry":"is_frozen","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"utils/model_utils.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/utils/model_utils.py","link_basis":"harvester_set","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":"930cddf0a4d80ab1"}},{"code_sha256_prefix":"91fca7a2b44569ad","entry":"is_image_file","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"dataset_RGB.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/dataset_RGB.py","link_basis":"harvester_set","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":"91fca7a2b44569ad"}},{"code_sha256_prefix":"c3bea8c4ee6bef4a","entry":"load_start_epoch","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"utils/model_utils.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/utils/model_utils.py","link_basis":"harvester_set","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":"c3bea8c4ee6bef4a"}},{"code_sha256_prefix":"09ff3a6c27965536","entry":"make_layer","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"utils/arch_utils.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/utils/arch_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"09ff3a6c27965536"}},{"code_sha256_prefix":"92bb8e7c6d06af3f","entry":"numpyPSNR","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"utils/image_utils.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/utils/image_utils.py","link_basis":"harvester_set","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":"92bb8e7c6d06af3f"}},{"code_sha256_prefix":"9081354b1a5b7c3e","entry":"resize_flow","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"utils/arch_utils.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/utils/arch_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9081354b1a5b7c3e"}},{"code_sha256_prefix":"c87a3a8603bcab49","entry":"rgb2ycbcr","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"cal.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/cal.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"c87a3a8603bcab49"}},{"code_sha256_prefix":"73f51043ee4046f1","entry":"to_y_channel","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"cal.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/cal.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"73f51043ee4046f1"}},{"code_sha256_prefix":"deaed84dcb1ccde1","entry":"torchPSNR","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"utils/image_utils.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/utils/image_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"deaed84dcb1ccde1"}},{"code_sha256_prefix":"a2bb271e0661073c","entry":"master_only","repo":"Tombs98/CAPTNet","repo_kind":"official","path":"utils/dist_util.py","file_url":"https://github.com/Tombs98/CAPTNet/blob/HEAD/utils/dist_util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"a2bb271e0661073c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}