{"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/vision-transformers-for-single-image-dehazing","title":"Vision Transformers for Single Image Dehazing","arxiv_id":"2204.03883","date":"2022-04-08","proceeding":null,"authors":["Yuda Song","Zhuqing He","Hui Qian","Xin Du"],"abstract":"Image dehazing is a representative low-level vision task that estimates latent haze-free images from hazy images. In recent years, convolutional neural network-based methods have dominated image dehazing. However, vision Transformers, which has recently made a breakthrough in high-level vision tasks, has not brought new dimensions to image dehazing. We start with the popular Swin Transformer and find that several of its key designs are unsuitable for image dehazing. To this end, we propose DehazeFormer, which consists of various improvements, such as the modified normalization layer, activation function, and spatial information aggregation scheme. We train multiple variants of DehazeFormer on various datasets to demonstrate its effectiveness. Specifically, on the most frequently used SOTS indoor set, our small model outperforms FFA-Net with only 25% #Param and 5% computational cost. To the best of our knowledge, our large model is the first method with the PSNR over 40 dB on the SOTS indoor set, dramatically outperforming the previous state-of-the-art methods. We also collect a large-scale realistic remote sensing dehazing dataset for evaluating the method's capability to remove highly non-homogeneous haze.","url_abs":"https://arxiv.org/abs/2204.03883v1","url_pdf":"https://arxiv.org/pdf/2204.03883v1.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":"vision-transformers-for-single-image-dehazing","repo_url":"https://github.com/IDKiro/DehazeFormer","is_official":0,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-dehazing","task_name":"Image Dehazing"},{"task_slug":"single-image-dehazing","task_name":"Single Image Dehazing"}],"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"}],"datasets_introduced":[{"slug":"rs-haze","name":"RS-Haze","full_name":""}],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-dehazing-on-reside-6k","task":"Image Dehazing","dataset":"RESIDE-6K","model":"DehazeFormer-B","rank_in_archive_order":1,"of":6,"metrics":{"PSNR":"31.45","SSIM":"0.98"},"uses_additional_data":false},{"leaderboard":"/sota/image-dehazing-on-rs-haze","task":"Image Dehazing","dataset":"RS-Haze","model":"DehazeFormer-B","rank_in_archive_order":1,"of":7,"metrics":{"PSNR":"39.87","SSIM":"0.971"},"uses_additional_data":false},{"leaderboard":"/sota/image-dehazing-on-sots-indoor","task":"Image Dehazing","dataset":"SOTS Indoor","model":"DehazeFormer-L","rank_in_archive_order":15,"of":34,"metrics":{"PSNR":"40.05","SSIM":"0.996"},"uses_additional_data":false},{"leaderboard":"/sota/image-dehazing-on-sots-outdoor","task":"Image Dehazing","dataset":"SOTS Outdoor","model":"DehazeFormer-B","rank_in_archive_order":19,"of":31,"metrics":{"PSNR":"34.95","SSIM":"0.984"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2204.03883","atlas_url":"https://app.syntology.ai/?focus=2204.03883","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2204.03883"}},"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/IDKiro/DehazeFormer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":2,"ran_honours":1,"ran_fixture":1,"ran_draft_wrong":1,"unverified":5},"by_repo_kind":{"named_in_paper":{"samples":10,"ran":5,"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":"3d1084cb97ab35dc","entry":"align","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"datasets/loader.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/datasets/loader.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3d1084cb97ab35dc"}},{"code_sha256_prefix":"69467681d00a88d8","entry":"augment","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"datasets/loader.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/datasets/loader.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"69467681d00a88d8"}},{"code_sha256_prefix":"2a53db1b6432ab8c","entry":"get_relative_positions","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"models/dehazeformer.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/models/dehazeformer.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2a53db1b6432ab8c"}},{"code_sha256_prefix":"751569c78a842e44","entry":"window_partition","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"models/dehazeformer.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/models/dehazeformer.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"751569c78a842e44"}},{"code_sha256_prefix":"7b0d02f75bf6b439","entry":"window_reverse","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"models/dehazeformer.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/models/dehazeformer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7b0d02f75bf6b439"}},{"code_sha256_prefix":"e4b2196560e07093","entry":"chw_to_hwc","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"utils/common.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/utils/common.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e4b2196560e07093"}},{"code_sha256_prefix":"81db6e556c7e4498","entry":"hwc_to_chw","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"utils/common.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/utils/common.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"81db6e556c7e4498"}},{"code_sha256_prefix":"22d056c672f87531","entry":"read_img","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"utils/common.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/utils/common.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"22d056c672f87531"}},{"code_sha256_prefix":"69598ced7806d8c3","entry":"scatter","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"utils/data_parallel.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/utils/data_parallel.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"69598ced7806d8c3"}},{"code_sha256_prefix":"aa1de448b0528802","entry":"scatter_kwargs","repo":"IDKiro/DehazeFormer","repo_kind":"named_in_paper","path":"utils/data_parallel.py","file_url":"https://github.com/IDKiro/DehazeFormer/blob/HEAD/utils/data_parallel.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aa1de448b0528802"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}