Abstract:Accurate extraction of the udder region of dairy goats was the key to realize non-invasive temperature detection of dairy goats. Due to the occlusion of breast area and the low quality of thermal infrared image, the detection accuracy needs to be further improved. Based on thermal infrared imaging technology, an improved YOLO v5s based detection method for key parts of milk goat udder was proposed. By replacing some convolutional modules of Backbone network in the original model with ShuffleNetV2 structure, the number of parameters in network deployment and training process was reduced, and the purpose of lightweight network design was realized. By introducing CBAM attention mechanism into the head of the Neck network detection head, the complexity of the network has been reduced and the detection accuracy of the breast region of dairy goats was ensured. Totally 4611 infrared images of breast of pregnant dairy goats containing complete information, incomplete information and blurred edges were collected, and the model was trained after location labeling. After testing, the accuracy of the model was 93.7%, the recall rate was 86.1%, the mean average precision was 92.4%, the number of parameters was 8×105, and the floating point computation was 1.9×109. Compared with the YOLO v5n,YOLO v5s,YOLO v7-tiny,YOLO v7,YOLO v8n and YOLO v8s target detection network, the accuracy of this network was increased by 1.9 percentage points,1.2 percentage points,1.6 percentage points,4.3 percentage points,3.5 percentage points and 2.7 percentage points, the recall rate was increased by 3.4 percentage points,5.0 percentage points,0.1 percentage points,2.6 percentage points,0.9 percentage points and 1.5 percentage points, the number of parameters was decreased by 1.1×106,6.2×106,5.2×106,3.6×107,2.4×106 and 1.0×107, and floating-point calculations were reduced by 2.6×109,1.4×1010,1.1×1010,1.0×1011,6.8×109 and 2.7×1010, respectively. It met the detection requirements of the key parts of milk goat udder, and significantly reduced the number of parameters of the network without losing the detection accuracy, which was conducive to the deployment and use of the network in different environments, and had reference significance for the design of non-contact temperature monitoring system for milk goat body temperature.