In recent years,deep neural network models have become a research hotspot in the field of artificial intelligence,including applications in speech recognition,image understanding,and video detection.However,with the continuous development of neural networks,follow-up research on the accuracy and speed of neural networks The requirements for network models are getting higher and higher,making the structure of the network model more and more complex,with more and more parameters,and the requirements for application scenarios and application equipment are also getting higher and higher.Therefore,the conceptual method of model compression is proposed.Model compression aims to reduce the amount of network model parameters while maintaining the accuracy of the network,thereby reducing the amount of calculation of the network model and increasing the speed of network inference.Reducing the number of parameters of the network model also means reducing the size of the model,which reduces the space required for network model storage,so that the network model can also be applied to some low-end mobile devices with lower performance and less storage space.Improve the applicability of the network model,and effectively solve the problem that the neural network model is difficult to apply in some scenarios.This thesis takes object detection and model compression as the research topic,and focuses on the realization of object detection in the diagnosis of thyroid nodules.Then compress the model in view of the difficulty of model training and using.The main contributions and innovations are as follows:1.Make a object detection dataset for thyroid ultrasound images,apply a deep learning object detection network on the thyroid image,classify and locate the thyroid in the image,and prove through experiments that it can be achieved by applying deep learning object detection to thyroid detection and positioning good effect,and a high-precision target detection model for thyroid ultrasound images is obtained.2.A new sparse method is proposed.After sparse training is completed to greatly compress the network weights,the sparse factor λ is reduced.Compared with the sparse method with a constant λ value,it will reduce a certain model compression ratio,but more It is conducive to the improvement of the accuracy of the model network after compression,while reducing the time cost of optimizing hyper-parameters.3.A layer pruning method is proposed to evaluate the previous convolution module containing the Batch Normalization(BN)layer of each shortcut in the network structure.The layer with the smaller scaling factor after sparseness The less important it is,sort the average value of the scaling factor of each layer,and take the smallest one for layer pruning.4.Use the method of judging the importance of channels through the scaling factor of the batch normalization layer to decide which channels to prune.Back-propagation of sparse training is used to update the scaling factor so that the scaling factor value of the batch normalization layer in most channels is close to 0,and the channel with the scaling factor close to 0 is the unimportant channel that we consider to be unimportant.These channels are pruned.5.Use the knowledge distillation method for the object detection model to perform knowledge distillation on the compressed model obtained after pruning,use the high-precision target detection model of the thyroid ultrasound image as the teacher network,and use the small low-precision model obtained after compression as the student The network allows the teacher network to guide the student network training,thereby improving the accuracy of the pruned small low-precision model,so that the compressed model can greatly reduce the model parameters while maintaining the accuracy. |