Learning Latent Transmission and Glare Maps for Lens Veiling Glare Removal

This paper proposes VeilGen, an unsupervised generative model that learns latent transmission and glare maps to synthesize realistic veiling glare datasets, and DeVeiler, a restoration network that leverages these maps to effectively remove veiling glare from simplified optical systems.

Xiaolong Qian, Qi Jiang, Lei Sun, Zongxi Yu, Kailun Yang, Peixuan Wu, Jiacheng Zhou, Yao Gao, Yaoguang Ma, Ming-Hsuan Yang, Kaiwei Wang

Published Mon, 09 Ma
📖 5 min read🧠 Deep dive

Imagine you have a brand-new, ultra-thin camera lens designed for your smartphone or a VR headset. It's small, cheap, and perfect for making devices portable. But there's a catch: because it's so simple, it doesn't take perfect pictures.

This paper tackles two specific problems that ruin photos from these "simplified" lenses:

  1. The Blur (Aberration): The lens isn't perfectly shaped, so the image looks a bit fuzzy or distorted, like looking through a warped piece of glass.
  2. The Haze (Veiling Glare): This is the tricky part. Imagine you're taking a photo on a sunny day, but the sun isn't even in the frame. Yet, your photo looks washed out, gray, and low-contrast, as if someone put a dirty, foggy sheet over the lens. This is Veiling Glare. It's caused by tiny imperfections inside the lens that scatter light everywhere, creating a "veil" over the image.

The Problem: A Double Whammy

Most existing software is good at fixing the blur (like sharpening a blurry photo) or good at fixing haze (like removing fog from a landscape). But when you have both happening at once, they confuse each other.

  • If you try to fix the blur, the software might make the haze worse.
  • If you try to remove the haze, you might accidentally blur the details.
  • The Big Hurdle: To teach a computer to fix this, you usually need thousands of "Before" and "After" photos. But in the real world, you can't easily take a perfect photo and then simultaneously take a "hazy" version of the exact same scene with the exact same lighting. It's like trying to teach someone how to fix a car crash by only showing them the wreckage, never the car before it crashed.

The Solution: A Two-Part Magic Trick

The authors, led by Xiaolong Qian and Kaiwei Wang, created a system called DeVeiler (De-veiling). They solved the "no data" problem with a clever two-step process.

Step 1: The "Fake It Till You Make It" Generator (VeilGen)

Since they couldn't find enough real-world examples of "perfect photo + hazy photo," they built a Generative AI (called VeilGen) to create them.

  • The Analogy: Imagine you want to teach a chef how to make a perfect cake, but you don't have any flour. Instead, you build a machine that simulates how flour turns into a cake.
  • How it works: VeilGen looks at a hazy photo and tries to guess the "secret recipe" of the haze. It estimates two invisible maps:
    1. The Transmission Map: Where the light is getting blocked (the "fog").
    2. The Glare Map: Where the stray light is bouncing around.
  • Once it understands these maps, it takes a clean photo and artificially adds the haze using those maps. Now, it has a perfect "Before and After" pair! It does this thousands of times, creating a massive training dataset that never existed before.

Step 2: The "Undo" Button (DeVeiler)

Now that they have a massive library of fake "Before and After" pairs, they train the main repair network, DeVeiler.

  • The Analogy: Think of DeVeiler as a master detective who has studied thousands of crime scenes (the hazy photos) and knows exactly how the criminal (the glare) operates.
  • The Secret Sauce: Instead of just guessing what the clean photo looks like, DeVeiler uses the same "secret maps" (Transmission and Glare) that VeilGen used to create the mess. It essentially says, "Okay, I know exactly how this haze was added, so I will run the process in reverse to remove it."
  • The Reversibility Check: To make sure it's not just hallucinating, the system checks its own work. It takes the "clean" photo it just restored, adds the haze back in using its own maps, and checks if it matches the original hazy photo. If it matches, the restoration is correct.

Why This Matters

This isn't just about making phone photos look better. It's about enabling tiny, cheap cameras to work in the real world.

  • AR/VR Headsets: These devices need lenses so thin they are almost flat. This method allows them to take clear, high-contrast images without expensive, bulky glass.
  • Medical Endoscopes: Tiny cameras inside the body often suffer from glare. This tech could help doctors see clearer.
  • Drones and Robots: Small, lightweight cameras can now see better in complex lighting.

In a Nutshell

The authors realized that simplified lenses create a unique "double trouble" of blur and haze that old software can't fix. They solved the lack of training data by building an AI that learns the physics of the glare to fake realistic training data. Then, they built a second AI that uses that physics knowledge to reverse-engineer the glare out of real photos.

It's like teaching a robot to clean a window by first teaching it exactly how the dirt gets there, so it knows exactly how to wipe it off.