Introduction
Deep Neural Networks (DNNs) have achieved remarkable performance in computer vision but at the cost of significant computational overhead. This complexity poses a major challenge for deployment on resource-constrained mobile and edge devices.
Existing "dynamic inference" strategies attempt to mitigate this by skipping entire layers for simpler inputs. However, the authors argue that this layer-wise approach is too coarse. Skipping a whole layer—the "nuclear option"—may discard vital channels, while keeping a redundant layer wastes computation. The proposed Dynamic Multi-path Neural Network (DMNN) addresses this by introducing a fine-grained mechanism that simultaneously adjusts both network width (active channels) and depth (active layers) based on the input context.
Methodology
DMNN achieves its efficiency through two primary innovations: Block Subdivision and a Context-Aware Controller.
Block Subdivision
Rather than treating a residual block as an indivisible unit, DMNN splits it into $N$ parallel sub-blocks. For instance, a standard ResNet block can be divided into multiple paths, each responsible for a subset of the output channels. Each sub-block is equipped with an independent "on/off" switch, allowing the model to dynamically prune its width.
Context-Aware Controller
The controller acts as the decision-making engine for sub-block execution. To optimize the inference path, it leverages three distinct information sources:
- Spatial Information: Derived via global average pooling of the current input.
- Temporal State: A hidden state ($h_{l-1}$) passed from the previous block, enabling the model to maintain a "memory" of the inference trajectory.
- Category Awareness: The controller is trained with an explicit category loss to recognize broad object clusters (e.g., "animals" vs. "artifacts"), facilitating specialized feature extraction paths.
To ensure the system remains end-to-end trainable despite the discrete nature of skipping operations, the authors employ the Gumbel-Softmax trick. Additionally, a resource-constrained loss function penalizes high FLOP counts, guiding the model toward a target efficiency during training.
Experimental Results
DMNN was evaluated on the ImageNet and CIFAR-100 benchmarks, demonstrating a superior accuracy-efficiency trade-off compared to static and dynamic baselines.
- Efficiency Gains: DMNN-101 outperforms the standard ResNet-101 while reducing FLOPs by 45.1%.
- Parameter Efficiency: A DMNN-50 model achieves performance comparable to ResNet-101 but with 42.1% fewer parameters.
- Versatility: When applied to the already efficient MobileNetV2, DMNN still achieves a 10% reduction in FLOPs alongside a slight improvement in Top-1 accuracy.
Analysis of the learned paths reveals that the model naturally reserves more sub-blocks for "hard" samples (cluttered or small objects) and utilizes specialized routing for different object categories. Notably, the computational overhead of the controllers is negligible, representing only about 0.02% of the total FLOPs in a DMNN-50 architecture.
Conclusion
DMNN represents a significant step forward in dynamic inference by enabling simultaneous width and depth optimization. By utilizing a context-aware controller to navigate a subdivided block architecture, it achieves substantial computational savings without sacrificing accuracy. Future work may involve scaling the number of sub-blocks and evaluating the framework on downstream tasks such as object detection and segmentation.
Summary updated