TGFuse: An Infrared and Visible Image Fusion Approach Based on Transformer and Generative Adversarial Network

Dongyu Rao, Xiao-Jun Wu, Tianyang Xu

TL;DR

TGFuse introduces a novel end-to-end image fusion framework that combines the global modeling power of transformers with the detail-refining capability of Generative Adversarial Networks (GANs). By capturing both long-range spatial and cross-channel dependencies alongside a dual-discriminator setup, it successfully merges the thermal saliency of infrared images with the high-resolution textures of visible light images.

What Problem Does This Paper Address?

Infrared (IR) and visible image fusion is essential for applications like military surveillance, night vision, and autonomous tracking. IR images excel at highlighting thermal targets (like people or vehicles) even in low light or adverse weather, while visible images provide rich textural details and environmental context.

Current state-of-the-art fusion methods rely heavily on Convolutional Neural Networks (CNNs). However, CNNs operate on local receptive fields, meaning they inherently struggle to capture long-range dependencies and global context across an entire image. This limitation makes it difficult to balance global perception in complex scenarios, often leading to unnatural artifacts, loss of background details, or an inability to properly scale to different image sizes.

Methods

The authors propose TGFuse, an end-to-end framework consisting of a transformer-based generator and a dual-discriminator architecture.

Fig. 3. The framework of our method.

Key components include:

  • Composite Transformer Fusion Module: Instead of using a standard Vision Transformer (ViT), the authors design a lightweight composite module featuring two distinct parts:
  • Channel Transformer: Learns global correlations across the channel dimensions.
  • Spatial Transformer: Learns long-range spatial relationships between image patches.
  • Position Embedding Removal: Unlike standard ViTs used for classification, TGFuse removes position embeddings entirely. This design choice makes the network flexible enough to handle arbitrary input image resolutions during inference.
  • Dual Discriminator GAN: To preserve the unique characteristics of both modalities, the training process uses two separate discriminators. Dis-IR leverages deep layers of a pre-trained VGG-16 network to capture the prominent thermal saliency of the IR image, while Dis-VIS utilizes shallow layers to retain fine, high-resolution textures from the visible image.
  • Variance-driven SSIM Loss ($Var\_SSIM$): Rather than combining multiple conflicting loss functions (a common pitfall in deep learning-based image fusion), the authors implement a single structural similarity loss guided by image variance. This adaptively forces the fused image to match the most informative source modality block-by-block.
Fig. 5. The framework of transformer fusion module.

Datasets

  • KAIST Pedestrian Dataset: Used for training, containing 40,000 pairs of aligned infrared and visible images covering campus, street, and countryside scenes. Images were resized to $256 \times 256$ pixels for training.
  • DenseFuse Test Set: 10 pairs of public evaluation images were used to benchmark the performance against existing methods.

Key Insights and Ideas

  • Channel First, Spatial Second: Through ablation studies, the authors discovered that modeling cross-channel relationships before spatial relationships helps the transformer learn more effective fusion coefficients for multi-modal inputs.
  • Ditching Position Embeddings Pays Off: Position embeddings are crucial for classification tasks to retain spatial order, but for image fusion, removing them allows the model to handle variable input resolutions seamlessly without degrading performance.
  • Loss Function Consolidation: Multi-loss optimization often leads to objective conflicts where gradients pull the network in opposing directions. Replacing them with a single, variance-weighted structural similarity loss cleanly avoids optimization entanglement.

Key Results

The authors compared TGFuse against 15 traditional and deep learning-based methods (including DenseFuse, FusionGAN, and RFN-Nest) across 9 objective metrics.

  • Quantitative Performance: TGFuse achieved the best performance on 7 out of 9 metrics (including Entropy, Structural Similarity, and Standard Deviation) and ranked third on the remaining two.
  • Qualitative Performance: Visual results demonstrate that TGFuse cleanly highlights human targets from the IR spectrum while preserving crisp environmental details (like text on signs, clouds in the sky, and architectural textures) from the visible spectrum without introducing artificial noise.

Limitations and Future Work

The paper notes that the performance of the transformer module is highly sensitive to hyperparameter tuning, specifically the number of encoder layers. Setting it too low (e.g., 3 layers) causes training failure (resulting in a blank black image), while setting it too high (5 layers) introduces redundancy and degrades performance.

The authors suggest that future work could explore making the selection of these layer depths more adaptive or exploring lighter-weight attention mechanisms to reduce computational overhead during deployment.

Summary updated

BibTeX
@misc{rao2022tgfuse,
  author = {Dongyu Rao and Xiao-Jun Wu and Tianyang Xu},
  title = {{TGFuse: An Infrared and Visible Image Fusion Approach Based on Transformer and Generative Adversarial Network}},
  year = {2022},
  eprint = {2201.10147},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.10147},
}
Figure