Neuron Linear Transformation: Modeling the Domain Shift for Crowd Counting

Qi Wang, Tao Han, Junyu Gao, Yuan Yuan · DOI

Abstract: Cross-domain crowd counting (CDCC) is a hot topic due to its importance in public safety. The purpose of CDCC is to alleviate the domain shift between the source and target domain. Recently, typical methods attempt to extract domain-invariant features via image translation and adversarial learning. When it comes to specific tasks, we find that the domain shifts are reflected on model parameters' differences. To describe the domain gap directly at the parameter-level, we propose a Neuron Linear Transformation (NLT) method, exploiting domain factor and bias weights to learn the domain shift. Specifically, for a specific neuron of a source model, NLT exploits few labeled target data to learn domain shift parameters. Finally, the target neuron is generated via a linear transformation. Extensive experiments and analysis on six real-world datasets validate that NLT achieves top performance compared with other domain adaptation methods. An ablation study also shows that the NLT is robust and more effective than supervised and fine-tune training.

Introduction

Crowd counting—estimating the number of people in a scene—is critical for public safety and urban planning. However, training these models is a logistical challenge; pixel-level annotation of a single dense crowd dataset can take thousands of human hours. To bypass this, researchers often use synthetic data (like the GCC dataset) for training.

The primary obstacle in this approach is the domain shift. A model trained on synthetic pixels often fails when faced with real-world lighting, camera angles, and backgrounds. While existing solutions typically use image translation or adversarial learning to bridge this gap, these methods are indirect. This paper proposes that the domain gap is most effectively addressed directly at the parameter level.

The domain gap visualized at both the vision level (images) and the parameter level (weight distributions).

Methodology: Neuron Linear Transformation (NLT)

The core innovation of this work is the Neuron Linear Transformation (NLT). The authors observed that when a model is trained on two different domains, the resulting weight distributions are similar in shape (Gaussian) but shifted in mean and variance.

The NLT Framework

  1. Source Training: A "Source Model" is first trained on large-scale synthetic data (GCC).
  2. Linear Mapping: For every neuron in the source model, two learnable parameters are defined: a domain factor ($\theta^f$) and a domain bias ($\theta^b$).
  3. Target Generation: The target model's neurons are generated via a simple linear operation: $Target = Source \times Factor + Bias$.
  4. Few-Shot Optimization: Using a small amount of labeled real-world data (e.g., 10% of a dataset), the source weights are frozen, and only the factors and biases are optimized.
The NLT framework overview, illustrating how source model parameters are transformed using few-shot target data to create the target model.

This approach acts as a powerful regularizer. Because the model learns a scale and shift for existing neurons rather than retraining millions of weights, it is significantly less likely to overfit on small target samples compared to standard fine-tuning.

Experimental Results

The authors evaluated NLT on six diverse real-world datasets, including high-density (UCF-QNRF, Shanghai Tech Part A), medium-density (Shanghai Tech Part B, WorldExpo’10), and sparse (Mall, UCSD) environments.

  • Superior Accuracy: NLT consistently outperformed standard fine-tuning and unsupervised domain adaptation (UDA) methods. On the Shanghai Tech Part A dataset, NLT reduced the Mean Absolute Error (MAE) by 13.1% compared to standard fine-tuning.
  • Parameter Efficiency: NLT is highly efficient, introducing very few extra parameters (~2/9 of the source model's size), making it faster to train than complex GAN-based methods.
  • Robustness: The method demonstrated a "down domain shift" phenomenon, where synthetic models often over-represent features that need to be scaled down for real-world application. NLT effectively "tweaks the knobs" of the source model to achieve this adaptation.

Conclusion

Neuron Linear Transformation offers a novel perspective on domain adaptation by modeling the gap in the parameter space. By leveraging the rich features learned from synthetic data and adapting them via a simple linear transformation, NLT achieves state-of-the-art performance in few-shot crowd counting. Future work may extend this parameter-level modeling to other dense prediction tasks such as semantic segmentation or saliency detection.

Summary updated

BibTeX
@article{wang2020neuron,
  author = {Qi Wang and Tao Han and Junyu Gao and Yuan Yuan},
  title = {{Neuron Linear Transformation: Modeling the Domain Shift for Crowd Counting}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2020},
  doi = {10.1109/tnnls.2021.3051371},
}
Figure