{"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/safnet-selective-alignment-fusion-network-for","title":"SAFNet: Selective Alignment Fusion Network for Efficient HDR Imaging","arxiv_id":"2407.16308","date":"2024-07-23","proceeding":null,"authors":["Lingtong Kong","Bo Li","Yike Xiong","Hao Zhang","Hong Gu","Jinwei Chen"],"abstract":"Multi-exposure High Dynamic Range (HDR) imaging is a challenging task when facing truncated texture and complex motion. Existing deep learning-based methods have achieved great success by either following the alignment and fusion pipeline or utilizing attention mechanism. However, the large computation cost and inference delay hinder them from deploying on resource limited devices. In this paper, to achieve better efficiency, a novel Selective Alignment Fusion Network (SAFNet) for HDR imaging is proposed. After extracting pyramid features, it jointly refines valuable area masks and cross-exposure motion in selected regions with shared decoders, and then fuses high quality HDR image in an explicit way. This approach can focus the model on finding valuable regions while estimating their easily detectable and meaningful motion. For further detail enhancement, a lightweight refine module is introduced which enjoys privileges from previous optical flow, selection masks and initial prediction. Moreover, to facilitate learning on samples with large motion, a new window partition cropping method is presented during training. Experiments on public and newly developed challenging datasets show that proposed SAFNet not only exceeds previous SOTA competitors quantitatively and qualitatively, but also runs order of magnitude faster. Code and dataset is available at https://github.com/ltkong218/SAFNet.","url_abs":"https://arxiv.org/abs/2407.16308v1","url_pdf":"https://arxiv.org/pdf/2407.16308v1.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":"safnet-selective-alignment-fusion-network-for","repo_url":"https://github.com/ltkong218/safnet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"optical-flow-estimation","task_name":"Optical Flow Estimation"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"focus","method_name":"Focus"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2407.16308","atlas_url":"https://app.syntology.ai/?focus=2407.16308","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.16308"}},"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/ltkong218/safnet","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/ltkong218/SAFNet","reach":{"status":"ok"}}],"summary":{"ran":5,"ran_draft_wrong":8,"ran_fixture":1,"unverified":3},"by_repo_kind":{"official":{"samples":17,"ran":14,"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":17,"samples":[{"code_sha256_prefix":"526a08dea587b0f9","entry":"Encoder","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"526a08dea587b0f9"}},{"code_sha256_prefix":"bf675e7fb0a9f61c","entry":"RefineNet","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bf675e7fb0a9f61c"}},{"code_sha256_prefix":"c3f4d7b585938d35","entry":"ResBlock","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c3f4d7b585938d35"}},{"code_sha256_prefix":"cdcf7fd9884d712b","entry":"channel_shuffle","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cdcf7fd9884d712b"}},{"code_sha256_prefix":"1a30c25d56937bad","entry":"convrelu","repo":"ltkong218/safnet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/safnet/blob/HEAD/models/SAFNet.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1a30c25d56937bad"}},{"code_sha256_prefix":"1cea7934f596790b","entry":"deconv","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1cea7934f596790b"}},{"code_sha256_prefix":"16e26a9c44539572","entry":"merge_hdr","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"16e26a9c44539572"}},{"code_sha256_prefix":"85874809cf85c428","entry":"read_expos","repo":"ltkong218/safnet","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/ltkong218/safnet/blob/HEAD/datasets.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":"85874809cf85c428"}},{"code_sha256_prefix":"2cc097fc1e814937","entry":"read_ldr","repo":"ltkong218/safnet","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/ltkong218/safnet/blob/HEAD/datasets.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":"2cc097fc1e814937"}},{"code_sha256_prefix":"b44a1e73d2f3547f","entry":"resize","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b44a1e73d2f3547f"}},{"code_sha256_prefix":"a4d5c37ca03cf29f","entry":"warp","repo":"ltkong218/safnet","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ltkong218/safnet/blob/HEAD/utils.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a4d5c37ca03cf29f"}},{"code_sha256_prefix":"3f38af8e9abcc9d3","entry":"weight_3expo_high_tog17","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3f38af8e9abcc9d3"}},{"code_sha256_prefix":"8d6f40f73b25f251","entry":"weight_3expo_low_tog17","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8d6f40f73b25f251"}},{"code_sha256_prefix":"c39e0b2a9f1e3d59","entry":"weight_3expo_mid_tog17","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c39e0b2a9f1e3d59"}},{"code_sha256_prefix":"6cc52ba724aaaaf2","entry":"Decoder","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6cc52ba724aaaaf2"}},{"code_sha256_prefix":"929bc378e8866c39","entry":"SAFNet","repo":"ltkong218/SAFNet","repo_kind":"official","path":"models/SAFNet.py","file_url":"https://github.com/ltkong218/SAFNet/blob/HEAD/models/SAFNet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"929bc378e8866c39"}},{"code_sha256_prefix":"5b156f6ddc69668b","entry":"read_hdr","repo":"ltkong218/safnet","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/ltkong218/safnet/blob/HEAD/datasets.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5b156f6ddc69668b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}