Search

CN-121982473-A - Synchronous reasoning method and device for pig weight and body type

CN121982473ACN 121982473 ACN121982473 ACN 121982473ACN-121982473-A

Abstract

The embodiment of the application provides a synchronous reasoning method and device for pig weight and body type, the method comprises the steps of synchronously acquiring depth images and RGB images of live pigs, respectively inputting the depth images and the RGB images into an improved weight reasoning convolutional neural network and a body type reasoning convolutional neural network, wherein the weight reasoning network extracts three-dimensional features based on PointNet ++ architecture to predict the body weight, the body type reasoning network extracts appearance features based on ResNet embedded with an attention mechanism to judge the body type grade, and outputting the comprehensive grade of the live pigs after calibrating and mapping the predicted body weight result and the body type grade.

Inventors

  • Ju Tiezhu
  • ZENG QINGYUAN
  • YU NA
  • HUANG PING

Assignees

  • 北京小龙潜行科技有限公司

Dates

Publication Date
20260505
Application Date
20251229

Claims (10)

  1. 1. A method for synchronously reasoning the weight and the body type of a pig, which is characterized by comprising the following steps: Synchronously acquiring a depth image and an RGB image of a pig, preprocessing the depth image and the RGB image, and determining preprocessed depth image data and preprocessed RGB image data; Inputting the preprocessed depth image data into a set weight reasoning convolutional neural network, wherein the weight reasoning convolutional neural network adopts an improved three-dimensional point cloud neural network, determines corresponding three-dimensional morphological characteristics of pigs through multi-layer sampling operation, multi-layer grouping operation and multi-layer aggregation operation, and outputs a pig weight prediction value; Inputting the preprocessed RGB image data into a set body type reasoning convolutional neural network, wherein the body type reasoning convolutional neural network adopts an improved deep convolutional neural network, and a attention mechanism module is embedded in the neural network to determine corresponding pig body type key characteristics and output corresponding pig body type grade probability distribution; And carrying out linear calibration adjustment on the pig weight predicted value according to the historical slaughter actual measurement weight data, determining a corresponding pig weight value, determining a corresponding pig body type grade according to the grade with the highest probability in the pig body type grade probability distribution, mapping the pig weight value and the pig body type grade to a preset pig grade table, and completing synchronous reasoning of pig weight and body type.
  2. 2. The method for synchronously reasoning about weight and body type of a pig according to claim 1, wherein the preprocessing the depth image and the RGB image to determine preprocessed depth image data and preprocessed RGB image data comprises: Performing median filtering on the depth image to remove noise, extracting a depth mask of a live pig region through background subtraction, converting pixels in the depth mask into three-dimensional point cloud data by utilizing camera internal parameters, and determining corresponding preprocessed depth image data; And performing color correction on the RGB image, extracting RGB sub-images corresponding to the live pig region by utilizing the coordinate alignment relation between the RGB image and the depth image, and determining corresponding preprocessed RGB image data.
  3. 3. The method for synchronously reasoning about weight and body shape of pigs according to claim 1, wherein the multi-layer sampling operation comprises: Constructing 3 sampling layers, wherein each sampling layer adopts a furthest point sampling algorithm; and respectively sampling 1024, 256 and 64 core points through the sampling layers, and determining a corresponding core point set layer by layer.
  4. 4. The method for synchronously reasoning about weight and body shape of pigs according to claim 3, wherein the multi-layer grouping operation comprises: constructing 3 grouping layers, wherein each grouping layer adopts a ball query algorithm; And carrying out radius search on the core point set by taking each core point as a center through the grouping layer to determine a corresponding local neighborhood point set, wherein the search radius of each grouping layer is 0.3m, 0.2m and 0.1m respectively.
  5. 5. The method for synchronously inferring weight and body shape of pigs according to claim 4, wherein the multi-layer aggregation operation comprises: constructing 3 aggregation layers, wherein each aggregation layer comprises 21×1 convolution kernels, batchNorm layers and a ReLU activation function; And carrying out local three-dimensional feature extraction on each local neighborhood point set through the aggregation layer, and aggregating the three-dimensional local features subjected to feature extraction into global feature vectors, wherein the global feature vectors represent the whole three-dimensional form of the pig.
  6. 6. The method for synchronously reasoning the body weight and the body shape of the pig according to claim 1, wherein the body shape reasoning convolutional neural network adopts an improved deep convolutional neural network, and the corresponding key characteristics of the body shape of the pig are determined by embedding an attention mechanism module in the neural network, and the method comprises the following steps: The characteristic extraction network of the body type reasoning convolutional neural network adopts an improved ResNet network structure, and the improved ResNet network structure is obtained by replacing the first 3 layers of convolution kernels of the original ResNet network structure according to a preset 3×3 small convolution kernel; And a CBAM attention module is embedded behind a4 th convolution block of a convolution layer of the body type reasoning convolution neural network, wherein the CBAM attention module comprises a channel attention sub-module and a space attention sub-module and is used for weighting the channel dimension and the space dimension of the pig feature map and determining the corresponding key characteristics of the pig body type.
  7. 7. The method for synchronously reasoning the weight and the body type of the pig according to claim 1, wherein the step of linearly calibrating and adjusting the predicted weight value of the pig according to the historical slaughter actual measurement weight data to determine the corresponding weight value of the pig comprises the following steps: a calibration sample set is constructed through a pig weight predicted value in a preset historical time period and slaughter actual measurement weight data in the corresponding historical time period; Performing linear regression analysis on the calibration sample set, determining a corresponding calibration coefficient, and establishing a linear calibration model according to the calibration coefficient; and inputting the pig weight predicted value into the linear calibration model, and determining a corresponding calibrated pig weight value.
  8. 8. A synchronous reasoning device for pig weight and body type, characterized in that the device comprises: the data preprocessing module is used for synchronously acquiring a depth image and an RGB image of a pig, preprocessing the depth image and the RGB image and determining preprocessed depth image data and preprocessed RGB image data; The weight prediction module is used for inputting the preprocessed depth image data into a set weight reasoning convolutional neural network, wherein the weight reasoning convolutional neural network adopts an improved three-dimensional point cloud neural network, determines corresponding three-dimensional morphological characteristics of pigs through multi-layer sampling operation, multi-layer grouping operation and multi-layer aggregation operation, and outputs a weight prediction value of the pigs; The body type prediction module is used for inputting the preprocessed RGB image data into a set body type reasoning convolutional neural network, the body type reasoning convolutional neural network adopts an improved deep convolutional neural network, a attention mechanism module is embedded in the neural network to determine corresponding pig body type key characteristics, and corresponding pig body type grade probability distribution is output; The data calibration module is used for carrying out linear calibration adjustment on the pig weight predicted value according to the historical slaughter actual measurement weight data, determining a corresponding pig weight value, determining a corresponding pig body type grade according to the grade with the highest probability in the pig body type grade probability distribution, mapping the pig weight value and the pig body type grade to a preset pig body type grade table, and completing synchronous reasoning of pig weight and body type.
  9. 9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor performs the steps of the method for synchronously inferring weight and body shape of pigs as claimed in any one of claims 1 to 7 when the program is executed.
  10. 10. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the method for synchronously reasoning about body weight and body shape of pigs according to any one of claims 1 to 7.

Description

Synchronous reasoning method and device for pig weight and body type Technical Field The application relates to the field of data processing, in particular to a method and a device for synchronously reasoning the weight and the body type of pigs. Background In the livestock slaughtering industry, screening and grading of live pigs are key links for ensuring product quality, meeting customer requirements and improving economic benefits. Traditionally, slaughterhouses have been screened to determine slaughter sequences after receiving the pigs according to the specific requirements of the purchasing customer for the weight range and body type characteristics of the live pigs. The process is usually completed by naked eye observation and manual estimation by experienced staff, but has obvious technical defects and limitations, including strong subjectivity of manual screening, inconsistent body type judgment standards, lack of uniformity and objectivity, influence on fairness of grading results, low manual screening rate, long screening time of single-head pigs, difficulty in adapting to batch screening requirements of a large-scale slaughterhouse and the like. Aiming at the defects of the existing manual screening technology, a synchronous pig weight and body type reasoning method is needed, and the accuracy and efficiency of pig weight and body type reasoning can be improved. Disclosure of Invention Aiming at the problems in the prior art, the application provides a synchronous pig weight and body type reasoning method and device, which can improve the accuracy and efficiency of pig weight and body type reasoning. In order to solve at least one of the problems, the application provides the following technical scheme: In a first aspect, the application provides a method for synchronously reasoning the weight and the body type of pigs, which comprises the following steps: Synchronously acquiring a depth image and an RGB image of a pig, preprocessing the depth image and the RGB image, and determining preprocessed depth image data and preprocessed RGB image data; Inputting the preprocessed depth image data into a set weight reasoning convolutional neural network, wherein the weight reasoning convolutional neural network adopts an improved three-dimensional point cloud neural network, determines corresponding three-dimensional morphological characteristics of pigs through multi-layer sampling operation, multi-layer grouping operation and multi-layer aggregation operation, and outputs a pig weight prediction value; Inputting the preprocessed RGB image data into a set body type reasoning convolutional neural network, wherein the body type reasoning convolutional neural network adopts an improved deep convolutional neural network, and a attention mechanism module is embedded in the neural network to determine corresponding pig body type key characteristics and output corresponding pig body type grade probability distribution; And carrying out linear calibration adjustment on the pig weight predicted value according to the historical slaughter actual measurement weight data, determining a corresponding pig weight value, determining a corresponding pig body type grade according to the grade with the highest probability in the pig body type grade probability distribution, mapping the pig weight value and the pig body type grade to a preset pig grade table, and completing synchronous reasoning of pig weight and body type. Further, the preprocessing the depth image and the RGB image to determine preprocessed depth image data and preprocessed RGB image data includes: Performing median filtering on the depth image to remove noise, extracting a depth mask of a live pig region through background subtraction, converting pixels in the depth mask into three-dimensional point cloud data by utilizing camera internal parameters, and determining corresponding preprocessed depth image data; And performing color correction on the RGB image, extracting RGB sub-images corresponding to the live pig region by utilizing the coordinate alignment relation between the RGB image and the depth image, and determining corresponding preprocessed RGB image data. Further, the multi-layer sampling operation includes: Constructing 3 sampling layers, wherein each sampling layer adopts a furthest point sampling algorithm; and respectively sampling 1024, 256 and 64 core points through the sampling layers, and determining a corresponding core point set layer by layer. Further, the multi-layer grouping operation includes: constructing 3 grouping layers, wherein each grouping layer adopts a ball query algorithm; And carrying out radius search on the core point set by taking each core point as a center through the grouping layer to determine a corresponding local neighborhood point set, wherein the search radius of each grouping layer is 0.3m, 0.2m and 0.1m respectively. Further, the multi-layer polymerization operation includes: constructing 3 aggregation