Method and system for predicting early growth performance of piglets in pig delivery room

Through contactless RGB-D image shooting and AutoGluon-Tabular method, a prediction model of early growth performance of piglets was constructed, which solved the problem of low efficiency of traditional methods and the inability to achieve no manual intervention, and achieved automated and accurate prediction of piglet growth performance.

CN119129845APending Publication Date: 2024-12-13HUAZHONG AGRI UNIV +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411314563.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Traditional animal growth performance prediction methods rely on complex data collection and manual weighing, are inefficient and cannot reflect the growth of animals under different environmental conditions in real time, and it is difficult to achieve fully automatic monitoring and analysis without manual intervention.

Method used

Using contactless RGB-D image shooting, we constructed a piglet individual segmentation model, identification model and weight estimate model, and combined with the AutoGluon-Tabular method, we constructed an early growth performance prediction model to achieve automated and accurate prediction.

Benefits of technology

The growth performance of piglets from birth to before weaning is automated and accurate prediction, which reduces manual intervention and improves prediction accuracy and efficiency. The R2 predicted by the model reaches 0.825, and the RMSE, MAE and MAPE are 0.591kg and 0.426kg respectively. 10.729%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119129845A_ABST
    Figure CN119129845A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for predicting early growth performance of piglets in a pig delivery room. According to the invention, artificial intelligence and deep learning technologies are utilized, based on the RGB image and the depth image of the unconstrained piglet group before weaning in the delivery room fence, the accurate depth information of each piglet is automatically obtained through the piglet individual segmentation and recognition model, so that the weight of the piglet is estimated in a non-contact manner, and the accuracy of the piglet weight estimation is improved. A set of intelligent piglet early-stage growth performance prediction method and system is constructed, the system can automatically obtain the daily growth condition of the piglet, and the growth performance prediction of the piglet before weaning is realized. Compared with the prior art, an effective non-contact solution is provided for early growth performance prediction of the piglets, even if the activity of the piglets in the pigsty is not limited, the growth performance of the piglets at the individual level in the delivery room can be accurately predicted, and by combining with an optimized feeding strategy, the system can remarkably improve the breeding efficiency, reduce the breeding cost and improve the breeding efficiency. And human resource and biological safety are both friendly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of artificial intelligence systems in production, animal husbandry automation, computer vision technology and animal feature recognition technology, and specifically relates to a method and system for predicting the early growth performance of piglets in a pig delivery room. Background Art

[0002] In modern pig farming, evaluating the early growth performance of piglets is crucial to improving the economic benefits of breeding enterprises. Being able to accurately predict the growth dynamic curve of piglets as early as possible is critical for early health intervention and improving feed efficiency. Early growth performance prediction of piglets refers to the use of various technical means to predict the changes in weight of piglets from birth to weaning. By presenting these data and prediction results in a visual form and drawing growth curves, it helps animal husbandry scientists and veterinarians analyze the growth patterns of piglets and predict their growth trends and potential health problems. This method can shorten the research cycle and reduce research costs, thereby optimizing feeding and management strategies and improving breeding efficiency and animal welfare.

[0003] The patent with publication number CN110378505A proposes a weight prediction method. This method combines meteorological data with weight data, uses grey correlation analysis to determine the main meteorological factors affecting weight, and integrates these factors into the traditional growth model in a linear or exponential form. This method is for Sunite sheep aged 0-7 months, taking into account meteorological factors such as wind speed, precipitation, and temperature. The improved model improves the accuracy of weight prediction and provides more scientific weight management and market time decision support for herders and farmers. DOI: 10.1093 / tas / txab006 The study proposed a computer vision system based on RGB-D cameras to predict the weight of non-restricted pigs from images. The system automatically extracts the length, width, and height of the pigs by analyzing the RGB and depth images of the pigs, and estimates the weight accordingly. The study recorded videos and weighed 8 pigs manually every day for 38 days, and developed a Python image processing process to optimize image feature extraction. The experimental results show that this method has a high prediction accuracy for 1 to 4 days of weight prediction in time series cross validation, providing an effective technical means for non-invasive pig weight monitoring. However, both methods require manual intervention in data acquisition, resulting in poor practical application efficiency of the model and the inability to draw a more detailed growth curve.

[0004] A comprehensive analysis of existing technologies shows that most traditional animal growth performance prediction methods rely on complex data collection and manual weighing processes. This method has limitations in data acquisition efficiency and prediction accuracy, and cannot fully reflect the actual growth of animals under different environmental conditions. With the rapid development of computer vision, image processing technology, and machine learning algorithms, especially the breakthroughs of deep learning in the fields of image recognition and pattern recognition, image-based deep learning technology provides a new solution for animal weight prediction. This technology can automatically learn and extract features from a large amount of image data, which not only improves the accuracy and efficiency of prediction, but also reduces the dependence on manual data collection and processing, making real-time monitoring and long-term trend prediction possible. This is of great significance for improving the management efficiency and prediction accuracy of animal husbandry. However, most of the existing animal growth performance prediction methods based on deep learning are still unable to handle livestock in relatively complex feeding scenarios and free-moving states without human intervention. Summary of the invention

[0005] The technical problems to be solved by the present invention include the following aspects. Traditional animal growth performance prediction methods often rely on detailed data collection and manual weighing, which is not only time-consuming and labor-intensive, but also has obvious limitations in the real-time nature of the data and the accuracy of the prediction. These methods are difficult to capture the impact of various complex environmental factors on animals in their natural growth environment. Although animal growth performance prediction models that incorporate deep learning technology have made significant progress in reducing human intervention and improving the degree of prediction automation, they still face challenges in dealing with complex feeding scenarios where animals are in a free-moving state, and it is difficult to fully realize fully automatic monitoring and analysis without human intervention.

[0006] In order to solve the above problems, the present invention provides the following technical solutions, and proposes a method and system for predicting the early growth performance of piglets in a pig delivery room. The specific solution is as follows.

[0007] A method for predicting early growth performance of piglets in a farrowing house, comprising: Step S1, non-contact RGB-D image capture of a group of unrestrained pre-weaned piglets in a farrowing pen, and regular acquisition of RGB and depth images; Step S2, using the RGB image as a data set, constructing a piglet individual segmentation model, and applying the segmentation model to segment and obtain a single piglet RGB image and a background image within the detection frame; Step S3, using the single piglet RGB image as a data set, constructing a piglet individual recognition model, and applying the recognition model to recognize the RGB image of the single piglet to obtain the piglet identity information; Step S4, converting the RGB image of the single piglet obtained by segmentation in step S2 into a depth image to obtain a single piglet depth image, and combining the piglet identity information obtained in step S3 to obtain a single piglet depth image with identity information; Step S5, using the single piglet depth image with identity information obtained in step S4 as a data set, constructing a piglet weight estimation model, and using the weight estimation model to estimate the piglet weight; Step S6, recording the piglet weight and piglet age estimated in step S5, collecting and organizing them in time series as a data set, constructing a piglet early growth performance prediction model, and applying the prediction model to predict the growth performance of piglets from birth to weaning.

[0008] Preferably, in step S1, non-contact RGB-D image capture of the unrestrained pre-weaned piglet group in the farrowing room is performed, which is specifically achieved by the following method: building an RGB-D intelligent monitoring vehicle that can move freely in the farrowing room, and sequentially acquiring RGB and depth images of piglets in multiple pens.

[0009] Preferably, the segmentation model constructed in step S2 is obtained based on the Mask R-CNN network pre-trained on ImageNet.

[0010] Preferably, the recognition model constructed in step S3 is obtained based on a ResNeXt-101 (32x8d) network.

[0011] Preferably, when obtaining the depth image of a single piglet in step S4, the following steps are adopted: Step S41, based on the background image in the detection frame obtained in step S2, mapping it to a depth image, and then selecting the maximum depth value as the vertical distance between the depth camera and the ground; Step S42, subtracting the depth value of each piglet in the depth image from the vertical distance between the depth camera and the ground to obtain the real depth information of the piglet; Step S43, for abnormal values ​​of pixels in the depth image that are less than 0, fill them by summing and averaging the depth values ​​of the surrounding valid pixels, and scale the depth images taken at different positions to the same height according to the nearest neighbor interpolation algorithm to obtain the final corrected depth image of a single piglet.

[0012] Preferably, the step S5 of estimating the weight of the piglet is achieved by the following steps: Step S51, based on the single piglet depth image obtained in step S4 and the actual weighing value of the piglet, construct a piglet weight estimation model based on the ResNeXt-101 (32x8d) network; Step S52, based on the piglet weight estimation model constructed in step S51, weight estimation is performed on multiple depth images of individual piglets of the same identity and age to obtain multiple weight estimation values; Step S53, based on the multiple estimated weight values ​​of the piglets obtained in step S52, calculate the median of the estimated weight values ​​as the final estimated weight value of the piglet at that age.

[0013] Preferably, the step S6 specifically includes the following steps: Step S61, based on the estimated weight data of the piglets for multiple consecutive days from birth to weaning, a growth curve of each piglet is constructed in time series, and this is used as a data set for the piglet early growth performance prediction model; Step S62, randomly dividing the data set constructed in step S61 into a training set and a test set in a ratio of 8:2; Step S63, using the AutoGluon-Tabular method developed based on the automatic machine learning framework to build a piglet early growth performance prediction model, input the piglet weight data of the previous i days, predict the weight on the i+1 day, i∈[3,20], train 18 models, for each model The 5-fold cross-validation method uses AutoGluon's two-layer stacking strategy to predict the weight of piglets at the next time point by integrating multiple regression models, and then evaluates their growth performance. The input-output relationship of the model is as follows: In the formula, It predicts the weight on day i+1 based on the weight on day i. is the weight on day i estimated by the piglet weight estimation model.

[0014] Preferably, constructing the early growth performance prediction model of piglets in step S63 specifically includes the following steps: Step S631: The integration of the model is achieved through weights. The output of each sub-model is multiplied by the corresponding weight, and then the sum is obtained to obtain the final prediction. The mathematical formula is as follows: m is the number of models used, is the weight of the jth model, is the jth sub-model; Step S632, The model weights of the model are adjusted based on the MAPE calculated on the validation set. The model hyperparameters are evaluated and adjusted using MAPE. The MAPE mathematical formula of the model is as follows: 𝑁 is the sample size, is the weight of the sample with index q predicted by the model on the i+1th day, is the corresponding actual weight; Step S633, using five-fold cross validation, The mathematical formula is as follows: is obtained by the k-fold cross validation The MAPE value of the model, It is the average of all MAPE obtained by five-fold cross validation; Step S634, in the inference stage, select the corresponding model for prediction according to the number of days of input data, input the weight data of the previous i days, and use arrive The model weights are used to predict the new input data, and the 18 model weights that have been trained are used to iteratively predict the weight of the new input data from the i+1 day to the weaning weight on the 21st day. , ,…, The mathematical formula is as follows: … .

[0015] The present invention also discloses a system for predicting early growth performance of piglets in a pig delivery room, which adopts the above-mentioned method for predicting early growth performance of piglets in a pig delivery room to predict growth performance. The system includes the following modules: Image acquisition module, used to take non-contact RGB-D images of unrestrained pre-weaned piglets in the farrowing pen, and regularly acquire RGB and depth images; The individual segmentation module is used to construct an individual piglet segmentation model using the RGB image as a data set, and apply the segmentation model to obtain a single piglet RGB image and a background image within the detection frame; An identity information recognition module is used to use the single piglet RGB image as a data set to construct a piglet individual recognition model, and use the recognition model to recognize the RGB image of the single piglet to obtain the piglet identity information; The depth image processing module is used to convert the segmented RGB image of a single piglet into a depth image, obtain a single piglet depth image, and combine the piglet identity information to obtain a single piglet depth image with identity information; The piglet weight estimation module is used to use a single piglet depth image with identity information as a data set to build a piglet weight estimation model, and use the weight estimation model to estimate the piglet weight; The growth performance prediction module is used to record the estimated piglet weight and piglet age together, collect and organize them in time series as a data set, build an early growth performance prediction model for piglets, and use the prediction model to predict the growth performance of piglets from birth to weaning.

[0016] Compared with the prior art, the present invention has at least the following positive technical effects.

[0017] Most of the existing animal growth performance prediction methods are based on data collected by manual or automatic feeding measurement stations. They are not only overly dependent on labor, but also increase the risk of cross-contamination and disease transmission due to contact with animals, and cannot be used to predict piglet growth performance in large-scale breeding scenarios. The present invention proposes an innovative method, which constructs a piglet early growth performance prediction model based on the AutoGluon-Tabular method developed based on the automatic machine learning framework to analyze the estimated piglet weight data in the form of a time series, and integrates multiple regression models through a two-layer stacking strategy to train the piglet early growth performance prediction model and predict its growth curve, thereby realizing the automation and accurate prediction of the growth performance of piglets before weaning. Even if only the piglet weight data estimated 7 days before birth is used, the model predicts the pre-weaning growth performance with an accuracy of 𝑅 2 It reaches 0.825, and the RMSE, MAE, and MAPE are 0.591kg, 0.426kg, and 10.729% respectively.

[0018] Most of the existing methods for obtaining depth information based on RGB-D images require the distance between the camera and the ground to be determined in advance, so as to determine the morphological parameters and live weight of the piglets. However, the depth images of piglets obtained from multiple pens and multiple farms have not yet achieved the accurate and automated measurement function of the distance between the camera and the ground under the existing technical specifications, and it is also difficult to accurately quantify the morphological parameters and live weight of piglets within the standardized scale space framework. The method proposed in the present invention only uses one RGB-D intelligent detection vehicle to non-contactly shoot each unconstrained piglet in the delivery room, surpassing the traditional method's dependence on the artificial preset camera height and the ground height of the piglets, and realizing an automated data collection process. Through algorithm integration, the depth information of the surrounding effective pixels is summed and averaged to fill the data gaps in the imaging process. The nearest neighbor interpolation algorithm is further applied to unify the scale of the depth images obtained from different pens and farms to achieve geometric correction of the image, thereby accurately quantifying the morphological parameters and live weight of a single piglet.

[0019] In the existing field of animal growth performance prediction, traditional models mainly rely on machine learning algorithms or recursive neural networks, which were originally designed for time series prediction tasks such as stock markets and weather forecasts. Therefore, when applied to animal growth performance prediction models that need to process short inputs and long outputs, these methods often produce large prediction errors and poor results. The method proposed in the present invention uses a constructed piglet growth performance prediction model, integrates multiple regression models through a two-layer stacking strategy, and assigns different weights according to the importance of different model training results, so that the piglet growth performance prediction model can automatically screen and learn the optimal results from a variety of regression models and assign weights of different importance to different regression models, ensuring that the model pays more attention to the area in this time series that has an important impact on growth performance prediction when processing the input estimated weight data, so that the model can extract more critical features for growth performance prediction tasks from multidimensional analysis during data processing, thereby reducing prediction errors.

[0020] Most of the existing prediction methods for animal growth performance use a single modeling strategy, and do not optimize the model for a specific prediction task. These regression models are originally intended to reveal the correlation between one or more independent variables and the dependent variable. Therefore, they are limited in processing continuous time series data for a single individual, and it is difficult to achieve long-term multi-point prediction of animal growth performance. When constructing a prediction model for early growth performance of piglets, the present invention introduces the concept of iterative prediction, and jointly constructs a model by different input data and corresponding target output data, so as to expand the weight prediction of a single time point into a multi-point prediction of a continuous time series. That is, for a period of time series data input of the estimated weight of piglets, the time series weight data of all days in the future until weaning are predicted, so as to comprehensively evaluate their growth performance. In addition, the model uses a random input time series length function in the prediction process, which enhances the adaptability of the model to different individuals and time series data of different lengths, and improves the generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 The present invention is a flow chart of the method for predicting early growth performance of piglets.

[0022] Figure 2 The segmentation of the present invention obtains a single piglet RGB image and a background image rendering within the detection frame.

[0023] Figure 3 This is a depth image rendering of a single piglet with identity information according to the present invention.

[0024] Figure 4 This is a network structure diagram of the piglet weight estimation model constructed in the present invention.

[0025] Figure 5This is a network structure diagram of the early growth performance prediction model for piglets constructed in the present invention.

[0026] Figure 6 This is a visual prediction effect diagram of the estimated weight of the piglets 7 days before birth and the growth performance before weaning.

[0027] Figure 7 This is a flow chart of the early growth performance prediction system for piglets of the present invention. DETAILED DESCRIPTION

[0028] The present invention is further described below in conjunction with the accompanying drawings and implementation examples.

[0029] The present invention discloses a method for predicting the early growth performance of piglets in a pig delivery room. Figure 1 The flowchart shown is a method for predicting early growth performance of piglets in a farrowing house provided in this embodiment, which includes the following steps.

[0030] Step S1, non-contact RGB-D image capture of a group of unrestrained pre-weaned piglets in a farrowing pen, and regular acquisition of RGB and depth images; Specifically, the steps of non-contact RGB-D image capture of the unrestrained pre-weaned piglet group in the farrowing room in step S1 are as follows: (1) Building a data acquisition platform, the data acquisition hardware platform obtains piglet images by installing an RGB-D camera on an intelligent detection vehicle, developing a matching software algorithm for the data acquisition hardware platform, and integrating the pyrealsense2 library to develop an image acquisition program based on the Python programming language; (2) Selecting 373 purebred Large White piglets from 31 farrowing beds by random sampling for image and weight collection; (3) Among them, 216 piglets from 17 farrowing beds were imaged every three days for the construction of a piglet weight estimation model, and 157 piglets from 14 farrowing beds were imaged every day for the construction of a piglet growth performance prediction model.

[0031] Step S2, using the RGB image as a data set, constructing a piglet individual segmentation model, and applying the segmentation model to segment a single piglet RGB image and its background image in the detection frame. The effect of segmenting a single piglet RGB image and its background image in the detection frame is shown in the following example: Figure 2 As shown; Specifically, the steps of constructing the piglet segmentation model in step S2 are as follows: (1) Apply data augmentation techniques including RandomHorizontal Flip and Color Jitter to enhance the generalization ability of the model; (2) Construct a piglet segmentation model based on the Mask R-CNN network. ImageNet pre-training is used in the initial stage of training the piglet segmentation model to take advantage of transfer learning; (3) The model is further trained using the RGB image dataset in the fine-tuning stage of training to complete the piglet segmentation task; (4) The following hyperparameter settings are adopted: the weight file of resnet50 transferred from ImageNet is used, the first three layers are fixed, the optimizer is SGD, the momentum parameter is set to 0.9, and the weight decay parameter is 0.0001. The initial learning rate is set to 0.01 and is halved at the 50th, 100th, 200th, and 400th epochs during training to achieve effective learning rate scheduling. The entire training process lasted 600 epochs, and the batch size was set to 16.

[0032] In order to objectively evaluate the accuracy of the individual piglet segmentation of the present invention, this exemplary embodiment calculated the Intersection over Union (IoU) of the model pixel-level segmentation and manual pixel-level annotation of piglets from birth to weaning. The results show that even when the confidence of the model is set to 99%, the IoU of the test set reaches 82.75%, indicating that there is a high similarity between the model segmentation and the manual annotation segmentation, and the segmentation result is more consistent with the actual size of the piglets and their position in the image. This shows that the individual piglet segmentation of the present invention has a high accuracy.

[0033] Specifically, the steps for obtaining the single piglet RGB image and the background image within the detection frame in step S2 are as follows: (1) when the piglet individual segmentation model segments the RGB image, the position coordinates of the piglet detection frame in the single piglet RGB image are obtained; (2) the piglets within the piglet detection frame are segmented to obtain the background image within the single piglet detection frame.

[0034] Step S3, using the single piglet RGB image as a data set, constructing a piglet individual recognition model, and applying the recognition model to recognize the RGB image of the single piglet to obtain the piglet identity information; Specifically, the steps for constructing the piglet individual recognition model in step S3 are as follows: (1) Data augmentation techniques including Gaussian noise, Random Crop, Random Horizontal Flip, Random Vertical Flip and Color Jitter are applied to enhance the generalization ability of the model; (2) All images are standardized before being input into the model; (3) The piglet individual recognition model is constructed based on the ResNeXt-101 (32x8d) network, and the model is trained by training from scratch; (4) The following hyperparameter settings are adopted: Adam is selected as the optimizer, the learning rate is set to 0.0001, the training rounds are 100, and the batch size is set to 32.

[0035] In order to objectively evaluate the accuracy of individual piglet identification of the present invention, this exemplary embodiment calculated the accuracy of model identification of piglets from birth to pre-weaning and manual identification of piglets, and calculated the accuracy of each classification separately to ensure that the piglet number identification of each category is accurate. The results show that even if the confidence of the model is set to 99%, the accuracy of the test set reaches 97.95%, indicating that there is a high similarity between model identification and manual identification, indicating that the identification results are more consistent with the actual number of piglets.

[0036] Step S4, converting the single piglet RGB image obtained by segmentation in step S2 into a depth image, obtaining a single piglet depth image, and combining it with the piglet identity information obtained in step S3 to obtain a single piglet depth image with identity information. An example of a single piglet depth image with identity information is as follows: Figure 3 As shown; Specifically, the steps of processing the single piglet depth image in step S4 are as follows: (1) The mask of the single piglet RGB image segmented in step S2 and the position coordinates of the piglet detection frame correspond to the depth image, and the single piglet depth image and the depth image of the background area in the piglet detection frame are obtained; (2) The abnormal values ​​less than 0 in the background area in the piglet detection frame in the depth image are removed, and the maximum value of the top 10% in the background area is found. If the difference between these 10% values ​​is within 30 mm, the average value of these values ​​is taken as the vertical distance between the depth camera and the ground. If the difference exceeds 30 mm, the average value of these values ​​is taken as the vertical distance between the depth camera and the ground. If the value is greater than 30 mm, the maximum value in the top 5% is selected and the process is repeated until the difference between these values ​​is within 30 mm; (3) the outliers in the depth image of a single piglet are corrected by summing the adjacent nearest pixels with depth values ​​greater than 0 and taking the average as the missing depth information value; (4) the images of different depth cameras at different vertical distances from the ground are scaled to the same height to deal with the image distortion problem caused by the difference in distance between the piglet and the camera. All depth images are scaled to the same camera height using the nearest neighbor interpolation method.

[0037] Step S5, using the single piglet depth image with identity information obtained in step S4 as a data set, constructing a piglet weight estimation model, and using the weight estimation model to estimate the piglet weight, wherein the network structure of the constructed piglet weight estimation model is as follows: Figure 4 As shown; Specifically, the steps for constructing the piglet weight estimation model in step S5 are as follows: (1) The original three-channel image input architecture is designed to be a network architecture that can process single-channel images; (2) A regression head is designed in the output layer to map the feature vector extracted by the network to the predicted value of the pig weight; (3) The following hyperparameter settings are adopted: SGD is used as the optimizer, the momentum parameter is set to 0.9, the weight decay parameter is 0.00005, the cosine learning rate scheduler is used to dynamically adjust the learning rate, and the mean square error (MSE) is used as the loss function for model training. (4) Based on individual information, a single piglet depth image of the same individual and the same age is obtained, and its median weight is calculated to determine the final estimated weight of the model.

[0038] In order to objectively evaluate the accuracy of the piglet weight estimation of the present invention, the present exemplary embodiment calculated the mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), correlation coefficient (𝑟) and determination coefficient (𝑅) of the piglet weight identified by the model from birth to weaning and manual weighing. 2 ), the results show that the model's MSE, RMSE, MAE, MAPE, 𝑟, 𝑅 2 0.267kg respectively 2 , 0.517kg, 0.36kg, 12.576%, 0.94 and 0.88, indicating that there is a high similarity between the model-estimated weight and manual weighing, indicating that the weight estimation results are more consistent with the actual weight of the piglets.

[0039] Step S6, recording the piglet weight and piglet age estimated in step S5, collecting and arranging them in time series as a data set, constructing a piglet early growth performance prediction model, and applying the prediction model to predict the growth performance of piglets from birth to weaning. The network structure of the constructed piglet early growth performance prediction model is as follows: Figure 4 shown.

[0040] Specifically, the steps for constructing the early growth performance prediction model of piglets in step S6 are as follows: (1) The AutoGluon-Tabular method developed based on the automatic machine learning framework is used to construct the early growth performance prediction model of piglets, and the weight of piglets at multiple future time points is predicted by integrating multiple regression models; (2) The input is the piglet weight data of the previous i days, and the goal is to predict the weight on the 𝑖 + 1 day, i∈[3,20], a total of 18 models were trained; (3) Based on the 5-fold cross-validation method, the two-layer stacking strategy of AutoGluon was used to train the model Mi-2 through the ensemble selection method; (4) An automatic hyperparameter adjustment strategy was adopted, the maximum number of trials was set to 50, the hyperparameter learning rate of the neural network model was searched in the range of 10-4 to 10-2 on a logarithmic scale, the activation function was selected from relu, softrelu and tanh, and the dropout probability was searched between 0.0 and 0.5. In addition, the number of training cycles was fixed to 100. For the gradient boosting tree model, the number of rounds was set to 50, and the number of leaf nodes of the tree was searched between 26 and 66; (5) Based on the 18 models and the piglet weight data of random days, the growth performance of piglets from birth to weaning was iteratively predicted, and the growth curve of piglets was plotted to visualize the prediction results. The visualization prediction effect of predicting the growth performance before weaning using only the estimated weight of piglets 7 days before birth is shown in the following example. Figure 6 shown.

[0041] In order to objectively evaluate the accuracy of the prediction of the early growth performance of piglets of the present invention, the present exemplary embodiment calculated the mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), correlation coefficient (𝑟) and determination coefficient (𝑅2) of the model identifying the weight of piglets from birth to weaning and manual weighing. The results showed that when the model only used the weight of the first 7 days to predict the weaning weight on the 21st day, the MSE, RMSE, MAE, MAPE, 𝑟, 𝑅 2 0.846 kg respectively 2 , 0.92 kg, 0.754 kg, 15.399%, 0.856, 0.626, MSE, RMSE, MAE, MAPE, 𝑟 and 𝑅 when predicting the pre-weaning growth curve 2 0.349 kg respectively 2 , 0.591 kg, 0.426 kg, 10.729%, 0.918, 0.825. This indicates that there is a high degree of similarity between the early growth performance of piglets predicted by the model and the actual early growth performance, indicating that the prediction results of the early growth performance of piglets are more consistent with the actual growth of piglets.

[0042] The present invention also discloses a system for predicting early growth performance of piglets in a pig delivery room. Figure 7 The flowchart of a system for predicting early growth performance of piglets in a farrowing house provided by this embodiment is shown. The system includes the following modules: Image acquisition module, used to take non-contact RGB-D images of unrestrained pre-weaned piglets in the farrowing pen, and regularly acquire RGB and depth images; The individual segmentation module is used to construct an individual piglet segmentation model using the RGB image as a data set, and apply the segmentation model to obtain a single piglet RGB image and a background image within the detection frame; An identity information recognition module is used to use the single piglet RGB image as a data set to construct a piglet individual recognition model, and use the recognition model to recognize the RGB image of the single piglet to obtain the piglet identity information; The depth image processing module is used to convert the segmented RGB image of a single piglet into a depth image, obtain a single piglet depth image, and combine the piglet identity information to obtain a single piglet depth image with identity information; The piglet weight estimation module is used to use a single piglet depth image with identity information as a data set to build a piglet weight estimation model, and use the weight estimation model to estimate the piglet weight; The growth performance prediction module is used to record the estimated piglet weight and piglet age together, collect and organize them in time series as a data set, build an early growth performance prediction model for piglets, and use the prediction model to predict the growth performance of piglets from birth to weaning.

[0043] The specific examples described in the application are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific examples described in the present invention, or replace them in a similar manner, but they will not deviate from the spirit of the present invention or exceed the scope defined by the attached claims.

Claims

1. A method for predicting early growth performance of piglets in a farrowing house, characterized in that: include: Step S1, non-contact RGB-D image capture of a group of unrestrained pre-weaned piglets in a farrowing pen, and regular acquisition of RGB and depth images; Step S2, using the RGB image as a data set, constructing a piglet individual segmentation model, and applying the segmentation model to segment and obtain a single piglet RGB image and a background image within the detection frame; Step S3, using the single piglet RGB image as a data set, constructing a piglet individual recognition model, and applying the recognition model to recognize the RGB image of the single piglet to obtain the piglet identity information; Step S4, converting the RGB image of the single piglet obtained by segmentation in step S2 into a depth image to obtain a single piglet depth image, and combining the piglet identity information obtained in step S3 to obtain a single piglet depth image with identity information; Step S5, using the single piglet depth image with identity information obtained in step S4 as a data set, constructing a piglet weight estimation model, and using the weight estimation model to estimate the piglet weight; Step S6, recording the piglet weight and piglet age estimated in step S5, collecting and organizing them in time series as a data set, constructing a piglet early growth performance prediction model, and applying the prediction model to predict the growth performance of piglets from birth to weaning.

2. The method for predicting early growth performance of piglets in a pig delivery room according to claim 1, characterized in that: In step S1, non-contact RGB-D image capture of the unrestrained pre-weaned piglet group in the farrowing room is performed, which is specifically achieved in the following way: building an RGB-D intelligent monitoring vehicle that can move freely in the farrowing room, and sequentially acquiring RGB and depth images of piglets in multiple pens.

3. The method for predicting early growth performance of piglets in a pig delivery room according to claim 1, characterized in that: The segmentation model constructed in step S2 is obtained based on the Mask R-CNN network pre-trained on ImageNet.

4. The method for predicting early growth performance of piglets in a pig delivery room according to claim 1, characterized in that: The recognition model constructed in step S3 is obtained based on the ResNeXt-101 (32x8d) network.

5. The method for predicting early growth performance of piglets in a pig delivery room according to claim 1, characterized in that: When obtaining a single piglet depth image in step S4, the following steps are adopted: Step S41, based on the background image in the detection frame obtained in step S2, mapping it to a depth image, and then selecting the maximum depth value as the vertical distance between the depth camera and the ground; Step S42, subtracting the depth value of each piglet in the depth image from the vertical distance between the depth camera and the ground to obtain the real depth information of the piglet; Step S43, for abnormal values ​​of pixels in the depth image that are less than 0, fill them by summing and averaging the depth values ​​of the surrounding valid pixels, and scale the depth images taken at different positions to the same height according to the nearest neighbor interpolation algorithm to obtain the final corrected depth image of a single piglet.

6. The method for predicting early growth performance of piglets in a pig delivery room according to claim 1, characterized in that: The weight of the piglets is estimated in step S5 by the following steps: Step S51, based on the single piglet depth image obtained in step S4 and the actual weighing value of the piglet, construct a piglet weight estimation model based on the ResNeXt-101 (32x8d) network; Step S52, based on the piglet weight estimation model constructed in step S51, weight estimation is performed on multiple depth images of individual piglets of the same identity and age to obtain multiple weight estimation values; Step S53, based on the multiple estimated weight values ​​of the piglets obtained in step S52, calculate the median of the estimated weight values ​​as the final estimated weight value of the piglet at that age.

7. The method for predicting early growth performance of piglets in a pig delivery room according to claim 1, characterized in that: The step S6 specifically includes the following steps: Step S61, based on the estimated weight data of the piglets for multiple consecutive days from birth to weaning, a growth curve of each piglet is constructed in time series, and this is used as a data set for the piglet early growth performance prediction model; Step S62, randomly dividing the data set constructed in step S61 into a training set and a test set in a ratio of 8:2; Step S63, using the AutoGluon-Tabular method developed based on the automatic machine learning framework to build a piglet early growth performance prediction model, input the piglet weight data of the previous i days, predict the weight on the i+1 day, i∈[3,20], train 18 models, for each model The 5-fold cross-validation method uses AutoGluon's two-layer stacking strategy to predict the weight of piglets at the next time point by integrating multiple regression models, and then evaluates their growth performance. The input-output relationship of the model is as follows: In the formula, It predicts the weight on day i+1 based on the weight on day i. is the weight on day i estimated by the piglet weight estimation model.

8. The method for predicting early growth performance of piglets in a farrowing house according to claim 7, characterized in that: The step S63 of constructing the early growth performance prediction model of piglets specifically includes the following steps: Step S631: The integration of the model is achieved through weights. The output of each sub-model is multiplied by the corresponding weight, and then the sum is obtained to obtain the final prediction. The mathematical formula is as follows: Where m is the number of models used, is the weight of the jth model, is the jth sub-model; Step S632, The model weights of the model are adjusted based on the MAPE calculated on the validation set. The model hyperparameters are evaluated and adjusted using MAPE. The MAPE mathematical formula of the model is as follows: 𝑁 is the sample size, is the weight of the sample with index 𝑞 predicted by the model on day 𝑖+1, is the corresponding actual weight; Step S633, using five-fold cross validation, The mathematical formula is as follows: is obtained by the k-fold cross validation The MAPE value of the model, It is the average of all MAPE obtained by five-fold cross validation; Step S634, in the inference stage, select the corresponding model for prediction according to the number of days of input data, input the weight data of the previous i days, and use arrive The model weights are used to predict the new input data, and the 18 model weights that have been trained are used to iteratively predict the weight of the new input data from the i+1 day to the weaning weight on the 21st day. , , … , The mathematical formula is as follows: …… 。 9. A system for predicting early growth performance of piglets in a pig delivery room, which adopts the method for predicting early growth performance of piglets in a pig delivery room as claimed in any one of claims 1 to 8 to predict growth performance, characterized in that: The system includes the following modules: Image acquisition module, used to take non-contact RGB-D images of unrestrained pre-weaned piglets in the farrowing pen, and regularly acquire RGB and depth images; The individual segmentation module is used to construct an individual piglet segmentation model using the RGB image as a data set, and apply the segmentation model to obtain a single piglet RGB image and a background image within the detection frame; An identity information recognition module is used to use the single piglet RGB image as a data set to construct a piglet individual recognition model, and use the recognition model to recognize the RGB image of the single piglet to obtain the piglet identity information; The depth image processing module is used to convert the segmented RGB image of a single piglet into a depth image, obtain a single piglet depth image, and combine the piglet identity information to obtain a single piglet depth image with identity information; The piglet weight estimation module is used to use a single piglet depth image with identity information as a data set to build a piglet weight estimation model, and use the weight estimation model to estimate the piglet weight; The growth performance prediction module is used to record the estimated piglet weight and piglet age together, collect and organize them in time series as a data set, build an early growth performance prediction model for piglets, and use the prediction model to predict the growth performance of piglets from birth to weaning.

Citation Information

Patent Citations

  • Weaned piglet target tracking method based on deep learning

    CN111709287A

  • Live pig asset checking method, system and equipment based on machine vision

    CN118521252A

  • A Method of providing information sharing service for infants and toddlers and a system implementing the same

    KR1020230010145A

  • A system for weighing livestock using depth vision sensor

    KR102380879B1