Amortized Guidance for Image Inpainting with Pretrained Diffusion Models
This paper introduces Amortized Inpainting with Diffusion (AID), a method that trains a small, reusable guidance module on a fixed pretrained diffusion backbone to achieve efficient, high-quality image inpainting without per-instance optimization, leveraging a novel Gaussian formulation and actor-critic algorithm to bridge deterministic guidance with learnable randomized objectives.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Problem: The "Fix-It" Dilemma
Imagine you have a master painter (a Pretrained Diffusion Model) who is incredibly talented at painting beautiful landscapes from scratch. Now, imagine someone hands you a photo of a landscape where a large chunk has been torn out (a Masked Image). Your goal is to fill in that missing chunk so it looks perfect and fits the rest of the picture.
Currently, there are two main ways to do this, and both have a big catch:
- The "Custom Apprentice" Approach: You hire a new, specialized apprentice to learn only how to fix torn photos.
- The Catch: It takes a long time and a lot of resources to train this apprentice. Plus, if you want to fix a different type of tear later, you might need a different apprentice.
- The "On-the-Fly" Approach: You ask the master painter to fix the photo right then and there. But because the painter wasn't trained specifically for "tearing," they have to stop, think really hard, and run a complex, step-by-step calculation for every single photo to figure out how to fill the hole.
- The Catch: It's slow. If you have 1,000 photos, the painter has to do this heavy thinking 1,000 separate times.
The Solution: AID (The "Smart Guide")
The authors propose a middle ground called AID (Amortized Inpainting with Diffusion).
Think of AID as hiring a Smart Guide who stands next to the Master Painter.
- The Master Painter stays exactly the same. We don't retrain them or change their brain. They keep doing what they do best.
- The Smart Guide is a tiny, lightweight assistant. We train this guide offline (in advance) on thousands of examples of torn photos.
- How it works: When a new torn photo arrives, the Master Painter starts painting. The Smart Guide whispers instructions to the painter, saying, "Hey, look at the visible part of the photo; make sure the new paint matches the style of the existing trees."
Once the guide is trained, it can help fix any torn photo instantly. We don't need to stop and think for each new photo; the guide just does its job.
The Secret Sauce: The "Randomized Rehearsal"
The hardest part of this paper is the math behind how they trained the guide.
Usually, to teach a guide to give perfect instructions, you'd have to solve a massive, impossible math puzzle for every single photo. The authors realized that trying to solve the "perfect" puzzle directly is too hard.
So, they invented a clever trick:
- The Analogy: Imagine you want to teach a guide to drive a car perfectly on a specific road. Instead of trying to calculate the exact steering angle for every second (which is hard), you let the guide practice driving the road while wearing blinders that make the steering wheel wobble randomly.
- The Magic: The authors proved mathematically that if you train the guide to handle this "wobbly, random" driving, the average of all those wobbly movements will point exactly to the perfect, smooth path you wanted all along.
- The Result: They used a method called Continuous-Time Actor-Critic (a type of Reinforcement Learning) to train the guide using this "random wobble" method. Once training is done, they simply take the "average" (the smooth path) and use that as the guide's instructions. This makes the training possible and the final result perfect.
What They Found (The Results)
The authors tested this on famous image datasets (AFHQv2, FFHQ, and ImageNet). Here is what happened:
- Speed vs. Quality: AID was much faster than the "On-the-Fly" methods (like RePaint) because it didn't have to do heavy calculations for every new photo. In fact, it was about 10 times faster than the best existing method while producing better quality images.
- Tiny Footprint: The "Smart Guide" (the trainable part) is incredibly small. It adds less than 1% to the size of the original Master Painter. It's like adding a sticky note to a library book rather than rewriting the whole book.
- Versatility: The same guide trained on one type of tear worked perfectly on different types of tears (center holes, strip holes) without needing to be retrained.
Summary
The paper introduces a way to fix damaged images using a powerful AI model without slowing it down. They do this by training a tiny, reusable "guide" that whispers instructions to the main AI. They proved mathematically that they can train this guide using a "randomized rehearsal" technique, ensuring the final instructions are perfect. The result is a system that is faster, cheaper, and produces higher-quality fixes than previous methods.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.