Abstract:Animal face detection is of great significance to the intelligent management of animal farm. At present, goats have the characteristics of multi angle, random distribution and flexibility in the actual feeding environment, which greatly increases the difficulty of goat face detection. Therefore, a goat face detection model combined with coordinate information was proposed based on YOLO v5s target detection network. Firstly, indoor, outdoor, single and multiple goat images were obtained by using mobile devices to build sample data sets. Secondly, coordinate attention mechanism (CA) was integrated into the backbone network of YOLO v5s to make full use of target position information and improve the target recognition accuracy in the occluded area, small target and multi view sample images. The proposed YOLO v5s-CA based approach achieved a precision of 95.6%, a recall of 83.0%, an mAP0.5 of 90.2%, a frame rate of 69f/s and a model size of 13.2MB. Compared with that of the original YOLO v5s model, the detection precision of YOLO v5s-CA was increased by 1.3 percentage points, and the memory space was reduced by 1.2MB. And the overall performance of the YOLO v5s-CA was better than that of the Faster R-CNN, YOLO v4 and YOLO v5s. Experimental results showed that the proposed YOLO v5s-CA approach can improve the detection precision of occluding and small targets by introducing target coordinate information. In addition, datasets with different lighting and camera shake were simulated and constructed to further verify the feasibility of the proposed method. Overall, the proposed deep learning-based goat face detection approach can quickly and effectively detect and locate goat faces in complex scenes, providing detection ideas and technical support for target detection and recognition in intelligent animal farm.