Localization-aware channel pruning for object detection

Zihao Xie, Li Zhu, Lin Zhao, Bo Tao, Liman Liu, Wenbing TaoNeurocomputing 2019

TL;DR

This paper introduces a novel "localization-aware channel pruning" (LCP) method that directly prunes deep neural networks for object detection tasks. By employing a specialized auxiliary network with a contextual RoIAlign layer and a tailored loss function, LCP effectively identifies and retains channels crucial for both classification and localization, achieving significant model compression with minimal accuracy loss.

What Problem Does This Paper Address?

Deep convolutional neural networks (CNNs) have revolutionized computer vision, but their large size and computational demands make them challenging to deploy on resource-constrained devices. Model compression techniques like channel pruning aim to reduce model size by removing redundant channels. While many pruning methods focus on classification tasks, object detection presents a unique challenge: it requires not only semantic understanding but also precise spatial localization information. Existing methods that adapt classification pruning techniques to object detection often involve fine-tuning on object detection datasets, which can be suboptimal due to the differing information needs of the two tasks. This paper addresses the need for a channel pruning method that is specifically designed for object detection, directly optimizing for both classification and localization accuracy.

Methods

The core of this paper is the proposed Localization-Aware Channel Pruning (LCP) method. LCP introduces an auxiliary network that guides the pruning process. This auxiliary network has two key components:

  • Contextual RoIAlign Layer: This layer is designed to extract more precise localization information. It goes beyond standard RoIAlign by incorporating contextual information from the surrounding regions of a default box. This is achieved by combining the features of the default box with the features of its smallest enclosing convex object, which helps enlarge the receptive fields, especially crucial when pruning shallower layers.
  • Localization-Aware Loss Function: This loss function is specifically designed for object detection. It comprises two parts:
  • Classification Loss: This leverages a discrimination-aware loss, similar to what's used in classification pruning.
  • Regression Loss: This uses the GIoU (Generalized Intersection over Union) loss, which is better suited for bounding box regression as it considers both overlapping and non-overlapping areas, providing a more accurate measure of box similarity.

The pruning process is conducted layer by layer. The auxiliary network is fine-tuned along with the pruned network, and the gradients from the localization-aware loss are used to determine which channels to prune. A reconstruction loss is also incorporated to ensure that the pruned network can still reconstruct the feature maps of the original network. The overall joint loss function aims to minimize reconstruction error and the auxiliary network's loss, subject to a constraint on the number of channels to be retained.

Datasets

The paper evaluates its method on the following datasets:

  • PASCAL VOC 2007 and 2012: Used for training and testing object detection models. The training set is a union of VOC2007 and VOC2012 trainval, containing 16,551 images. The VOC2007 test set with 4,592 images is used for evaluation. The "07metric" is used for evaluation.
  • MS COCO 2017: Used for further evaluation. The primary performance metric is AP, which averages mAP across different IoU thresholds (0.5 to 0.95).

Key Insights and Ideas

  • Object Detection Needs More Than Just Semantics: The paper highlights that object detection requires explicit localization information, which is often overlooked by pruning methods designed solely for classification.
  • Contextual RoIAlign for Better Localization: The proposed contextual RoIAlign layer is a key innovation, demonstrating that incorporating surrounding context improves the extraction of localization-relevant features, especially in earlier layers.
  • GIoU Loss for Robust Regression: Using GIoU loss for bounding box regression is shown to be more effective than simpler IoU-based losses, leading to better localization accuracy after pruning.
  • Direct Pruning for Object Detection is Superior: The paper argues that directly pruning for object detection, rather than adapting classification pruning, leads to better performance and efficiency by aligning the pruning objective with the task's specific requirements.
  • Gradient Analysis Reveals Importance of Localization: The analysis of gradients from different loss components shows that regression loss plays a significant role in channel selection, underscoring the importance of localization information.

Key Results

  • Significant Compression: The method achieves substantial pruning ratios, for example, pruning 70% of parameters of SSD based on ResNet-50 on MS COCO with a modest accuracy drop.
  • State-of-the-Art Performance: On PASCAL VOC 2007, LCP outperforms other methods like ThiNet and DCP when pruning VGG-16 and ResNet-50 backbones, especially at higher pruning ratios (e.g., 75%).
  • Improved Performance on Small Objects: On MS COCO, LCP shows a larger gain on small objects compared to DCP, indicating its ability to retain crucial localization details.
  • Qualitative Improvements: Visualizations show that LCP-pruned models produce predictions closer to the original model compared to other pruning methods, preserving localization accuracy.

Limitations and Future Work

  • Computational Cost of Auxiliary Network: While LCP saves overall computation by pruning, the auxiliary network itself adds some computational overhead during the pruning process.
  • Layer-wise Pruning: The current method prunes layer by layer. Future work could explore more global pruning strategies.
  • Further Exploration of Context: The paper suggests that further exploration of how to best incorporate context could lead to even better results.
  • Generalization to Other Architectures: While tested on SSD with VGG and ResNet, exploring LCP's effectiveness on other object detection architectures and backbones would be valuable.

Summary updated

BibTeX
@inproceedings{xie2019localization,
  author = {Zihao Xie and Li Zhu and Lin Zhao and Bo Tao and Liman Liu and Wenbing Tao},
  title = {{Localization-aware channel pruning for object detection}},
  booktitle = {Neurocomputing},
  year = {2019},
  doi = {10.1016/j.neucom.2020.03.056},
}
Figure