{"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/posterior-sampling-for-image-restoration","title":"Posterior Sampling for Image Restoration using Explicit Patch Priors","arxiv_id":"2104.09895","date":"2021-04-20","proceeding":null,"authors":["Roy Friedman","Yair Weiss"],"abstract":"Almost all existing methods for image restoration are based on optimizing the mean squared error (MSE), even though it is known that the best estimate in terms of MSE may yield a highly atypical image due to the fact that there are many plausible restorations for a given noisy image. In this paper, we show how to combine explicit priors on patches of natural images in order to sample from the posterior probability of a full image given a degraded image. We prove that our algorithm generates correct samples from the distribution $p(x|y) \\propto \\exp(-E(x|y))$ where $E(x|y)$ is the cost function minimized in previous patch-based approaches that compute a single restoration. Unlike previous approaches that computed a single restoration using MAP or MMSE, our method makes explicit the uncertainty in the restored images and guarantees that all patches in the restored images will be typical given the patch prior. Unlike previous approaches that used implicit priors on fixed-size images, our approach can be used with images of any size. Our experimental results show that posterior sampling using patch priors yields images of high perceptual quality and high PSNR on a range of challenging image restoration problems.","url_abs":"https://arxiv.org/abs/2104.09895v1","url_pdf":"https://arxiv.org/pdf/2104.09895v1.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":"posterior-sampling-for-image-restoration","repo_url":"https://github.com/friedmanroy/torchEPLL","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-restoration","task_name":"Image Restoration"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2104.09895","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2104.09895"}},"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/friedmanroy/torchEPLL","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":6},"by_repo_kind":{"official":{"samples":6,"ran":0,"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":"8bdc57246e968fc5","entry":"BiCGSTAB","repo":"friedmanroy/torchEPLL","repo_kind":"official","path":"EPLL/solvers.py","file_url":"https://github.com/friedmanroy/torchEPLL/blob/HEAD/EPLL/solvers.py","link_basis":"first_harvest_node","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":"8bdc57246e968fc5"}},{"code_sha256_prefix":"ca740ff5461abf3e","entry":"conjgrad","repo":"friedmanroy/torchEPLL","repo_kind":"official","path":"EPLL/solvers.py","file_url":"https://github.com/friedmanroy/torchEPLL/blob/HEAD/EPLL/solvers.py","link_basis":"first_harvest_node","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":"ca740ff5461abf3e"}},{"code_sha256_prefix":"f6d0e8b56deeefa3","entry":"hamilMC","repo":"friedmanroy/torchEPLL","repo_kind":"official","path":"EPLL/solvers.py","file_url":"https://github.com/friedmanroy/torchEPLL/blob/HEAD/EPLL/solvers.py","link_basis":"first_harvest_node","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":"f6d0e8b56deeefa3"}},{"code_sha256_prefix":"ff4e7efd1f8265e3","entry":"pad_im","repo":"friedmanroy/torchEPLL","repo_kind":"official","path":"EPLL/EPLL_utils.py","file_url":"https://github.com/friedmanroy/torchEPLL/blob/HEAD/EPLL/EPLL_utils.py","link_basis":"first_harvest_node","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":"ff4e7efd1f8265e3"}},{"code_sha256_prefix":"ddb785d19d4fc2d9","entry":"to_patches","repo":"friedmanroy/torchEPLL","repo_kind":"official","path":"EPLL/EPLL_utils.py","file_url":"https://github.com/friedmanroy/torchEPLL/blob/HEAD/EPLL/EPLL_utils.py","link_basis":"first_harvest_node","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":"ddb785d19d4fc2d9"}},{"code_sha256_prefix":"e73f53ca4c9d4a9c","entry":"trim_im","repo":"friedmanroy/torchEPLL","repo_kind":"official","path":"EPLL/EPLL_utils.py","file_url":"https://github.com/friedmanroy/torchEPLL/blob/HEAD/EPLL/EPLL_utils.py","link_basis":"first_harvest_node","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":"e73f53ca4c9d4a9c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}