Abstract:The recognition of cows’ body parts is essential for providing accurate details of the cows’ shape, which is the fundamental prerequisite for locomotion scoring, posture detection and behavioral quantifications. The objective was to develop a robust depth feature in order to reduce the difficulty in building the classifier and detect cows’ body parts with higher accuracy. Therefore, a method for segmenting cows’ body parts was proposed, including the head, neck, body, forelimbs, hind limbs and tail, with high accuracy on the basis of depth image processing and machine learning. The local binary patterns of each pixel under several sampling radii were used as the features with which the filtering rules were designed, and a decision forest was trained and tested to classify the pixels into six groups. Furthermore, totally 288 depth images were captured from 30 cows;150 images were randomly selected to build three decision trees, and the rest images were used for testing. The results showed that when the number of sampling radii and training layers were 30 and 20, respectively, the recognition rate reached 95.15%. Among the cows’ body parts, the recognition rate of tail was 54.97%, and the minimum recognition rate of other parts was 89.22%. In some cases that tail was too close to trunk to segment tail from trunk by human marker, the decision trees recognized the tail successfully. The average recognition time for pixel were 0.38ms and 0.25ms, and the recognition time for cow target were 20.30s and 15.25s for the conventional method and new method, respectively. This LBP-based depth image feature was translation-invariant and rotation-invariant and had fewer parameters. The results showed that the new method proposed was more effective in recognizing small and complex structures of the cow target with higher accuracy. Compared with the typical depth image features, the new feature employed was capable of extracting the details of cows’ body and recognizing complex parts more accurately with fewer parameters and simple model.