CN117351404A - Milk cow delivery stress degree judging and recognizing method and system - Google Patents

Milk cow delivery stress degree judging and recognizing method and system Download PDF

Info

Publication number
CN117351404A
CN117351404A CN202311544982.6A CN202311544982A CN117351404A CN 117351404 A CN117351404 A CN 117351404A CN 202311544982 A CN202311544982 A CN 202311544982A CN 117351404 A CN117351404 A CN 117351404A
Authority
CN
China
Prior art keywords
leg
image
stress
stress degree
judging
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311544982.6A
Other languages
Chinese (zh)
Inventor
安晓萍
齐景伟
王步钰
宋懿峰
安禹宁
王园
刘娜
李霞
扎拉嘎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inner Mongolia Agricultural University
Original Assignee
Inner Mongolia Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inner Mongolia Agricultural University filed Critical Inner Mongolia Agricultural University
Priority to CN202311544982.6A priority Critical patent/CN117351404A/en
Publication of CN117351404A publication Critical patent/CN117351404A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/46Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/776Validation; Performance evaluation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method and a system for judging and identifying the stress degree of milk cow delivery, and relates to the technical field of image processing and identification. According to the invention, the leg gesture recognition model is adopted to extract the leg gesture image from the dairy cow video data, then the leg gesture key characteristic parameters are extracted based on the leg gesture image, and finally the accurate recognition of the childbirth stress degree can be realized based on the leg gesture key characteristic parameters by adopting the childbirth stress degree recognition model, so that technical support can be provided for the intelligent pasture.

Description

Milk cow delivery stress degree judging and recognizing method and system
Technical Field
The invention relates to the technical field of image processing and recognition, in particular to a method and a system for judging and recognizing the stress degree of milk cow delivery
Background
Cow delivery is an important piece of life cycle and production activity. The childbirth process can adversely affect the neuroendocrine system and behavior of the animal. Severe pain is a typical feature and is also a major cause of childbirth stress. Pain behaviors in the delivery process are mainly expressed in frequent lying, lifting/kicking, and the like, based on the typical behaviors, the gesture changes at different positions are observed and mastered, the difficulty condition of cow delivery is favorably and accurately judged, the delivery stress degree of cows is mastered, the intelligence of cow delivery management is improved, the pain of the cows in the delivery process is reduced, and the welfare level of the cows is improved.
Stress is a painful manifestation of cows during delivery and is also a normal physiological response, but excessive stress will cause dystocia. The method for evaluating the difficulty level of the milk cow delivery is generally divided into 4 parts, and the delivery stress levels corresponding to 1-4 parts are unassisted, slightly midwifered, strongly midwifered and surgically midwifered. The traditional assessment method is a method for recording after delivery, the delivery process of the dairy cows is monitored in real time through behaviors at present, and the delivery difficulty and the stress degree of the dairy cows are usually manually carried out by professionals based on the behavior. The method is time-consuming and labor-consuming, is greatly influenced by human subjective and environmental light, and cannot guarantee accuracy.
With the continuous deep level of intellectualization in the agriculture and animal husbandry, large intelligent pastures grow, and sensor technology and computer vision technology have been applied to animal behavior recognition analysis. At present, the contact type dairy cow behavior recognition tracking application based on the sensor is at most a dairy cow intelligent collar, but the method is easy to cause stress reaction of the dairy cow and damage the sensor. Meanwhile, in order to reduce the stress influence on the milk cows during delivery, the intelligent necklace is not worn in the delivery process. Therefore, the computer vision technology becomes an important means for monitoring the milk cow delivery process in real time and accurately judging the stress degree of the milk cow. Computer vision technology can be used for collecting cow delivery video data in a stress-free, contact-free and low-cost way for researchers to carefully observe and analyze. However, the conventional computer vision technology still requires expert experience and a great deal of manpower to label and analyze the long-term behavior monitoring data. In addition, the existing cow delivery stress degree is mostly judged by only depending on blood stress indexes, and the defects of high cost, poor real-time performance and the like exist. Based on the above, it is needed to establish a behavior perception technology based on machine vision to feed back the childbirth stress degree of the dairy cows in real time, so as to provide a foundation for fine management of pastures.
Disclosure of Invention
The invention aims to provide a method and a system for judging the stress degree of milk cow delivery, which can realize accurate judgment of the stress degree of milk cow delivery based on leg postures of milk cows and provide technical support for intelligent pastures.
In order to achieve the above object, the present invention provides the following solutions:
a milk cow delivery stress degree judging method comprises the following steps:
acquiring cow video data to be identified;
constructing a leg gesture recognition model;
inputting the dairy cow video data into the leg gesture recognition model to obtain a leg gesture image;
extracting key characteristic parameters of the leg gesture based on the leg gesture image;
constructing a labor stress degree judgment model;
inputting the leg gesture key characteristic parameters into the labor stress degree judgment model to obtain a labor stress degree judgment result.
Optionally, constructing a leg gesture recognition model specifically includes:
acquiring a video of the milk cow delivery process;
processing the video of the milk cow delivery process to obtain a processed image;
marking different leg postures in the processed image to obtain a marked image;
constructing a training set, a verification set and a test set based on the annotation image;
constructing a YOLOv5 neural network model;
training the YOLOv5 neural network model by adopting the training set to obtain a trained YOLOv5 neural network model;
verifying and testing the trained Yolov5 neural network model by adopting a verification set and the test set until the trained Yolov5 neural network model meets the verification and test requirements;
and taking the trained YOLOv5 neural network model meeting the verification and test requirements as the leg gesture recognition model.
Optionally, the processing the video of the cow delivery process to obtain a processed image specifically includes:
performing format conversion on the video of the milk cow delivery process;
and dividing the video of the milk cow delivery process after format conversion, and extracting frames to obtain the processed image.
Optionally, marking different leg poses in the processed image with a labelimg tool based on the python environment results in the annotation image.
Optionally, extracting the leg gesture key feature parameters based on the leg gesture image specifically includes:
identifying contours of the leg pose image;
adopting a contour function to screen and obtain a leg target image based on the contour;
performing binarization processing on the leg target image to obtain a binarized image;
converting the binarized image in one action period into a Numpy array; the action cycle is a lifting/leg-kicking cycle from a lifting/leg-kicking phase to a lifting/leg-kicking return phase of the dairy cow leg;
stacking the Numpy arrays, and obtaining a motion energy image in one motion period based on the stacked Numpy arrays;
extracting leg gesture characteristic parameters in the milk cow delivery process based on the motion energy image; the leg gesture characteristic parameters comprise time length, average lifting/kicking height per time, average lifting/kicking speed, variability of leg gesture characteristic parameter distribution and homogeneity of leg gesture characteristic parameter distribution.
Optionally, constructing a labor stress degree judgment model specifically comprises the following steps:
measuring the childbirth stress indexes of the cows with different childbirth stress degrees; the childbirth stress index is a physiological index of the 0 th day after childbirth;
acquiring leg gesture characteristic parameters in the milk cow delivery process;
analyzing the relevance between the leg posture characteristic parameters and the childbirth stress indexes in the childbirth process of the dairy cows by adopting a Pearson method so as to optimize and obtain the leg posture key characteristic parameters reflecting the childbirth stress degree;
taking the labor stress degree and the leg gesture key characteristic parameters corresponding to the labor stress degree as training sample pairs to form a training sample data set;
constructing a judgment model;
training the judgment model by adopting the training sample data set until the trained judgment model meets the set condition;
and taking the judgment model meeting the set conditions as the labor stress degree judgment model.
Optionally, a random forest algorithm is adopted to construct the identification model.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
according to the invention, the leg gesture recognition model is adopted to extract the leg gesture image from the dairy cow video data, then the leg gesture key characteristic parameters are extracted based on the leg gesture image, and finally the accurate recognition of the childbirth stress degree can be realized based on the leg gesture key characteristic parameters by adopting the childbirth stress degree recognition model, so that technical support can be provided for the intelligent pasture.
Further, the invention also provides a milk cow delivery stress degree judging and identifying system, which comprises:
a camera for photographing video data of cows in the childbirth house;
and the upper computer is connected with the camera and used for implementing the method for judging the stress degree of the milk cow delivery, so that the result for judging the stress degree of the milk cow delivery is obtained based on the video data of the milk cow.
Optionally, the upper computer includes:
a memory for storing a computer program and video images of cow delivery;
and the processor is connected with the memory and the camera and is used for calling and executing the computer program so as to implement the method for judging the stress degree of the milk cow delivery.
Optionally, the processor includes:
the video data acquisition module is used for acquiring the video data of the dairy cows to be identified;
the leg gesture recognition model building module is used for building a leg gesture recognition model;
the leg gesture image extraction module is used for inputting the dairy cow video data into the leg gesture recognition model to obtain a leg gesture image;
the leg gesture key feature parameter extraction module is used for extracting leg gesture key feature parameters based on the leg gesture image;
the labor stress degree judgment model construction module is used for constructing a labor stress degree judgment model;
and the labor stress degree judging and identifying module is used for inputting the leg gesture key characteristic parameters into the labor stress degree judging and identifying model to obtain a labor stress degree judging and identifying result.
The technical effects achieved by the system provided by the invention are the same as those achieved by the method for judging the stress degree of milk cow delivery provided by the invention, so that the description is omitted here.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for judging the stress level of milk cow delivery according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a leg gesture recognition model according to an embodiment of the present invention;
fig. 3 is a schematic view of a shooting angle according to an embodiment of the present invention; fig. 3 (a) is a schematic view of a hip photographing angle, fig. 3 (b) is a schematic view of an abdomen photographing angle, and fig. 3 (c) is a schematic view of a head photographing angle;
FIG. 4 is a matrix diagram of Labelimg labeling results provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram of accuracy in training results of a leg gesture recognition model according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of loss values in training results of a leg gesture recognition model according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of recall in training results of a leg gesture recognition model according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of average accuracy values in training results of a leg gesture recognition model according to an embodiment of the present invention;
FIG. 9 is a matrix diagram of recognition effects of a leg gesture recognition model according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of binary image extraction according to an embodiment of the present invention;
fig. 11 is an energy diagram of leg movements of a lying-down delivery cow provided by an embodiment of the invention;
fig. 12 is a flowchart of a cow delivery stress degree identification model for identifying the delivery stress degree according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The invention aims to provide a method and a system for judging the stress degree of milk cow delivery, which can realize accurate judgment of the stress degree of milk cow delivery based on leg postures of milk cows and provide technical support for intelligent pastures.
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
In the milk cow delivery process, calves are produced by forceful effort and responsibility in the modes of pacing, frequently rising, lying, lifting/leg-pressing and the like, so that the labor and responsibility degree and the delivery stress degree of the milk cows are directly reflected through leg postures. Based on the above, the invention provides a leg posture-based cow delivery stress degree judging method, as shown in fig. 1, which comprises the following steps:
step 100: and acquiring the video data of the dairy cows to be identified. In the practical application process, video acquisition is generally performed in a pasture delivery house by selecting different angles, for example, the acquired image is shown in fig. 3.
Step 101: and constructing a leg gesture recognition model. The construction process of the leg gesture recognition model adopted by the invention can comprise the following steps:
step 1011: the method comprises the steps of acquiring a cow delivery process video, and specifically comprises a primiparity and a parturient cow delivery video. In the practical application process, video acquisition can be carried out at 4 angles of pasture delivery house, and the camera position is fixed to make the angle of camera can cover whole obstetric table, will shoot video and regularly transmit to mobile hard disk storage, playback video recording carries out delivery action gesture analysis after the experiment finishes.
Step 1012: a leg position image dataset of the parturition cow is established. In the process, in order to avoid identification errors caused by the problems of mutual shielding, dim light, standing angle and the like among cows, format conversion, video segmentation, frame extraction and the like can be performed on each cow image video so as to extract images from the cow parturition process video in frames, thereby improving the effect of subsequent processing. After the images are extracted in frames, the leg lifting/kicking, leg non-lifting/kicking postures and standing leg posture of the lying-down parturition cows are marked so as to establish a leg posture image dataset of the parturition cows. And constructing a training set, a verification set and a test set based on the established leg posture image data set of the parturition dairy cow. For example, the ratio of training set, validation set to test set is 7:2:1.
For example, the images obtained by the frame extraction are marked by the python environment using a labelimg tool to mark the leg lifting/kicking, non-lifting/kicking and standing leg position of a lying parturition cow, the image format is saved as txt, and the mark classification definition is shown in table 1. The completion flag image is 15408 sheets, wherein a partial example of the completion flag is shown in fig. 4.
Table 1 typical posture chart of cow hind leg performance during parturition
Step 1013: an initial leg gesture recognition model is constructed by applying a YOLOv5 algorithm. As shown in fig. 2, the initial leg gesture recognition model may be composed of an Input (Input), a Backbone network (Backbone), a Neck network (neg), and an output (Prediction).
Step 1014: training the initial leg gesture recognition model to obtain a leg gesture recognition model.
The process may include training a model, validating a model, and performance testing, taking the initial leg gesture recognition model after training, validating, and testing that meets the assessment criteria as the final leg gesture recognition model employed. During training, verification and testing, model performance can be assessed in terms of accuracy (Precision), recall (Recall), average accuracy value (Mean average Precision, mAp) and Loss value (Loss), and generalization ability of the model is improved. The change of the accuracy, recall, average accuracy and loss during the training process is shown in fig. 5-8.
Step 102: and inputting the cow video data into the leg gesture recognition model to obtain a leg gesture image. The partial leg gesture image obtained by the leg gesture recognition model is shown in fig. 9.
Step 103: and extracting the key characteristic parameters of the leg gesture based on the leg gesture image. The implementation process of the step can be as follows:
step 1031: contours of leg pose images are identified.
Step 1032: and obtaining a leg target image based on contour screening by adopting a contour function.
Step 1033: and carrying out binarization processing on the leg target image to obtain a binarized image. A specific implementation of this step can be seen in fig. 10.
Step 1034: the binarized image in one action period is converted into a Numpy array. The action cycle refers to the period from the lifting/stepping off of the legs of the dairy cows to the lifting/stepping back.
Step 1035: the Numpy arrays are stacked and motion energy images within one motion cycle are obtained based on the stacked Numpy arrays, for example, as shown in fig. 11.
Step 1036: leg gesture characteristic parameters in the milk cow delivery process are extracted based on the movement energy image. The leg posture characteristic parameters comprise time length, average lifting/kicking height per time, average lifting/kicking speed, variability of leg posture characteristic parameter distribution and homogeneity of leg posture characteristic parameter distribution. The variability of the distribution of the characteristic parameters of the leg posture and the homogeneity of the distribution of the characteristic parameters of the leg posture are defined by the uniformity of the distribution of the obtained parameters, the definition of poor uniformity is variability, the description quantity is small, the definition of strong uniformity is homogeneity, and the description quantity is large.
Step 104: and constructing a labor stress degree judgment model. The construction process of the labor stress degree judgment model comprises the following steps:
step 1041: and (5) measuring the childbirth stress indexes of the cows with different childbirth stress degrees. The childbirth stress index is physiological index of the 0 th day after childbirth, comprising: SOD (superoxide dismutase), MDA (malondialdehyde), T-AOC (total antioxidant capacity), CAT (catalase) and GSH-Px (glutathione peroxidase). The physiological index is measured by ELISA kit, and the specific operation mode is as follows: 60 cows with different delivery time lengths are selected, blood is collected 0 day after delivery, supernatant is centrifugally taken, and physiological indexes SOD, MDA, T-AOC, CAT, GSH-Px are obtained through measurement. Table 2 gives the average results of physiological indicators on day 0 after delivery of 60 cows.
Table 2 table of results of average values of key physiological antioxidant indicators of 60 cows of different parity on day 0 of delivery
Step 1042: and acquiring leg posture characteristic parameters in the milk cow delivery process. Specific:
1) Extracting binary images of lying-down parturition cows, specifically: inputting images of different postures of legs in the lying delivery process, processing by a multi-level threshold mean value filtering method based on field similarity, calculating the gradient in eight directions, adopting canny contour extraction and other technologies, carrying out contour recognition on the lifting/kicking images of the midwifery cows and the parturient cows, screening the contour area by a contour function, accurately highlighting the leg targets, carrying out image binarization processing, and extracting the binary images of the legs of the cows.
2) And extracting a leg movement cycle energy map based on the binarized image extracted in the step 1). Wherein, one action cycle refers to a complete lifting/kicking cycle, which comprises a lifting/kicking off ground phase and a return phase of one leg.
The binarized image in one action cycle is converted into a Numpy array, the Numpy arrays are stacked together to calculate an average value, and the motion energy image of one action cycle is obtained based on the average value.
3) And constructing a leg posture characteristic parameter data set in the milk cow delivery process. Based on the process of extracting the leg movement cycle energy map in the step 2), indexes such as the delivery time length, the average lifting/kicking height, the average lifting/kicking speed, the variability of the leg gesture characteristic parameter distribution, the homogeneity of the leg gesture characteristic parameter distribution and the like can be obtained, and the indexes are used as the leg gesture characteristic parameters in the dairy cow delivery process to obtain a leg gesture characteristic parameter data set.
Step 1043: the Pearson method is adopted to analyze the relevance between the leg posture characteristic parameters and the childbirth stress indexes in the childbirth process of the dairy cows, so that the leg posture characteristic can reflect the stress degree suffered in the childbirth process of the dairy cows, and the leg posture key characteristic parameters which can reflect the childbirth stress degree are further optimized.
Step 1044: and taking the labor stress degree and the optimized leg posture key characteristic parameters corresponding to the labor stress degree as training sample pairs to form a training sample data set.
Step 1045: and constructing a judgment model.
Step 1046: and training the judgment model by adopting the training sample data set until the trained judgment model meets the set condition. The training process of the judgment model essentially comprises three operation flows of model training, model testing and model verification. In the actual application process, the data set proportion can be 7:2:1, and the classification effect of the judgment model is assessed by taking the F1 score (F1-score) and the accuracy (accuracy) as evaluation indexes so as to establish the classification judgment of the cow delivery stress degree based on a random forest algorithm.
Step 1047: and taking the judgment model meeting the set conditions as a labor stress degree judgment model.
Step 105: inputting the key characteristic parameters of the leg postures into the labor stress degree judgment model to obtain the labor stress degree judgment result. Among them, childbirth stress is classified into normal and strong degrees. A specific implementation flow of this step is shown in fig. 12.
Further, the invention also provides a milk cow delivery stress degree judging and identifying system, which comprises: camera and host computer. The camera is connected with the host computer to the camera sets up on four angles of childbirth house, so that can obtain the video data of milk cow in all-round. The upper computer is used for implementing the method for judging the childbirth stress degree of the dairy cows, so that the childbirth stress degree judgment result is obtained based on the video data of the dairy cows.
In the practical application process, the upper computer adopted by the invention can comprise: memory and a processor. The memory is used for storing a computer program and video images of cow delivery. The processor is connected with the memory and the camera for retrieving and executing the computer program to implement the method for judging the stress degree of the milk cow delivery.
Wherein the processor comprises: the system comprises a video data acquisition module, a leg gesture recognition model construction module, a leg gesture image extraction module, a leg gesture key characteristic parameter extraction module, a labor stress degree judgment model construction module and a labor stress degree judgment module.
The video data acquisition module is used for acquiring the cow video data to be identified.
The leg gesture recognition model building module is used for building a leg gesture recognition model.
The leg gesture image extraction module is used for inputting the dairy cow video data into the leg gesture recognition model to obtain a leg gesture image.
The leg gesture key feature parameter extraction module is used for extracting leg gesture key feature parameters based on the leg gesture image.
The labor stress degree judgment model building module is used for building a labor stress degree judgment model.
The labor stress degree judgment module is used for inputting the leg gesture key characteristic parameters into the labor stress degree judgment model to obtain the labor stress degree judgment result.
Furthermore, the computer program in the above-described memory may be stored in a computer-readable storage medium when it is implemented in the form of a software functional unit and sold or used as a separate product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to assist in understanding the methods of the present invention and the core ideas thereof; also, it is within the scope of the present invention to be modified by those of ordinary skill in the art in light of the present teachings. In view of the foregoing, this description should not be construed as limiting the invention.

Claims (10)

1. A method for judging the stress degree of milk cow delivery, which is characterized by comprising the following steps:
acquiring cow video data to be identified;
constructing a leg gesture recognition model;
inputting the dairy cow video data into the leg gesture recognition model to obtain a leg gesture image;
extracting key characteristic parameters of the leg gesture based on the leg gesture image;
constructing a labor stress degree judgment model;
inputting the leg gesture key characteristic parameters into the labor stress degree judgment model to obtain a labor stress degree judgment result.
2. The method for judging the stress degree of milk cow delivery according to claim 1, wherein the step of constructing the leg posture recognition model comprises the following steps:
acquiring a video of the milk cow delivery process;
processing the video of the milk cow delivery process to obtain a processed image;
marking different leg postures in the processed image to obtain a marked image;
constructing a training set, a verification set and a test set based on the annotation image;
constructing a YOLOv5 neural network model;
training the YOLOv5 neural network model by adopting the training set to obtain a trained YOLOv5 neural network model;
verifying and testing the trained Yolov5 neural network model by adopting a verification set and the test set until the trained Yolov5 neural network model meets the verification and test requirements;
and taking the trained YOLOv5 neural network model meeting the verification and test requirements as the leg gesture recognition model.
3. The method for judging the stress degree of milk cow delivery according to claim 2, wherein the processing of the video of the milk cow delivery process to obtain a processed image specifically comprises:
performing format conversion on the video of the milk cow delivery process;
and dividing the video of the milk cow delivery process after format conversion, and extracting frames to obtain the processed image.
4. The method for judging the stress degree of milk cow delivery according to claim 2, wherein the labeling image is obtained by labeling different leg postures in the processing image by using a labelimg tool based on a python environment.
5. The method for judging the stress degree of milk cow delivery according to claim 1, wherein extracting the leg posture key feature parameters based on the leg posture image comprises the following steps:
identifying contours of the leg pose image;
adopting a contour function to screen and obtain a leg target image based on the contour;
performing binarization processing on the leg target image to obtain a binarized image;
converting the binarized image in one action period into a Numpy array; the action cycle is a lifting/leg-kicking cycle from a lifting/leg-kicking phase to a lifting/leg-kicking return phase of the dairy cow leg;
stacking the Numpy arrays, and obtaining a motion energy image in one motion period based on the stacked Numpy arrays;
extracting leg gesture characteristic parameters in the milk cow delivery process based on the motion energy image; the leg gesture characteristic parameters comprise time length, average lifting/kicking height per time, average lifting/kicking speed, variability of leg gesture characteristic parameter distribution and homogeneity of leg gesture characteristic parameter distribution.
6. The method for judging the degree of stress in milk cow delivery according to claim 1, wherein the construction of the model for judging the degree of stress in milk delivery specifically comprises the following steps:
measuring the childbirth stress indexes of the cows with different childbirth stress degrees; the childbirth stress index is a physiological index of the 0 th day after childbirth;
acquiring leg gesture characteristic parameters in the milk cow delivery process;
analyzing the relevance between the leg posture characteristic parameters and the childbirth stress indexes in the childbirth process of the dairy cows by adopting a Pearson method so as to optimize and obtain the leg posture key characteristic parameters reflecting the childbirth stress degree;
taking the labor stress degree and the leg gesture key characteristic parameters corresponding to the labor stress degree as training sample pairs to form a training sample data set;
constructing a judgment model;
training the judgment model by adopting the training sample data set until the trained judgment model meets the set condition;
and taking the judgment model meeting the set conditions as the labor stress degree judgment model.
7. The method for judging the stress level of milk cow parturition according to claim 6, wherein a random forest algorithm is adopted to construct the judging model.
8. A system for determining the stress level of a cow during delivery, comprising:
a camera for photographing video data of cows in the childbirth house;
the upper computer is connected with the camera and used for implementing the method for judging the childbirth stress degree of the dairy cows according to any one of claims 1 to 7 so as to obtain the childbirth stress degree judging result based on the video data of the dairy cows.
9. The system for determining the stress level of milk cow delivery according to claim 8, wherein the upper computer comprises:
a memory for storing a computer program and video images of cow delivery;
a processor, connected to the memory and the camera, for retrieving and executing the computer program to implement the method for determining the stress level of milk cow delivery according to any one of claims 1-7.
10. The dairy cow stress level judgment system of claim 9, wherein the processor comprises:
the video data acquisition module is used for acquiring the video data of the dairy cows to be identified;
the leg gesture recognition model building module is used for building a leg gesture recognition model;
the leg gesture image extraction module is used for inputting the dairy cow video data into the leg gesture recognition model to obtain a leg gesture image;
the leg gesture key feature parameter extraction module is used for extracting leg gesture key feature parameters based on the leg gesture image;
the labor stress degree judgment model construction module is used for constructing a labor stress degree judgment model;
and the labor stress degree judging and identifying module is used for inputting the leg gesture key characteristic parameters into the labor stress degree judging and identifying model to obtain a labor stress degree judging and identifying result.
CN202311544982.6A 2023-11-20 2023-11-20 Milk cow delivery stress degree judging and recognizing method and system Pending CN117351404A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311544982.6A CN117351404A (en) 2023-11-20 2023-11-20 Milk cow delivery stress degree judging and recognizing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311544982.6A CN117351404A (en) 2023-11-20 2023-11-20 Milk cow delivery stress degree judging and recognizing method and system

Publications (1)

Publication Number Publication Date
CN117351404A true CN117351404A (en) 2024-01-05

Family

ID=89371208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311544982.6A Pending CN117351404A (en) 2023-11-20 2023-11-20 Milk cow delivery stress degree judging and recognizing method and system

Country Status (1)

Country Link
CN (1) CN117351404A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117942190A (en) * 2024-03-27 2024-04-30 中国农业科学院北京畜牧兽医研究所 Sow temporary yield early warning system based on angle sensing

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117942190A (en) * 2024-03-27 2024-04-30 中国农业科学院北京畜牧兽医研究所 Sow temporary yield early warning system based on angle sensing

Similar Documents

Publication Publication Date Title
Bao et al. Artificial intelligence in animal farming: A systematic literature review
Qiao et al. Intelligent perception for cattle monitoring: A review for cattle identification, body condition score evaluation, and weight estimation
Hu et al. Cow identification based on fusion of deep parts features
CN109141248B (en) Pig weight measuring and calculating method and system based on image
Wang et al. ASAS-NANP SYMPOSIUM: Applications of machine learning for livestock body weight prediction from digital images
Xiao et al. Cow identification in free-stall barns based on an improved Mask R-CNN and an SVM
CN110532899B (en) Sow antenatal behavior classification method and system based on thermal imaging
CN112288793B (en) Method and device for detecting backfat of livestock individuals, electronic equipment and storage medium
CN113947734A (en) Pig physical sign information acquisition method and system
CN112101333A (en) Smart cattle farm monitoring and identifying method and device based on deep learning
Lu et al. An automatic splitting method for the adhesive piglets’ gray scale image based on the ellipse shape feature
Zhang et al. Biometric facial identification using attention module optimized YOLOv4 for sheep
CN113822185A (en) Method for detecting daily behavior of group health pigs
CN113420709A (en) Cattle face feature extraction model training method and system and cattle insurance method and system
CN115527234A (en) Infrared image cage dead chicken identification method based on improved YOLOv5 model
CN116295022A (en) Pig body ruler measurement method based on deep learning multi-parameter fusion
Bello et al. Deep belief network approach for recognition of cow using cow nose image pattern
CN114299551A (en) Model training method, animal behavior identification method, device and equipment
CN117036820B (en) Pig classification model based on visual image and method thereof
CN112883915A (en) Automatic wheat ear identification method and system based on transfer learning
CN110414369B (en) Cow face training method and device
CN115830078B (en) Multi-target pig tracking and behavior recognition method, computer equipment and storage medium
Qin et al. Identification of body size characteristic points based on the Mask R-CNN and correlation with body weight in Ujumqin sheep
CN117351404A (en) Milk cow delivery stress degree judging and recognizing method and system
Avanzato et al. Dairy cow behavior recognition using computer vision techniques and CNN networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination