On the Theory of Conditional Feature Alignment for Unsupervised Domain-Adaptive Counting
Zhuonan Liang, Dongnan Liu, Jianan Fan, Yaxuan Song, Qiang Qu, Runnan Chen, Yu Yao, Peng Fu, Weidong Cai
TL;DR
This work tackles cross-domain object counting where density variation is task-relevant and can invalidate standard domain-adaptation assumptions. It introduces a conditional divergence framework that partitions samples into condition-defined subsets (e.g., foreground vs background) and proves a joint-error bound that favors conditional alignment over unconditional matching. The approach partitions images with pseudo-labels, learns partition-specific features with a shared regressor, applies per-partition adversarial alignment, and employs a Condition-consistent Mechanism to refine pseudo-labels via a consistency loss. Empirical results on crowd and cell counting benchmarks show consistent improvements over state-of-the-art unsupervised DA methods, validating both the theory and the practical effectiveness of preserving task-relevant density variations during adaptation.
Abstract
Object counting models suffer when deployed across domains with differing density variety, since density shifts are inherently task-relevant and violate standard domain adaptation assumptions. To address this, we propose a theoretical framework of conditional feature alignment and provide a straightforward implementation. By theoretical analysis, our framework is feasible to achieve superior cross-domain generalization for counting. In the presented network, the features related to density are explicitly preserved across domains. Theoretically, we formalize the notion of conditional divergence by partitioning each domain into subsets and measuring divergences per condition. We then derive a joint error bound showing that, under discrete label spaces treated as condition sets, aligning distributions conditionally leads to tighter bounds on the combined source-target decision error than unconditional alignment. Empirically, we demonstrate the effectiveness of our approach through extensive experiments on multiple counting datasets with varying density distributions. The results show that our method outperforms existing unsupervised domain adaptation methods, empirically validating the theoretical insights on conditional feature alignment.
