Automatic lameness detection in dairy cows based on machine vision - Jia, Zongwei; Yang, Xuhui; Wang, Zhi; Yu, Ruirui; Wang, Ruibin (International Journal of Agricultural and Biological Engineering, 2023)
This study proposed a method for detecting lameness in dairy cows based on machine vision, addressing the challenges associated with manual detection. Data from a dairy farm in Taigu, Shanxi, China were collected and divided into two parts. The first part was utilized to precisely position the cow’s back by employing a dedicated deep learning model named GhostNet_YOLOv4, which can be implemented on mobile or embedded devices. The second part was used with the Visual Background Extractor (Vibe) algorithm, incorporating additional morphological processing techniques. Enhancing the Vibe algorithm, a widely used background subtraction algorithm for image sequences, achieved more accurate recognition of the specific pixel areas of cows. Subsequently, cow shape-related feature parameters were extracted from the back area using the combined approach. These parameters were used to calculate the average curvature, which describes the degree of curvature of the cow’s back contour during walking. The differences in curvature values were employed for classification to detect lameness. Through extensive experimentation, distinct average curvature ranges of [−0.025, −0.125], [−0.025, +∞], and [−∞, −0.125] were established for normal cows, early lameness, and moderate-severe lameness, respectively. The algorithm’s effectiveness was validated by processing 600 image sequences of dairy cows, resulting in a lameness detection accuracy of 91.67%. These findings can serve as a reference for the timely and accurate recognition of lameness in dairy cows. Keywords: dairy cow, lameness detection, machine vision, object detection, deep learning DOI: 10.25165/j.ijabe.20231603.8097 Citation: Jia Z W, Yang X H, Wang Z, Yu R R, Wang R B. Automatic lameness detection in dairy cows based on machine vision. Int J Agric & Biol Eng, 2023; 16(3): 217–224.