Living animal measuring method and device
Through deep learning algorithms, analyzing the side images and shooting distances of living animals is achieved, contactless and automated weight prediction is solved, and the traditional weighing methods are low efficiency, high cost and high psychological pressure are provided, providing an efficient, accurate and real-time weight monitoring solution.
Patent Information
- Application Number
- CN202411864277.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-22
AI Technical Summary
Traditional live animal weighing methods have problems such as low efficiency, high cost, high psychological pressure on animals and difficulty in detecting weight changes in real time in the wild.
By obtaining the side images and shooting distance of living animals, inputting preset training weighing estimate models, and using deep learning algorithms to analyze body shape characteristics to achieve contactless and automated weight prediction.
It realizes efficient, accurate and real-time prediction of the weight of living animals, simplifies the measurement process, reduces operational complexity and cost, and reduces the psychological pressure of animals.
Smart Images

Figure CN119860830A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to but is not limited to measurement technology, and in particular to a method and device for measuring living animals. Background Art
[0002] In modern ranches, weighing is one of the key links in management and production. It is not only used to evaluate the health status of live animals such as sheep on the ranch, but also to measure production performance and determine market value. However, traditional weighing methods have many disadvantages. First, when sheep enter an unfamiliar weighing station, they may experience psychological stress and anxiety due to environmental changes, which will affect their physical condition and quality. Secondly, the weighing process consumes a lot of time and human resources, especially in large-scale farms. This method is inefficient and costly. In addition, weighing facilities usually require large site support and have low mobility, making it difficult to detect changes in sheep weight in real time in the field environment.
[0003] How to measure the weight of living animals easily, easily and accurately is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a method and device for measuring living animals, which can easily and accurately measure living animals.
[0005] The present application embodiment provides a living animal measurement method, comprising:
[0006] Obtain side-on images of live animals;
[0007] The obtained side image and the shooting distance when obtaining the side image are input into a preset trained weighing estimation model to obtain the weight of the living animal; wherein the weighing estimation model is obtained by training with the side area and body size data of the living animal as input and the weight of the living animal as output.
[0008] In an exemplary embodiment, the method further includes generating the weighing estimation model:
[0009] Acquire lateral images of multiple live animal specimens;
[0010] Extracting contour data from the obtained side images respectively and calculating body size data of living animal samples;
[0011] Calculating the lateral area of the living animal sample based on the extracted contour data and the shooting information including the shooting distance when the lateral image is acquired;
[0012] The lateral area and body size data of the living animal sample are used as input of the weight estimation mathematical model, the weight of the living animal sample is used as output of the weight estimation mathematical model, and the parameters of the weight estimation mathematical model are trained to obtain the weight estimation model.
[0013] In an exemplary embodiment, extracting contour data from the obtained side images respectively includes:
[0014] The acquired side image is input into an image processing model for processing, and its side contour area is extracted to obtain the contour data of the side image.
[0015] In an exemplary embodiment, the method further includes: using an image segmentation algorithm to process the side image to distinguish between the background and foreground in the side image.
[0016] In an exemplary instance, the image processing model includes a mask region convolutional neural network model.
[0017] In an exemplary embodiment, calculating the body size data of a living animal sample includes:
[0018] According to the side image processed by the image segmentation algorithm, the body size pixel number L is extracted q ;
[0019] Calculate the pixel resolution P according to the shooting distance and shooting equipment parameters GSD , pixel resolution P GSD The calculation of is as follows: Among them, D x Indicates the shooting distance, S w Indicates the actual width of the sensor, IM w Indicates the image pixel width, F r Indicates the actual focal length of the shooting device;
[0020] According to the pixel resolution P GSD and the number of pixels of body size L q , according to L pi =L q ×P GSD Calculate the estimated body size data L of the living animal pi .
[0021] In an exemplary embodiment, the body size data includes body length and body height.
[0022] In an exemplary embodiment, calculating the lateral area of a living animal sample includes:
[0023] Extracting and binarizing the side image, calculating the number of pixels of the body length of the living animal sample, and removing interference information of the living animal sample by image corrosion;
[0024] By using image recognition technology, the number of pixels F of all white parts in the side image after removing interference information is calculated. x ;
[0025] Calculate the pixel resolution P according to the shooting distance and shooting equipment parameters GSD , D x is the shooting distance, S w is the actual width of the sensor, IM w is the image pixel width, F r is the actual focal length of the shooting device;
[0026] according to Calculate the lateral area L of the living animal sample area .
[0027] In an exemplary embodiment, the training of the parameters of the weight estimation mathematical model to obtain the weight estimation model includes:
[0028] Standardizing the lateral area and body size data of the living animal sample;
[0029] Constructing the weight estimation mathematical model, wherein the input layer of the weight estimation mathematical model is set to the lateral area and the body size data, and the output layer is the predicted weight;
[0030] The loss function is used to optimize the model using an optimizer, and through multiple rounds of iterations, the hyperparameters of the weight estimation mathematical model are adjusted to obtain the weight estimation model.
[0031] In an exemplary embodiment, the weight estimation mathematical model is a genetic algorithm optimized support vector machine model.
[0032] An embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above-mentioned methods for measuring living animals.
[0033] An embodiment of the present application further provides a computer device, including a memory and a processor, wherein the memory stores the following instructions executable by the processor: used to execute the steps of any of the above-mentioned methods for measuring living animals.
[0034] The embodiment of the present application also provides a living animal measurement device, comprising: a first acquisition module and a processing module; wherein:
[0035] A first acquisition module, used to acquire a side image of a living animal;
[0036] The processing module is used to input the obtained side image and the shooting distance when obtaining the side image into a preset trained weighing estimation model to obtain the weight of the living animal; wherein the weighing estimation model is obtained by training with the side area, body length and body height of the living animal as input and the weight of the living animal as output.
[0037] In an exemplary embodiment, a training module for generating a weight estimation model is also included;
[0038] The training module includes: a second acquisition module, an extraction module, a calculation module, and a generation module, wherein:
[0039] A second acquisition module is used to acquire side images of multiple living animal samples;
[0040] An extraction module, used for respectively extracting contour data from the obtained side images and calculating body size data of the living animal sample;
[0041] A calculation module, used to calculate the side area of the living animal sample according to the extracted contour data and the shooting information including the shooting distance when the side image is obtained;
[0042] The generation module is used to use the lateral area and body size data of the living animal sample as the input of the weight estimation mathematical model, use the weight of the living animal sample as the output of the weight estimation mathematical model, and train the parameters of the weight estimation mathematical model to obtain the weight estimation model.
[0043] The living animal measurement method provided in the embodiment of the present application realizes contactless and automated prediction of the weight of living animals, greatly simplifies the measurement process, and improves the efficiency and accuracy of the measurement. It is not only simple and easy to operate, but also has high accuracy, avoiding the cumbersome steps and possible sources of error in traditional weight measurement, and provides an efficient and practical weight estimation solution for the management of living animal breeding.
[0044] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0046] Figure 1 Schematic diagram of the process of the living animal measurement method in the embodiment of the present application;
[0047] Figure 2 A schematic diagram of a flow chart of a method for generating a weighing estimation model in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of the side image and shooting distance collected in the embodiment of the present application;
[0049] Figure 4 This is an example schematic diagram of a side image captured in an embodiment of the present application;
[0050] Figure 5 This is a schematic diagram of using an image segmentation algorithm to process a side image in an embodiment of the present application;
[0051] Figure 6 This is a schematic diagram of a living animal after binarization in an embodiment of the present application;
[0052] Figure 7 This is a schematic diagram of body size measurement in an embodiment of the present application;
[0053] Figure 8 This is a schematic diagram comparing the actual value and the estimated value of the sheep weight in the embodiment of the present application;
[0054] Fig. 9 Schematic diagram of the structure of the living animal measurement device in the embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.
[0056] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0058] It is understood that the terms "first" and "second" used in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0059] It can be understood that the “connection” in the following embodiments should be understood as “electrical connection”, “communication connection”, etc. if the connected circuits, modules, units, etc. have electrical signals or data transmission between each other.
[0060] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0061] With the development of deep learning technology, the inventors of this application have found through research that it has become possible to use images and physiological data to predict weight. By combining computer vision technology and portable sensors, efficient prediction of the weight of live animals such as sheep on pastures can be achieved. Image-based weight prediction does not require contact with the sheep. It only collects its appearance images and analyzes its body shape characteristics in combination with deep learning algorithms to accurately estimate its weight. This non-contact method not only reduces the psychological pressure of the sheep, but also improves the real-time and convenience of data collection, and is low-cost. At the same time, by collecting physiological data such as heart rate and respiratory rate through sensors and fusing them with image data for modeling, the accuracy and reliability of the prediction can be further improved. The key to this weight prediction method lies in data collection and model building. It is necessary to collect sheep data covering a variety of body shapes and characteristics, use a deep learning framework to design an efficient neural network model, and optimize performance through technologies such as transfer learning and model compression. In actual use, it is also necessary to verify and deploy the model in combination with the pasture environment to ensure the accuracy and practicality of the prediction. In general, the weight prediction method based on deep learning can effectively solve the shortcomings of traditional weighing methods, monitor the weight changes of live animals such as sheep in the ranch in real time, and provide ranchers with accurate management tools. This not only helps to improve breeding efficiency, but also promotes the development of intelligent and automated modern ranch management systems.
[0062] Figure 1FIG. 1 is a flow chart of a method for measuring a living animal in an embodiment of the present application. Figure 1 As shown, it may include:
[0063] Step 100: Acquire a side image of a living animal.
[0064] In an exemplary embodiment, a side image of a living animal such as a sheep can be captured at a certain distance using a smart mobile terminal such as a mobile phone, ensuring that the side profile of the living animal such as a sheep is clearly and completely displayed in the image. At the same time, the distance between the photographer and the living animal such as a sheep is recorded.
[0065] In one embodiment, the clarity of the image and the accuracy of the shooting distance directly affect the accuracy of the subsequent weight measurement of the living animal, so a mobile terminal with a high resolution and a stable sensor can be used for shooting.
[0066] Step 101: input the obtained side image and the shooting distance when obtaining the side image into a preset trained weighing estimation model to obtain the weight of the living animal; wherein the weighing estimation model is obtained by training with the side area and body size data of the living animal as input and the weight of the living animal as output.
[0067] The living animal measurement method provided in the embodiment of the present application realizes contactless and automated prediction of the weight of living animals, greatly simplifies the measurement process, and improves the efficiency and accuracy of the measurement. It is not only simple and easy to operate, but also has high accuracy, avoiding the cumbersome steps and possible sources of error in traditional weight measurement, and provides an efficient and practical weight estimation solution for the management of living animal breeding.
[0068] In an exemplary embodiment, the weight estimation model is pre-trained, and the method for generating the weight estimation model may include performing the following operations on a plurality of living animal samples:
[0069] Step 201: Acquire a side image of a living animal sample.
[0070] The implementation of this step is consistent with step 100 and will not be repeated here.
[0071] In one embodiment, taking the measurement of the weight of a sheep as an example, Figure 3 As shown, the side image of the sheep can be photographed by a mobile terminal, and the accurate shooting distance can be obtained by measuring with a rangefinder such as a laser rangefinder. In one embodiment, if the mobile phone has the ability to accurately measure the distance, the shooting distance can also be measured while the mobile phone is shooting. Figure 4 Shown is an example of a side view of a sheep.
[0072] In one embodiment, the method further includes: cleaning the collected data and removing obvious outliers to improve data quality.
[0073] Taking N sheep as a sample set as an example, the actual weight and size of different body parts of each sheep are measured through step 201. At the same time, a side image of each sheep is collected using a mobile phone, and the distance between the photographer and the sheep is measured using a rangefinder. This data is used as basic information for estimating weight.
[0074] Step 202: extracting contour data from the obtained side images respectively, and calculating body size data of the living animal sample.
[0075] In an exemplary embodiment, extracting contour data from the obtained side images respectively includes:
[0076] The acquired side image is input into the image processing model for processing, and its side contour area is extracted to obtain the contour data of the side image.
[0077] In one embodiment, the image processing model may include, but is not limited to, a Mask Region Convolutional Neural Network (Mask R-CNN) model, a U-Net model, Deeplab, etc. Mask R-CNN is an advanced deep learning model for implementing target detection and image segmentation tasks, which can automatically identify living animal objects in an image and extract their side profile areas. The Mask R-CNN model detects and classifies various objects in an image, generates a pixel-level mask of the target through segmentation, and is used to accurately mark the contour of the target object; extracts the side profile area of the living animal sample based on the mask generated by Mask R-CNN; filters out the image information of the background and other irrelevant objects, thereby accurately extracting the side profile data of the living animal.
[0078] In one embodiment, an image segmentation algorithm can be used to process the collected side image to clearly distinguish the background and foreground in the side image. In this way, the side image of the sheep can be accurately separated from the background to form a basic image. This separation process uses pattern recognition technology to effectively extract the sheep from the background image. In this way, after the extracted side image is processed, it can be Figure 5 As shown, the sheep part is marked as light and the background part is marked as black for subsequent analysis.
[0079] In an exemplary embodiment, the body size data of a living animal sample such as a sheep, such as body length and body height, can be calculated by using the obtained side profile data. Figure 7As shown, in one embodiment, the body length can be the maximum horizontal length from the head to the tail of a living animal sample such as a sheep. In one embodiment, the body height can be the vertical height from the shoulder to the sole of the foot of a living animal sample such as a sheep. By locating and measuring these feature points, the body size data of the sheep can be accurately extracted, providing key input variables for the subsequent weight estimation model.
[0080] In one embodiment, the number of body size pixels L is extracted from the processed side image of the sheep. q ; Calculate the pixel resolution P according to the distance from the shooting point to the sheep and the shooting equipment parameters such as the mobile phone camera parameters GSD , pixel resolution P GSD The calculation of is as follows: Among them, D x Indicates the distance from the photographer to the sheep, S w Indicates the actual width of the sensor (mm), IM w Indicates the image pixel width, F r Indicates the actual focal length of a shooting device such as a mobile phone camera; based on the pixel resolution P GSD and the number of pixels of body size L q , according to L pi =L q ×P GSD Calculate the estimated body size L of sheep pi (Body size values include body length and height); a simultaneous equation is established based on the estimated and actual values of body size in the sample to estimate body size.
[0081] Step 203: Calculate the side area of the living animal sample based on the extracted contour data and the shooting information including the shooting distance when the side image is acquired.
[0082] In an exemplary embodiment, after obtaining the side profile of a living animal sample such as a sheep, the actual side area of the living animal such as a sheep is calculated in combination with the shooting distance and the camera sensor parameters. In one embodiment, the pixel area value of the side profile of the living animal sample such as a sheep can be used, and the pixel value can be converted into the actual side area of the living animal sample such as a sheep according to the focal length, sensor size and shooting distance of the camera. In this way, the accurate ratio of the side area of the living animal sample such as a sheep on the image to the actual side area is ensured, and the value of the actual side area of the living animal sample such as a sheep is finally obtained.
[0083] In the embodiment of the present application, after extracting the contour data, as Figure 6As shown, the side image is extracted and binarized, the number of pixels of the body length of a living animal sample such as a sheep is calculated, and interference information such as the legs and tail of the living animal sample is removed by image corrosion, so as to more accurately calculate the side area of the living animal sample such as a sheep. In this way, the volume of the living animal sample such as a sheep can also be calculated in combination with the actual distance obtained by the rangefinder.
[0084] In one embodiment, the binary side image can be subjected to image ablation technology to ablate the limbs, ears and other parts of the sheep; the number of pixels F of all white parts in the side image of the sheep can be calculated by image recognition technology. x ; Calculate the pixel resolution P according to the shooting distance from the shooting point to the sheep and the shooting equipment such as the camera parameters of a mobile phone GSD , D x is the distance from the photographer to the sheep, S w is the actual width of the sensor (mm), IM w is the image pixel width, F r is the actual focal length of the camera; finally, according to Calculate the lateral area of the sheep's trunk L area .
[0085] Step 204: Using the lateral area and body size data of the living animal sample as input of the weight estimation mathematical model, using the weight of the living animal sample as output of the weight estimation mathematical model, and training the parameters of the weight estimation mathematical model to obtain the weight estimation model.
[0086] In one embodiment, step 204 may include:
[0087] First, the lateral area and body size data (such as body length and height) of the living animal samples are standardized. In this way, it is ensured that each eigenvalue is at the same order of magnitude, thereby improving the training efficiency and convergence speed of the deep learning model. In one embodiment, the data can be further divided into a training set, a validation set, and a test set, and a stratified sampling method is used to ensure the representativeness of each data set. The specific implementation belongs to the conventional technical means of those skilled in the art, and is not used to limit the scope of protection of this application, and will not be repeated here.
[0088] Then, a deep learning model, i.e., a mathematical model for weight estimation, is constructed. In one embodiment, the mathematical model for weight estimation may be, but is not limited to, a genetic algorithm optimized support vector machine (GA-SVM) model. The input layer of the GA-SVM model is set to the lateral area and body size data, and the output layer is the predicted weight. In one embodiment, during the training process, the mean square error (MSE) may be used as the loss function, and the stochastic gradient descent (SGD) or Adam optimizer may be used for model optimization. In this way, through multiple rounds of iterations, the hyperparameters are adjusted to achieve the best model performance.
[0089] In an exemplary embodiment, after the weight estimation mathematical model is trained, it can be further evaluated through a test set. By calculating the error between the predicted weight and the actual weight, and using R 2 The coefficient and root mean square error (RMSE) are used as evaluation indicators to verify the accuracy of the model. In this way, the trained weight estimation mathematical model can be applied to newly collected data of living animals such as sheep to predict their weight in real time. Furthermore, the model can be continuously optimized based on actual application feedback to improve the accuracy and practicality of the prediction.
[0090] The practical effect of the live animal measurement method provided in the embodiment of the present application is described below in conjunction with an embodiment. This embodiment takes the weight measurement of sheep in a pasture as an example. The live animal measurement method provided in the embodiment of the present application is used to measure the body size of the sheep, and the actual body size measurement is performed at the same time to obtain the measured value. Subsequently, the body size value estimated by the live animal measurement method provided in the embodiment of the present application is compared in detail with the measured value to calculate the deviation between the estimated value and the actual value. Based on the comparison results, the estimation function will be modified and optimized as necessary to ensure that the estimated value is closer to the actual value. Through this iterative process, the performance of the live animal measurement method is continuously improved, making it more suitable for practical applications, and providing more accurate body size data for breeders, farmers and veterinarians, thereby improving the convenience and reliability of breeding management and decision-making.
[0091] In this experiment, 15 sheep were selected for research, of which 10 were designated as experimental subjects (the experimental results are shown in Table 1), and the other 5 were used as verification subjects (the experimental results are shown in Table 2). First, the side area of each sheep was obtained by taking photos, and the shooting distance was measured using a distance calculation tool. Based on the relationship between the side area and the weight, the coefficients between them were calculated. These coefficients will be used to predict the weight of the sheep in the verification set, providing reliable basic data for further research. Such processing enables the effective prediction and verification of sheep weight with the help of image processing technology and related calculation methods.
[0092]
[0093]
[0094] Table 1
[0095]
[0096] Table 2
[0097] Figure 8 Schematic diagram of comparison between the actual value and the estimated value of the sheep weight in the embodiment of the present application. Figure 8 As shown in Table 1 and Table 2, the error between the data obtained from the 5 sheep in the experiment and the actual value, that is, the error rate of the predicted weight of the 5 paper samples, is generally effectively controlled within 6%, and the lowest error rate is 1.3% and the highest error rate is 5.75%, indicating that the prediction of the weight estimation model provided in the embodiment of the present application has high stability. The living animal measurement method provided in the embodiment of the present application has high accuracy and reliability, and provides highly credible results.
[0098] This experiment successfully constructed an efficient and reliable sheep weight prediction method by studying the relationship between side area and weight and processing image data. The error of the experimental results was controlled within 6%, which provided a good foundation for practical application.
[0099] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above-mentioned methods for measuring living animals.
[0100] The present application further provides a computer device, comprising a memory and a processor, wherein the memory stores the following instructions executable by the processor: for executing the steps of any of the above-mentioned methods for measuring living animals.
[0101] Fig. 9 Schematic diagram of the structure of the living animal measurement device in the embodiment of the present application. Figure 8 As shown, it may include: a first acquisition module and a processing module; wherein,
[0102] A first acquisition module, used to acquire a side image of a living animal;
[0103] The processing module is used to input the obtained side image and the shooting distance when obtaining the side image into a preset trained weighing estimation model to obtain the weight of the living animal; wherein the weighing estimation model is obtained by training with the side area, body length and body height of the living animal as input and the weight of the living animal as output.
[0104] In an exemplary embodiment, it may also include: a training module for generating a weighing estimation model.
[0105] In one embodiment, the training module may include: a second acquisition module, an extraction module, a calculation module, and a generation module, wherein:
[0106] A second acquisition module is used to acquire side images of multiple living animal samples;
[0107] An extraction module, used for respectively extracting contour data from the obtained side images and calculating body size data of the living animal sample;
[0108] A calculation module, used to calculate the side area of the living animal sample according to the extracted contour data and the shooting information including the shooting distance when the side image is obtained;
[0109] The generation module is used to use the lateral area and body size data of the living animal sample as the input of the weight estimation mathematical model, use the weight of the living animal sample as the output of the weight estimation mathematical model, and train the parameters of the weight estimation mathematical model to obtain the weight estimation model.
[0110] In an exemplary embodiment, the first acquisition module and the second acquisition module may be the same module.
[0111] The live animal measurement device provided in the embodiment of the present application realizes contactless and automated prediction of the weight of live animals, greatly simplifies the measurement process, and improves the efficiency and accuracy of the measurement. It is not only simple and easy to operate, but also has high accuracy, avoiding the cumbersome steps and possible sources of error in traditional weight measurement, and provides an efficient and practical weight estimation solution for live animal breeding management.
[0112] Although the embodiments disclosed in this application are as above, the contents described are only embodiments adopted to facilitate understanding of this application and are not intended to limit this application. Any technician in the field to which this application belongs can make any modifications and changes in the form and details of implementation without departing from the spirit and scope disclosed in this application, but the scope of patent protection of this application shall still be based on the scope defined in the attached claims.
Claims
1. A method for measuring living animals, characterized in that: include: Obtain side-on images of live animals; The obtained side image and the shooting distance when obtaining the side image are input into a preset trained weighing estimation model to obtain the weight of the living animal; wherein the weighing estimation model is obtained by training with the side area and body size data of the living animal as input and the weight of the living animal as output.
2. The method for measuring living animals according to claim 1, further comprising generating the weighing estimation model: Acquire lateral images of multiple live animal specimens; Extracting contour data from the obtained side images respectively and calculating body size data of living animal samples; Calculating the lateral area of the living animal sample based on the extracted contour data and the shooting information including the shooting distance when the lateral image is acquired; The lateral area and body size data of the living animal sample are used as input of the weight estimation mathematical model, the weight of the living animal sample is used as output of the weight estimation mathematical model, and the parameters of the weight estimation mathematical model are trained to obtain the weight estimation model.
3. The living animal measurement method according to claim 2, wherein: The extracting of contour data from the obtained side images respectively comprises: The acquired side image is input into an image processing model for processing, and its side contour area is extracted to obtain the contour data of the side image.
4. The living animal measurement method according to claim 3, further comprising: The side image is processed using an image segmentation algorithm to distinguish the background and foreground in the side image.
5. The living animal measurement method according to claim 3 or 4, wherein: The image processing model includes a mask region convolutional neural network model.
6. The living animal measurement method according to claim 4, wherein: The method of calculating the body size data of the living animal sample comprises: According to the side image processed by the image segmentation algorithm, the body size pixel number L is extracted q ; Calculate the pixel resolution P according to the shooting distance and shooting equipment parameters GSD , pixel resolution P GSD The calculation of is as follows: Among them, D x Indicates the shooting distance, S w Indicates the actual width of the sensor, IM w Indicates the image pixel width, F r Indicates the actual focal length of the shooting device; According to the pixel resolution P GSD and the number of pixels of body size L q , according to L pi =L q ×P GSD Calculate the estimated body size data L of the living animal pi .
7. The living animal measurement method according to claim 6, wherein: The body size data includes body length and body height.
8. The living animal measurement method according to claim 2, wherein: The calculating the lateral area of the living animal sample comprises: Extracting and binarizing the side image, calculating the number of pixels of the body length of the living animal sample, and removing interference information of the living animal sample by image corrosion; By using image recognition technology, the number of pixels F of all white parts in the side image after removing interference information is calculated. x ; Calculate the pixel resolution P according to the shooting distance and shooting equipment parameters GSD , D x is the shooting distance, S w is the actual width of the sensor, IM w is the image pixel width, F r is the actual focal length of the shooting device; according to Calculate the lateral area L of the living animal sample area .
9. The living animal measurement method according to claim 2, wherein: The step of training the parameters of the weight estimation mathematical model to obtain the weight estimation model includes: Standardizing the lateral area and body size data of the living animal sample; Constructing the weight estimation mathematical model, wherein the input layer of the weight estimation mathematical model is set to the lateral area and the body size data, and the output layer is the predicted weight; The loss function is used to optimize the model using an optimizer, and the hyperparameters of the weight estimation mathematical model are adjusted through multiple rounds of iterations to obtain the weight estimation model.
10. The living animal measurement method according to claim 9, wherein: The weight estimation mathematical model is a genetic algorithm optimized support vector machine model.
11. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the living animal measurement method according to any one of claims 1 to 10.
12. A computer device comprising a memory and a processor, wherein: The memory stores the following instructions executable by the processor: used to execute the steps of the living animal measurement method described in any one of claims 1-10.
13. A living animal measuring device, characterized in that: include: The first acquisition module and the processing module; wherein, A first acquisition module, used to acquire a side image of a living animal; The processing module is used to input the obtained side image and the shooting distance when obtaining the side image into a preset trained weighing estimation model to obtain the weight of the living animal; wherein the weighing estimation model is obtained by training with the side area, body length and body height of the living animal as input and the weight of the living animal as output.
14. The living animal measuring device according to claim 13, further comprising a training module for generating a weighing estimation model; The training module includes: The second acquisition module, the extraction module, the calculation module, and the generation module, wherein: A second acquisition module is used to acquire side images of multiple living animal samples; An extraction module, used for respectively extracting contour data from the obtained side images and calculating body size data of the living animal sample; A calculation module, used to calculate the side area of the living animal sample according to the extracted contour data and the shooting information including the shooting distance when the side image is obtained; The generation module is used to use the lateral area and body size data of the living animal sample as the input of the weight estimation mathematical model, use the weight of the living animal sample as the output of the weight estimation mathematical model, and train the parameters of the weight estimation mathematical model to obtain the weight estimation model.