{"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/deep-optimal-transport-a-practical-algorithm-1","title":"Deep Optimal Transport: A Practical Algorithm for Photo-realistic Image Restoration","arxiv_id":"2306.02342","date":"2023-06-04","proceeding":"NeurIPS 2023 11","authors":["Theo Adrai","Guy Ohayon","Tomer Michaeli","Michael Elad"],"abstract":"We propose an image restoration algorithm that can control the perceptual quality and/or the mean square error (MSE) of any pre-trained model, trading one over the other at test time. Our algorithm is few-shot: Given about a dozen images restored by the model, it can significantly improve the perceptual quality and/or the MSE of the model for newly restored images without further training. Our approach is motivated by a recent theoretical result that links between the minimum MSE (MMSE) predictor and the predictor that minimizes the MSE under a perfect perceptual quality constraint. Specifically, it has been shown that the latter can be obtained by optimally transporting the output of the former, such that its distribution matches the source data. Thus, to improve the perceptual quality of a predictor that was originally trained to minimize MSE, we approximate the optimal transport by a linear transformation in the latent space of a variational auto-encoder, which we compute in closed-form using empirical means and covariances. Going beyond the theory, we find that applying the same procedure on models that were initially trained to achieve high perceptual quality, typically improves their perceptual quality even further. And by interpolating the results with the original output of the model, we can improve their MSE on the expense of perceptual quality. We illustrate our method on a variety of degradations applied to general content images of arbitrary dimensions.","url_abs":"https://arxiv.org/abs/2306.02342v2","url_pdf":"https://arxiv.org/pdf/2306.02342v2.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":"deep-optimal-transport-a-practical-algorithm-1","repo_url":"https://github.com/theoad/dot-dmax","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-restoration","task_name":"Image Restoration"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2306.02342","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.02342"}},"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/theoad/dot-dmax","reach":null}],"summary":{"ran_draft_wrong":1,"ran_violates":1,"unverified":1},"by_repo_kind":{"official":{"samples":3,"ran":2,"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":"3a91d277f9dfb751","entry":"matrix_operator","repo":"theoad/dot-dmax","repo_kind":"official","path":"dmax/latent_w2.py","file_url":"https://github.com/theoad/dot-dmax/blob/HEAD/dmax/latent_w2.py","link_basis":"first_harvest_node","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":"3a91d277f9dfb751"}},{"code_sha256_prefix":"e6e29a67faf00eeb","entry":"unsqueeze_like","repo":"theoad/dot-dmax","repo_kind":"official","path":"dmax/latent_w2.py","file_url":"https://github.com/theoad/dot-dmax/blob/HEAD/dmax/latent_w2.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e6e29a67faf00eeb"}},{"code_sha256_prefix":"96c56dcdbd0d5802","entry":"eye_like","repo":"theoad/dot-dmax","repo_kind":"official","path":"dmax/latent_w2.py","file_url":"https://github.com/theoad/dot-dmax/blob/HEAD/dmax/latent_w2.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":"96c56dcdbd0d5802"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}