Test-Time Dynamic Image Fusion

Bing Cao, Yinan Xia, Yi Ding, Changqing Zhang, Qinghua Hu

TL;DR

This paper introduces Test-Time Dynamic (TTD) image fusion, a plug-and-play paradigm that adaptively weights source images at the pixel level during inference without requiring additional training. By mathematically proving that generalization error is minimized when fusion weights are negatively correlated with reconstruction loss, the authors provide a theoretical foundation for dynamic fusion that consistently outperforms static methods across diverse vision tasks.

What Problem Does This Paper Address?

Image fusion—the art of combining multiple source images (like infrared and visible light, or different exposure levels) into a single, high-quality result—is a cornerstone of modern computer vision. However, most existing methods suffer from two major flaws:

  1. Static Rules: They often use fixed weighting schemes (like simple addition or $\ell_1$-norm) that fail to adapt to complex, changing environments.
  2. Lack of Theory: While some "dynamic" methods using Mixture of Experts (MoE) or adapters exist, they are largely heuristic. They lack theoretical guarantees, making them potentially unreliable for high-stakes deployments like autonomous driving or medical diagnostics.

The authors ask: Is it possible to conduct dynamic image fusion with a clear theoretical justification?

Methods

The core of the paper is the Generalization Error Upper Bound. The authors decompose a fused image into multiple "uni-source components"—essentially what each sensor contributes to the final result.

Theoretical framework of Test-Time Dynamic Image Fusion

The "Aha!" Math

They prove that the key to reducing the generalization error lies in the negative covariance between the fusion weight ($\omega$) and the reconstruction loss ($\ell$) of each source. Intuitively, if a sensor is struggling to reconstruct a specific region (high loss), it should have a lower weight in the final fusion.

Relative Dominability (RD)

To implement this, they introduce Relative Dominability (RD). At test-time, the process works in two stages:

  1. Component Estimation: The system feeds each source image through a frozen pre-trained model to calculate a pixel-level reconstruction loss.
  2. Dynamic Weighting: It calculates the RD weight using a Softmax function: $\omega = Softmax(e^{-\ell})$. This ensures that the "dominant" sensor for any given pixel gets the most say in the final output.

For cases where numeric losses are difficult to integrate, they extend this to a Gradient-based RD, using the absolute values of feature gradients to identify which channels carry the most useful information.

Datasets

The authors evaluated TTD across four distinct fusion tasks using several standard benchmarks:

  • Visible-Infrared Fusion (VIF): LLVIP and MSRS datasets.
  • Medical Image Fusion (MIF): Harvard Medical Image Dataset (covering MRI-CT, MRI-PET, and MRI-SPECT).
  • Multi-Exposure Fusion (MEF): MEFB dataset.
  • Multi-Focus Fusion (MFF): MFI-WHU dataset.

Key Insights and Ideas

  • Dynamic > Static: This paper provides the first theoretical proof that dynamic image fusion is inherently superior to static fusion for generalization.
  • Negative Correlation is the Secret Sauce: The mathematical requirement for a negative correlation between weights and losses provides a clear "north star" for designing fusion rules, moving away from trial-and-error heuristics.
  • Zero-Shot Adaptation: Because TTD is a test-time strategy, it requires no additional training, no fine-tuning, and no extra parameters. It can be "plugged" into existing state-of-the-art models like CDDFuse or IFCNN to immediately boost their performance.
  • Visual Interpretability: The RD maps act as a saliency map, clearly showing how the model switches focus—for example, prioritizing infrared for pedestrians at night and visible light for text on signs.
Relative Dominability (RD) maps across various fusion tasks

Key Results

The TTD paradigm achieved State-of-the-Art (SoTA) results across almost all tested metrics (Entropy, Standard Deviation, Spatial Frequency, etc.):

  • Quantitative Boost: On the LLVIP dataset, applying TTD to the IFCNN baseline improved the Standard Deviation (SD) from 37.75 to 38.99 and the Average Gradient (AG) from 5.18 to 5.48.
  • Qualitative Superiority: Fused images show significantly sharper edges, better contrast, and more preserved details compared to traditional static or MoE-based methods.
  • Downstream Impact: In object detection tests, TTD-fused images led to fewer "missing detections" for hard-to-see objects in low-light or blurred conditions.
  • Efficiency: While the two-stage inference process roughly doubles the processing time compared to a simple baseline, it remains highly efficient (e.g., 0.0013s for IFCNN+TTD), making it viable for real-time applications.

Limitations and Future Work

  • Baseline Dependency: TTD is a "booster." Its performance is ultimately capped by the quality of the underlying baseline model it is applied to.
  • Empirical Gradient Selection: In the gradient-based version of TTD, selecting which feature channels best represent "dominance" is currently done empirically. The authors suggest that a more automated, adaptive selection approach is a promising area for future research.
  • High-Risk Scenarios: While the theory is robust, the authors note that guaranteeing performance in high-risk scenarios (like surgery) still requires further empirical validation.

Summary updated

BibTeX
@inproceedings{cao2024test,
  author = {Bing Cao and Yinan Xia and Yi Ding and Changqing Zhang and Qinghua Hu},
  title = {{Test-Time Dynamic Image Fusion}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=NkXuAOygXN},
}
Figure