CN114170292A - Pig weight estimation method and device based on depth image - Google Patents

Pig weight estimation method and device based on depth image Download PDF

Info

Publication number
CN114170292A
CN114170292A CN202111258590.4A CN202111258590A CN114170292A CN 114170292 A CN114170292 A CN 114170292A CN 202111258590 A CN202111258590 A CN 202111258590A CN 114170292 A CN114170292 A CN 114170292A
Authority
CN
China
Prior art keywords
pig
point
depth image
weight
weight estimation
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
CN202111258590.4A
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.)
Guangzhou Huanong University Intelligent Agricultural Technology Co ltd
Original Assignee
Guangzhou Huanong University Intelligent Agricultural Technology Co ltd
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 Guangzhou Huanong University Intelligent Agricultural Technology Co ltd filed Critical Guangzhou Huanong University Intelligent Agricultural Technology Co ltd
Priority to CN202111258590.4A priority Critical patent/CN114170292A/en
Publication of CN114170292A publication Critical patent/CN114170292A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • G01B11/06Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness for measuring thickness ; e.g. of sheet material
    • G01B11/0608Height gauges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • G06F18/24137Distances to cluster centroïds
    • G06F18/2414Smoothing the distance, e.g. radial basis function networks [RBFN]
    • 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/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]

Landscapes

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

Abstract

The invention provides a pig weight estimation method and device based on a depth image, and relates to the technical field of livestock informatization. According to the method, the depth image is shot for the pig, the Keypoint-RCNN network is adopted to extract the key points of the pig, the body size characteristic data of the pig is calculated according to the key point information, and then the weight data of the pig is obtained.

Description

Pig weight estimation method and device based on depth image
Technical Field
The invention relates to the technical field of livestock information, in particular to a pig weight estimation method and device based on a depth image.
Background
The monitoring of the change of the weight indexes of the pigs can reflect the development speed, the body state, the feed-meat ratio and the diet condition of the pigs, the evaluation of the indexes is beneficial to the quality identification, the marketing and the breeding and the accurate feeding of the pigs, meanwhile, the meat quantity and the corresponding quality after slaughtering can be estimated, and whether the weight of the pigs reaches the hurdle mark or not can be judged quickly. The weight of the pigs is quickly detected, so that the weight of the pigs is of great significance.
Currently, the weight of a pig is estimated by a manual body size measurement method (pig weight (kg) ═ chest circumference (cm) × body length (cm)/coefficient), or a group weight is estimated by driving the pig to a weighbridge in a specific area. None of these methods achieves accurate measurement of individual pigs and is inefficient.
Publication No.: CN110426112A, published as 2019-11-08, discloses a live pig weight measurement method and device, and the method is used for extracting key points and measuring volumes based on rgb images of videos, although the stability of recognition is enhanced by using a neural network. But this scheme is based on ordinary rgb image measurement pig's buttock width and buttock height, and the accuracy is lower, and this scheme is compared and is extracted the key point slowly through the depth map.
Disclosure of Invention
The invention aims to overcome the technical problems and provides the pig body weight estimation method based on the depth image, which has high speed of extracting key points and accurate body size characteristic data.
The technical scheme of the invention is as follows:
a pig weight estimation method based on a depth image comprises the following steps:
s1, obtaining the depth image of the pig taken down and the breed of the pig;
s2, extracting key points of the pigs in the depth image by using a Keypoint-RCNN network;
s3, calculating the body size characteristic data and the overlooking projection area of the pig according to the key points of the pig;
s4, inputting the pig variety, the body size characteristic data and the overlook projection area into an weight estimation model;
s5, obtaining the weight of the pig;
wherein, the weight estimation model in step S4 is established based on a regression model.
According to the technical scheme, weight estimation is carried out on the basis of the depth image, the height and width data of the pigs can be obtained at one time, the extraction speed of the key points is high, the positions of the key points are accurate, so that the method is high in robustness, and the finally obtained weight data is small in error.
Further, the method for obtaining the depth image in step S1 is as follows: firstly, a pig is subjected to downward shooting through a depth camera to obtain point cloud data, and then a depth image is generated according to the point cloud data;
when the pig is shot in a depression mode, the depth camera detects the real-time posture of the depth camera through the gyroscope, the depth camera meets the preset shooting visual angle and automatically shoots images, and otherwise, a prompt for adjusting the posture of the depth camera is sent.
Further, in step S2, before extracting the key points of the pig in the depth image using the Keypoint-RCNN network, the depth image needs to be segmented to obtain the pig contour in the image, and the segmentation step includes:
s21, carrying out noise reduction processing on the depth image according to a point cloud density filtering noise reduction algorithm to remove noise;
s22, calculating the height difference between the ground and the contour of the back of the pig by a sorting method, identifying the ground part by using the height information and deleting the ground part;
and S23, after the height information converted from the depth information is sequenced, extracting the maximum connected region to obtain the image including the contour of the pig.
According to the technical scheme, the contour of the pig in the image is segmented before the key point is extracted, so that whether the pig in the image completely finishes picture screening is judged, and the fact that the depth image subjected to key point segmentation comprises the complete pig is guaranteed.
Further, the key points of the pig in step S2 include: ear root point, anterior elbow point, posterior spine point, and caudal root point; wherein the ear root point, the anterior elbow point, the posterior elbow point and the tail root point are respectively arranged on the left and the right;
step S3, the body size feature data includes: shoulder width, hip width, body height, body length;
the shoulder width is obtained by calculating the distance between two front elbow points;
the hip width is obtained by calculating the distance between two back elbow points;
the height of the body is calculated by the distance of the difference between the height of the back point of the ridge and the height of the ground;
the body length is obtained by the connecting line distance of the middle point of the connecting line of the two ear root points and the middle point of the connecting line of the two tail root points.
Further, in step S2, the Keypoint-RCNN network includes: the system comprises a backbone network unit, a region suggestion unit, a region of interest matching unit, a key point detection branch unit, a mask detection branch unit and a frame regression and classification unit;
the method comprises the steps that a Keypoint-RCNN network obtains a depth image of a pig, and a backbone network unit extracts image features from the depth image to obtain a feature map of the depth image; the region suggesting unit extracts the region-of-interest feature maps with different sizes from the feature map; the interesting region matching unit converts the interesting region feature maps with different sizes into an interesting region feature map with a fixed size; the key point monitoring branch unit obtains an ear root point, an anterior elbow point, a posterior spine point and a tail root point on a region-of-interest characteristic diagram with a fixed size; the mask monitoring branch unit divides the characteristic diagram of the region of interest with fixed size to obtain a division diagram of the contour line of the pig; and the frame regression and classification unit identifies the pig from the region-of-interest feature map with the fixed size and provides other objects.
Further, the method for calculating the overhead projection area in step S3 is: the head and the tail of the pig are divided through key points, the head and the tail of the pig contour line segmentation image obtained by the mask branching unit are removed, and then the area of the rest part in the pig contour line segmentation image is calculated to be used as the overlook projection area.
In the technical scheme, the purpose of removing the head and the tail of the pig image is to avoid the change of the projection area of the pig caused by the change of the postures of the head and the tail of the pig in the actual application scene, so that the condition of weight estimation precision is influenced.
Further, the method for establishing the weight estimation model comprises the following steps:
the method comprises the steps of collecting weight data, body size characteristic data, overlooking projection area and pig varieties of pigs to establish a sample library of the pigs, corresponding the characteristics to actually measured weight data to establish a regression model of the pigs, and determining regression coefficients of the regression model of the pigs by using a least square method to obtain an estimated weight model.
Further, the regression model includes: a linear regression model, a polynomial regression model, a ridge regression model, a lasso regression model; the regression model corresponding to the different breeds of pigs is determined based on the weight estimation precision of sample data of the different breeds of pigs under each model.
A pig weight estimation device comprising: the device comprises a depth camera, a key point extraction module, a body size calculation module and an weight estimation module;
the method comprises the steps of inputting the variety of a pig to be detected, using a depth camera to perform downward shooting on the pig to obtain a depth image, extracting key points of the pig in the depth image by a key point extraction module, calculating body ruler feature data and an overlooking projection area of the pig by the body ruler calculation module by using the key points, and obtaining the weight of the pig by a weight estimation module according to the variety of the pig, the body ruler feature data and the overlooking projection area;
the key point extracting module adopts a Keypoint-RCNN network to extract key points, and the weight estimating module adopts a regression model to estimate weight.
This technical scheme has provided a pig weight estimation equipment, and equipment is equipped with the degree of depth camera for only shoot the depth map to the pig, then the key point draws the module and draws the key point to the depth map through the Keypoint-RCNN network, and this technical scheme's pig weight estimation equipment adopts the degree of depth camera, can once only obtain the height and body width data of pig, and the key point extraction rate is fast, and the key point position is accurate, the pig weight data of the low error that can be fast convenient acquisition.
Further, still include controller and gyroscope, the real-time gesture of gyroscope detection depth camera, the controller passes through the gyroscope and judges whether the shooting angle of depth camera accords with the preset range, if not accord with then the controller sends the correction suggestion, if accord with then the controller control depth camera shoots the image and shows
The technical scheme provides a pig weight estimation method and device based on a depth image, and compared with the prior art, the technical scheme has the beneficial effects that: the method comprises the steps of shooting a depth image of a pig, extracting key points of the pig by adopting a Keypoint-RCNN network, calculating body size characteristic data of the pig according to key point information, and further obtaining weight data of the pig.
Drawings
FIG. 1 is a schematic diagram of the steps of a pig weight estimation method based on depth images;
FIG. 2 is a schematic view of an operator using the apparatus to photograph pigs;
FIG. 3 is a diagram of a Keypoint-RCNN network structure;
FIG. 4 is a schematic view of key points on the back of a pig;
wherein, 1, ear root points; 2. the anterior elbow point; 3. posterior elbow point; 4. a tail root point; 5. posterior point of spine.
Detailed Description
For clearly illustrating the pig weight estimation method based on depth images of the present invention, the present invention will be further described with reference to the following examples and drawings, but the scope of the present invention should not be limited thereby.
Example 1
A pig weight estimation method based on depth images is shown in figure 1 and comprises the following steps:
s1, obtaining the depth image of the pig taken down and the breed of the pig;
s2, extracting key points of the pigs in the depth image by using a Keypoint-RCNN network;
s3, calculating the body size characteristic data and the overlooking projection area of the pig according to the key points of the pig;
s4, inputting the pig variety, the body size characteristic data and the overlook projection area into a weight estimation model to obtain the weight data of the pig;
wherein, the weight estimation model in step S4 is established based on a regression model.
The technical scheme carries out weight estimation based on the depth image, can obtain height and width data of the pigs at one time, is high in key point extraction speed and accurate in key point positions, and therefore the method is high in robustness and small in error of finally obtained weight data.
Example 2
A pig weight estimation method based on depth images is shown in figure 1 and comprises the following steps:
s1, obtaining the depth image of the pig taken down and the breed of the pig;
s2, extracting key points of the pigs in the depth image by using a Keypoint-RCNN network;
the key points of the pigs comprise: ear root point 1, anterior elbow point 2, posterior elbow point 3, posterior spine point 5, and caudal root point 4; wherein, the ear root point 1, the anterior elbow point 2, the posterior elbow point 3 and the tail root point 4 are respectively arranged on the left and the right;
step S3, the body size feature data includes: shoulder width, hip width, body height, body length;
the shoulder width is calculated by the distance between two anterior elbow points 2;
the hip width is calculated by the distance between two back elbow points 3;
the height is calculated by the distance of the difference between the height of the posterior ridge point 5 and the height of the ground;
the body length is obtained by the connecting line distance of the connecting line middle points of the two ear root points 1 and the connecting line middle points of the two tail root points 4.
The Keypoint-RCNN network includes: the system comprises a backbone network unit, a region suggestion unit, a region of interest matching unit, a key point detection branch unit, a mask detection branch unit and a frame regression and classification unit;
the method comprises the steps that a Keypoint-RCNN network obtains a depth image of a pig, and a backbone network unit extracts image features from the depth image to obtain a feature map of the depth image; the region suggesting unit extracts the region-of-interest feature maps with different sizes from the feature map; the interesting region matching unit converts the interesting region feature maps with different sizes into an interesting region feature map with a fixed size; the key point monitoring branch unit obtains an ear root point 1, an anterior elbow point 2, a posterior elbow point 3, a posterior spine point 5 and a tail root point 4 on a feature map of an interested area with a fixed size; the mask monitoring branch unit divides the characteristic diagram of the region of interest with fixed size to obtain a division diagram of the contour line of the pig; and the frame regression and classification unit identifies the pig from the region-of-interest feature map with the fixed size and provides other objects.
S3, calculating the body size characteristic data and the overlooking projection area of the pig according to the key points of the pig;
the method for calculating the overlook projection area comprises the following steps: the head and the tail of the pig are divided through key points, the head and the tail of the pig contour line segmentation image obtained by the mask branching unit are removed, and then the area of the rest part in the pig contour line segmentation image is calculated to be used as the overlook projection area.
S4, inputting the pig variety, the body size characteristic data and the overlook projection area into a weight estimation model to obtain the weight data of the pig;
wherein, the weight estimation model in step S4 is established based on a regression model.
The method for establishing the weight estimation model comprises the following steps:
the method comprises the steps of collecting weight data, body size characteristic data, overlooking projection area and pig varieties of pigs to establish a sample library of the pigs, corresponding the characteristics to actually measured weight data to establish a regression model of the pigs, and determining regression coefficients of the regression model of the pigs by using a least square method to obtain an estimated weight model. The regression model includes: a linear regression model, a polynomial regression model, a ridge regression model, a lasso regression model; and (3) testing the weight estimation precision of various regression models in the weight estimation model by using the test set in the sample library to different breeds of pigs, and determining the regression model with the highest precision for each breed of pig.
When the weight estimation model is actually applied, the regression model with the highest precision is determined according to the variety of the pig to be estimated, and the weight estimation model inputs the body size characteristic data and the overlooking projection area into the regression model to obtain the weight data of the pig.
Example 3
A pig weight estimation method based on depth images is shown in figure 1 and comprises the following steps:
s1, obtaining the depth image of the pig taken down and the breed of the pig;
the method for acquiring the depth image comprises the following steps: firstly, a pig is subjected to downward shooting through a depth camera to obtain point cloud data, and then a depth image is generated according to the point cloud data;
when the pig is shot in a depression mode, the depth camera detects the real-time posture of the depth camera through the gyroscope, the depth camera meets the preset shooting visual angle and automatically shoots images, and otherwise, a prompt for adjusting the posture of the depth camera is sent.
S2, extracting key points of the pigs in the depth image by using a Keypoint-RCNN network;
in this embodiment, in step S2, before extracting the key points of the pig in the depth image using the Keypoint-RCNN network, the depth image needs to be segmented to obtain the contour of the pig in the image, and whether the pig in the image is complete is determined, where the segmenting step includes:
s21, carrying out noise reduction processing on the depth image according to a point cloud density filtering noise reduction algorithm to remove noise;
s22, calculating the height difference between the ground and the contour of the back of the pig by a sorting method, identifying the ground part by using the height information and deleting the ground part;
and S23, after the height information converted from the depth information is sequenced, extracting the maximum connected region to obtain the image including the contour of the pig.
In this embodiment, before the key points are extracted, the contour of the pig in the image is segmented, so that whether the pig in the image completely completes picture screening is judged, and it is ensured that the depth image subjected to key point segmentation comprises the complete pig.
The key points of the pigs comprise: ear root point 1, anterior elbow point 2, posterior elbow point 3, posterior spine point 5, and caudal root point 4; wherein, the ear root point 1, the anterior elbow point 2, the posterior elbow point 3 and the tail root point 4 are respectively arranged on the left and the right;
step S3, the body size feature data includes: shoulder width, hip width, body height, body length;
the shoulder width is calculated by the distance between two anterior elbow points 2;
the hip width is calculated by the distance between two back elbow points 3;
the height is calculated by the distance of the difference between the height of the posterior ridge point 5 and the height of the ground;
the body length is obtained by the connecting line distance of the connecting line middle points of the two ear root points 1 and the connecting line middle points of the two tail root points 4.
The Keypoint-RCNN network includes: the system comprises a backbone network unit, a region suggestion unit, a region of interest matching unit, a key point detection branch unit, a mask detection branch unit and a frame regression and classification unit;
the Keypoint-RCNN network structure is shown in FIG. 3, the Keypoint-RCNN network obtains a depth image of a pig, and the backbone network unit extracts image features from the depth image to obtain a feature map of the depth image; the region suggesting unit extracts the region-of-interest feature maps with different sizes from the feature map; the interesting region matching unit converts the interesting region feature maps with different sizes into an interesting region feature map with a fixed size; the key point monitoring branch unit obtains an ear root point 1, an anterior elbow point 2, a posterior elbow point 3, a posterior spine point 5 and a tail root point 4 on a feature map of an interested area with a fixed size; the mask monitoring branch unit divides the characteristic diagram of the region of interest with fixed size to obtain a division diagram of the contour line of the pig; and the frame regression and classification unit identifies the pig from the region-of-interest feature map with the fixed size and provides other objects.
The backbone network unit adopts ResNext.
ResNext is a combination of ResNet and inclusion, on the basis of the inclusion V4, the ResNext simplifies the detail part of the inclusion structure, optimizes the topological structure of each branch, and realizes the characteristics that the parameter quantity is less than the inclusion V4 and the running speed is superior to the inclusion V4. The backbone network unit is used for extracting image characteristics from input original RGBD picture data after network processing.
The region-of-interest matching unit (ROIAlign) uses a bilinear interpolation method to obtain an image numerical value on a pixel point with coordinates of a floating point number.
S3, calculating the body size characteristic data and the overlooking projection area of the pig according to the key points of the pig;
the method for calculating the overlook projection area comprises the following steps: the head and the tail of the pig are divided through key points, the head and the tail of the pig contour line segmentation image obtained by the mask branching unit are removed, and then the area of the rest part in the pig contour line segmentation image is calculated to be used as the overlook projection area.
The head part is the area in front of the connecting line of the left and right ear root points 1 in the pig contour, and the tail part is the area in back of the connecting line of the left and right tail root points 4 in the pig contour.
S4, inputting the pig variety, the body size characteristic data and the overlook projection area into a weight estimation model to obtain the weight data of the pig;
wherein, the weight estimation model in step S4 is established based on a regression model.
The method for establishing the weight estimation model comprises the following steps:
the method comprises the steps of collecting weight data, body size characteristic data, overlooking projection area and pig varieties of pigs to establish a sample library of the pigs, corresponding the characteristics to actually measured weight data to establish a regression model of the pigs, and determining regression coefficients of the regression model of the pigs by using a least square method to obtain an estimated weight model. The regression model includes: a linear regression model, a polynomial regression model, a ridge regression model, a lasso regression model; and (3) testing the weight estimation precision of various regression models in the weight estimation model by using the test set in the sample library to different breeds of pigs, and determining the regression model with the highest precision for each breed of pig.
When the weight estimation model is actually applied, the regression model with the highest precision is determined according to the variety of the pig to be estimated, and the weight estimation model inputs the body size characteristic data and the overlooking projection area into the regression model to obtain the weight data of the pig.
In the embodiment, after the weight data is calculated, the weight data is matched with the RFID of the pig, and is uploaded to the database.
Example 4
A pig weight estimation device comprising: the device comprises a depth camera, a key point extraction module, a body size calculation module and an weight estimation module;
the method comprises the steps of inputting the variety of a pig to be detected, using a depth camera to perform downward shooting on the pig to obtain a depth image, extracting key points of the pig in the depth image by a key point extraction module, calculating body ruler feature data and an overlooking projection area of the pig by the body ruler calculation module by using the key points, and obtaining the weight of the pig by a weight estimation module according to the variety of the pig, the body ruler feature data and the overlooking projection area;
the key point extracting module adopts a Keypoint-RCNN network to extract key points, and the weight estimating module adopts a regression model to estimate weight.
In this embodiment, the pig weight estimation device further comprises a controller and a gyroscope, the gyroscope detects a real-time posture of the depth camera, the controller judges whether a shooting angle of the depth camera meets a preset range through the gyroscope, if not, the controller sends out a correction prompt, and if so, the controller controls the depth camera to shoot images.
An operating personnel utilizes equipment to shoot a pig schematic diagram as shown in figure 2, operating personnel handheld device is directly over the pig, and adjust the shooting angle according to the equipment suggestion, make the shooting angle accord with the preset range, then the automatic image of shooing of equipment, estimate equipment through the pig weight of this embodiment, operating personnel can be at the weight of the direct real-time measurement pig of current aquaculture environment, need not to reform transform aquaculture environment, application scope is wide, and this embodiment adopts the degree of depth camera, can once only obtain the height and width data of the body of pig, the key point extraction rate is fast, the key point position is accurate, the pig weight data of the low error of acquisition that can be fast convenient.

Claims (10)

1. A pig weight estimation method based on a depth image is characterized by comprising the following steps:
s1, obtaining the depth image of the pig taken down and the breed of the pig;
s2, extracting key points of the pigs in the depth image by using a Keypoint-RCNN network;
s3, calculating the body size characteristic data and the overlooking projection area of the pig according to the key points of the pig;
s4, inputting the pig variety, the body size characteristic data and the overlook projection area into a weight estimation model to obtain the weight data of the pig;
wherein, the weight estimation model in step S4 is established based on a regression model.
2. The method for estimating pig body weight based on depth image according to claim 1, wherein the method for obtaining the depth image in step S1 is: firstly, a pig is subjected to downward shooting through a depth camera to obtain point cloud data, and then a depth image is generated according to the point cloud data;
when the pig is shot in a depression mode, the depth camera detects the real-time posture of the depth camera through the gyroscope, the depth camera meets the preset shooting visual angle and automatically shoots images, and otherwise, a prompt for adjusting the posture of the depth camera is sent.
3. The method as claimed in claim 1, wherein the step S2 is to segment the depth image to obtain the pig contour before extracting the key points of the pig in the depth image using the Keypoint-RCNN network, and the step of segmenting includes:
s21, carrying out noise reduction processing on the depth image according to a point cloud density filtering noise reduction algorithm to remove noise;
s22, calculating the height difference between the ground and the contour of the back of the pig by a sorting method, identifying the ground part by using the height information and deleting the ground part;
and S23, after the height information converted from the depth information is sequenced, extracting the maximum connected region to obtain the image including the contour of the pig.
4. The method for pig weight estimation based on depth image according to claim 1, wherein the key points of the pig at step S2 include: ear root point (1), anterior elbow point (2), posterior elbow point (3), posterior spine point (5), and caudal root point (4); wherein the ear root point (1), the front elbow point (2), the back elbow point (3) and the tail root point (4) are respectively arranged on the left and the right;
step S3, the body size feature data includes: shoulder width, hip width, body height, body length;
the shoulder width is calculated by the distance between two front elbow points (2);
the hip width is calculated by the distance between two back elbow points (3);
the height of the body is calculated by the distance of the difference between the height of the back point (5) of the ridge and the height of the ground;
the body length is obtained through the connecting line distance of the connecting line middle points of the two ear root points (1) and the connecting line middle points of the two tail root points (4).
5. The depth image-based pig weight estimation method according to claim 4, wherein the Keypoint-RCNN network of step S2 comprises: the system comprises a backbone network unit, a region suggestion unit, a region of interest matching unit, a key point detection branch unit, a mask detection branch unit and a frame regression and classification unit;
the method comprises the steps that a Keypoint-RCNN network obtains a depth image of a pig, and a backbone network unit extracts image features from the depth image to obtain a feature map of the depth image; the region suggesting unit extracts the region-of-interest feature maps with different sizes from the feature map; the interesting region matching unit converts the interesting region feature maps with different sizes into an interesting region feature map with a fixed size; the key point monitoring branch unit acquires an ear root point (1), an anterior elbow point (2), a posterior elbow point (3), a posterior spine point (5) and a caudal root point (4) on a region-of-interest characteristic diagram with a fixed size; the mask monitoring branch unit divides the characteristic diagram of the region of interest with fixed size to obtain a division diagram of the contour line of the pig; and the frame regression and classification unit identifies the pig from the region-of-interest feature map with the fixed size and provides other objects.
6. The pig weight estimation method based on the depth image as claimed in claim 5, wherein the method for calculating the overlook projection area in step S3 is as follows: the head and the tail of the pig are divided through key points, the head and the tail of the pig contour line segmentation image obtained by the mask branching unit are removed, and then the area of the rest part in the pig contour line segmentation image is calculated to be used as the overlook projection area.
7. The pig weight estimation method based on the depth image according to claim 1, wherein the weight estimation model is established by the following method:
the method comprises the steps of collecting weight data, body size characteristic data, overlooking projection area and pig varieties of pigs to establish a sample library of the pigs, corresponding the characteristics to actually measured weight data to establish a regression model of the pigs, and determining regression coefficients of the regression model of the pigs by using a least square method to obtain an estimated weight model.
8. The method of claim 7, wherein the regression model comprises: a linear regression model, a polynomial regression model, a ridge regression model, a lasso regression model; the regression model corresponding to the different breeds of pigs is determined based on the weight estimation precision of sample data of the different breeds of pigs under each model.
9. The pig weight estimation device for executing the pig weight estimation method based on the depth image according to any one of claims 1 to 8, comprising: the device comprises a depth camera, a key point extraction module, a body size calculation module and an weight estimation module;
the method comprises the steps of inputting the variety of a pig to be detected, using a depth camera to perform downward shooting on the pig to obtain a depth image, extracting key points of the pig in the depth image by a key point extraction module, calculating body ruler feature data and an overlooking projection area of the pig by the body ruler calculation module by using the key points, and obtaining the weight of the pig by a weight estimation module according to the variety of the pig, the body ruler feature data and the overlooking projection area;
the key point extracting module adopts a Keypoint-RCNN network to extract key points, and the weight estimating module adopts a regression model to estimate weight.
10. The pig weight estimation device according to claim 8, further comprising a controller and a gyroscope, wherein the gyroscope detects a real-time posture of the depth camera, the controller judges whether a shooting angle of the depth camera meets a preset range through the gyroscope, if not, the controller sends out a correction prompt, and if so, the controller controls the depth camera to shoot an image.
CN202111258590.4A 2021-10-27 2021-10-27 Pig weight estimation method and device based on depth image Pending CN114170292A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111258590.4A CN114170292A (en) 2021-10-27 2021-10-27 Pig weight estimation method and device based on depth image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111258590.4A CN114170292A (en) 2021-10-27 2021-10-27 Pig weight estimation method and device based on depth image

Publications (1)

Publication Number Publication Date
CN114170292A true CN114170292A (en) 2022-03-11

Family

ID=80477691

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111258590.4A Pending CN114170292A (en) 2021-10-27 2021-10-27 Pig weight estimation method and device based on depth image

Country Status (1)

Country Link
CN (1) CN114170292A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115331266A (en) * 2022-10-17 2022-11-11 天津大学四川创新研究院 Pig unique identification duplicate removal alarm method
CN116452597A (en) * 2023-06-20 2023-07-18 厦门农芯数字科技有限公司 Sow backfat high-precision determination method, system, equipment and storage medium
CN118171784A (en) * 2024-05-14 2024-06-11 正大农业科学研究有限公司 Feed conversion ratio prediction method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115331266A (en) * 2022-10-17 2022-11-11 天津大学四川创新研究院 Pig unique identification duplicate removal alarm method
CN115331266B (en) * 2022-10-17 2023-02-10 天津大学四川创新研究院 Pig unique identification duplicate removal alarm method
CN116452597A (en) * 2023-06-20 2023-07-18 厦门农芯数字科技有限公司 Sow backfat high-precision determination method, system, equipment and storage medium
CN116452597B (en) * 2023-06-20 2023-08-29 厦门农芯数字科技有限公司 Sow backfat high-precision determination method, system, equipment and storage medium
CN118171784A (en) * 2024-05-14 2024-06-11 正大农业科学研究有限公司 Feed conversion ratio prediction method and device

Similar Documents

Publication Publication Date Title
CN114170292A (en) Pig weight estimation method and device based on depth image
CN110426112B (en) Live pig weight measuring method and device
US20230281265A1 (en) Method for estimating body size and weight of pig based on deep learning
CN112950667B (en) Video labeling method, device, equipment and computer readable storage medium
CN109459119B (en) Weight measurement method, device and computer readable storage medium
CN110609037A (en) Product defect detection system and method
US20100224140A1 (en) Method and a System for Measuring an Animal's Height
CN109636779B (en) Method, apparatus and storage medium for recognizing integrated ruler of poultry body
CN110689519B (en) Fog drop deposition image detection system and method based on yolo network
CN111666855B (en) Animal three-dimensional parameter extraction method and system based on unmanned aerial vehicle and electronic equipment
CN105260750B (en) A kind of milk cow recognition methods and system
Banhazi et al. Improved image analysis based system to reliably predict the live weight of pigs on farm: Preliminary results
CN108491807B (en) Real-time monitoring method and system for oestrus of dairy cows
Wang et al. Automated calculation of heart girth measurement in pigs using body surface point clouds
CN112288793B (en) Method and device for detecting backfat of livestock individuals, electronic equipment and storage medium
CN109740659A (en) A kind of image matching method and device, electronic equipment, storage medium
Ruchay et al. Accurate 3d shape recovery of live cattle with three depth cameras
CN113989353A (en) Pig backfat thickness measuring method and system
CN111145205B (en) Pig body temperature detection method based on infrared image under multiple pig scenes
CN115752683A (en) Weight estimation method, system and terminal based on depth camera
CN111814698A (en) Method for detecting calf-protecting behavior of cows in pasturing area based on artificial intelligence and aerial images
CN113180640B (en) Size measuring method and system for livestock breeding
Liu et al. Estimation of weight and body measurement model for pigs based on back point cloud data
CN113706512A (en) Live pig weight measurement method based on deep learning and depth camera
CN110415246B (en) Analysis method of abdomen fat component

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