Unpaired Thermal to Visible Spectrum Transfer using Adversarial Training

Adam Nyberg, Abdelrahman Eldesokey, David Bergström, David GustafssonarXiv 2019

Abstract

Thermal Infrared (TIR) cameras are gaining popularity in many computer vision applications due to their ability to operate under low-light conditions. Images produced by TIR cameras are usually difficult for humans to perceive visually, which limits their usability. Several methods in the literature were proposed to address this problem by transforming TIR images into realistic visible spectrum (VIS) images. However, existing TIR-VIS datasets suffer from imperfect alignment between TIR-VIS image pairs which degrades the performance of supervised methods. We tackle this problem by learning this transformation using an unsupervised Generative Adversarial Network (GAN) which trains on unpaired TIR and VIS images. When trained and evaluated on KAIST-MS dataset, our proposed methods was shown to produce significantly more realistic and sharp VIS images than the existing state-of-the-art supervised methods. In addition, our proposed method was shown to generalize very well when evaluated on a new dataset of new environments.

Introduction

Thermal cameras are essential for night vision and surveillance because they detect heat rather than light. However, thermal images are notoriously difficult for humans to interpret—a hot engine and a warm human might look similar, and fine textures are often lost. To make these images more useful for applications like autonomous driving, we want to "translate" them into the visible spectrum. The standard approach is supervised learning, which requires a dataset of perfectly aligned pairs: one thermal image and one visible image of the exact same scene.

The catch? Creating these datasets is physically difficult. Even with specialized hardware, cameras are often slightly offset, leading to "registration errors" (pixel misalignment). When you train a supervised model on misaligned data, it tries to average the differences, resulting in blurry, "ghosted" images that lack detail.

Methodology: TIRcGAN

The authors propose TIRcGAN, an unsupervised approach based on the CycleGAN architecture. Instead of telling the AI, "Make this specific thermal pixel look like this specific visible pixel," they use a "distribution matching" strategy.

The TIRcGAN architecture utilizes two generators and two discriminators to learn unpaired mappings between thermal and visible domains.

The architecture consists of:

  1. Two Generators: One translates TIR to VIS ($G$), and another translates VIS back to TIR ($F$).
  2. Cycle Consistency Loss: If you translate a thermal image to visible and then back to thermal, you should end up with the original image. This ensures the model preserves the structural content (like the shape of a car) rather than just hallucinating a random pretty picture.
  3. Adversarial Training: Discriminator networks "critique" the generated images, forcing the generators to produce textures and colors that are indistinguishable from real visible-light photographs.

Because the model doesn't need pixel-perfect pairs, it simply learns what "visible-light streets" look like and applies that style to the "thermal structures" it sees.

Datasets

The study utilizes two primary benchmarks:

  • KAIST-MS: A well-known large-scale dataset of urban and suburban driving scenes. It is notorious for having a registration error of up to 16 pixels (about 5% of the image width).
  • FOI Dataset: A new dataset introduced by the authors (from the Swedish Defence Research Agency). It features natural environments like fields and forests. It was captured using a co-axial imaging system, providing much better alignment (0.8 to 2.2-pixel error) than KAIST-MS.

Key Insights

  • Unsupervised > Supervised for Noisy Data: An unsupervised method can produce better visual results than a supervised one when the training labels (the image pairs) are slightly misaligned. By ignoring the imperfect pairs, the GAN avoids the "blurring" trap.
  • Luminance + Chrominance: Unlike standard image colorization, TIR-to-VIS transfer requires the model to estimate both the lighting (luminance) and the color (chrominance) from scratch, as thermal values don't correlate directly with visible light brightness.
  • Robust Generalization: Because the model learns the "essence" of the visible domain rather than memorizing specific pixel mappings, it performs much better when moved from a city environment (KAIST) to a forest environment (FOI).

Results and Evaluation

Qualitatively, TIRcGAN produced much sharper and more saturated images than the state-of-the-art supervised baseline (TIR2Lab). While supervised images often looked like "smudged watercolors," TIRcGAN could distinguish between yellow and white road lines.

Qualitative comparison between TIR input, ground truth, and various generated outputs across different scenes.

On the KAIST-MS dataset, the proposed method achieved a significantly lower RMSE (0.21 vs. 0.46), indicating it is much more robust against extreme outliers and "hallucinated" artifacts. In generalization tests (trained on city, tested on forest), the supervised model failed completely (PSNR 8.48), while the proposed unsupervised model maintained high performance (PSNR 13.10).

Limitations and Conclusion

Despite the progress, several "failure cases" remain. Predicting the appearance of humans is difficult due to high variability in clothing and heat signatures. The model occasionally produces "inverse shadows"—painting dark patches where the thermal image showed a heat shadow. Additionally, rare objects in the training set were sometimes colorized incorrectly. Future work will likely focus on incorporating semantic information to help the GAN understand object context for even more accurate translations.

Summary updated

BibTeX
@misc{nyberg2019unpaired,
  author = {Adam Nyberg and Abdelrahman Eldesokey and David Bergström and David Gustafsson},
  title = {{Unpaired Thermal to Visible Spectrum Transfer using Adversarial Training}},
  year = {2019},
  eprint = {1904.02242},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.02242},
}
Figure