基於梯度的一次性物件偵測模型通道裁剪方法
A Gradient-Based One-Shot Model Channel Pruning Method for Object Detection Models
摘要
模型剪枝(Model Pruning)的目標在於找出最佳的結構,以在一定硬體限制的情況下只保留必要的參數。本研究探索了不同的一次性(One-Shot)結構性剪枝(Structured Pruning)方法對物件偵測(Object Detection)模型的影響。為了更準確地評估像物件偵測這樣的多任務模型,我們使用基於梯度的剪枝方法來分別評估每個任務的重要性。同時,我們通過敏感度和穩定性分別分析來自多個任務組合而成的梯度信息。
然而,我們發現,使用梯度信息來進行敏感度和穩定性評估所產生的結果與局部剪枝類似,這意味著跨層的重要性評估時,不同層與層間的信息未被充分考慮。因此,我們另外使用了一種計算層級冗餘度的技術,並分析了不同層間的權重分佈以及梯度分佈的情況,以展示每層的計算和參數成本與準確性表現之間的關係。
此外,由於我們使用的是一次性剪枝方法,直接使用基於冗餘度的方法雖能達到較高的準確性表現,但可能導致更高的FLOPs。為了緩解這一問題,我們額外採用了FLOPs約束評估指標來幫助降低FLOPs成本。
在接下來的實驗部分,我們將展示我們的方法如何在相同計算成本下,即使在剪枝掉90%的FLOPs(或MACs)和參數的情況下,依然能夠達到更高的準確性和更少的參數,並與現有方法和人類設計的輕量化模型,在Scaled-Yolov4和Yolov7上進行比較。
然而,我們發現,使用梯度信息來進行敏感度和穩定性評估所產生的結果與局部剪枝類似,這意味著跨層的重要性評估時,不同層與層間的信息未被充分考慮。因此,我們另外使用了一種計算層級冗餘度的技術,並分析了不同層間的權重分佈以及梯度分佈的情況,以展示每層的計算和參數成本與準確性表現之間的關係。
此外,由於我們使用的是一次性剪枝方法,直接使用基於冗餘度的方法雖能達到較高的準確性表現,但可能導致更高的FLOPs。為了緩解這一問題,我們額外採用了FLOPs約束評估指標來幫助降低FLOPs成本。
在接下來的實驗部分,我們將展示我們的方法如何在相同計算成本下,即使在剪枝掉90%的FLOPs(或MACs)和參數的情況下,依然能夠達到更高的準確性和更少的參數,並與現有方法和人類設計的輕量化模型,在Scaled-Yolov4和Yolov7上進行比較。
Model pruning focuses on identifying the optimal structure that retains only the essential parameters while adhering to hardware limitations. This study explores the model pruning effect on the object detection model across different one-shot structured pruning methods. To evaluate the multi-task models more accurately, like object detectors, which handle multiple objectives simultaneously. We found that using gradient information for both sensitivity and stability can yield results similar to local pruning, which means pruning the same percentage of channels across layers. This implies that information across layers is not adequately considered during the importance evaluation. Therefore, we additionally used a technique to calculate the layer-wise redundancy.
Besides, since we use a one-shot approach, directly using redundancy-based methods can achieve higher accuracy performance but may lead to higher FLOPs. To mitigate this, we additionally employed a FLOPs constraint evaluation metric to help reduce FLOPs cost.
In the following experiment section, we will demonstrate how our method can achieve higher accuracy and fewer parameters with comparable computational costs, even under the condition of 90\% FLOPs(or MACs) and parameters pruned, compared to existing methods and human-designed lightweight models on the Scaled-Yolov4 and Yolov7 series.
Besides, since we use a one-shot approach, directly using redundancy-based methods can achieve higher accuracy performance but may lead to higher FLOPs. To mitigate this, we additionally employed a FLOPs constraint evaluation metric to help reduce FLOPs cost.
In the following experiment section, we will demonstrate how our method can achieve higher accuracy and fewer parameters with comparable computational costs, even under the condition of 90\% FLOPs(or MACs) and parameters pruned, compared to existing methods and human-designed lightweight models on the Scaled-Yolov4 and Yolov7 series.