Abstract:Behavior recognition of Hu sheep contributes to their intensive and intelligent farming. Due to the generally high density of Hu sheep farming, severe occlusion occurs among different behaviors and even among sheep performing the same behavior, leading to missing and false detection issues in existing behavior recognition methods. A high-low frequency aggregated attention and negative sample comprehensive score loss and comprehensive score soft non-maximum suppression-YOLO (HLNC-YOLO) was proposed for identifying the behavior of Hu sheep, addressing the issues of missed and erroneous detections caused by occlusion between Hu sheep in intensive farming. Firstly, images of four typical behaviors—standing, lying, eating, and drinking—were collected from the sheep farm to construct the Hu sheep behavior dataset (HSBD). Next, to solve the occlusion issues, during the training phase, the C2F-HLAtt module was integrated, which combined high-low frequency aggregation attention, into the YOLO v8 Backbone to perceive occluded objects and introduce an auxiliary reversible branch to retain more effective features. Using comprehensive score regression loss (CSLoss) to reduce the scores of suboptimal boxes and enhance the comprehensive scores of occluded object boxes. Finally, the soft comprehensive score non-maximal suppression (Soft-CS-NMS) algorithm filtered prediction boxes during the inferencing. Testing on the HSBD, HLNC-YOLO achieved a mean average precision (mAP@50) of 87.8%, with a memory footprint of 17.4MB. This represented an improvement of 7.1, 2.2, 4.6, and 11 percentage points over YOLO v8, YOLO v9, YOLO v10, and Faster R-CNN, respectively. Research indicated that the HLNC-YOLO accurately identified the behavior of Hu sheep in intensive farming and possessed generalization capabilities, providing technical support for smart farming.