{"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/learning-a-physical-aware-diffusion-model","title":"Learning A Physical-aware Diffusion Model Based on Transformer for Underwater Image Enhancement","arxiv_id":"2403.01497","date":"2024-03-03","proceeding":null,"authors":["Chen Zhao","Chenyu Dong","Weiling Cai"],"abstract":"Underwater visuals undergo various complex degradations, inevitably influencing the efficiency of underwater vision tasks. Recently, diffusion models were employed to underwater image enhancement (UIE) tasks, and gained SOTA performance. However, these methods fail to consider the physical properties and underwater imaging mechanisms in the diffusion process, limiting information completion capacity of diffusion models. In this paper, we introduce a novel UIE framework, named PA-Diff, designed to exploiting the knowledge of physics to guide the diffusion process. PA-Diff consists of Physics Prior Generation (PPG) Branch, Implicit Neural Reconstruction (INR) Branch, and Physics-aware Diffusion Transformer (PDT) Branch. Our designed PPG branch aims to produce the prior knowledge of physics. With utilizing the physics prior knowledge to guide the diffusion process, PDT branch can obtain underwater-aware ability and model the complex distribution in real-world underwater scenes. INR Branch can learn robust feature representations from diverse underwater image via implicit neural representation, which reduces the difficulty of restoration for PDT branch. Extensive experiments prove that our method achieves best performance on UIE tasks.","url_abs":"https://arxiv.org/abs/2403.01497v2","url_pdf":"https://arxiv.org/pdf/2403.01497v2.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":"learning-a-physical-aware-diffusion-model","repo_url":"https://github.com/chenydong/pa-diff","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"image-enhancement","task_name":"Image Enhancement"},{"task_slug":"uie","task_name":"UIE"}],"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":"diffusion","method_name":"Diffusion"},{"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":{"atlas_url":"https://app.syntology.ai/?focus=2403.01497","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.01497"}},"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/chenydong/pa-diff","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":6,"ran_violates":2,"ran_draft_wrong":3,"ran_honours":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":"9394ff2c25b8a988","entry":"calculate_psnr","repo":"chenydong/pa-diff","repo_kind":"official","path":"core/metrics.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/core/metrics.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":"9394ff2c25b8a988"}},{"code_sha256_prefix":"fbf9ec7be545688e","entry":"default","repo":"chenydong/pa-diff","repo_kind":"official","path":"model/ddpm_trans_modules/diffusion.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/model/ddpm_trans_modules/diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fbf9ec7be545688e"}},{"code_sha256_prefix":"7e1f7c581619b800","entry":"default_conv","repo":"chenydong/pa-diff","repo_kind":"official","path":"model/ddpm_trans_modules/PPU.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/model/ddpm_trans_modules/PPU.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7e1f7c581619b800"}},{"code_sha256_prefix":"40c52ad98161c17b","entry":"dict2str","repo":"chenydong/pa-diff","repo_kind":"official","path":"core/logger.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/core/logger.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":"40c52ad98161c17b"}},{"code_sha256_prefix":"ada7273eee7081c7","entry":"dict_to_nonedict","repo":"chenydong/pa-diff","repo_kind":"official","path":"core/logger.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/core/logger.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":"ada7273eee7081c7"}},{"code_sha256_prefix":"608e364a9d2376a3","entry":"exists","repo":"chenydong/pa-diff","repo_kind":"official","path":"model/ddpm_trans_modules/diffusion.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/model/ddpm_trans_modules/diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"608e364a9d2376a3"}},{"code_sha256_prefix":"91325ea11845812d","entry":"gram_matrix","repo":"chenydong/pa-diff","repo_kind":"official","path":"model/ddpm_trans_modules/style_transfer.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/model/ddpm_trans_modules/style_transfer.py","link_basis":"first_harvest_node","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":"91325ea11845812d"}},{"code_sha256_prefix":"1855446869c2370c","entry":"load_part_of_model","repo":"chenydong/pa-diff","repo_kind":"official","path":"model/utils.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/model/utils.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":"1855446869c2370c"}},{"code_sha256_prefix":"bdbc72e56312023e","entry":"load_part_of_model2","repo":"chenydong/pa-diff","repo_kind":"official","path":"model/utils.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/model/utils.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":"bdbc72e56312023e"}},{"code_sha256_prefix":"90be2f67f3d453d7","entry":"make_beta_schedule","repo":"chenydong/pa-diff","repo_kind":"official","path":"model/ddpm_trans_modules/diffusion.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/model/ddpm_trans_modules/diffusion.py","link_basis":"plan_row","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":"90be2f67f3d453d7"}},{"code_sha256_prefix":"ba721aeacc165234","entry":"ssim","repo":"chenydong/pa-diff","repo_kind":"official","path":"core/metrics.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/core/metrics.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":"ba721aeacc165234"}},{"code_sha256_prefix":"34c878feb7966d4c","entry":"tensor2img","repo":"chenydong/pa-diff","repo_kind":"official","path":"core/metrics.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/core/metrics.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":"34c878feb7966d4c"}},{"code_sha256_prefix":"25a6a47b93887187","entry":"define_G","repo":"chenydong/pa-diff","repo_kind":"official","path":"model/networks.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/model/networks.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":"25a6a47b93887187"}},{"code_sha256_prefix":"9ded097b1ff97516","entry":"np_to_pil","repo":"chenydong/pa-diff","repo_kind":"official","path":"model/utils.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/model/utils.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":"9ded097b1ff97516"}},{"code_sha256_prefix":"7ab62e92dd308cad","entry":"parse","repo":"chenydong/pa-diff","repo_kind":"official","path":"core/logger.py","file_url":"https://github.com/chenydong/pa-diff/blob/HEAD/core/logger.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":"7ab62e92dd308cad"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}