Determination method, application method and product of dairy cow limb and hoof performance abnormity identification model
Through image processing and machine learning algorithm models, combined with cow walking images and visible-infrared light images, a cow's limb and hoof performance abnormality recognition model was trained, solving the accuracy and efficiency problems of traditional methods in the identification and severity recognition of cow's limb and hoof disease, and achieving high-precision automatic recognition and real-time monitoring.
Patent Information
- Application Number
- CN202411864922.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
AI Technical Summary
Traditional methods have problems such as low accuracy, low efficiency and inability to realize real-time monitoring in the identification and severity of cow limb disease.
Image processing and machine learning algorithm models are adopted to obtain the cow's walking images and visible-infrared light images of cow's hoof and integrated data, and train the machine learning algorithm model to obtain the abnormal performance recognition model of cow's limbs and hoof diseases, and realize automatic and comprehensive and accurate identification of cow's limbs and hoof diseases.
It realizes high-precision prediction and identification of cow limb and hoof disease and accurate identification of severity, improves the accuracy and efficiency of identification, can analyze cows' walking postures in real time, and timely discover potential problems.
Smart Images

Figure CN119810910A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition and animal husbandry technology, and in particular to a method for determining an abnormal recognition model for limb and hoof performance of dairy cows, an application method and a product. Background Art
[0002] In large-scale farming scenarios, limb and hoof disease in dairy cows is a common problem that seriously affects the health and production performance of dairy cows. Accurately identifying limb and hoof disease in dairy cows and judging its severity are crucial for timely treatment and prevention of the spread of the disease.
[0003] In traditional dairy farming, farmers mainly rely on experience to judge whether cows have limb and hoof diseases and the severity of the disease through manual observation. This method has great limitations. First, the accuracy of manual observation is limited by the experience and expertise of farmers. Different people may have different judgment criteria for the symptoms and severity of limb and hoof diseases in dairy cows, which is prone to misjudgment. For example, for some early hoof lesions, such as mild softening of the hoof horn or minor abnormalities in the joints, inexperienced farmers may find it difficult to detect. Secondly, manual observation is inefficient. In large-scale farming scenarios, there are a large number of dairy cows, and manual observation is time-consuming and labor-intensive, with low efficiency, and it is difficult to identify minor abnormalities in the cow's gait. Moreover, this inspection is usually performed regularly, making it difficult to achieve real-time monitoring, and may miss the critical period of disease occurrence and development.
[0004] With the development of technology, some farms have begun to use sensors to monitor the behavior and physiological parameters of dairy cows to assist in judging the health of dairy cows. For example, accelerometers are used to monitor the activity of dairy cows, and changes in activity are analyzed to infer whether the cows have health problems. However, this method also has its shortcomings. Sensors can usually only obtain limited information and cannot fully understand the actual condition of the cow's limbs and hooves. For example, accelerometers can only reflect the movement of dairy cows, but there is a lack of direct basis for the diagnosis of specific hoof lesions, such as hoof ulcers and laminitis. Moreover, the interpretation of sensor data often requires professional knowledge and complex algorithms, which is difficult for ordinary farmers to use and understand. Summary of the invention
[0005] The purpose of this application is to provide a method for determining, applying and product of an abnormal recognition model for limb and hoof performance of dairy cows. By using advanced image processing and machine learning algorithm models to analyze image data, the original image can be directly called to achieve automatic, comprehensive and accurate recognition of limb and hoof diseases in dairy cows.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In a first aspect, the present application provides a method for determining a model for identifying abnormal limb and hoof performance of a dairy cow, the method for determining a model for identifying abnormal limb and hoof performance of a dairy cow comprising:
[0008] Acquire cow walking images, visible-infrared light images of cow hooves, and integrated data; the integrated data includes: environmental temperature and humidity data and ground condition data on which the cow walks;
[0009] Input the cow walking image into a key part walking performance identification model to obtain a key part image; the key part image is an image including a key part of the cow; the key parts include: back, head and legs;
[0010] Using the key part walking performance recognition model, according to the key part image, the joint point position of the key part is identified;
[0011] Calculating the posture feature value and gait parameter value of the cow according to the joint point position;
[0012] The posture feature value, the gait parameter value, the visible-infrared light image of the cow's hoof and the integrated data are used as input, and the degree of hoof injury of the cow is used as output to train a machine learning algorithm model to obtain a cow limb and hoof performance abnormality recognition model.
[0013] In a second aspect, the present application provides an application method of a model for identifying abnormal limb and hoof performance of dairy cows, and the application method of the model for identifying abnormal limb and hoof performance of dairy cows comprises:
[0014] Acquire the walking image of the cow to be identified, the visible-infrared light image of the cow's hoof to be identified, and the integrated data to be identified;
[0015] Inputting the to-be-identified cow walking image into a key-part walking performance recognition model to obtain a to-be-identified key-part image;
[0016] Using the key part walking performance recognition model, according to the key part image to be identified, the position of the joint point to be identified of the key part is identified;
[0017] Calculating the posture feature value and gait parameter value of the cow to be identified according to the position of the joint point to be identified;
[0018] The posture feature value of the cow to be identified, the gait parameter value, the visible-infrared light image of the hoof of the cow to be identified and the integrated data to be identified are input into a cow limb and hoof performance abnormality recognition model to obtain the degree of hoof injury of the cow to be identified; the cow limb and hoof performance abnormality recognition model is trained by the determination method of the cow limb and hoof performance abnormality recognition model described in any of the above items.
[0019] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-described methods for determining a model for identifying abnormal limb and hoof performance of dairy cows or a method for applying a model for identifying abnormal limb and hoof performance of dairy cows.
[0020] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for determining a model for identifying abnormal limb and hoof performance of a dairy cow or the method for applying a model for identifying abnormal limb and hoof performance of a dairy cow as described in any of the above items.
[0021] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method for determining the abnormal limb and hoof performance identification model for dairy cows or the method for applying the abnormal limb and hoof performance identification model for dairy cows as described in any of the above items.
[0022] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0023] The present application provides a method for determining a model for identifying abnormal limb and hoof performance of a dairy cow, an application method and a product, the method comprising: obtaining a walking image of a dairy cow, a visible-infrared light image of a cow's hoof and integrated data; the integrated data comprising: environmental temperature and humidity data and ground condition data on which the dairy cow walks; the ground condition data on which the dairy cow walks comprising: ground flatness, hardness and friction; inputting the walking image of the dairy cow into a key part walking performance identification model to obtain a key part image; the key part image is an image including a key part of the dairy cow; the key parts comprise: back, head and legs; using the key part walking performance identification model, according to the key part image, identifying the joint point positions of the key parts; calculating the posture feature value and gait parameter value of the dairy cow according to the joint point position; taking the posture feature value, the gait parameter value, the visible-infrared light image of the cow's hoof and the integrated data as input, and taking the degree of hoof damage of the dairy cow as output, training a machine learning algorithm model to obtain a model for identifying abnormal limb and hoof performance of the dairy cow. By integrating the deep learning model to identify the key parts of the cow's walking and the visible-infrared light technology to identify the degree of hoof loss in the cow, high-precision prediction and identification of cow limb and hoof diseases can be achieved, and comprehensive analysis and prediction of the behavior of the cow's limbs, back, and head can be performed. This application uses advanced image processing and machine learning algorithm models to analyze these data, without relying on manual processing of later videos. The system can directly call the original images to achieve automatic identification of cow limb and hoof diseases and accurate identification of the severity. In addition, this application takes into account the flatness, hardness and friction of the ground on which the cow walks, and fully grasps the various situations that may affect cow limb and hoof diseases, effectively improving the accuracy of cow limb and hoof disease identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 A schematic flow chart of a method for determining an abnormal recognition model for limb and hoof performance of a dairy cow provided in one embodiment of the present application;
[0026] Figure 2 A schematic diagram of the main steps of a method for determining an abnormal recognition model for limb and hoof performance of dairy cows provided in one embodiment of the present application;
[0027] Figure 3 A schematic diagram of steps for extracting RGB value images of cattle hooves using ImageJ and then analyzing them according to an embodiment of the present application;
[0028] Figure 4 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] In view of the many problems that traditional methods have in identifying and judging the severity of limb and hoof diseases in dairy cows, this application aims to develop a method and system for identifying and judging the severity of limb and hoof diseases in dairy cows in large-scale breeding scenarios. Computer vision technology has made significant progress in recent years, providing new ideas and methods for solving the problem of monitoring limb and hoof diseases in dairy cows. By installing cameras on the farm, video image data of dairy cows in the farm can be obtained in real time, and these data can be analyzed using advanced image processing and machine learning algorithms. Without relying on manual processing of later videos, the system can directly call the original video to realize automatic identification of limb and hoof diseases in dairy cows and accurate judgment of their severity. This system can solve the problems of low accuracy and low efficiency of traditional methods. By integrating deep learning models to identify key parts of cows' walking and visible-infrared light technology to identify the degree of hoof loss in cows, we can achieve high-precision prediction and identification of cow limb and hoof diseases and predict the severity of the disease, analyze cows' walking posture in real time, and conduct comprehensive analysis and prediction of the behavioral performance of cows' limbs, backs, and heads to promptly discover potential problems with cows' hooves, provide a scientific basis for dairy cow breeding management, and improve the production performance and welfare level of dairy cows.
[0031] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0032] In an exemplary embodiment, Figure 1 As shown, a method for determining an abnormal recognition model of limbs and hooves of dairy cows is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to a server as an example for explanation, and includes the following steps S1 to S5. Among them:
[0033] S1. Obtain a cow walking image, a visible-infrared image of the cow's hoof, and integrated data; the integrated data includes: environmental temperature and humidity data and ground condition data of the cow walking. Obtain a cow walking video; extract the cow walking video by frames to obtain a cow walking image; obtain a bottom image of the cow's hoof to obtain a visible-infrared image of the cow's hoof, and the visible-infrared image of the cow's hoof includes: texture, shape and structural information of the hoof surface; obtain integrated data.
[0034] Video shooting: Install multiple high-definition cameras in the cow activity area (such as the cowshed passage, playground, etc.) to ensure that all angles and positions of the cows are covered. The camera resolution should be no less than 1920×1080 and the frame rate should be 25fps to ensure clear videos of cows walking. The camera resolution should meet the requirements for hoof detail recognition.
[0035] Using a manually operated visible-infrared dual-mode camera, images from various angles and positions of the bottom of the cow's hoof are collected. These images contain information such as the texture, shape and structure of the hoof surface, and can reflect the appearance characteristics of the hoof in different states. Images of cows with hoof diseases are mainly collected.
[0036] The collected image data should include hoof images under different lighting conditions, at different times, and from different individual dairy cows to ensure the diversity and comprehensiveness of the data.
[0037] S2. Input the cow walking image into the key part walking performance identification model to obtain a key part image; the key part image is an image including a key part of the cow; the key parts include: back, head and legs. The key part walking performance identification model is trained by the YOLOv8 model; the labels during the training of the key part walking performance identification model include: one head annotation point, three back annotation points and four limb annotation points; the head annotation points are used to determine the head position and posture; the back annotation points are selected along the back spine; the back annotation points are used to describe the degree of curvature of the back; the limb annotation points are set at the joints and key parts of the limbs; the limb annotation points are used to calculate the joint angles and limb swing amplitudes.
[0038] S3. Using the key part walking performance recognition model, the joint point positions of the key parts are identified according to the key part images.
[0039] In this embodiment, when training the key part walking performance recognition model, the following steps are included:
[0040] Image screening and labeling: Extract the collected videos by frames, and remove images that are blurred, unclear, or cannot accurately identify key parts (back, head, legs) due to cows blocking each other. Use the labelimg tool in the Python environment to label the key parts of the cows in the remaining images. The labeling effect is: one coordinate point for the head, three coordinate points for the back, and four coordinate points for one limb. The labeling content includes normal posture and abnormal posture (such as leg lameness, head shaking, back arching, etc.), and the image format is saved in txt.
[0041] Dataset division: The labeled image dataset is divided into training set, validation set and test set in a ratio of 7:2:1.
[0042] Model selection: The YOLOv8 algorithm can be used to build a model for identifying the walking performance of key parts of a cow during its walking process, which is suitable for identifying the behavior of key parts of a cow.
[0043] Initialize model parameters: Initialize the model using random initialization or pre-trained weights.
[0044] Training iteration: Multiple iterations of training are performed, each of which includes forward propagation, calculation of loss function, and back propagation to update model parameters. During the training process, the model parameters are adjusted by monitoring the performance indicators of the validation set, such as precision, recall, and F1 value, to prevent overfitting.
[0045] Selection of evaluation indicators: Use indicators such as precision, recall, F1 value, and accuracy to evaluate the trained model.
[0046] Model adjustment: Adjust the model according to the evaluation results, such as adjusting the model parameters, adding data enhancement operations, etc.
[0047] As an optional implementation, the specific process of training the key part walking performance recognition model can be selected from the following steps:
[0048] Input:
[0049] 1. Image data:
[0050] The images are framed from the video of cows walking taken by a high-definition camera, with a resolution of 1920×1080 and a frame rate of 25fps. These images contain the appearance information of cows at various angles and positions in different activity states (walking, standing, eating, etc.), and are the basic data for identifying the behavior of key parts of cows (back, head, legs). The images of cows' hooves at various angles and positions collected by the visible-infrared dual-mode camera have a resolution that meets the requirements for hoof detail recognition.
[0051] 2. Label information:
[0052] The key parts of the cow in the image are annotated and saved in txt format. The head is annotated with one coordinate point to determine the head position and posture; the back is annotated with three coordinate points (such as key nodes selected along the back spine) to describe the posture information such as the degree of back curvature; a limb is annotated with four coordinate points (located at the key parts of the joints and limbs) to calculate the joint angle and limb swing amplitude. The annotation content covers normal posture and abnormal posture (such as leg lameness, head shaking, back arching, etc.), providing the learning goals and standards for the model.
[0053] 3. Output: Prediction results of the behavior of key parts of dairy cows:
[0054] For each input image, the model will output a prediction of the behavior of the key parts of the cow (back, head, legs). For example, it predicts the tilt angle of the head, the left and right rotation angle; the degree of bending and arching of the back; the position of the joint points of the legs (hip joint, knee joint, ankle joint, etc.), and then calculates the leg joint angle (such as the angle between the hip joint-knee joint-ankle joint) and the leg swing amplitude. At the same time, it also outputs a judgment on the overall posture of the cow (including walking, standing, etc.), such as whether it is normal, whether there are signs of lameness, etc. These prediction results are presented in the form of numerical values or classification labels. For example, the joint angle is represented by a specific angle value, and the posture judgment is represented by a category label such as normal / abnormal. In the recognition process, the physiological structure and movement characteristics of the cow should be fully considered to ensure the accuracy of the recognition of key points.
[0055] S4. Calculate the posture feature value and gait parameter value of the cow according to the joint point position. Calculate the leg joint angle and leg swing amplitude; calculate the curvature and arch angle of the back; calculate the tilt angle and left and right rotation angle of the head; calculate the cow's step length, step frequency and walking speed. The machine learning algorithm model is a linear regression model, a decision tree model or a random forest model.
[0056] In this embodiment, the characteristic parameters of abnormal walking performance of the cow's back, head, and legs are extracted:
[0057] Leg joint detection: Input the video of the cow walking into the trained key parts walking performance recognition model to obtain images of the cow's back, head, and legs. Use the YOLOv8 algorithm to estimate the posture and detect the joints of the cow's head, back, and legs, including the hip joint, knee joint, and ankle joint.
[0058] Back and head key point detection: The model identifies key bone structure points or contour feature points, which will serve as the basis for subsequent feature calculations. The above-mentioned annotation of the image during the construction of the dataset, including one coordinate point for the head, three coordinate points for the back, four coordinate points for one limb, and the normal posture and abnormal posture information, provides an important reference for the key point detection here. The position of these annotated points and the corresponding posture information can help determine the areas and features that should be focused on when detecting key points. For example, when detecting leg joints, the four coordinate points marked on the limbs can be used as the approximate reference position of the joints. At the same time, according to the annotated abnormal posture (such as leg lameness), the change characteristics of the position and angle of the joints in the lame state can be specifically analyzed, so as to more accurately detect and judge whether there are abnormalities in the joints. For the detection of key points on the head and back, the annotated coordinate points and posture information can also guide the model to find key bone structure points or contour feature points in the image, and improve the accuracy of detection according to the change rules of these points under different postures.
[0059] Posture feature calculation: According to the detected joint points or feature point coordinates, the posture features of the back, head and legs are calculated respectively. For the legs, the joint angles (such as the angles between the hip joint, knee joint and ankle joint) and the leg swing amplitude are calculated; for the back, the degree of curvature and arch angle of the back are calculated; for the head, the tilt angle and left and right rotation angle of the head are calculated.
[0060] 1. Leg posture feature calculation:
[0061] Joint angle calculation:
[0062] Assume the coordinates of the hip joint are (xknee, yknee), the coordinates of the knee joint are (xhip, yhip), and the coordinates of the ankle joint are (xankle, yankle).
[0063] First calculate the vector HK (from the hip joint to the knee joint) and the vector KA (from the knee joint to the ankle joint):
[0064]
[0065] Then calculate the angle θ (i.e. the joint angle) between the two vectors, according to the vector dot product formula
[0066]
[0067] Finally, through the inverse trigonometric function Get the joint angle.
[0068] Leg swing range calculation:
[0069] Assume that in consecutive video frames, the coordinate changes of a key point of the leg (such as the knee joint) in the horizontal direction (axis) and the vertical direction (axis) are △x and △y respectively.
[0070] Leg swing range The swing amplitude between multiple frames can be calculated, and its standard deviation can be found to describe the stability of the leg swing amplitude. The larger the standard deviation, the more uncoordinated the leg movement.
[0071] 2. Calculation of back posture features:
[0072] Calculation of bending degree:
[0073] Using the three detected annotated coordinate points on the back (assumed to be P1(x1,y1), P2(x2,y2) and P3(x3,y3)), calculate the vectors P1P2 and P2P3.
[0074] The angle between these two vectors is then used to describe the curvature of the back. This is calculated similarly to the angles of the leg joints:
[0075] First calculate the vector dot product And the vector modulus According to Calculate the angle θ, the larger the angle θ is, the greater the degree of back curvature is.
[0076]
[0077] 3. Head posture feature calculation:
[0078] Tilt angle calculation:
[0079] With a coordinate point marked on the head (assuming it is Q(x, y)) as a reference, calculate the tilt angle of the head relative to the horizontal plane (assuming y=0).
[0080] First, project the head coordinate point onto the horizontal plane to obtain the projection point Q'(x',y') (where y'=0), then the tilt angle Tilt angles outside the normal range (±[tilt angle range] degrees) may indicate abnormal head posture.
[0081] Gait analysis: The gait of dairy cows is analyzed by analyzing the changes in leg posture characteristics during walking in continuous video frames. The gait parameters such as the cow's step length, step frequency, and walking speed are calculated, and the symmetry and regularity of the gait are observed.
[0082] Overall posture analysis (including back, head and legs): Consider the posture characteristics of the cow's back and head and the gait parameters of the legs to analyze the overall posture of the cow during walking. Compare the calculated overall posture characteristics and gait parameters with the reference values of normal cows. Observe whether lame cows have abnormal behaviors such as excessive arching or sinking of the back, excessive tilt of the head, lameness or incoordination of the legs compared with normal cows. These abnormal behaviors may indicate potential health problems in cows, especially those related to hoof injuries.
[0083] Overall posture analysis (including back, head, legs):
[0084] Back posture characteristics: Through the previous calculations, characteristic values such as the degree of curvature and arch angle of the back have been obtained. These characteristics reflect the morphological changes of the cow's back during walking, which may indicate the balance of the cow's body and whether there is discomfort.
[0085] Head posture characteristics: including the tilt angle of the head, left and right rotation angle, etc. These characteristics are related to the cow's visual attention and neural coordination ability. Abnormal head posture may affect the cow's perception and reaction ability to the surrounding environment.
[0086] Leg gait parameters: such as step length, step frequency, walking speed, leg joint angles (such as the angle between the hip joint, knee joint and ankle joint), leg swing amplitude, etc. These parameters directly reflect the motor ability and health status of the cow's legs, and are crucial to determine whether the cow is lame or has leg diseases.
[0087] Compared with normal reference values:
[0088] Establish reference standards: In the early stage of system establishment, it is necessary to collect a large amount of posture characteristics and gait parameter data of normal dairy cows and establish a comprehensive normal reference value database. This database should cover the impact of factors such as age, weight, and breed on dairy cow posture to ensure the accuracy and universality of the reference standard.
[0089] Comparative analysis: Compare the back, head posture characteristics and leg gait parameters of the currently monitored dairy cows with the data in the normal reference value database one by one. For example, observe whether lame dairy cows have abnormal behaviors such as excessive back arching or sinking (arching or sinking beyond the normal reference value range), excessive head tilt (tilt angle or rotation angle deviates from the normal range), leg lameness (abnormal step length, step frequency, abnormal joint angle or uncoordinated leg swing) compared with normal dairy cows. These abnormal behaviors often indicate potential health problems in dairy cows, especially those related to hoof injuries.
[0090] Multi-dimensional comprehensive judgment:
[0091] Body part correlation analysis: Consider the correlation and influence between the various parts of the cow's body. For example, the posture of the back may affect the force distribution of the legs, which in turn affects the gait; abnormal head posture may cause the cow to lose concentration when walking, increasing the risk of leg injury. By analyzing the correlation between these parts, we can have a deeper understanding of the reasons for the abnormal overall posture of the cow.
[0092] Comprehensive health assessment: The overall health of the cow is assessed by combining the posture characteristics and gait parameters of the back, head and legs. Not only is there lameness or obvious posture abnormalities, but also the impact of subtle changes on the long-term health of the cow is considered. For example, even if the cow is not obviously lame at present, if the back posture is in a slightly abnormal state for a long time, it may gradually affect the cow's feed intake and reproductive performance, and eventually lead to health problems such as hoof disease.
[0093] Dynamic monitoring and trend analysis:
[0094] Continuous data collection: During the breeding process, the overall posture of the cow is continuously and dynamically monitored, and the back and head posture characteristics and leg gait parameter data are regularly collected. The collection frequency can be adjusted according to the actual situation of the farm and the health status of the cow. For example, for cows with unstable health conditions, the collection frequency can be increased.
[0095] Trend analysis method: Use appropriate data analysis methods, such as time series analysis, to perform trend analysis on the collected posture data. Observe the changing trends of various features and parameters over time, such as whether the step length is gradually shortened, whether the back arch angle is gradually increased, etc.
[0096] Health warning mechanism: Establish a health warning mechanism based on trend analysis results. If certain posture characteristics are found to gradually deviate from the normal range, or there is a trend of abnormal changes, this may be a sign that the health of the cow is gradually deteriorating. For example, when the leg swing amplitude gradually decreases for several consecutive weeks and there is a trend of shortening stride length, the system should issue a warning in time to prompt the breeder to conduct further inspection and treatment of the cow to prevent the occurrence and development of hoof diseases.
[0097] S5. Taking the posture feature value, the gait parameter value, the visible-infrared light image of the cow's hoof and the integrated data as input and the degree of hoof injury of the cow as output, a machine learning algorithm model is trained to obtain a model for identifying abnormal limb and hoof performance of the cow.
[0098] Local feature extraction of visible-infrared images: For visible-infrared images, any object above absolute zero will radiate infrared, and the radiated infrared energy is positively correlated with its own temperature. The higher the temperature, the stronger the radiated energy. The thermal infrared camera can measure the surface temperature of the object based on the infrared energy radiated by the object. These feature points can reflect the texture, shape and structure information of the hoof surface. Image j is used to extract the RGB value image of the cow hoof and then analyze it, such as Figure 3 As shown. During the extraction process, the accuracy and stability of the algorithm must be ensured. The image is preprocessed, such as denoising, contrast enhancement, etc., to improve the effect of feature extraction. At the same time, the influence of different lighting conditions and hoof angles on feature extraction must be considered. Through a large number of experiments and data analysis, the algorithm parameters are optimized so that it can accurately extract feature points in various practical scenarios.
[0099] Establishing an association model: Collect data on dairy cows with known hoof damage, including leg posture characteristics, gait parameters, and actual diagnosis results of hoof damage when lame. Use the random forest algorithm to establish an association model between the posture characteristics and gait parameters of key parts of dairy cows and the degree of hoof damage. The association model is based on the relationship between the walking posture of key parts of dairy cows and the degree of hoof damage of dairy cows.
[0100] Data on dairy cows with known hoof injury levels were extensively collected. These data should cover information such as leg posture characteristics, gait parameters, and actual diagnosis results of hoof injuries during lameness. By collating and analyzing these data, a correlation model between the posture characteristics of key parts of dairy cows, gait parameters, and the degree of hoof injury was established using the random forest algorithm.
[0101] In the process of building a model, the training set, validation set, and test set should be divided reasonably. Generally, they can be divided in a ratio of 7:2:1 to ensure that the model has good generalization ability. At the same time, the data should be normalized to avoid the impact of dimensional differences between different features on model performance.
[0102] By analyzing the importance of each feature in the association model, the features that play a key role in predicting the extent of hoof damage are identified. For example, certain joint angles, specific gait parameters, etc. may have higher weights in the model.
[0103] Use appropriate feature importance evaluation methods, such as the feature importance scoring method based on the random forest algorithm. According to the evaluation results, focus on and analyze key features, further optimize the model structure, and improve the accuracy of the model in predicting the degree of hoof damage.
[0104] Model building and training:
[0105] Initialize model parameters: Initialize the model using random initialization or pre-trained weights.
[0106] Training iterations: Perform multiple iterations of training, each of which includes forward propagation, calculation of loss function, and back propagation to update model parameters. During the training process, the model parameters are adjusted by monitoring the performance indicators of the validation set, such as precision, recall, and F1 value, to prevent overfitting. For example, if the precision of the validation set does not improve significantly in several consecutive iterations, the learning rate may need to be appropriately reduced to avoid overfitting of the model.
[0107] Selection of evaluation indicators: Use precision, recall, F1 value, accuracy and other indicators to evaluate the trained model. Precision reflects the proportion of samples predicted as positive that are actually positive; recall indicates the proportion of samples predicted as positive that are actually positive; F1 value is the harmonic mean of precision and recall, which can comprehensively measure the performance of the model; accuracy is the proportion of samples predicted correctly to the total samples. Through comprehensive analysis of these indicators, we can fully understand the performance of the model.
[0108] Model adjustment: Adjust the model according to the evaluation results, such as adjusting the model parameters, adding data enhancement operations, etc. Adjust the model according to the evaluation results. If the performance of the model is not ideal, such as low precision or recall, you can adjust the model parameter settings, such as increasing or decreasing the number of hidden layer neurons, adjusting the activation function, etc.
[0109] At the same time, data enhancement operations can be added, such as rotating, flipping, scaling, and other transformations on the image to increase the diversity of training data and improve the generalization ability of the model. Retrain and evaluate the adjusted model until the model performance reaches a satisfactory effect.
[0110] As an optional implementation, the specific training method of the abnormal limb and hoof performance recognition model for dairy cows can be selected from the following steps:
[0111] Input:
[0112] Visible-infrared image data: images collected from various angles and positions of the bottom of the cow's hoof. These images contain information such as the texture, shape, and structure of the hoof surface, and can reflect the appearance characteristics of the hoof in different states. Mainly collect images of hoof diseases.
[0113] The key posture characteristics and gait parameter data of dairy cows include the leg joint angles (such as the angles between the hip joint, knee joint and ankle joint) calculated above, leg swing amplitude, back bending degree, arch angle, head tilt angle, left and right turning angle, and gait parameters such as step length, step frequency, and walking speed. These data can provide information related to the health of the hoof from the perspective of the cow's behavioral performance. For example, abnormal leg joint angles may indicate uneven force on the hoof, which is related to hoof injury.
[0114] Data of dairy cows with known hoof injury degree: This part of the data covers the leg posture characteristics, gait parameters, actual diagnosis results of hoof injury when lame, and the hoof disease images actually taken by the visible light-infrared camera for comprehensive analysis. By collecting and organizing a large amount of dairy cow data with clear diagnosis results of hoof injury degree, accurate label information is provided for model training, so that the model can learn the relationship between different features and hoof injury degree. For example, for dairy cows that have been diagnosed with severe laminitis, the corresponding leg posture characteristics, gait parameters, hoof image characteristics and other data will serve as the basis for the model to learn severe hoof injury patterns.
[0115] Output:
[0116] Prediction results of hoof injury degree: After the model is trained, for the new cow data (including visible-infrared light images, posture features, and gait parameters, etc.), it will output the prediction of the cow's hoof injury degree. The prediction results can be in the form of classification, such as no injury, mild injury, moderate injury, severe injury, etc.; or in numerical form, such as the predicted hoof injury degree score (a value between 0-1, 0 means no injury, 1 means the most serious injury), the specific form depends on the design of the model and the training objectives.
[0117] Here, in this embodiment, environmental temperature and humidity data and ground condition data on which the cow walks can also be considered. When these data are considered, the training method of the above-mentioned cow limb and hoof performance abnormality recognition model specifically includes:
[0118] Acquire integrated data; the integrated data includes: environmental temperature and humidity data and ground condition data on which the cows walk;
[0119] The posture feature value, the gait parameter value, the visible-infrared light image of the cow's hoof and the integrated data are used as input, and the degree of hoof injury of the cow is used as output to train a machine learning algorithm model to obtain a cow limb and hoof performance abnormality recognition model.
[0120] As an optional implementation, considering the ambient temperature and humidity data and the ground condition data on which the cows walk:
[0121] Key part feature extraction: further extract the behavioral performance characteristics related to the back, head, legs and hoof lesions of the cow. In addition to the posture features and gait parameters calculated previously, some dynamic features can also be considered, such as the leg swing amplitude during walking, the degree of arching of the back muscles, and the head swing frequency. Further extract the behavioral performance characteristics related to the back, head, legs and hoof lesions of the cow. Or the change trend of the leg swing amplitude during walking, the change of the degree of arching of the back muscles over time, the head swing frequency and its stability, etc.
[0122] To extract these dynamic features, appropriate time series analysis methods should be used. For example, for the changing trend of leg swing amplitude, the difference between adjacent video frames can be calculated and smoothed to obtain the change curve of leg swing amplitude. By analyzing these curves, we can better understand the changes in the movement state of the cow's legs and provide more abundant information for predicting the degree of hoof lesions.
[0123] Integration of environmental factors: Combine environmental temperature and humidity data and environmental factors such as the ground conditions where cows walk (such as the flatness, hardness, friction, etc. of the ground), and integrate these factors with the behavioral performance characteristics of key parts of cows. Because environmental factors may affect the health of cows' hooves, for example, a humid environment may increase the risk of hoof infection, and an uneven ground may cause uneven force on the hoof, which in turn causes damage. Environmental factors are measured using a thermometer and humidity meter, and the obtained data is synchronized. The extracted and processed environmental characteristics are combined with the behavioral performance characteristics of key parts of cows (such as posture characteristics such as leg joint angles, leg swing amplitude, back arching, head swing frequency, and gait parameters such as step length, step frequency, and walking speed) into a comprehensive feature vector. During the training process, the model learns the complex interactive relationship between environmental factors and cow behavioral performance characteristics and their comprehensive impact on the degree of hoof lesions.
[0124] For the collection of environmental data, the accuracy and timeliness of the data must be ensured. Appropriate temperature and humidity sensors and ground condition monitoring equipment can be installed in the farm to collect environmental data in real time and synchronize it with the cow's behavior data. In the integration process, the impact mechanism of environmental factors on the health of cow hooves should be considered. For example, a humid environment may increase the risk of hoof infection, and uneven ground may cause uneven force on the hoof, which may lead to damage. By analyzing these impact mechanisms, the weight of environmental factors in the prediction model can be reasonably determined.
[0125] Model selection: According to the characteristics of the integrated feature data and the requirements of the prediction task, select a suitable machine learning algorithm to build a prediction model. For example, if there is a linear relationship between the feature data and the hoof lesions, a linear regression model can be selected; if the relationship is more complex and nonlinear, algorithms such as decision trees, random forests, or neural networks can be considered. According to the changes in the motion parameters of key parts of the cow during walking and the degree of limb lesions of the cow, the linear relationship between the feature data and the hoof lesions is analyzed, and a linear regression model can be selected; if the relationship is more complex and nonlinear, algorithms such as decision trees, random forests, or neural networks can be considered. When selecting an algorithm, factors such as the performance, computational complexity, and interpretability of the algorithm should be considered comprehensively. For example, the neural network algorithm has advantages in dealing with complex nonlinear relationships, but poor interpretability; the decision tree algorithm has good interpretability, but may have overfitting problems when dealing with large-scale data. Weigh the pros and cons according to the actual situation and select the most suitable algorithm.
[0126] Initialize model parameters:
[0127] Initialize the model using random initialization or pre-trained weights. For linear regression models, the initialization parameters are usually simple and can be directly set to some reasonable initial values. For complex nonlinear models, such as neural networks, the range of initialization parameters should be reasonably set according to the structure of the model and the characteristics of the input data to avoid excessive gradient fluctuations in the early stages of model training.
[0128] Model evaluation and tuning:
[0129] The trained model was evaluated using indicators such as precision, recall, F1 value, and accuracy, which can reflect the accuracy and reliability of the model in predicting hoof lesions.
[0130] Adjust the model based on the evaluation results. If the performance of the model is not ideal, you can adjust the model's parameter settings, add data enhancement operations, or reselect a more appropriate model algorithm. For example, if the accuracy of the prediction model is low, you can try to adjust the number of layers and neurons in the neural network, or increase the diversity of the training data to improve the generalization ability of the model.
[0131] As an optional implementation, considering the environmental temperature and humidity data and the ground condition data on which the cows walk: the specific training method of the abnormal recognition model for the limb and hoof performance of the cows can be selected from the following steps:
[0132] Input:
[0133] Key part feature data: including further extracted behavioral performance characteristics related to cow back, head and leg and hoof lesions. In addition to the previously calculated posture features (such as leg joint angle, back curvature, head tilt angle, etc.) and gait parameters (step length, step frequency, walking speed, etc.), it also covers dynamic features, such as the change trend of leg swing amplitude during walking (the change curve of leg swing amplitude over time calculated by multi-frame data or related statistical characteristics), the change of back muscle arch over time (represented by the time series data of arch angle or its statistical characteristics), and the head swing frequency and its stability (such as the average and standard deviation of head swing frequency over a period of time).
[0134] Environmental factors data:
[0135] Ambient temperature and humidity data are collected in real time by temperature and humidity sensors installed in the farm and are normalized to be within a specific range (such as temperature normalized to the range, humidity normalized to the range, etc.) so that the model can better process and learn its relationship with hoof lesions.
[0136] Output content: Prediction results of hoof lesion severity:
[0137] The model outputs a prediction of the degree of hoof lesions in dairy cows after complex calculations and analysis based on the input key part feature data and environmental factor data. The prediction results can be in the form of classification, such as classifying the degree of hoof lesions into categories such as no lesions, mild lesions, moderate lesions, and severe lesions, so as to clearly inform farmers of the general health status of dairy cows' hooves; or in numerical form, such as predicting a score representing the degree of hoof lesions, which can more accurately reflect the degree of hoof lesions and provide farmers with more detailed information.
[0138] In order to specifically implement the above functions, this embodiment also provides corresponding systems and installation methods of various system structures:
[0139] Camera installation and data collection:
[0140] Cameras should be properly installed in the dairy barn, including high-definition cameras and visible-infrared dual-mode cameras, to focus on the key parts of the cows' walking performance in the activity area. Make sure that the camera's installation position and angle can cover the key areas of the cows' activities and will not interfere with the cows' normal activities.
[0141] The real-time collection and storage of video data and environmental data are realized through data acquisition software. The collected data should include video images of dairy cows, environmental temperature and humidity, ground conditions and other information. During the collection process, the accuracy and integrity of the data must be ensured, and the collected data must be preprocessed as necessary, such as denoising and compression, to improve the storage and processing efficiency of the data.
[0142] Host computer function realization:
[0143] The upper computer is connected to the camera and is responsible for testing the above-mentioned method for predicting the degree of hoof injury based on the walking performance of key parts of the cow during walking. Through its internal modules, including video data acquisition module, key part recognition model construction module during cow walking, key part image extraction module during cow walking, key feature parameter extraction module, cow hoof lesion degree identification model construction module, cow hoof lesion degree identification module, etc., the cow video data is processed and analyzed, and the hoof degree identification result is finally obtained.
[0144] When implementing the functions of the upper computer, it is necessary to ensure the coordination between the various modules. For example, the video data acquisition module must obtain video data in a timely and accurate manner and pass it to subsequent modules; the module for building a key part recognition model during the cow's walking process must build an accurate model based on the input data; the module for extracting key parts images during the cow's walking process must correctly extract key parts images from the video data; the module for extracting key behavioral feature parameters must accurately extract key feature parameters from the image; the module for building a model for identifying the extent of hoof lesions must build a reasonable identification model based on key feature parameters; the module for identifying the extent of hoof lesions must correctly obtain the identification result of the extent of hoof damage based on the identification model.
[0145] Server configuration and data processing:
[0146] Configure a high-performance server to store and process video data and model operations. The server should have sufficient storage capacity and computing power to quickly process large amounts of data and ensure data security and reliability. A corresponding database management system should be installed on the server to store information such as cow video images, environmental data, and model parameters.
[0147] It is necessary to reasonably arrange the resource allocation of the server and allocate corresponding computing resources and storage resources according to different task requirements, such as data storage, model training, inference prediction, etc. For example, in the model training stage, sufficient computing resources should be allocated to the training task to speed up the training; in the inference prediction stage, sufficient computing resources should be allocated to the prediction task to ensure the timeliness and accuracy of the prediction.
[0148] Perfect software functions:
[0149] Data collection software should continuously improve its functions to improve the accuracy and efficiency of data collection. In addition to collecting video data and environmental data, other physiological data of dairy cows, such as body temperature and heart rate, can also be considered to provide more comprehensive information for dairy cow health assessment. At the same time, the collected data should be pre-processed more finely, such as data cleaning, feature extraction and other operations, to improve the quality of the data.
[0150] Model training and reasoning software should be based on the deep learning framework YOLOv8 and continuously optimize its performance. The accuracy and generalization ability of the model should be improved by increasing the diversity of training data, adjusting model parameters, and improving algorithms. At the same time, its reasoning and prediction functions should be improved so that it can make predictions quickly and accurately based on newly collected data, providing timely decision support for farmers.
[0151] System testing and optimization:
[0152] After the system development is completed, a comprehensive system test should be carried out, including functional test, performance test and stability test.
[0153] Functional testing is to check whether the system can normally realize the functions of identifying limb and hoof diseases of dairy cows and judging their severity. For example, check whether the camera can collect data normally, whether the host computer can correctly process the data and obtain the correct hoof severity judgment results, and whether the server can store and process data normally.
[0154] Performance testing evaluates the processing speed and efficiency of the system. For example, it measures the time it takes for the system to collect data and obtain the hoof degree identification result, as well as the system's performance when processing large amounts of data.
[0155] Stability testing is to check the stability of the system during long-term operation. For example, observe whether the system will fail or have abnormal conditions during continuous operation for 24 hours, 48 hours, etc. Through continuous testing and optimization, the system can achieve the best performance, provide a scientific basis for dairy farming management, and improve the production performance and welfare level of dairy cows.
[0156] The method for determining the abnormal recognition model of the limb and hoof performance of dairy cows provided in this embodiment mainly includes: step (1) constructing a walking performance recognition model of key parts of dairy cows during walking (including back, head, and legs); step (2) extracting the characteristic parameters of abnormal walking performance of the back, head, and legs of dairy cows; step (3) constructing a dairy cow hoof injury degree recognition model based on key parts; step (4) constructing a model for predicting the degree of hoof lesions based on the behavior performance of the back, head, and legs of dairy cows; step (5) developing a method and system for recognizing and judging the severity of dairy cow limb and hoof diseases in large-scale breeding scenarios, such as Figure 2 shown.
[0157] Hoof disease can cause many harms to dairy cows. First of all, hoof disease can cause pain in dairy cows, affecting their normal ability to stand, walk and exercise, and reducing the activity of dairy cows. This will not only affect the comfort of dairy cows, but also further lead to a decrease in the amount of feed intake of dairy cows, because pain and discomfort will make dairy cows unwilling to stand and eat, or unable to chew and swallow normally during the feeding process. Secondly, hoof disease will also affect the reproductive performance of dairy cows, resulting in a lower pregnancy rate and a longer reproductive cycle. From the perspective of production performance, hoof disease will reduce the milk production of dairy cows, and the quality of milk may also be affected to a certain extent. Moreover, the treatment of hoof disease requires a lot of manpower, material and financial resources, which increases the cost of breeding. If hoof disease is not treated promptly and effectively, in severe cases, dairy cows may be eliminated, causing economic losses to the ranch. Therefore, preventing and timely detecting hoof disease in dairy cows is crucial to ensuring the health and production performance of dairy cows.
[0158] In the traditional method of detecting and judging hoof diseases in dairy cows, the experience of farmers is mainly relied on to observe the limbs and hooves of dairy cows to determine whether there are lesions and the extent of the lesions. However, this method has many disadvantages. On the one hand, the accuracy of manual observation is limited by the experience and professional knowledge of farmers, and the judgments of different people may be different, which is prone to misjudgment. On the other hand, manual observation is inefficient and requires a lot of time and manpower. Especially in large-scale farming scenarios, it is difficult to conduct timely and comprehensive inspections of each cow. Moreover, some early hoof lesions may not have obvious symptoms and are difficult to detect by manual observation alone, resulting in missing the best time for treatment.
[0159] To this end, this application proposes a method for multi-dimensional monitoring and analysis and prevention of hoof diseases during the walking process of dairy cows. This method integrates the deep learning model to identify the key parts of dairy cows walking and the visible-infrared light technology to identify the degree of hoof loss of dairy cows, and has the following significant advantages. By installing multiple high-definition cameras and visible-infrared dual-mode cameras in the dairy cow activity area, image data from various angles and positions during the walking process of dairy cows can be collected, including hoof images of different lighting conditions, different times and different individual dairy cows, to ensure the diversity and comprehensiveness of the data. The system can accurately identify the normal and abnormal postures of key parts of dairy cows, further extract the behavioral characteristic parameters and gait parameters of abnormal walking performance of dairy cows' backs, heads and legs, and analyze their symmetry and regularity. Then, a model for identifying the degree of hoof damage based on key parts and a model for predicting the degree of hoof lesions based on the behavior of the cow's back, head, and legs were constructed. The local feature points and descriptors of the hoof image were extracted through the local feature descriptor algorithm. Combined with the cow data with known hoof damage, the association model was established using the random forest algorithm. Environmental factors such as ambient temperature and humidity and ground conditions were considered to comprehensively judge the degree of hoof damage. The advantage of this system is that it does not rely on post-human processing of the video. It analyzes the cow's walking posture in real time from the actual environment of the farm. Through comprehensive analysis and prediction of the behavior of the cow's limbs, back, and head, potential problems of the cow's hoof are discovered in time, providing a scientific basis for dairy cow farming management, improving the production performance and welfare level of dairy cows, and effectively solving the problems of low accuracy and low efficiency of traditional methods.
[0160] In an exemplary embodiment, a method for applying a model for identifying abnormal limb and hoof performance of a dairy cow is provided, and the method for applying the model for identifying abnormal limb and hoof performance of a dairy cow comprises:
[0161] A1. Obtaining a walking image of a cow to be identified, a visible-infrared image of the cow's hoof to be identified, and integrated data to be identified. The integrated data to be identified includes: environmental temperature and humidity data of the cow to be identified and ground condition data on which the cow to be identified walks.
[0162] A2. Input the to-be-identified cow walking image into a key-part walking performance recognition model to obtain a to-be-identified key-part image.
[0163] A3. Using the key part walking performance recognition model, according to the key part image to be identified, identify the position of the joint point to be identified of the key part.
[0164] A4. Calculate the posture feature value and gait parameter value of the cow to be identified according to the position of the joint point to be identified.
[0165] A5. Input the posture feature value of the cow to be identified, the gait parameter value, the visible-infrared light image of the hoof of the cow to be identified and the integrated data to be identified into a cow limb and hoof performance abnormality recognition model to obtain the degree of hoof injury of the cow to be identified; the cow limb and hoof performance abnormality recognition model is trained by the determination method of the cow limb and hoof performance abnormality recognition model described above.
[0166] Here, this application also provides several specific test examples:
[0167] Test Example 1
[0168] 1.1 Experimental setup
[0169] Farm selection: Select a large-scale dairy farm located in North China, raising Chinese Holstein cows and Jersey cows.
[0170] 1.2 System Installation and Configuration
[0171] The high-definition camera and visible-infrared dual-mode camera required by this system are installed in the cowshed passage, exercise field, milking hall and other areas where cows move frequently. The resolution of the high-definition camera is set to 1920×1080 and the frame rate is 25fps to ensure that every detail of the cow's walking process can be clearly captured; the visible-infrared dual-mode camera is optimized according to the requirements of hoof detail recognition to ensure that high-quality hoof images can be obtained under different lighting conditions.
[0172] After the installation, the system was fully debugged and calibrated to ensure that the various devices could work together normally. At the same time, the early model construction and training work was completed, including the walking performance identification model of key parts of the cow during walking, the cow hoof injury degree identification model based on key parts, and the cow hoof lesion degree prediction model based on the cow's back, head, and leg behavior. The training data of these models comes from the historical video data and actual diagnosis results of a large number of cows in the farm. After strict labeling and division, the ratio of training set, validation set and test set is 7:2:1.
[0173] 1.3 Data Collection and Analysis
[0174] Video data collection: The dairy cows in the farm were monitored for two consecutive months. Video data of the cows in different activity states (walking, standing, eating, etc.) was collected in the morning, afternoon, and evening every day. The collection time for each time period was about 30 minutes. At the same time, the environmental temperature, humidity, ground conditions and other information were recorded each time the data was collected.
[0175] Data preprocessing: The collected video data is processed and stored in real time through data acquisition software. First, the video is framed and extracted to remove images that are blurred, unclear, or cannot accurately identify key parts (back, head, legs) due to cows blocking each other. Then, the labelimg tool in the Python environment is used to annotate the key parts of the cows in the remaining images. The annotation rules are to mark one coordinate point for the head, three coordinate points for the back, and four coordinate points for one limb. The annotation content includes normal posture and abnormal posture (such as leg lameness, head shaking, back arching, etc.). Finally, the annotated image format is saved as txt.
[0176] 1.4 Data Analysis Process
[0177] The preprocessed image data is input into the key walking performance recognition model of the cow during walking, which is built based on the YOLOv8 algorithm. Through the recognition and analysis of the model, the behavior images of the cow's back, head and legs are obtained.
[0178] Next, based on the behavior images, the behavior key feature parameter extraction module is used to extract the behavior feature parameters and gait parameters of abnormal walking performance of the cow's back, head, and legs. For example, for the legs, the joint angles (such as the angles between the hip joint, knee joint, and ankle joint) and the leg swing amplitude are calculated; for the back, the degree of curvature and arch angle of the back are calculated; for the head, the tilt angle and left and right rotation angle of the head are calculated. At the same time, by analyzing the leg posture during the walking process of continuous video frame images, the changes in the cow's leg posture characteristics can be analyzed, and the cow's step length, step frequency, walking speed and other gait parameters can be calculated, and the symmetry and regularity of the gait can be observed.
[0179] Finally, the extracted key behavioral feature parameters were input into a model for predicting the degree of hoof lesions based on the behavioral performance of the cow's back, head, and legs. The model comprehensively considered the behavioral characteristics of key parts as well as factors such as environmental temperature and humidity and ground conditions. The local feature points and descriptors of the hoof image were extracted through the local feature descriptor algorithm. Combined with the data of dairy cows with known hoof injury degrees, the random forest algorithm was used to establish an association model to comprehensively judge the degree of hoof injury.
[0180] 1.5 Judgment criteria setting and result analysis
[0181] (1) Leg judgment criteria
[0182] Stride length: Through the statistical analysis of historical data of a large number of normal dairy cows in the farm, it is determined that the average stride length of this breed of dairy cows in normal walking state is [X] cm. When the stride length of a dairy cow is monitored to be less than 70% of the normal average value (i.e. [0.7X] cm) for 3 consecutive days, it is initially judged that there may be leg problems. This is because hoof diseases may cause pain to dairy cows, affecting their normal walking, and thus shortening their stride length. For example, hoof ulcers or laminitis may cause dairy cows to try to avoid stress on the diseased hoof when walking, thereby changing their walking stride length.
[0183] Leg joint angle: Taking the angle between the hip joint, knee joint and ankle joint as an example, the normal range is [assumed angle range]. When the angle is monitored to fluctuate 10° above or below the normal range for 5 consecutive days, it is suspected that there is an abnormality in the leg joint. This may be due to hoof disease causing the cow's walking posture to change, resulting in uneven force on the joints, causing the joint angle to exceed the normal range. For example, hoof fractures or severe laminitis may affect the normal support and movement of the cow's legs, causing changes in the joint angle.
[0184] Leg swing amplitude: The leg swing amplitude of a normal dairy cow is relatively stable during walking, and its standard deviation is [standard deviation value]. When the standard deviation of a cow's leg swing amplitude is greater than 120% of the normal standard deviation for a week in a row, it indicates that the leg movement may be uncoordinated and there is a risk of limb and hoof disease. This may be due to hoof injuries, such as hoof sole wear or hoof sprains, which affect the normal movement of the cow's legs and cause abnormal swing amplitude.
[0185] (2) Back judgment criteria: The average arch angle of a normal cow's back during walking is [arch angle value] degrees. When a cow's back arch angle is monitored to be greater than 110% of the normal average for 4 consecutive days (i.e. [1.1×arch angle value] degrees), it is considered that there may be discomfort in the back and the possibility of being related to limb and hoof disease increases. This is because hoof disease may change the distribution of the cow's body center of gravity. In order to maintain balance, the cow may adjust its back posture, resulting in an abnormal back arch angle. For example, when a cow has pain in one hoof, it may shift its center of gravity to the other side, which in turn causes compensatory changes in the back muscles, manifested as a change in the back arch angle.
[0186] (3) Head judgment standard: The head of a normal dairy cow remains basically horizontal during walking, and the tilt angle is within ±[tilt angle range] degrees. When the tilt angle of a cow's head is monitored to be outside this range for 3 consecutive days, there may be abnormal head posture, and further attention should be paid to whether it is related to limb and hoof disease. Although abnormal head posture does not necessarily directly indicate hoof disease, it may be a manifestation of the cow's overall physical discomfort. For example, severe pain in the hoof may make the cow feel painful and uneasy, which may affect the normal posture of its head, manifested as a change in the tilt angle of the head.
[0187] 1.6 Analysis of prediction results
[0188] In the monitored dairy cow herd, based on the set judgment criteria, we first calculate how many cows may have suspected limb and hoof disease symptoms to varying degrees.
[0189] For example, a cow's stride length may be below the threshold for several consecutive days, which may indicate leg problems, with a higher likelihood of hoof damage, including hoof ulcers and laminitis. This is because abnormal stride length may be an important manifestation of hoof disease causing cows to have difficulty walking, and hoof damage is one of the common causes of stride length changes.
[0190] For example, the leg joint angle of a cow may exceed the threshold continuously, which may indicate joint inflammation, which may be caused by hip joint inflammation or uneven joint force caused by hoof disease. If the swing amplitude of a cow's leg is abnormal, there may be uncoordinated leg movement. Subsequent inspections may reveal lameness in the leg, which may be caused by hoof injury or leg muscle or nerve problems.
[0191] For example, the cow’s back may be arched at an abnormal angle, and there may be tension in the back muscles, which may be related to hoof discomfort or caused by back spine problems, but its behavioral changes need to be observed.
[0192] Based on the abnormal walking state of cows detected by the system, a preliminary analysis is conducted on the extent of the lesions in the cows' limbs, and timely feedback is given to the administrator for appropriate treatment measures.
[0193] Test Example 2
[0194] 2.1 Experimental setup
[0195] Farm selection: A large-scale dairy farm located in the Northeast region was selected, and the breeds included Chinese Holstein cows and Jersey cows.
[0196] System installation and configuration: Similar to Experiment 1, cameras and sensors were installed in key areas of the farm, and the system debugging and model training were completed. The difference is that the parameters of the visible-infrared dual-mode camera were further optimized according to the environmental characteristics of the farm (cold winter, snow or ice on the ground, etc.) to ensure that clear hoof images can be captured under adverse weather and lighting conditions. At the same time, during the model training process, some data on cow behavior and hoof conditions in winter environments were added to improve the model's adaptability to special environments.
[0197] 2.2 Data collection and analysis
[0198] Video data collection: During the three months of winter, the dairy cows in the farm were monitored. Since the activity time of dairy cows in winter is relatively short, the video data of dairy cows was collected in two time periods every day, 10:00-12:00 in the morning and 14:00-16:00 in the afternoon, and the collection time in each time period was about 40 minutes. At the same time, the environmental temperature and humidity, ground conditions (whether there is snow accumulation, ice thickness, etc.), and the industry venues of dairy cows (such as in the cowshed, on the sports field, etc.) were recorded in detail.
[0199] Data preprocessing: Same as in Experiment 1, preprocessing operations such as frame extraction and image annotation are performed on the collected high-quality data.
[0200] Data analysis process: Same as in Experiment 1, the pre-processed image data is input into each model in turn for analysis and processing, and finally the identification result of the hoof injury degree is obtained.
[0201] 2.3 Judgment criteria setting and result analysis
[0202] (1) Leg judgment criteria
[0203] Stride length: Considering that the ground conditions in winter may affect the walking of dairy cows, the stride length threshold has been appropriately adjusted. The average stride length of dairy cows in the farm under normal winter walking conditions is [Y] cm. When the stride length of a cow is monitored to be lower than 60% of the normal average value (i.e. [0.6Y] cm) for 4 consecutive days, it is initially judged that there may be leg problems. This is because there may be snow or ice on the ground in winter, making it difficult for dairy cows to walk, and the force on the hoof changes, which can easily lead to hoof diseases and affect the stride length. For example, hoof frostbite or hoof injury caused by slipping on snow can shorten the stride length of dairy cows.
[0204] Leg joint angle: The normal range is [angle range]. Since the joint movement of dairy cows may be limited due to the cold in winter, when the angle is monitored to fluctuate 12° above or below the normal range for 6 consecutive days (the specific number of days depends on the actual situation), it is suspected that there is an abnormality in the leg joint. This may be because the cold weather makes the cow's joints stiff, and the uneven force on the joints caused by hoof diseases may cause the joint angle to exceed the normal range. For example, hoof diseases may cause dairy cows to change their posture when walking, making the joints more prone to abnormal angles in cold environments.
[0205] Leg swing amplitude: The normal standard deviation is [standard deviation value]. When the standard deviation of the leg swing amplitude of a cow is greater than 130% of the normal standard deviation for two consecutive weeks, it is suspected that the leg movement is uncoordinated and there is a risk of limb and hoof disease. This may be because the hoof condition in winter may be affected by factors such as snow and ice, resulting in restricted leg movement and abnormal swing amplitude. For example, the hoof is stuck in snow or slipped on icy ground and injured, which may affect the normal swing of the leg.
[0206] (2) Back judgment criteria: The average arch angle of a normal cow's back during winter walking is [arch angle value] degrees. When a cow's back arch angle is greater than 115% of the normal average (i.e. [1.15 × arch angle value] degrees) for 5 consecutive days, it is considered that the back may be uncomfortable and the correlation with the limbs is increased. This is because hoof diseases in winter may change the distribution of the cow's body center of gravity. For example, after frostbite or injury to the hoof, the cow may adjust its back posture in order to maintain balance, resulting in an abnormal back arch angle.
[0207] (3) Head judgment standard: The head of a normal dairy cow remains basically horizontal while walking in winter, and the tilt angle is within ±[tilt angle range] degrees. When the tilt angle of a cow's head is monitored to be outside this range for three consecutive days, there may be abnormal head posture, and further attention should be paid to whether it is related to limb and hoof disease. Although abnormal head posture does not necessarily directly indicate hoof disease, it may be a manifestation of the cow's overall physical discomfort. For example, cold weather in winter may make dairy cows feel uncomfortable, and the pain caused by hoof disease may affect the normal posture of their heads, which is manifested as changes in the tilt angle of the head.
[0208] 2.4 Analysis of prediction results
[0209] The same as Experimental Example 1.
[0210] Test Example 3
[0211] 3.1 Experimental setup
[0212] Farm selection: Choose a large-scale dairy farm in the southern region, where the breed is mainly Chinese Holstein cows. The climate of the farm is humid, the summer is hot and rainy, and the humidity in the cowshed is relatively high.
[0213] System installation and configuration: Install cameras and sensors in the farm, and complete system debugging and model training. According to the environmental characteristics of the farm, some adaptive adjustments were made to the system. For example, the importance of monitoring the environmental humidity was added to the data acquisition software. At the same time, during the model training process, some data on cow behavior and hoof conditions in high humidity environments were added to improve the model's adaptability to high humidity environments.
[0214] 3.2 Data collection and analysis
[0215] Video data collection: During the two months of summer, we collected video data from the dairy cows in the farm for three consecutive days, with each time period lasting about 30 minutes. At the same time, we also recorded detailed information such as environmental temperature and humidity, ground conditions, and the cows' activity areas.
[0216] Data preprocessing: As in Experiment 1, the collected video data is subjected to preprocessing operations such as frame extraction and image annotation.
[0217] Data analysis process: Same as in Experiment 1, the pre-processed image data is sequentially input into each model for analysis and processing, and finally the identification result of the hoof injury degree is obtained.
[0218] 3.3 Judgment criteria setting and result analysis
[0219] (1) Leg judgment criteria
[0220] Stride length: The stride length of the dairy cows in the farm during normal summer walking is [Z] cm. When the stride length of a dairy cow is monitored to be lower than 75% of the normal average (i.e. [0.75Z] cm) for three consecutive days, it is initially judged that there may be leg problems. This is because the summer is hot and rainy, the ground may be wet, and the cow's hooves are susceptible to bacterial and fungal infections, leading to hoof diseases, which in turn affect the stride length. For example, hoof rot may cause pain when the cow walks, avoiding stress on the diseased hoof, thereby shortening the stride length.
[0221] Leg joint angle: The normal range is [angle range]. When the angle is monitored to fluctuate 10° above or below the normal range for 4 consecutive days, it is suspected that there is an abnormality in the leg joint. This may be because hoof disease causes the cow's walking posture to change, causing uneven force on the joint, thus causing the joint angle to exceed the normal range. For example, laminitis or hoof ulcers may affect the normal support and movement of the cow's legs, causing changes in the joint angle.
[0222] Leg swing amplitude: The normal standard deviation is [standard deviation value]. When the standard deviation of the leg swing amplitude of a cow is greater than 120%% of the normal standard deviation (i.e. [1.1×standard deviation value] degrees) for a week in a row, it indicates that the leg movement may be uncoordinated and there is a risk of limb and hoof disease. This may be due to hoof injuries, such as hoof sole wear or hoof sprains, which affect the movement of that part of the cow's leg and cause abnormal swing amplitude.
[0223] (2) Back judgment criteria: Through long-term observation and data statistics of a large number of normal dairy cows in the farm, it is determined that the average arch angle of the back of a normal dairy cow during walking in summer is [arch angle value] degrees. This range is based on a comprehensive consideration of multiple factors, including the breed characteristics, body structure, and daily feeding and management conditions of the dairy cow. When the back arch angle of a dairy cow monitored for 4 consecutive days is greater than 110% of the normal average (i.e. [1.1×arch angle value] degrees), it is considered that there may be discomfort in the back. This may be due to a variety of reasons. For example, the high temperature and high humidity environment in summer may cause tension in the cow's back muscles, or the body posture changes caused by hoof diseases cause the cow to adjust the back arch angle to relieve pain or discomfort.
[0224] (3) Head judgment standard: The head of a normal dairy cow is basically kept horizontal during walking in summer, and the tilt angle is within ±[tilt angle range] degrees. This range is determined based on the physiological structure and normal behavioral habits of dairy cows, and is intended to ensure the balance and stability of the cow's head. When the tilt angle of a cow's head is monitored to be outside this range for three consecutive days, there may be abnormal head posture. This may be caused by head muscle strain, nervous system problems or other unknown factors.
[0225] 3.4 Analysis of prediction results
[0226] The same as Experimental Example 1.
[0227] The prior art is used as a comparative example to illustrate that the solution of the present application solves the problems of the prior art.
[0228] Taking the control test as a comparative example, if the reaction temperature is 20-50°C, a test plan corresponding to a reaction temperature outside the range of 20-50°C can be provided.
[0229] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the method for determining the abnormal recognition model of the limb and hoof performance of the cow or the application method of the abnormal recognition model of the limb and hoof performance of the cow described above is implemented.
[0230] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0231] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0232] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0233] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0234] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0235] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0236] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0237] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0238] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for determining a model for identifying abnormal limb and hoof performance of dairy cows, characterized in that: The method for determining the abnormal recognition model of the limb and hoof performance of dairy cows comprises: Acquire cow walking images, visible-infrared light images of cow hooves and integrated data; the integrated data includes: environmental temperature and humidity data and ground condition data on which the cow walks; the ground condition data on which the cow walks includes: flatness, hardness and friction of the ground; Input the cow walking image into a key part walking performance identification model to obtain a key part image; the key part image is an image including a key part of the cow; the key parts include: back, head and legs; Using the key part walking performance recognition model, according to the key part image, the joint point position of the key part is identified; Calculating the posture feature value and gait parameter value of the cow according to the joint point position; The posture feature value, the gait parameter value, the visible-infrared light image of the cow's hoof and the integrated data are used as input, and the degree of hoof injury of the cow is used as output to train a machine learning algorithm model to obtain a cow limb and hoof performance abnormality recognition model.
2. The method for determining the abnormal recognition model of limb and hoof performance of dairy cows according to claim 1, characterized in that: The posture feature values include: leg posture feature values, back posture feature values and head posture feature values; the gait parameter values include the step length, step frequency and walking speed of the cow; the posture feature values and gait parameter values of the cow are calculated according to the joint point positions, specifically including: Calculating leg posture feature values according to the joint point positions; the leg posture feature values include: leg joint angles and leg swing amplitudes; Calculating back posture feature values according to the joint point positions; the back posture feature values include: the degree of curvature and the arch angle of the back; Calculating head posture feature values according to the joint point positions; the head posture feature values include: the tilt angle and the left and right rotation angles of the head; The step length, step frequency and walking speed of the cow are calculated according to the positions of the joint points.
3. The method for determining the abnormal recognition model of limb and hoof performance of dairy cows according to claim 1, characterized in that: The key part walking performance recognition model is trained by the YOLOv8 model; The labels of the key parts walking performance recognition model training include: one head annotation point, three back annotation points and four limb annotation points; The head annotation points are used to determine the position and posture of the head; the back annotation points are selected along the back spine; the back annotation points are used to describe the degree of curvature of the back; the limb annotation points are set at the joints and key parts of the limbs; the limb annotation points are used to calculate the joint angles and limb swing amplitudes; The machine learning algorithm model is a linear regression model, a decision tree model or a random forest model.
4. The method for determining the abnormal recognition model of limb and hoof performance of dairy cows according to claim 1, characterized in that: The cow walking image, the visible-infrared light image of the cow's hoof and the integrated data are obtained; the integrated data includes: environmental temperature and humidity data and ground condition data of the cow walking, specifically including: Get videos of cows walking; Extracting frames from the video of the cow walking to obtain an image of the cow walking; Acquire a bottom image of a cow's hoof to obtain a visible-infrared image of the cow's hoof, wherein the visible-infrared image of the cow's hoof includes: texture, shape and structural information of the hoof surface; Get integrated data.
5. The method for determining the abnormal recognition model of limb and hoof performance of dairy cows according to claim 1, characterized in that: The degree of damage to the cow's hooves includes: no damage, slight damage, moderate damage and severe damage.
6. An application method of a model for identifying abnormal limb and hoof performance of dairy cows, characterized in that: The application method of the abnormal recognition model for limb and hoof performance of dairy cows includes: Acquire the walking image of the cow to be identified, the visible-infrared light image of the cow's hoof to be identified, and the integrated data to be identified; Inputting the to-be-identified cow walking image into a key-part walking performance recognition model to obtain a to-be-identified key-part image; Using the key part walking performance recognition model, according to the key part image to be identified, the position of the joint point to be identified of the key part is identified; Calculating the posture feature value and gait parameter value of the cow to be identified according to the position of the joint point to be identified; The posture feature value of the cow to be identified, the gait parameter value, the visible-infrared light image of the cow's hoof to be identified and the integrated data to be identified are input into a cow limb and hoof performance abnormality recognition model to obtain the degree of hoof injury of the cow to be identified; the cow limb and hoof performance abnormality recognition model is trained by the determination method of the cow limb and hoof performance abnormality recognition model according to any one of claims 1 to 5.
7. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for determining the abnormal limb and hoof performance recognition model for dairy cows described in any one of claims 1 to 5 or the method for applying the abnormal limb and hoof performance recognition model for dairy cows described in claim 6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method for determining the abnormal limb and hoof performance recognition model for dairy cows described in any one of claims 1 to 5 or the method for applying the abnormal limb and hoof performance recognition model for dairy cows described in claim 6.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the method for determining the abnormal limb and hoof performance recognition model for dairy cows described in any one of claims 1 to 5 or the method for applying the abnormal limb and hoof performance recognition model for dairy cows described in claim 6.
Citation Information
Cited By
Image processing method and system for rehabilitation training action analysis
CN120563743A