{"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/maintaining-natural-image-statistics-with-the","title":"Maintaining Natural Image Statistics with the Contextual Loss","arxiv_id":"1803.04626","date":"2018-03-13","proceeding":null,"authors":["Roey Mechrez","Itamar Talmi","Firas Shama","Lihi Zelnik-Manor"],"abstract":"Maintaining natural image statistics is a crucial factor in restoration and\ngeneration of realistic looking images. When training CNNs, photorealism is\nusually attempted by adversarial training (GAN), that pushes the output images\nto lie on the manifold of natural images. GANs are very powerful, but not\nperfect. They are hard to train and the results still often suffer from\nartifacts. In this paper we propose a complementary approach, that could be\napplied with or without GAN, whose goal is to train a feed-forward CNN to\nmaintain natural internal statistics. We look explicitly at the distribution of\nfeatures in an image and train the network to generate images with natural\nfeature distributions. Our approach reduces by orders of magnitude the number\nof images required for training and achieves state-of-the-art results on both\nsingle-image super-resolution, and high-resolution surface normal estimation.","url_abs":"http://arxiv.org/abs/1803.04626v3","url_pdf":"http://arxiv.org/pdf/1803.04626v3.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":"maintaining-natural-image-statistics-with-the","repo_url":"https://github.com/idearibosome/tf-perceptual-eusr","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"maintaining-natural-image-statistics-with-the","repo_url":"https://github.com/roimehrez/contextualLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"maintaining-natural-image-statistics-with-the","repo_url":"https://github.com/subeeshvasu/2018_subeesh_epsr_eccvw","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-super-resolution","task_name":"Image Super-Resolution"},{"task_slug":"super-resolution","task_name":"Super-Resolution"},{"task_slug":"surface-normal-estimation","task_name":"Surface Normal Estimation"}],"methods":[{"method_slug":"convolution","method_name":"Convolution"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=1803.04626","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1803.04626"}},"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/roimehrez/contextualLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/idearibosome/tf-perceptual-eusr","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/subeeshvasu/2018_subeesh_epsr_eccvw","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran":1,"unverified":4},"by_repo_kind":{"listed":{"samples":6,"ran":2,"repositories":2}},"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":2,"samples":[{"code_sha256_prefix":"8b0e794d4d8f9b13","entry":"default_conv","repo":"subeeshvasu/2018_subeesh_epsr_eccvw","repo_kind":"listed","path":"EPSR_testcode/code/model/common.py","file_url":"https://github.com/subeeshvasu/2018_subeesh_epsr_eccvw/blob/HEAD/EPSR_testcode/code/model/common.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8b0e794d4d8f9b13"}},{"code_sha256_prefix":"b1c1acd3c89a39f3","entry":"quantize","repo":"subeeshvasu/2018_subeesh_epsr_eccvw","repo_kind":"listed","path":"EPSR_testcode/code/utility.py","file_url":"https://github.com/subeeshvasu/2018_subeesh_epsr_eccvw/blob/HEAD/EPSR_testcode/code/utility.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b1c1acd3c89a39f3"}},{"code_sha256_prefix":"d7c555594cf97176","entry":"CX_loss","repo":"roimehrez/contextualLoss","repo_kind":"listed","path":"CX/CX_distance.py","file_url":"https://github.com/roimehrez/contextualLoss/blob/HEAD/CX/CX_distance.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":"d7c555594cf97176"}},{"code_sha256_prefix":"a04007cfe560d01e","entry":"calc_psnr","repo":"subeeshvasu/2018_subeesh_epsr_eccvw","repo_kind":"listed","path":"EPSR_testcode/code/utility.py","file_url":"https://github.com/subeeshvasu/2018_subeesh_epsr_eccvw/blob/HEAD/EPSR_testcode/code/utility.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":"a04007cfe560d01e"}},{"code_sha256_prefix":"f3316005a99d1d08","entry":"make_optimizer","repo":"subeeshvasu/2018_subeesh_epsr_eccvw","repo_kind":"listed","path":"EPSR_testcode/code/utility.py","file_url":"https://github.com/subeeshvasu/2018_subeesh_epsr_eccvw/blob/HEAD/EPSR_testcode/code/utility.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":"f3316005a99d1d08"}},{"code_sha256_prefix":"9793849e67c6f7ab","entry":"symetric_CX_loss","repo":"roimehrez/contextualLoss","repo_kind":"listed","path":"CX/CX_distance.py","file_url":"https://github.com/roimehrez/contextualLoss/blob/HEAD/CX/CX_distance.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":"9793849e67c6f7ab"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}