Abstract:Aiming to address the challenge of accurately assessing the body condition of dairy cows in environments with motion blur, an integrated method for body condition scoring that incorporated an improved noise adaptive flow network model was proposed for the restoration of motion-blurred images. The simple channel attention module in NAFNet was replaced with a channel prior convolutional attention module, which dynamically allocated attention weights in both channel and spatial dimensions, refining and enhancing features to generate high-quality body condition feature maps. Additionally, the inverted residual mobile block module was embedded within the C2f module of the YOLO v8 model, maintaining the model's lightweight nature while aiding in the extraction of spatial relationships among body condition features. Furthermore, the large separable kernel attention module was integrated into the spatial pyramid pooling fusion (SPPF) module to achieve a larger effective receptive field, enhancing the model's ability to extract global features for body condition scoring. It can effectively reduce the probability of false detection and missing detection, and improve the detection accuracy. The proposed NAF-YOLO v8 method achieved precision, recall, and mean average precision of 80.7%, 75.3%, and 80.1%, respectively, on the motion-blurred test set, representing improvements of 8.2, 4.7, and 8.0 percentage points compared with models without image restoration. This integrated approach effectively reduced the impact of motion blur on the accuracy of body condition scoring, providing significant support for the intelligent management of dairy cattle.