Domain-Aware Dynamic Networks

Tianyuan Zhang, Bichen Wu, Xin Wang, Joseph Gonzalez, Kurt KeutzerarXiv 2019

TL;DR

This paper introduces Domain-Aware Dynamic Networks (DDN), a novel approach to boost neural network capacity for edge devices without increasing inference-time complexity. DDN dynamically combines multiple weights within each layer based on the input domain, effectively creating a specialized, lightweight network on the fly, leading to improved accuracy on object detection tasks.

What Problem Does This Paper Address?

Deploying deep neural networks (DNNs) on edge devices presents a fundamental trade-off: high-capacity models offer better generalization across diverse scenarios but demand significant computational resources (parameters and FLOPs), which are scarce on edge hardware. Conversely, reducing model complexity for edge deployment often sacrifices accuracy. This paper tackles this dilemma by proposing a method to enhance a model's capacity without incurring higher inference costs, leveraging the observation that data encountered by an edge device within a short time frame often belongs to a single, relatively homogeneous "domain."

Methods

The core innovation is the Domain-Aware Dynamic Network (DDN). Unlike static networks, DDN layers contain multiple sets of weights. During inference, a "domain representation" is extracted from the input data. This representation is then fed into a controller that dynamically combines the layer's multiple weights into a single, specialized weight for that specific domain. This process effectively creates a tailored, low-complexity network for the current input domain.

Key aspects of the DDN methodology include:

  • Data Locality Assumption: The method hinges on the assumption that input data to an edge device (e.g., an autonomous vehicle) is often from a single domain (e.g., nighttime, clear weather) for a sustained period, exhibiting low intra-domain diversity.
  • Domain Representation: A feature extractor (e.g., a pre-trained ResNet-50) is used to generate an embedding vector for each domain, typically by averaging image features from that domain.
  • Controller Network: A controller, often a simple linear transformation followed by a sigmoid function, takes the domain representation and determines the combination weights for the multiple layer weights.
  • Dynamic Weight Combination: For each layer, the final weight is a linear combination of pre-defined weight tensors, with the coefficients determined by the controller based on the domain.
  • Training: DDN is trained by sampling domains and then sampling data from those domains to compute loss and update both the network weights and the controller parameters.

Datasets

The primary dataset used for training and evaluation is BDD100K. This is a large-scale, diverse driving dataset that is particularly well-suited for this research because it includes annotations for attributes like weather condition, scenes, and time of day. These attributes are used to define the different "domains" for the DDN. The paper does not introduce new benchmarks.

Key Insights and Ideas

  • Leveraging Data Locality: The paper's central insight is that the temporal stability of environmental conditions for edge devices can be exploited to create specialized, efficient models without sacrificing accuracy.
  • Dynamic Networks for Efficiency: DDN demonstrates that dynamic networks, when designed with domain awareness and data locality in mind, can achieve higher capacity without increasing inference-time FLOPs or memory footprint compared to static networks.
  • Model Pool Limitations: The authors highlight significant drawbacks of a "model pool" approach (training a separate model for each domain), including exponential growth in model storage requirements and potential issues with insufficient data for training individual specialized models. DDN elegantly sidesteps these problems.
  • Domain-Awareness is Crucial: Experiments with "domain shuffle" (feeding incorrect domain embeddings) show a significant drop in accuracy, confirming that DDN indeed learns domain-specific adaptations.

Key Results

  • Accuracy Improvement: DDN achieved up to 2.6% higher AP50 (average precision with IoU > 0.50) on the BDD100K object detection benchmark compared to a static network baseline.
  • No Inference-Time Overhead: Crucially, DDN maintained the same inference-time parameters, FLOPs, and actual latency as the static baseline.
  • Comparison with Model Pool: The proposed DDN significantly outperformed a "pool of specialized models" approach, which struggled with data scarcity and domain-specific feature learning.
  • Robustness to Domain Granularity: DDN showed consistent performance improvements across different domain partitioning strategies (e.g., by time, time+weather, time+weather+scene).
  • Sample-Dependent vs. Domain-Dependent: While sample-dependent dynamic networks (SDN) showed better training accuracy, DDN achieved comparable or better validation accuracy and was significantly faster at inference, especially on resource-constrained hardware like the Raspberry Pi.

Limitations and Future Work

  • Domain Definition: The paper acknowledges that defining domains can be arbitrary, and the effectiveness of DDN relies on choosing attributes that are truly stable over time. Mismatched domain splits (training on one set of attributes, evaluating on another) led to accuracy drops, indicating the controller's sensitivity to the training split.
  • Hardware Friendliness of SDN: Sample-dependent dynamic networks, while potentially more flexible, are noted as not being hardware-friendly due to the on-the-fly computation of weights, leading to slower inference.
  • Future Work: The authors suggest exploring more sophisticated ways to extract domain representations and potentially training the feature extraction networks to be more sensitive to domain-specific features. Further investigation into the controller's generalization capabilities and its interaction with different domain split strategies could also be fruitful.

Summary updated

BibTeX
@misc{zhang2019domain,
  author = {Tianyuan Zhang and Bichen Wu and Xin Wang and Joseph Gonzalez and Kurt Keutzer},
  title = {{Domain-Aware Dynamic Networks}},
  year = {2019},
  eprint = {1911.13237},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.13237},
}
Figure