Abstract:The fine segmentation of cow body parts has significant applications in research fields such as cow body condition scoring, posture estimation, behavior recognition, and body measurement. Due to the limited practicality of existing segmentation methods for different cow body parts, an improved YOLO v8n-seg model named YOLO v8n-seg-FCA-BiFPN was proposed for cow body part segmentation tasks. The improved model added FCA channel attention mechanism to the YOLO v8n backbone feature extraction network to better extract the geometric feature information of small targets, and used repeated weighted bidirectional features in the network feature fusion layer. The BiFPN was used to achieve the purpose of increasing the coupling of features at each scale. In order to validate the model performance, side-view images of cows at the channel were collected for network training. To ensure the quality of the dataset, the structural similarity algorithm was used to remove similar redundant images, resulting in a total of 1452 images. LabelMe software was used to label the target cows, which were divided into eight parts, forelimbs, hindlimbs, udders, tails, belly, head, neck, and trunk, and was sent to the training model. The test results showed that the precision was 96.6%, the recall was 94.6% and the mean average precision was 97.1%, the parameters number was 3.3×106, and the detection speed was 6.2f/s. The precision of each part was from 90.3% to 98.2%, and the mean average precision was 96.3%. The YOLO v8n-seg-FCA-BiFPN network could realize accurate segmentation of various parts of dairy cows. Compared with the original YOLO v8n, the precision, recall and mean average precision of YOLO v8n-seg-FCA-BiFPN were 3.2 percentages points, 2.6 percentages points and 3.1 percentages points higher than that of YOLO v8n-seg, respectively. The precision under occlusion was 93.8%, the recall value was 91.67%, and the mean average precision was 93.15%. The volume of the improved model remained unchanged and had strong robustness. Under occlusion, the precision was 93.8%, the recall was 91.67%, and the mean average precision was 93.15%. The overall results showed that the research can provide necessary technical support for precise segmentation of dairy cows' body parts.