TL;DR
When you digitally erase a glowing lantern or a pair of glasses from a photo, standard AI tools leave behind ghostly light on the floor or accidentally hallucinate a brand-new face where the lenses used to be. PhysRemover solves this by treating object removal not as simple "hole-filling," but as counterfactual physics: reconstructing the scene as if the object had never existed. By feeding a diffusion model both the masked and unmasked images side-by-side, it cleanly wipes away complex side effects (like steam, reflections, and emitted light) while preserving the true background behind transparent objects.
What Problem Does This Paper Address?
Objects in the physical world don’t keep to themselves—they cast shadows, bounce light onto walls, send steam into the air, and refract whatever sits behind them. Yet, traditional AI object removal follows a "mask-and-inpaint" paradigm: you draw a mask over an unwanted object, blindfold the model to everything inside that mask, and ask it to guess what belongs in the hole.
This creates two major headaches:
- Lingering footprints: Even recent side-effect-aware models usually only look for basic cast shadows and mirror reflections. They miss richer physics like caustics, volumetric steam from a hot mug, or the warm glow of a lamp on pavement.
- The transparency trap: If you mask a magnifying glass over a page of text—or eyeglasses on a dog—the mask completely hides the background details visible through the glass. Blinded to what was actually there, standard models destroy the underlying reality and hallucinate something fake.
Methods
Built on a Diffusion Transformer (FLUX.1-dev) trained with Conditional Flow Matching and lightweight LoRA adapters, PhysRemover abandons the "blindfold" approach. Instead of just feeding the model a masked image, the authors introduce In-Context Contrastive Guidance (ICCG) and a Learnable Removal Trigger (LRT):
- In-Context Contrastive Pairs (New): The model receives both the masked image (showing where the target is) and the original unmasked image (showing what the object is—e.g., transparent glass or a light source—and what lies behind it) encoded into a unified token sequence.
- Spatially-Aligned RoPE (New): To help the model compare the masked and unmasked inputs pixel-by-pixel without accidentally copying the unwanted object into the final output, both streams are assigned identical 2D spatial coordinates, though their rotary positional encodings (RoPE) are computed separately before attention.
- Counterfactual Timestep Scheduling (New): Standard Diffusion Transformers apply the current noise timestep $t$ across streams. Because the reference images aren't noisy, PhysRemover pins the conditioning stream's timestep to $t=0$ (completely clean) while denoising the target at $t$. This temporal separation is crucial for peeling away transparent objects while keeping the background intact.
- Learnable Removal Trigger (New): Text prompts like "remove the object" are surprisingly vague to a neural network. The authors replace text prompts with optimizable task tokens, initializing the visual-semantic branch (CLIP) using the average visual embedding of target objects across the training set.
Training happens in two stages: first learning general structure completion on random masks, then shifting to counterfactual background estimation.
Datasets
Existing datasets rely on naive copy-pasting or small-scale camera captures limited to simple shadows. To fix this, the authors built and used:
- LAION: Used in Stage 1 training with random masks to teach basic inpainting.
- PhyTrace (New): A public, 1-megapixel dataset of 10,000 image pairs featuring diverse physical interactions (light emission, steam, reflections, transparency). Raw images are filtered for aesthetics, analyzed by Gemini-3-pro to plan physically rich edits, edited via generative expert models (Nano-Banana), segmented with Grounded-SAM, and verified by both VLMs and humans.
- PhyTrace-Test & PhyTrace-TP (New Benchmarks): A 500-image test split for general physical removal, plus a 150-image subset (PhyTrace-TP) specifically targeting transparent and semi-transparent objects.
Key Insights and Ideas
- To erase an object properly, the model has to see it: Masking out an object before feeding it to the network throws away the exact clues needed to undo its presence. Letting the model see that an object is a steaming cup or a clear lens lets it deduce what else in the room needs to change—or stay the same.
- Telling clean references apart from noisy targets unlocks transparency: In ablation studies, removing the $t=0$ counterfactual timestep caused the sharpest drop in transparent removal quality. Explicitly signaling which tokens represent the "clean reality" prevents the model from lazily retaining the transparent glass structure.
- Better physics needs a better ruler: Standard pixel metrics miss physical logic, so the authors introduced PhysRM, a VLM-based metric (powered by Gemini-3-Flash) scoring 1–5 on Physical Effects Removal, Completion & Blending, and Object Removal Success.
Key Results
PhysRemover outperforms 13 general inpainting and specialized object-removal baselines across every metric:
- General & Side-Effect Removal (PhyTrace-Test): Achieves a best-in-class FID of 17.402 (vs. 20.317 for ObjectClear and 22.001 for OmniPaint) and CMMD of 0.106. On PhysRM's 5-point scale, it jumps to 4.528 for Physical Effects Removal, compared to 3.492 for the strongest baseline (GeoRemover).
- Transparent Object Removal (PhyTrace-TP): Computed strictly inside the masked region to test true background recovery, PhysRemover hits 20.882 dB PSNR and 0.134 DINO similarity distance (improving over ObjectClear’s 19.551 dB and OmniPaint’s 0.184 DINO score). Qualitatively, it cleanly erases magnifying glasses over dense text and eyeglasses over eyes without smudging underlying details.
Limitations and Future Work
Not discussed in the paper. (In the provided main text, the authors do not explicitly detail failure modes or limitations, noting primarily as future/broader potential that PhysRemover naturally extends to artistic styles and unconstrained in-the-wild scenarios, and that PhyTrace will be publicly released to spur further community research.)
Summary updated