| The large-scale and intensive transformation of animal husbandry is the trend of modern development of animal husbandry,which will also increase the difficulty of farm management.Therefore,it is necessary to improve the management efficiency and carry out husbandry farms information construction.With the rapid development of deep learning,applying deep learning in animal husbandry has received extensive attention and research.Aiming at the sheep counting task in sheep farm,in this paper,a dataset containing 4240 images and label files is constructed for training and testing,an improved detection model and an improved detection algorithm is proposed,and an online sheep counting system and a sheep shed integrated management platform is developed,which is used as an auxiliary tool for sheep farm management.The research in this paper provides a working example for the construction of animal husbandry informatization in China,analyzes the key issues,and accumulates relevant data resources,providing help and reference for the follow-up animal husbandry informatization and light simplification in China.Main works of paper are as follow:(1)Combining self-collected dataset and free-access dataset,a dataset suitable for training sheep counting object detection model is established,which is labeled and divided.This dataset provides data resources for the future modernization of the livestock breeding industry,and partially solves the problem of lacking sheep detection datasets at present.(2)Aiming at the requirements of both accuracy and real-time,a sheep counting object detection model based on attention depth separation convolution is proposed.The attention depth separation convolution module is introduced,which reduces the calculation of traditional convolution and improves the running speed of the model,and then cascades SENET to compensate for the loss of channel connection.Given that counting task attaches importance to location task,the attention depth separation convolution module is used at deep layers of backbone and all layer in neck.CBAM module is added in deep layers of backbone to enhance the ability of obtaining full image information,so as to solve the obvious occlusion problem.The experimental results show that the improved model achieves 87.02%mAP and 28.5 frames per second detection rate in sheep counting task,indicating that the model has good detection performance.(3)For serious occlusion problem,a sheep detection algorithm based on fusion allocation strategy and multi-objective loss function is proposed.Based on the improved model,the fusion allocation strategy is used to allocate positive and negative samples in the model training stage,combining the prior information of the anchor and the efficient SimOTA algorithm,the advantages of which are proved by experiments.In view of the fact that the confidence and IOU of the sheep shed multi-objective situation is not equal at the NMS stage sometimes,a multi-objective loss function is proposed,replacing the confidence loss by the VarifocalLoss function,which fuses IOU into confidence calculation.The effectiveness of multi-objective loss function is also verified by experiments.The comparative experiments show that the mAP value of improved model reaches 87.81%based on the improved training algorithm,indicating the practicability of the algorithm in the sheep count detection model.(4)In order to apply the research results better,based on the improved model and algorithm,the online sheep counting system and the sheep shed integrated management platform are developed respectively.The sheep counting system can acquire the sheep number in sheep shed in real time through real-time video stream,with the high detection accuracy of 93.3%,good embeddedness and scalability.The sheep shed integrated management platform contains the online sheep counting platform and integrates multiple management tool,which can be used as an information tool for efficient sheep farms management. |