CD-Buffer: Complementary Dual-Buffer Framework for Test-Time Adaptation in Adverse Weather Object Detection

Youngjun Song, Hyeongyu Kim, Dosik Hwang

TL;DR

CD-Buffer bridges the gap between additive (refining) and subtractive (pruning) test-time adaptation (TTA) methods for object detection in adverse weather. By leveraging a unified domain discrepancy metric, it dynamically suppresses heavily corrupted feature channels while simultaneously applying adaptive compensation to moderately shifted ones. This coordinated dual-buffer approach achieves state-of-the-art performance and stability across varying weather severities without requiring manual tuning.

What Problem Does This Paper Address?

Deep learning models for object detection perform remarkably well under clear conditions, but their accuracy plummets when deployed in adverse weather like rain, fog, or snow. This degradation is caused by domain shift—the statistical distribution of the testing data diverges significantly from the clear-weather training data.

To fix this online without expensive offline retraining, researchers use Test-Time Adaptation (TTA). Current architectural TTA methods generally fall into two camps:

  1. Additive approaches: Introduce lightweight "adapters" to refine features. These work well under mild weather shifts but struggle to fix severely corrupted features.
  2. Subtractive approaches: Prune or suppress domain-sensitive channels entirely. These excel in severe weather by cutting out noisy features, but they risk throwing away useful information during mild weather.

The core limitation is that weather severity isn't uniform; it varies scene-by-scene and even channel-by-channel within the same network layer. Existing methods apply a blanket strategy across all channels. The authors of this paper ask: Can we dynamically balance both removal and refinement strategies based on the actual domain shift measured at the feature level?

Figure 1. Adaptation Performance Across Fog Severities. Ad- ditive method [13] excels under moderate shifts but struggle under severe corruption, while subtractive method [31] shows the op- posite pattern. Our CD-Buffer achieves consistent performance across all severities by adaptively balancing both strategies.

Methods

The authors introduce CD-Buffer (Complementary Dual-Buffer), a framework that couples subtractive and additive mechanisms through a shared, discrepancy-driven metric.

Figure 2. Overview of the proposed CD-Buffer framework. We compute feature-level domain discrepancy Dc by comparing target and pre-computed source statistics. This metric drives two complementary buffers: the Subtractive Buffer suppresses severely shifted channels via discrepancy-weighted regularization on learnable mask scores, while the Additive Buffer provides adaptive compensation through lightweight convolutions with inverse soft masking, where aggressively suppressed channels receive stronger compensation. Both buffers are unified by feature alignment loss, enabling differentiated adaptation where severely shifted features are both suppressed and compensated, while stable features undergo minimal intervention.

The pipeline operates in three main steps:

  1. Feature-Level Domain Discrepancy Score ($D$): At test time, the model measures the $L_1$ distance between the target batch features and pre-computed clear-weather source statistics. This is calculated at both the image-level and the object-instance level (post-RoI alignment) to capture comprehensive domain shifts.
  2. Subtractive Buffer Module: Channels with a high discrepancy score face aggressive regularization via a novel masking loss ($\mathcal{L}_{\text{mask}}$). This forces their learnable mask scores ($s_c$) toward zero, effectively pruning heavily corrupted channels using a reparameterized differentiable soft mask.
  3. Additive Buffer Module: To compensate for the lost information, parallel $1\times1$ and $3\times3$ convolution adapters inject refined features back into the residual paths. Crucially, this module uses inverse soft masking. The strength of the additive compensation is inversely proportional to the subtractive mask score; meaning, the more aggressively a channel is suppressed, the harder the adapter works to compensate for it.

Additionally, the framework employs layer-level gradient scaling, amplifying the adaptation gradients for layers experiencing the most severe domain shifts.

Datasets

The framework was validated using a mix of clean source datasets and synthetically/naturally corrupted target datasets:

  • Source Domains: KITTI and Cityscapes (clear daytime driving datasets).
  • Target Domains (Synthetic): KITTI-Fog (visibility at 50m, 75m, 150m), KITTI-Rain (precipitation at 75mm, 100mm, 200mm), and Cityscapes-Fog (severity parameters at 0.01, 0.02).
  • Target Domains (Real-World): ACDC, a dataset containing real-world fog, rain, snow, and night driving conditions sharing the same object classes as Cityscapes.

Key Insights and Ideas

  • The Crossover Effect: The paper clearly demonstrates that additive and subtractive TTA methods have perfectly inverted failure modes based on domain shift severity.
  • Coupling Destruction and Creation: The "aha!" moment of CD-Buffer is its inverse soft masking. Instead of treating pruning and adapting as independent choices, pruning a channel inherently scales up the attention/weights of the adapter for that exact channel.
  • Channel-Wise Granularity: Rather than deciding if an entire layer or model needs adaptation, CD-Buffer acknowledges that some feature channels remain robust in fog or rain while others break down completely.

Key Results

CD-Buffer consistently achieved state-of-the-art results across both discrete and continual TTA evaluations (measured in mAP@50):

  • Severe vs. Moderate Weather: On the highly corrupted KITTI Fog (50m) benchmark, CD-Buffer achieved 44.80 mAP, significantly outperforming the purely additive WHW (34.38) and the purely subtractive PruningTTA (33.97). On mild shifts (KITTI Rain 75mm), it maintained a top-tier score of 73.03 mAP.
  • Real-World Generalization: On the real-world ACDC dataset, CD-Buffer achieved the highest performance in fog (24.45) and night (8.92) settings, demonstrating robust real-world applicability.
  • Continual TTA Stability: In scenarios where weather progressively worsens (50m $\rightarrow$ 75m $\rightarrow$ 150m fog), full-parameter methods like ActMAD suffered from catastrophic forgetting and unstable convergence. CD-Buffer demonstrated the fastest and most stable accuracy gains over extended adaptation cycles.
Continual TTA performance on KITTI Fog 50m

Limitations and Future Work

While CD-Buffer shows impressive robustness, a few limitations and areas for future exploration remain:

  • Base Architecture Dependency: The method was implemented and validated on Faster R-CNN with a ResNet-50 backbone. How well this dual-buffer approach translates to modern single-stage detectors (like YOLOv8) or Vision Transformer (ViT)-based backbones is not explored.
  • Source Statistic Reliance: The framework requires pre-computed source feature statistics from the training set, meaning it cannot be applied to entirely black-box, proprietary source models where training data statistics are unavailable.

Summary updated

BibTeX
@inproceedings{song2026cd,
  author = {Youngjun Song and Hyeongyu Kim and Dosik Hwang},
  title = {{CD-Buffer: Complementary Dual-Buffer Framework for Test-Time Adaptation in Adverse Weather Object Detection}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=oMNr4OCJZr},
}
Figure