Font Size: a A A

Research On Model Compression Algorithm Based On Object Detection

Posted on:2023-03-08Degree:MasterType:Thesis
Country:ChinaCandidate:J P WuFull Text:PDF
GTID:2558307154475964Subject:Information and Communication Engineering
Abstract/Summary:PDF Full Text Request
In recent years,object detection algorithm based on deep learning has made breakthrough progress,and detection performance has been continuously improved.But at the same time,the number of network parameters and model volume are getting larger and larger,which makes it difficult for detection algorithms to deploy on resource-constrained embedded or mobile platforms,so model compression becomes necessary.Model compression can reduce the number of parameters,but it also brings performance loss.Therefore,it is of great practical significance to study how to compress detection algorithm and facilitate terminal deployment.Combined with lightweight network,channel pruning,knowledge distillation and model quantization methods,this thesis constructed a model compression system based on object detection.The main work of this thesis is as follows:Firstly,a lightweight network consisting of deep separable convolution,inverted residual structure and channel attention mechanism,is used to replace the backbone network of YOLOv3,and the model volume can be reduced by more than 60%.Then,channel pruning is carried out.This thesis proposes a channel pruning method based on dynamic weighting,which comprehensively considers the scaling factor and channel independence score,takes the weighted sum of the two as channel importance score,dynamically adjusts the weighting ratio,and obtains the optimal pruning model through continuous iteration.Experimental results show that channel pruning can remove most of the redundant channels in the networks.In order to improve the detection performance of the model after pruning,classification loss based on inter-class consistency and feature map loss based on channel correlation are designed,and then combined with regression loss based on teacher upper bound and spatial attention mechanism loss,loss function for knowledge distillation is constructed.Finally the student network can capture the strong representation ability of the teacher network as much as possible.Experiments show that the accuracy of the pruned model can improve through knowledge distillation.Then a quantization framework and simulated quantization operations for training are constructed to ensure that the detection performance does not decrease too much after quantization.In addition,operator fusion is carried out on the calculation graph,matrix multiplication is optimized,the number of addition and subtraction is reduced.Finally inference acceleration of detection model is realized.Finally,the YOLOv3 model after network lightweight,pruning,distillation and quantization is deployed to TX2 development board,and the inference speed reaches25.7FPS,which is 7.3 times faster than that of the uncompressed network.In Huawei Mate30 Pro with Harmony OS,the compressed YOLOv3 can run at 32.4FPS,5.7 times faster than the uncompressed network.
Keywords/Search Tags:Object detection, Lightweight network, Channel pruning, Knowledge distillation, Model quantization, Terminal deployment
PDF Full Text Request
Related items