Cattle abnormal walking detection method

By extracting the characteristic parameters of the four-hoof motion curve of the cattle and inputting the classification model, identifying the abnormal walking type, the problem of low detection accuracy of the cattle limp detection is solved, and more accurate limp detection is achieved.

CN119131682APending Publication Date: 2024-12-13HENAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411168961.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, abnormal walking of cattle leads to low detection accuracy of limp, frequent misjudgment, and affecting economic benefits.

Method used

By obtaining the motion curve of the four hooves of the cattle, extracting characteristic parameters such as the adjacent local peak time interval and local peak sequence of the motion curve derivative function, input an abnormal walking classification model for identification, and identifying and classifying the abnormal walking type of the cattle.

Benefits of technology

It improves the accuracy of limp detection, reduces abnormal walking misjudgment, and enhances detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131682A_ABST
    Figure CN119131682A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of cattle intelligent detection, and particularly relates to a cattle abnormal walking detection method. The method comprises the following steps: firstly, acquiring a motion curve of four hoofs of a cattle along the walking direction of the cattle, and extracting characteristic parameters of each hoofs from the motion curve; the characteristic parameters comprise a sequence consisting of time parameters for representing time intervals of adjacent local peak values of the motion curve derivative function and a sequence consisting of local peak values of the motion curve derivative function; inputting the extracted characteristic parameters of each hoof into an abnormal walking classification model to obtain an abnormal walking classification result of the cattle; the abnormal walking classification model is obtained by training a classification algorithm model by using a feature parameter data set containing an abnormal walking classification label. According to the method, the accurate detection of the abnormal walking of the cattle is realized, the method can be used as a front program for limping detection, the probability of misjudging the abnormal walking as limping is greatly reduced, the problem that the limping detection precision is influenced by the abnormal walking of the cattle in the prior art is solved, and the method has a good application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of intelligent detection of cattle, and in particular relates to a method for detecting abnormal walking of cattle. Background Art

[0002] Cattle are an important part of my country's animal husbandry. Their production performance and economic benefits are related to the development and modernization level of animal husbandry. Among them, hoof health problems are the most common. Hoof disease, hoof dermatitis and other hoof diseases may cause lameness in cattle. Lameness in cattle will lead to a decrease in food intake, which seriously affects the economic benefits of farmers. Therefore, early detection of lameness in cattle and timely treatment are of great research significance for cattle breeding.

[0003] Traditionally, the detection of lameness in cattle relies on manual work. This method is not only time-consuming and labor-intensive, but also costly. Due to the influence of subjective factors in manual observation and detection, it may even misjudge the degree of lameness of cattle. With the development of computer vision technology, more and more methods for detecting the degree of lameness of cattle based on machine vision have emerged. Using computer vision technology to detect and classify lameness in cattle can not only reduce labor costs, but also, as a non-contact detection technology, it can effectively reduce the stress behavior of cattle during the detection process.

[0004] In order to realize the lameness detection method based on machine vision technology introduced above, it is necessary to obtain videos of cattle walking without pauses, hoof slips and at a relatively uniform speed as the basis for analysis. However, in the actual acquisition of cattle walking video data, cattle often pause, hoof slips and walk at a non-uniform speed when passing through the channel in front of the camera. The above abnormal walking postures of cattle often lead to deviations in the fitting curves of key points of the cattle's body, resulting in serious misjudgment of whether the cattle are lame and the degree of lameness, affecting the accuracy of lameness detection. Therefore, it is necessary to accurately identify and detect abnormal walking conditions such as pauses, hoof slips and non-uniform walking before lameness detection. Summary of the invention

[0005] The object of the present invention is to provide a method for detecting abnormal walking of cattle, so as to solve the problem in the prior art that the accuracy of lameness detection is affected by abnormal walking of cattle.

[0006] In order to solve the above technical problems, the present invention provides a method for detecting abnormal walking of cattle, which comprises:

[0007] Obtaining the motion curve of the four hooves of the cattle along the walking direction of the cattle, and extracting the characteristic parameters of each hoof therefrom; the characteristic parameters include a sequence composed of time parameters of the time intervals of adjacent local peaks of the derivative function of the motion curve and a sequence composed of local peaks of the derivative function of the motion curve;

[0008] The extracted characteristic parameters of each hoof are input into an abnormal walking classification model to obtain the abnormal walking classification result of the cattle; the abnormal walking classification model is obtained by training a classification algorithm model using a characteristic parameter data set containing abnormal walking classification labels.

[0009] Furthermore, the means for obtaining the motion curve of the four hooves of the cow along the walking direction of the cow is: the positions of the four hooves in multiple frames of side-view walking images of the cow are located according to the following method: a frame of side-view walking image is input into a key point positioning model to obtain the positions of the four hooves in the frame of side-view walking image, and the key point positioning model is obtained by training an image target detection model using a side-view walking image data set marked with the positions of the four hooves; the motion curve of the four hooves of the cow along the walking direction of the cow is obtained according to the positions of the four hooves in each frame of the side-view walking image.

[0010] Furthermore, multiple frames of side-view walking images are extracted from a side-view walking video of a cattle, and the time parameter is a frame number difference of the side-view walking images corresponding to adjacent local peaks.

[0011] Furthermore, the time parameter is the time difference between adjacent local peaks.

[0012] Furthermore, the local peak is the local peak after removing abnormal values, and the method of removing abnormal values ​​includes removing local peaks whose values ​​are less than a set local peak threshold.

[0013] Furthermore, the derivative function of the motion curve is a derivative function curve after smoothing.

[0014] Furthermore, the classification algorithm model is a decision tree classification algorithm model.

[0015] Furthermore, the image target detection model is a deep learning model.

[0016] Furthermore, the abnormal walking classification labels include non-uniform walking, pauses, slipping, and others except non-uniform walking, pauses, and slipping.

[0017] Furthermore, the backbone network of the deep learning model is ResNet50 or EfficientNet-B0.

[0018] The beneficial effects of the present invention are as follows: the present invention is a pioneering invention and provides a new method for detecting abnormal walking of cattle. After analysis, the present invention found that when cattle walk abnormally, compared with normal walking of cattle, the local peak values ​​of the derivative function of the motion curve of the four hooves of cattle along the walking direction of cattle will change significantly. This obvious change is reflected in the change of local peak values ​​and the change of time interval between adjacent local peak values. Therefore, the present invention uses a sequence composed of time parameters for characterizing the time intervals of adjacent local peak values ​​of the derivative function of the motion curve and a sequence composed of local peak values ​​of the derivative function of the motion curve as characteristic parameters, and inputs the characteristic parameters into the abnormal walking classification model to realize accurate identification of abnormal walking of cattle. This method can be used as a pre-program for lameness detection, greatly reducing the probability of misjudging abnormal walking as lameness, solving the problem of affecting the accuracy of lameness detection due to abnormal walking of cattle in the prior art, and has practical significance and good application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of a method for detecting abnormal walking of cattle of the present invention;

[0020] Fig. 2(a1), Fig. 2(a2), Fig. 2(a3), and Fig. 2(a4) are respectively the motion curve diagram of the four hooves of the cattle that have paused during the movement, the right front hoof curve, the derivative function diagram of the right front hoof curve, and the derivative function diagram after smoothing;

[0021] Fig. 2(b1), Fig. 2(b2), Fig. 2(b3), and Fig. 2(b4) are respectively the motion curve diagram of the four hooves of the cattle with slipping hoof phenomenon during movement, the right front hoof curve, the derivative function diagram of the right front hoof curve, and the derivative function diagram after smoothing processing;

[0022] Fig. 2(c1), Fig. 2(c2), Fig. 2(c3), and Fig. 2(c4) are respectively the motion curve diagram of the four hooves of the cattle showing the phenomenon of non-uniform walking during the movement of the present invention, the right front hoof curve, the derivative function diagram of the right front hoof curve, and the derivative function diagram after smoothing;

[0023] Figure 3 It is the key point positioning diagram of cattle of the present invention. DETAILED DESCRIPTION

[0024] When the present invention finds that the cattle have abnormal walking, the local peak values ​​of the derivative function of the motion curve of the four hooves of the cattle along the walking direction of the cattle will change significantly, and the changes in the local peak values ​​of the derivative function of the motion curve of different types of abnormal walking are different. Therefore, the present invention selects a sequence composed of time parameters for characterizing the time intervals of adjacent local peak values ​​of the derivative function of the motion curve and a sequence composed of local peak values ​​of the derivative function of the motion curve as characteristic parameters, and then uses the characteristic parameters and the abnormal walking classification model to accurately classify the abnormal walking types of the cattle, thereby solving the problem in the prior art that the accuracy of lameness detection is affected by abnormal walking of the cattle.

[0025] In order to make the purpose, technical solution and advantages of the present invention more clear, the solution of the present invention is further described in detail below with reference to the accompanying drawings. The implementation process of the whole solution is as follows:

[0026] Step 1: Collect videos of cows walking sideways.

[0027] In this embodiment, video data is collected in a cattle farm. The video collection device may be a color camera; the collection location may be a passage that can accommodate a single cow passing through and walking in a straight line, such as a cow milking passage; at this time, the camera may be fixed on a tripod in front of the cow passage, and the shooting direction may be perpendicular to the cow walking passage, for example, the color camera may be mounted on a tripod 1.5 meters from the ground and 3.5 meters from the passage, to ensure that a complete cow walking video from the side can be collected.

[0028] Since the video collected in this step is to obtain the data set required for training the key point positioning model, side-view walking videos of different cows at different times can be collected to obtain multiple groups of cow side-view walking videos. Moreover, the side-view walking videos are selected here because the key points of the cow in this embodiment are the four hooves, and the side-view walking videos can better capture the four hooves of the cow without obstruction.

[0029] Step 2: Select video frames from the collected side-view walking videos, locate and annotate the key points of the cattle in the video frames, thereby obtaining a data set, and use the obtained data set to train an image target detection model to obtain a key point positioning model.

[0030] Specifically:

[0031] 1) Randomly select video frames from the collected side-view walking video to mark key points, thereby obtaining a data set. Of course, each video frame can be marked with key points so that a more accurate key point motion curve can be obtained later, but this will increase the amount of calculation. Moreover, the key points in this embodiment are the four hooves of the cow, and the marking situation is as follows: Figure 3 As shown, Figure 3 The circle in the figure is the labeling result. The head of the cow is also labeled in this figure, which is not used in this step.

[0032] 2) Construct an image target detection model. In this embodiment, the target detection model selects a deep learning model, whose backbone network is ResNet50 or EfficientNet-B0. Other image target detection models in the prior art can be selected, and their backbone networks can be adaptively selected, for example, Yolov4 can be selected.

[0033] 3) Divide the data set into a training set and a test set to train and test the image object detection model constructed in step 2) respectively, and finally obtain a key point positioning model. During the training process, according to the returned training results, change the model's learning rate, loss function and other parameters, and finally enable the model to accurately locate the key points of the cattle.

[0034] Step three, directly draw the motion curve of the cow's four hooves along the cow's walking direction based on the cow's four hooves marking results in step two, or draw the motion curve of the cow's four hooves along the cow's walking direction based on the positioning results of the key point positioning model in step two.

[0035] Directly drawing the motion curve of the cow's four hooves based on the marking results of the cow's four hooves in step 2 is a way to relatively improve the accuracy of the motion curve. However, considering its large workload, when the accuracy of the key point positioning model is relatively high, the positioning results of the key point positioning model can be used to draw the motion curve of the cow's four hooves.

[0036] Step 4: further analyze the extracted motion curves of the four hooves of the cow along the walking direction of the cow to extract the characteristic parameters of each hoof.

[0037] The characteristic parameters selected in this embodiment include a sequence composed of time parameters of the time intervals of adjacent local peaks (local peaks are essentially maxima) used to characterize the derivative function of the motion curve and a sequence composed of local peaks of the derivative function of the motion curve, wherein the time parameter can specifically select the time difference of adjacent local peaks or the frame number difference of the side-view walking image corresponding to adjacent local peaks. The local peaks here can be extracted by the findpeaks function in matlabR2023b, and the reasons and analysis process for selecting the characteristic parameters as described above are as follows:

[0038] ① It is stipulated that the walking direction of the cow in a side view is the x-axis, and the direction perpendicular to the ground is the y-axis, so as to obtain the motion curves of the cow's head and four hooves in the x-axis direction and y-axis direction respectively over time. It should be noted that the process of obtaining the x- and y-axis motion curves of the cow's head and the process of obtaining the y-axis motion curves of the cow's four hooves can refer to the processing process of step 2 and step 3. Among them, the motion curves of the four hooves of the cow in the x-axis when they pause, slide, and walk at a non-uniform speed during movement are shown in Figure 2 (a1), Figure 2 (b1), and Figure 2 (c1), and the horizontal coordinates of each figure in Figure 2 are the frame numbers of the video frames, which reflect time.

[0039] ② According to the obtained motion curves of the head and four hooves of the cattle, and compared with the moments when the cattle paused, slipped, and walked at a non-uniform speed, it was found that the motion curves of the head and four hooves of the cattle had the following change characteristics: in response to the phenomenon of the cattle pausing during walking, the motion curve of the cattle's four hooves on the x-axis remained almost unchanged with the increase of time when the cattle paused, and the motion curve of the cattle's four hooves on the y-axis also showed the same characteristics, while the head curve of the cattle showed no obvious characteristics in either the x-axis or the y-axis; in response to the phenomenon of cattle slipping, the hoof of the cattle with slipping hoof was analyzed separately, and it was found that at the moment when the cattle's hoof slipped, an inflection point appeared on the motion curve of the cattle's slipping hoof limb on the x-axis, and the motion curve of the cattle's slipping hoof limb on the y-axis and the motion curve of the cattle's head did not show obvious characteristics; in response to the phenomenon of cattle walking at a non-uniform speed, it was found that the motion curve of the cattle's four hooves on the x-axis showed obvious sparseness, while the motion curve of the cattle's four hooves on the y-axis and the motion curve of the cattle's head did not show obvious characteristics. Among them, the motion curves of the right front hoof on the x-axis of the cattle that pause, slip, and walk at an uneven speed are shown in Figure 2(a2), Figure 2(b2), and Figure 2(c2); and the right hind hoof was selected because it is aimed at Figure 3 The situation shown here is that the right hoof is not covered while the left hoof is occasionally covered while the cow is walking.

[0040] ③ The derivative analysis of the motion curves with obvious characteristics of abnormal walking posture of cattle was carried out, and it was found that the corresponding derivative functions had the following characteristics: for the phenomenon of cattle pausing during walking, it was found that the peak horizontal coordinates between the derivative functions of the motion curves of the four hooves on the x-axis increased abnormally, as shown in Figure 2(a3); for the phenomenon of slipping of the hoof during walking, it was found that the derivative function of the motion curve of the slipping hoof on the x-axis had a smaller peak value immediately after the normal peak value when the slipping hoof occurred, as shown in Figure 2(b3); for the phenomenon of non-uniform walking of cattle, it was found that the difference between the peak values ​​of the derivative functions of the motion curves of the four hooves on the x-axis increased abnormally, as shown in Figure 2(c3). The results of smoothing the curves of Figures 2(a3), 2(b3), and 2(c3) are shown in Figures 2(a4), 2(b4), and 2(c4).

[0041] ④ Thus, characteristic parameters for distinguishing abnormal walking postures of cattle are extracted. The specific characteristic parameters are the horizontal coordinate difference of the local peak value of the derivative function of the motion curve of each hoof of the cattle (the horizontal coordinate difference is the frame number difference, which is one of the cases of a sequence composed of time parameters used to characterize the time interval of adjacent local peak values ​​of the derivative function of the motion curve. The time difference of adjacent local peak values ​​of the derivative function of the motion curve can also be directly selected) and the vertical coordinate value of the local peak point of the derivative function (that is, a sequence composed of local peak values ​​of the derivative function of the motion curve).

[0042] Step 5: Use the feature parameters selected in step 4 to construct a feature parameter data set containing abnormal walking classification labels for training the classification algorithm model, and use the data set to train the classification algorithm model to obtain the abnormal walking classification model.

[0043] The classification labels include: non-uniform walking, pause, slipping, and other than non-uniform walking, pause, slipping. Considering the strong robustness of the decision tree classification algorithm model, the classification algorithm model selects the decision tree classification algorithm model. Of course, other classification algorithm models can be selected according to actual conditions, such as random forest algorithm model, support vector machine model, etc.

[0044] Step 6: Use the obtained abnormal walking classification model and key point positioning model to detect abnormal walking of any cattle. Figure 1 As shown:

[0045] 1) Collect a side-view walking video of the cattle to be tested.

[0046] 2) Extract key frame side-view walking images from the side-view walking video, use the key point positioning model to locate the positions of the four hooves in each frame of the side-view walking image, and use the extracted four hoof positions to draw the motion curve of the four hooves along the walking direction of the cattle. Among them, the key frame extraction method can be random extraction, full selection, set interval extraction, etc., but in the case of non-full selection, it is necessary to ensure that the extracted key frames can basically reflect the walking conditions of the cattle. In addition, the camera can be used to directly shoot to obtain the side-view walking image of the cattle, so as to omit the action of extracting from the side-view walking video.

[0047] 3) According to the motion curve of the four hooves in the walking direction of the cattle, the characteristic parameters of each hoof are extracted. The characteristic parameters include a sequence composed of the time difference of adjacent local peaks of the derivative function of the motion curve (or a sequence composed of the frame number difference of the side-view walking image corresponding to adjacent local peaks) and a sequence composed of local peaks of the derivative function of the motion curve. That is, the characteristic parameters finally extracted include 8 sequences. Among them, in order to ensure that only one peak can be extracted from the more prominent local main peak, so as to avoid extracting multiple peaks to affect subsequent calculations and classification, the derivative function curve needs to be smoothed first; and then considering that the derivative function image has more interference from small peaks, the local peaks extracted can be removed first in the process of local peak extraction after smoothing. Specifically, a local peak threshold can be set (the specific value can be selected according to the actual situation, such as 7.32m), and the local peaks smaller than the threshold are removed, and then the corresponding sequence is obtained according to the local peaks after removing the abnormal values.

[0048] 4) The extracted 8 sequences are input into the abnormal walking classification model to obtain the abnormal walking classification results of the tested cattle, which are non-uniform walking, pauses, slipping hoofs, or other than uniform walking, pauses, and slipping hoofs, thereby realizing the discrimination of abnormal walking posture of cattle.

[0049] At this point, the entire abnormal walking detection method of the present invention is realized. The method can detect whether the cattle pause, slip, and non-uniform walking posture occur during walking, and can be used as a pre-program for lameness detection, which has practical significance and good application prospects.

[0050] Specific implementation methods are given above, but the present invention is not limited to the described implementation methods. The basic idea of ​​the present invention lies in the above basic scheme. For ordinary technicians in this field, it does not take creative work to design various deformed models, formulas, and parameters according to the teachings of the present invention. Changes, modifications, substitutions, and variations of the implementation methods without departing from the principles and spirit of the present invention still fall within the scope of protection of the present invention.

Claims

1. A method for detecting abnormal walking of cattle, characterized in that: The method includes: Obtaining the motion curve of the four hooves of the cattle along the walking direction of the cattle, and extracting the characteristic parameters of each hoof therefrom; the characteristic parameters include a sequence composed of time parameters of the time intervals of adjacent local peaks of the derivative function of the motion curve and a sequence composed of local peaks of the derivative function of the motion curve; The extracted characteristic parameters of each hoof are input into an abnormal walking classification model to obtain the abnormal walking classification result of the cattle; the abnormal walking classification model is obtained by training a classification algorithm model using a characteristic parameter data set containing abnormal walking classification labels.

2. The method for detecting abnormal walking of cattle according to claim 1, characterized in that: The means of obtaining the motion curve of the four hooves of the cow along the walking direction of the cow is: The positions of the four hooves in multiple frames of side-view walking images of the cattle are located according to the following method: a frame of the side-view walking image is input into a key point positioning model to obtain the positions of the four hooves in the frame of the side-view walking image, wherein the key point positioning model is obtained by training an image target detection model using a side-view walking image data set with the positions of the four hooves annotated; The motion curve of the four hooves of the cattle along the walking direction of the cattle is obtained according to the positions of the four hooves in each frame of the side-view walking image.

3. The method for detecting abnormal walking of cattle according to claim 2, characterized in that: The multiple frames of side-view walking images are extracted from the side-view walking video of the cattle, and the time parameter is the frame number difference of the side-view walking images corresponding to adjacent local peaks.

4. The method for detecting abnormal walking of cattle according to claim 1, characterized in that: The time parameter is the time difference between adjacent local peaks.

5. The method for detecting abnormal walking of cattle according to claim 1, characterized in that: The local peak is the local peak after removing abnormal values, and the method of removing abnormal values ​​includes removing local peaks whose values ​​are less than a set local peak threshold.

6. The method for detecting abnormal walking of cattle according to claim 1, characterized in that: The motion curve derivative function is a derivative function curve after smoothing.

7. The method for detecting abnormal walking of cattle according to any one of claims 1 to 6, characterized in that: The classification algorithm model is a decision tree classification algorithm model.

8. The method for detecting abnormal walking of cattle according to claim 2 or 3, characterized in that: The image target detection model is a deep learning model.

9. The method for detecting abnormal walking of cattle according to any one of claims 1 to 6, characterized in that: The abnormal walking classification labels include non-uniform walking, pauses, slipping, and others except uniform walking, pauses, and slipping.

10. The method for detecting abnormal walking of cattle according to claim 8, characterized in that: The backbone network of the deep learning model is ResNet50 or EfficientNet-B0.