Abstract
Deploying state-of-the-art Deep Neural Networks (DNNs) on resource-constrained embedded systems is challenging due to strict real-time deadlines. This paper introduces NetCut, a methodology to optimize DNNs by systematically removing the final, task-specific layers of pretrained networks. By utilizing fast latency estimation, NetCut identifies models that maximize accuracy within a given time constraint. In a robotic prosthetic hand case study, NetCut achieved up to a 10.43% accuracy boost and a 27x speedup in model exploration compared to standard off-the-shelf architectures.
The Challenge of Real-Time Constraints
In many real-time applications, such as robotic control, engineers must select DNNs that meet rigid hardware deadlines. Often, this leads to the selection of smaller, off-the-shelf networks that satisfy the deadline but leave significant "slack time"—unused computational resources. This slack time represents a missed opportunity: a slightly larger or more complex network could have utilized that time to deliver higher accuracy.
The traditional approach to filling this gap—trial and error through manual architectural variations—is computationally prohibitive, often requiring weeks of training. NetCut aims to bridge this gap by quickly adapting large pretrained networks to fit arbitrary hardware deadlines without exhaustive retraining.
Methodology: Layer Removal and NetCut
The core of the NetCut approach lies in two concepts: Layer Removal and the NetCut algorithm.
Layer Removal (TRNs)
When applying transfer learning, early layers of a network typically extract general features (edges, colors), while later layers extract features specific to the original training task (e.g., ImageNet classes). If the target task is simpler, the final layers can be stripped away to reduce inference time. NetCut creates TRimmed Networks (TRNs) by dropping entire architectural blocks (e.g., ResNet or Inception modules) rather than individual layers, making the search space manageable.
The NetCut Algorithm
To avoid training every possible TRN, NetCut uses latency estimation models to predict inference times. The authors propose two estimators: a hardware profiler-based ratio and a device-agnostic analytical model using Support Vector Regression (SVR). NetCut predicts the latency of all possible TRNs, identifies those that most closely match the target deadline, and trains only those specific candidates.
Experimental Setup and Datasets
The study evaluated seven pretrained networks (ResNet50, DenseNet121, InceptionV3, and various MobileNets) originally trained on ImageNet. These were adapted to the HANDS Dataset, which contains images of graspable objects from a hand-camera perspective. The target task involves predicting five grasp types using probabilistic labels, reflecting the multi-modal nature of object interaction.
Key Results and Insights
- Accuracy Improvements: NetCut identified TRNs that achieved an average 5.0% (up to 10.43%) relative accuracy improvement over standard off-the-shelf networks while meeting a 0.9 ms inference deadline on an NVIDIA Jetson Xavier GPU.
- Exploration Efficiency: By using latency estimators to filter candidates, NetCut reduced exploration time from 183 hours to just 6.7 hours—a 27x speedup. Only 9 networks required training instead of 148.
- Architecture Sensitivity: DenseNet and Inception architectures proved highly resilient to trimming, maintaining accuracy even after removing over 100 layers. In contrast, MobileNets, which are already highly optimized, showed significant accuracy drops with even minor layer removal.
- Predictive Accuracy: The latency estimators were highly reliable, with the SVR model showing an average error of only 4.28% (0.029 ms).
Conclusion
NetCut demonstrates that "less is sometimes more" in transfer learning. By trimming deep networks to fit specific hardware deadlines, developers can reclaim wasted slack time and significantly improve model performance on embedded devices. This systematic approach to layer removal offers a powerful alternative to manual architecture search for real-time AI applications.
Summary updated