Abstract:In practical applications, current livestock detection algorithms often suffer from issues such as blurred, incomplete, or occluded captured images due to interference from complex scenes, leading to reduced detection accuracy. Additionally, detection models typically have a large number of parameters, making them difficult to deploy on portable devices. To address these challenges, a lightweight VSF-YOLO network architecture designed for cattle facial detection was proposed, which was capable of handling complex scenes and focusing on fine-grained facial features. The algorithm firstly introduced a VegsNet backbone network to replace the original YOLO v10n backbone, thereby reducing model complexity and operational parameters. Secondly, to capture fine-grained image features, a spatial receptive field convolution was proposed to efficiently extract key information from the entire image. Additionally, a full-feature anchor attention mechanism was designed to accurately capture fine-grained features by leveraging anchor point feature information across the entire image. Finally, the loss function was optimized to enhance the convolution's ability to extract fine-grained features and locate critical regions. To validate the algorithm's effectiveness and real-time performance, ablation studies and comparative experiments with various classical algorithms were conducted on a specific dataset. The model was also deployed on an Android mobile system for testing. The results indicated that compared with the traditional YOLO v10n, the parameter count was decreased by 30%, while the average accuracy was increased by 3.55 percentage points. Benefiting from fine-grained feature extraction, the detection confidence for cattle faces was improved by an average of 36% under the same complex scenarios involving blurring and occlusion. Moreover, after being ported to mobile applications, the operational efficiency was increased, with the average frame rate rising by 30% compared with that of the original model.