智慧农业 (Jul 2024)
CSD-YOLOv8s: Dense Sheep Small Target Detection Model Based on UAV Images
Abstract
ObjectiveThe monitoring of livestock grazing in natural pastures is a key aspect of the transformation and upgrading of large-scale breeding farms. In order to meet the demand for large-scale farms to achieve accurate real-time detection of a large number of sheep, a high-precision and easy-to-deploy small-target detection model: CSD-YOLOv8s was proposed to realize the real-time detection of small-targeted individual sheep under the high-altitude view of the unmanned aerial vehicle (UAV).MethodsFirstly, a UAV was used to acquire video data of sheep in natural grassland pastures with different backgrounds and lighting conditions, and together with some public datasets downloaded formed the original image data. The sheep detection dataset was generated through data cleaning and labeling. Secondly, in order to solve the difficult problem of sheep detection caused by dense flocks and mutual occlusion, the SPPFCSPC module was constructed with cross-stage local connection based on the you only look once (YOLO)v8 model, which combined the original features with the output features of the fast spatial pyramid pooling network, fully retained the feature information at different stages of the model, and effectively solved the problem of small targets and serious occlusion of the sheep, and improved the detection performance of the model for small sheep targets. In the Neck part of the model, the convolutional block attention module (CBAM) convolutional attention module was introduced to enhance the feature information capture based on both spatial and channel aspects, suppressing the background information spatially and focusing on the sheep target in the channel, enhancing the network's anti-jamming ability from both channel and spatial dimensions, and improving the model's detection performance of multi-scale sheep under complex backgrounds and different illumination conditions. Finally, in order to improve the real-time and deploy ability of the model, the standard convolution of the Neck network was changed to a lightweight convolutional C2f_DS module with a changeable kernel, which was able to adaptively select the corresponding convolutional kernel for feature extraction according to the input features, and solved the problem of input scale change in the process of sheep detection in a more flexible way, and at the same time, the number of parameters of the model was reduced and the speed of the model was improved.Results and DiscussionsThe improved CSD-YOLOv8s model exhibited excellent performance in the sheep detection task. Compared with YOLO, Faster R-CNN and other classical network models, the improved CSD-YOLOv8s model had higher detection accuracy and frames per second (FPS) of 87 f/s in the flock detection task with comparable detection speed and model size. Compared with the YOLOv8s model, Precision was improved from 93.0% to 95.2%, mAP was improved from 91.2% to 93.1%, and it had strong robustness to sheep targets with different degree of occlusion and different scales, which effectively solved the serious problems of missed and misdetection of sheep in the grassland pasture UAV-on-ground sheep detection task due to the small sheep targets, large background noise, and high degree of densification. misdetection serious problems. Validated by the PASCAL VOC 2007 open dataset, the CSD-YOLOv8s model proposed in this study improved the detection accuracy of 20 different objects, including transportation vehicles, animals, etc., especially in sheep detection, the detection accuracy was improved by 9.7%.ConclusionsThis study establishes a sheep dataset based on drone images and proposes a model called CSD-YOLOv8s for detecting grazing sheep in natural grasslands. The model addresses the serious issues of missed detections and false alarms in sheep detection under complex backgrounds and lighting conditions, enabling more accurate detection of grazing livestock in drone images. It achieves precise detection of targets with varying degrees of clustering and occlusion and possesses good real-time performance. This model provides an effective detection method for detecting sheep herds from the perspective of drones in natural pastures and offers technical support for large-scale livestock detection in breeding farms, with wide-ranging potential applications.
Keywords