{"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-mean-rectified-flow-towards-minimum","title":"Posterior-Mean Rectified Flow: Towards Minimum MSE Photo-Realistic Image Restoration","arxiv_id":"2410.00418","date":"2024-10-01","proceeding":null,"authors":["Guy Ohayon","Tomer Michaeli","Michael Elad"],"abstract":"Photo-realistic image restoration algorithms are typically evaluated by distortion measures (e.g., PSNR, SSIM) and by perceptual quality measures (e.g., FID, NIQE), where the desire is to attain the lowest possible distortion without compromising on perceptual quality. To achieve this goal, current methods commonly attempt to sample from the posterior distribution, or to optimize a weighted sum of a distortion loss (e.g., MSE) and a perceptual quality loss (e.g., GAN). Unlike previous works, this paper is concerned specifically with the optimal estimator that minimizes the MSE under a constraint of perfect perceptual index, namely where the distribution of the reconstructed images is equal to that of the ground-truth ones. A recent theoretical result shows that such an estimator can be constructed by optimally transporting the posterior mean prediction (MMSE estimate) to the distribution of the ground-truth images. Inspired by this result, we introduce Posterior-Mean Rectified Flow (PMRF), a simple yet highly effective algorithm that approximates this optimal estimator. In particular, PMRF first predicts the posterior mean, and then transports the result to a high-quality image using a rectified flow model that approximates the desired optimal transport map. We investigate the theoretical utility of PMRF and demonstrate that it consistently outperforms previous methods on a variety of image restoration tasks.","url_abs":"https://arxiv.org/abs/2410.00418v3","url_pdf":"https://arxiv.org/pdf/2410.00418v3.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-mean-rectified-flow-towards-minimum","repo_url":"https://github.com/ohayonguy/PMRF","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"blind-face-restoration","task_name":"Blind Face Restoration"},{"task_slug":"image-colorization","task_name":"Image Colorization"},{"task_slug":"image-denoising","task_name":"Image Denoising"},{"task_slug":"image-inpainting","task_name":"Image Inpainting"},{"task_slug":"image-restoration","task_name":"Image Restoration"},{"task_slug":"image-super-resolution","task_name":"Image Super-Resolution"},{"task_slug":"ssim","task_name":"SSIM"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/blind-face-restoration-on-celeba-test","task":"Blind Face Restoration","dataset":"CelebA-Test","model":"PMRF","rank_in_archive_order":15,"of":15,"metrics":{"Deg.":"30.67","FID":"37.46","NIQE":"4.118","PSNR":"26.37","SSIM":"0.7073"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2410.00418","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.00418"}},"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":"deterministic:regex_extraction","url":"https://github.com/ohayonguy/PMRF","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"ran_draft_wrong":1,"unverified":6},"by_repo_kind":{"official":{"samples":10,"ran":4,"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":"236cf18a7e5a0db9","entry":"calculate_points","repo":"ohayonguy/PMRF","repo_kind":"official","path":"evaluation/calculate_landmark_distance.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/evaluation/calculate_landmark_distance.py","link_basis":"first_harvest_node","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":"236cf18a7e5a0db9"}},{"code_sha256_prefix":"cd28335574411d48","entry":"conv3x3","repo":"ohayonguy/PMRF","repo_kind":"official","path":"evaluation/awing_arch.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/evaluation/awing_arch.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cd28335574411d48"}},{"code_sha256_prefix":"8b5cf3d00508f17b","entry":"img2tensor","repo":"ohayonguy/PMRF","repo_kind":"official","path":"evaluation/calculate_cos_dist.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/evaluation/calculate_cos_dist.py","link_basis":"first_harvest_node","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":"8b5cf3d00508f17b"}},{"code_sha256_prefix":"6d7e52beb54f602e","entry":"load_image_torch","repo":"ohayonguy/PMRF","repo_kind":"official","path":"evaluation/calculate_cos_dist.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/evaluation/calculate_cos_dist.py","link_basis":"first_harvest_node","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":"6d7e52beb54f602e"}},{"code_sha256_prefix":"37e244c7bbaccec7","entry":"calculate_points","repo":"ohayonguy/PMRF","repo_kind":"official","path":"evaluation/awing_arch.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/evaluation/awing_arch.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":"37e244c7bbaccec7"}},{"code_sha256_prefix":"60130eacf5484058","entry":"init_alignment_model","repo":"ohayonguy/PMRF","repo_kind":"official","path":"evaluation/calculate_landmark_distance.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/evaluation/calculate_landmark_distance.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":"60130eacf5484058"}},{"code_sha256_prefix":"d8d6d771a1dadff4","entry":"load_image","repo":"ohayonguy/PMRF","repo_kind":"official","path":"evaluation/calculate_cos_dist.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/evaluation/calculate_cos_dist.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":"d8d6d771a1dadff4"}},{"code_sha256_prefix":"794d4f7fc184e7e5","entry":"mesh_grid","repo":"ohayonguy/PMRF","repo_kind":"official","path":"utils/basicsr_custom.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/utils/basicsr_custom.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":"794d4f7fc184e7e5"}},{"code_sha256_prefix":"321b9c73d589eb9e","entry":"pdf2","repo":"ohayonguy/PMRF","repo_kind":"official","path":"utils/basicsr_custom.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/utils/basicsr_custom.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":"321b9c73d589eb9e"}},{"code_sha256_prefix":"e3444ff2b9d24600","entry":"sigma_matrix2","repo":"ohayonguy/PMRF","repo_kind":"official","path":"utils/basicsr_custom.py","file_url":"https://github.com/ohayonguy/PMRF/blob/HEAD/utils/basicsr_custom.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":"e3444ff2b9d24600"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}