Livestock body dimension measurement method, system, computer device and storage medium

By using an improved PointStack model and multi-resolution feature learning technology, high-precision segmentation and body size calculation of livestock point clouds were performed, solving the problems of inaccurate positioning and the influence of posture changes in livestock body size measurement, and achieving more accurate body size measurement.

CN119478006BActive Publication Date: 2025-10-21NORTHWEST A & F UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411592999.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-10-21
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

Existing methods for measuring the body size of livestock based on 3D point clouds suffer from inaccurate positioning and imprecise measurement results, especially with significant measurement errors under non-standard postures.

Method used

An improved PointStack model is adopted, which adds an external attention mechanism and a multi-resolution feature learning module to the pooling layer, and combines multilayer perceptron and one-dimensional convolution to extract local and global features of livestock point clouds, perform high-precision segmentation and calculate body size parameters.

Benefits of technology

It enables high-precision measurement of livestock body size under different postures, reduces computational load, improves the positioning accuracy of key points, and reduces the impact of posture changes on measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478006B_ABST
    Figure CN119478006B_ABST
Patent Text Reader

Abstract

The application provides a livestock body size measurement method, system, computer device and storage medium, and belongs to the field of computer three-dimensional vision point cloud. The method divides the automatically collected point cloud data of livestock into multiple parts through three-dimensional point cloud segmentation technology. The segmented point cloud is combined with the physiological characteristics of livestock to accurately locate the key points of body size measurement. In order to improve the accuracy of key point positioning, the application proposes a novel key point detection method, including coordinate normalization, key point cluster acquisition, key point optimization and edge detection. Through the above method, the key point deviation and measurement error that may occur in the body size measurement process are effectively reduced. The application realizes non-contact, fast and accurate livestock body size parameter measurement, and has important application prospects in the fields of genetic improvement, health screening and animal welfare evaluation. Experimental results show that the method has high accuracy and robustness, and can significantly improve the efficiency and accuracy of body size measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer three-dimensional visual point cloud technology, and in particular relates to a livestock body size measurement method, system, computer equipment and storage medium. Background Art

[0002] Accurately measuring livestock body dimensions is a key foundation for precision animal husbandry. Traditionally, livestock body measurements are performed manually using tools such as tape measures and calipers. However, this manual method is susceptible to operator subjective factors and can cause stress and even injury to livestock. To minimize negative impacts on livestock, modern livestock body measurement is increasingly moving towards non-contact and automated methods.

[0003] With the rapid development of computer vision technology, especially breakthroughs in 3D vision technology for point cloud data processing, more and more research is beginning to use point cloud data for livestock body measurement. This 3D point cloud-based measurement technology has made some progress in the field of livestock body measurement.

[0004] However, existing automated livestock body measurement methods based on 3D point clouds still face several challenges. First, in practice, the point cloud data of livestock collected by multi-view depth cameras is dense and disordered. Existing automated measurement methods typically extract geometric features from the entire point cloud, locate key measurement points, and calculate body dimensions. This not only results in a large computational workload, but can also lead to inaccurate positioning of key measurement points due to the varying postures of different parts of the livestock, thus affecting the accuracy of body measurements.

[0005] Secondly, most existing automated measurement methods are based on standard poses. However, in real farm environments, livestock may roam freely within the data collection area, resulting in significant differences in the pose of the acquired point cloud. This pose deviation can cause positional shifts in key measurement points, affecting the accuracy of the final measurement results. Summary of the Invention

[0006] In order to solve the problems of inaccurate positioning and inaccurate measurement results in existing livestock body size measurement methods based on point cloud data, the present invention provides a livestock body size measurement method.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

[0008] A method for measuring livestock body size comprises the following steps:

[0009] Obtain point cloud data of livestock from different perspectives at the same time;

[0010] An external attention mechanism is added to the pooling layer of the PointStack model to form a learnable pooling layer, which replaces the pooling layer in the backbone network of the original model. A multi-resolution feature learning module is added to the feature extraction network of the PointStack model to form an improved PointStack model. The improved PointStack model is then trained to obtain a point cloud segmentation model.

[0011] The livestock point cloud data is input into the point cloud segmentation model. The convolutional layer in the backbone network of the model processes the livestock point cloud data to obtain local features of the livestock point cloud. The learnable pooling layer in the backbone network performs single-resolution pooling on the local features of the livestock point cloud, calculates the weighted sum of all point features for aggregation, and generates a global feature vector. The multi-resolution feature learning module extracts the full semantic and full-resolution feature information in the global feature vector. After the full semantic and full-resolution feature information is processed sequentially by a multi-layer perceptron and a one-dimensional convolution, the point cloud data of different parts of the livestock body after segmentation is obtained.

[0012] The key points of the point cloud data of different body parts of livestock are extracted respectively, and the body size parameters of livestock are calculated based on the key points.

[0013] Preferably, the step of obtaining point cloud data of livestock from different perspectives at the same time comprises the following steps:

[0014] Collect depth images of livestock from different perspectives at the same time;

[0015] Convert the collected livestock depth images into scene point cloud data;

[0016] Detect the ground in the scene point cloud data and separate the livestock point cloud from the ground point cloud;

[0017] A three-dimensional point cloud of the livestock is extracted from the livestock point cloud, and the extracted three-dimensional point cloud of the livestock is denoised to generate point cloud data of the livestock.

[0018] Preferably, before processing the point cloud data of the livestock through the convolutional layer in the backbone network of the model to obtain the local features of the livestock point cloud, the method further includes:

[0019] The point cloud data of livestock is downsampled to obtain the downsampled point cloud, which is sent to the embedding layer of the multilayer perceptron for farthest point sampling and grouping. Features are extracted from point cloud data of different groups through residual blocks of different resolutions, and the extracted features are input into the point cloud segmentation model.

[0020] Preferably, the step of extracting key points of point cloud data of different body parts of livestock specifically includes:

[0021] The point cloud data are processed in sequence using coordinate normalization, key point cluster acquisition, key point optimization and edge detection methods to extract the key points of the point cloud data of different parts of livestock.

[0022] Preferably, the step of calculating the body size parameters of livestock based on key points specifically includes:

[0023] The principal component analysis method and RANSAC algorithm are used to obtain the normalized coordinate system of the segmented livestock body parts and the ground normal vector, and the three-dimensional point cloud coordinates of the body measurement points are obtained according to the normalized coordinate system;

[0024] The body size parameters of livestock are obtained through the three-dimensional point cloud coordinates of key points of various body parts and body size measurement points.

[0025] Preferably, the body size parameters of the livestock include body length, body height, hip height, body width and chest circumference, and the specific calculation of each parameter is as follows:

[0026] The body length is measured by determining the key points of the greater tubercle of the sternum and the base of the tail. The greater tubercle of the sternum is determined by analyzing the head point cloud data and the minimum Z coordinate value, and the base of the tail is determined by the maximum X coordinate value in the tail point cloud data. The Euclidean distance between the two key points is used as the body length data.

[0027] Body height was determined by measuring the vertical distance from the top of the shoulder blade to the ground, and hip height was determined by measuring the vertical distance from the top of the sciatic tuberosity to the ground;

[0028] Body width includes chest width and hip width. Chest width and hip width are based on the width of the posterior edge of the shoulder blade and the distance between the hip joints, respectively. Key points are determined by analyzing the segmented chest and hip point cloud data. During the measurement process, the body direction is first defined as the X-axis. Then, point pairs are sorted and filtered to identify points on the same vertical plane. The point pair with the largest Y coordinate difference is selected to calculate the width.

[0029] An optimized traveling salesman problem algorithm is used to process the segmented chest point cloud data. The TSP is solved through dynamic programming to determine the connection order of the points on the chest contour. By calculating the angle change between adjacent points, outliers are identified and removed. Then, the remaining contour points are connected in sequence, and the sum of the distances between them is calculated to finally obtain the chest length.

[0030] The present invention also provides a livestock body size measurement system, comprising:

[0031] The data acquisition module is used to obtain point cloud data of livestock from different perspectives at the same time;

[0032] The model construction module is used to add an external attention mechanism to the pooling layer of the PointStack model to form a learnable pooling layer, replace the pooling layer in the backbone network of the original model, add a multi-resolution feature learning module to the feature extraction network of the PointStack model to form an improved PointStack model, and train the improved PointStack model to obtain a point cloud segmentation model;

[0033] The point cloud segmentation module is used to input livestock point cloud data into the point cloud segmentation model, process the livestock point cloud data through the convolution layer in the backbone network of the model to obtain local features of the livestock point cloud; perform single-resolution pooling on the local features of the livestock point cloud through the learnable pooling layer in the backbone network, calculate the weighted sum of all point features for aggregation, and generate a global feature vector; extract full semantic and full-resolution feature information from the global feature vector through the multi-resolution feature learning module; after processing the full semantic and full-resolution feature information through a multi-layer perceptron and one-dimensional convolution, obtain the segmented point cloud data of different parts of the livestock body;

[0034] The body size measurement module is used to extract the key points of the point cloud data of different body parts of livestock and calculate the body size parameters of livestock based on the key points.

[0035] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement any one of the steps in the livestock body size measurement method.

[0036] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is loaded by a processor, it can execute any one of the steps in the livestock body size measurement method.

[0037] The livestock body measurement method provided by the present invention has the following beneficial effects:

[0038] The present invention improves the PointStack model to obtain an improved PointStack model, and trains the improved PointStack model to obtain a point cloud segmentation model. The point cloud segmentation model processes the point cloud data of livestock, and adopts a multi-resolution feature learning mechanism to perform high-precision segmentation of different body parts of livestock, thereby obtaining point cloud data of different body parts of livestock after segmentation. In the subsequent body size measurement, the entire point cloud is no longer used, thereby reducing the amount of calculation. At the same time, the key points of the point cloud data of different body parts of livestock are extracted separately, and the positioning of the key points is clearly defined to the specific parts, making the positioning more accurate. Since the key point extraction and body size calculation are performed in a part-by-part manner, the entire process is not restricted by the posture of the livestock, and the influence of posture changes on the measurement results is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] To more clearly illustrate the embodiments of the present invention and its design, the following briefly introduces the drawings required for this embodiment. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be derived from these drawings without inventive effort.

[0040] Figure 1 This is a flow chart of a method for measuring livestock body size according to an embodiment of the present invention;

[0041] Figure 2 This is a flow chart of the method for automated livestock body size measurement based on point cloud component segmentation of the present invention;

[0042] Figure 3 This is a data processing flow chart of the point cloud segmentation model proposed in the present invention;

[0043] Figure 4 This is a diagram of the traditional manual process of measuring livestock body size;

[0044] Figure 5 This is a body measurement chart of livestock body measurement method provided by an embodiment of the present invention; wherein, Figure 5 (a) is a measurement diagram of body length, body height, chest circumference and hip height. Figure 5 (b) is a schematic diagram of the measurement of chest width and hip width. DETAILED DESCRIPTION

[0045] In order to enable those skilled in the art to better understand the technical solution of the present invention and to be able to implement it, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention and are not intended to limit the scope of protection of the present invention.

[0046] Example 1

[0047] The present invention provides a method for measuring the body size of livestock, specifically Figure 1 and Figure 2 As shown, the following steps are included:

[0048] Step 1: Collect livestock depth images from different perspectives at the same time, and obtain complete point cloud data of the livestock from the livestock depth images.

[0049] Specifically, the present invention first collects depth images of livestock from three perspectives: left, right, and top. Then, the collected data is preprocessed, including point cloud registration, background removal, ground detection, point cloud segmentation, and point cloud denoising, to obtain a complete livestock point cloud.

[0050] To obtain a complete point cloud of livestock of varying growth states and sizes, a passageway with automatic doors was set up, through which a single livestock could pass. Depth cameras were placed on the left, right, and top of the passageway, approximately 0.8 meters from the passageway and 0.5 meters high. Synchronous cables were used to connect the cameras to ensure simultaneous acquisition of depth image data from all three perspectives of the livestock. To reduce noise from the environment and lighting, the acquisition scene and passageway were placed in an area protected from direct sunlight. The passageway only allowed a single livestock to pass through, ensuring that the depth camera captured data from only that single animal. When collecting livestock depth maps, it was ensured that livestock of varying sizes and motion states could be captured to improve the capture rate of passing livestock data and maximize the collection of livestock depth image data. A complete livestock point cloud was obtained through steps such as point cloud registration, background removal, ground detection, point cloud segmentation, and point cloud denoising.

[0051] Ransac is used to detect the ground and extract the ground point cloud. In this way, the livestock point cloud has no direct contact with the scene point cloud, so the density-based clustering algorithm DBSCAN can be used to segment the livestock point cloud separately.

[0052] Step 2. Add an external attention mechanism to the pooling layer of the PointStack model to form a learnable pooling layer, replace the pooling layer in the backbone network of the original model, add a multi-resolution feature learning module to the feature extraction network of the PointStack model to form an improved PointStack model, and train the improved PointStack model to obtain a point cloud segmentation model.

[0053] External attention enhances the network's understanding by capturing global context. It allows the network to focus on the global context within a point cloud, rather than just local features. This is particularly beneficial for point cloud segmentation because it captures relationships between distant points, helping to understand the overall structure. It can distinguish points with similar local features but belonging to different objects, and is particularly useful for processing sparse or unevenly distributed point cloud data.

[0054] Multi-resolution feature learning extracts features at different scales, taking into account both overall structure and local details. By extracting features at different scales, multi-resolution feature learning can improve segmentation performance. Low-resolution features capture large-scale structure and global context, while high-resolution features preserve detailed information, facilitating precise segmentation boundaries. Combining features at different resolutions allows the network to simultaneously understand both the overall structure and local details of a point cloud.

[0055] The learnable pooling layer adaptively optimizes the downsampling strategy to retain key information. The combination of these three techniques enables the network to more comprehensively understand the structure and semantics of point cloud data, resulting in a more comprehensive understanding of point cloud data, significantly improving segmentation accuracy. Working together, they enable the network to handle complex point cloud scenarios, cope with sparse or uneven data distribution, and provide more accurate segmentation results while maintaining computational efficiency. Compared to traditional fixed pooling operations, the learnable pooling layer can adaptively learn the optimal downsampling strategy based on the data. This preserves the information most important for the segmentation task while reducing computational complexity. This helps the network learn a hierarchical point cloud representation, thereby better understanding the structure of the point cloud.

[0056] Step 3: If Figure 3 As shown, the obtained livestock point cloud is downsampled and input into the point cloud segmentation model based on the improved PointStack proposed in the present invention to obtain the segmentation results and obtain point cloud data of the head, front legs, hind legs, chest, abdomen, buttocks and tail. Specifically:

[0057] Step 31: Downsample the livestock point cloud data to obtain a uniformly distributed downsampled point cloud. The number of sampling points is set to 4096. The downsampled point cloud is sent to the embedding layer of the multilayer perceptron for farthest point sampling and grouping.

[0058] Specifically, all parts of the livestock point cloud are uniformly sampled to obtain 4096 sampling points. The downsampled point cloud is sent to the embedding layer of the multi-layer perceptron for farthest point sampling and grouping. Subsequently, six groups of residual blocks with different resolutions are used to extract features, where the output resolution of each block is lower than the corresponding input but contains higher-level semantic information.

[0059] Step 32: Use six groups of residual modules with different resolutions to extract point cloud data features. The external learnable pooling layer extracts full semantic and full-resolution feature information by learning point cloud features. Finally, use multi-layer perceptron and one-dimensional convolution to output the segmentation results.

[0060] Specifically, the features extracted at each step are passed to an external learnable pooling layer. This module performs single-resolution pooling, exploiting the correlation between point features and trained parameters. It aggregates the features by calculating a weighted sum of all point features to generate a global feature vector. This vector is then returned to the external learnable pooling layer to extract full semantic and full-resolution feature information. The point cloud segmentation results are obtained after processing the data using a multilayer perceptron and one-dimensional convolution output.

[0061] Step 4: Obtain the livestock point cloud segmentation results obtained by the deep neural network model constructed by the improved PointStack backbone network, and use coordinate normalization, key point cluster acquisition, key point optimization, and edge detection methods to extract the key points of the point cloud data of different parts of the livestock body, such as Figure 5 As shown in Figure 1, the body size parameters of livestock are calculated based on key points. Specifically, they include:

[0062] Step 41: First, use the RANSAC algorithm to detect the ground and determine the Z axis. Then, use PCA to analyze the point cloud of the main parts of the livestock body to determine the X axis. Finally, use the cross product calculation to obtain the Y axis, thereby establishing a complete three-dimensional coordinate system.

[0063] Specifically, the RANSAC algorithm is used to accurately detect the ground, determine the accurate vertical reference, and define the ground normal vector as the Z-axis direction vector z; the center point of the ground is set as the origin of the coordinate system, and PCA is used to analyze the main axis direction of the livestock body point cloud part (chest, abdomen and buttocks) obtained from the upstream segmentation to eliminate interference from the head, tail and limbs, thereby more accurately determining the X-axis direction vector x; finally, the Y-axis direction vector y is obtained by calculating the cross product of the two vectors.

[0064] Step 42: Measure body length by identifying key points at the greater tuberosity and the base of the tail. The greater tuberosity is determined by analyzing the head point cloud data and the minimum Z coordinate value, while the base of the tail is determined by analyzing the maximum X coordinate value in the tail point cloud data. Use a clustering method to optimize the initially determined key points, remove possible outliers, and finally calculate the Euclidean distance between the two optimized key points as the body length data.

[0065] Specifically, body length is measured by locating the points from the greater sternal tuberosity to the base of the tail. The location of the greater sternal tuberosity is determined by analyzing the head point cloud data. In the calibrated coordinate system, the point with the minimum Z coordinate is searched. The caudal end of the sciatic tuberosity is then detected by calculating the point with the maximum X coordinate in the tail point cloud data.

[0066] After initially identifying key points, the five closest points to each key point are calculated, each considered a key cluster, and the cluster center is calculated. If the distance from a key point to the cluster center is significantly greater than the distance from the five points in the cluster to the center, the key point is considered an outlier and removed. This step is repeated until the distance condition is met. Livestock body length data is obtained by identifying two key points and calculating the Euclidean distance between them.

[0067] Step 43: Body height is determined by measuring the vertical distance from the top of the shoulder blade to the ground. This is done by finding the point with the maximum Z coordinate value in the chest point cloud data in the calibration coordinate system. Hip height is determined by measuring the vertical distance from the top of the sciatic tuberosity to the ground. This is done by finding the point with the maximum Z coordinate value in the hip point cloud. The Z coordinate value of this point is the hip height.

[0068] Specifically, the body height of livestock is determined by measuring the vertical distance from the top of the shoulder blade to the ground. In the calibrated coordinate system, the point with the maximum Z coordinate value in the segmented chest point cloud data is defined as the key point of body height.

[0069] The hip height of livestock is determined by measuring the vertical distance from the apex of the sciatic tuberosity to the ground. The point with the largest Z coordinate value in the hip point cloud is the key point of hip height, and its Z coordinate value is the hip height.

[0070] Step 44: The chest and hip widths of livestock are measured based on the width of the posterior edge of the shoulder blade and the distance between the hip joints, respectively. Key points are identified by analyzing the segmented chest and hip point cloud data. The measurement process first defines the body direction as the X-axis. Point pairs are then sorted and filtered to identify points on the same vertical plane. Finally, the point pair with the largest Y-coordinate difference is selected to calculate the width. This method is applied to both chest and hip width measurements.

[0071] Specifically, the chest width of livestock is determined by the width of the posterior edge of the shoulder blades, and the hip width is the distance between the hip joints perpendicular to the back. The chest width of livestock is defined by analyzing segmented chest point cloud data to calculate key points to locate the width behind the shoulder blades. Similarly, the hip width is determined by identifying the widest point in the segmented hip point cloud data for key point calculation.

[0072] After acquiring the point cloud data of the livestock chest, the body direction of the livestock is defined as the X-axis direction in the new coordinate system. To more easily identify points located on the same vertical plane in the point cloud, each point is sorted according to its X and Z coordinates. For adjacent points on the left and right, the difference in the sorted sequence is calculated as ΔP = P i+1 -P i =(Δx, Δy, Δz). Then, we filter and select point pairs that satisfy the conditions |Δx| ≤ t and |Δz| ≤ t. This threshold setting ensures that the X and Z coordinates of the selected points are similar enough to be considered to lie in the same vertical plane. Finally, among the point pairs that meet the above conditions, the one with the largest difference in Y coordinates is identified as representing the furthest endpoints on either side of the animal's chest. The distance between them is the chest width, and the same method used to determine chest width is used to calculate hip width.

[0073] Step 45: Use the optimized traveling salesman problem (TSP) algorithm to process the segmented chest point cloud data. Solve the TSP through dynamic programming to determine the connection order of the points on the chest contour. In order to deal with potential noise in the data, the angle change between adjacent points is calculated to identify and remove abnormal points. Then, the remaining contour points are connected in sequence and the sum of the distances between them is calculated, as shown in Figure 4. Figure 5 As shown in (a), the final result is the chest length.

[0074] Specifically: the calculation of chest circumference is based on segmented chest point cloud data. Figure 5 As shown in (b), the optimized traveling salesman problem (TSP) algorithm is used to automatically locate key points and effectively avoid erroneous noise points.

[0075] Due to the disordered nature of point cloud data, the present invention uses a method based on optimizing TSP to sequentially connect the points on the bust contour. The present invention uses dynamic programming to solve TSP, which is expressed as follows:

[0076]

[0077] Where s represents the starting point; d(i, V') represents the shortest path length from vertex i through each vertex in V' (all points of the chest contour, which can be understood as a point cloud slice. Measuring the chest circumference requires connecting these points with the shortest path, which is transformed into a traveling salesman problem) and returning to the starting point s; c ik Represents the distance from vertex i to vertex k, which is equivalent to solving the sub-problem of the distance from i to k + k passing through other nodes to return to the starting point s.

[0078] C is represents the direct path from i to the starting point s. (When the set V' is empty and i is not the starting point s, the cost of returning to the starting point s is C is ), φ represents the empty set, and d(k, V'-{k}) represents the shortest path from vertex k to other vertices V'-{k} back to the starting point s.

[0079] By solving this dynamic programming equation, the connection order of the isoline points in the set V' of the livestock chest girth can be determined. In order to solve the potential noise in the data, the present invention calculates the angle θ, θ (θ = atan2 (v2·y, v2·x) - atan2 (v1·y, v1·x), v1 = CG i -CG i-1 ,v2=CG i+1 -CG i ). Between the direction vectors of adjacent points, CG i-1 ,CG i ,CG i+1Sudden changes in direction are identified, allowing noise points to be identified and removed. After noise removal, the contour points are connected sequentially and the distance between each pair of points is calculated to ultimately determine the total chest girth of the livestock.

[0080] like Figure 4 As shown in the figure, it is the process of manual measurement of body size. Figure 5 The figure shows the automated body size results of the present invention. This demonstrates that, compared to traditional methods, the present invention utilizes a "non-contact, harmless, high-yield, and high-efficiency" deep learning approach, surpassing traditional livestock body size estimation methods in terms of efficiency. This invention not only provides a rapid method for obtaining livestock body size but also provides a direction for estimating livestock body size. It also saves time and improves animal welfare, making it worthy of widespread adoption.

[0081] Based on the above method, the present invention provides a livestock body size measurement system, which includes: a data acquisition module, a model construction module, a point cloud segmentation module and a body size measurement module.

[0082] Specifically, the data acquisition module is used to acquire point cloud data of livestock from different perspectives at the same time. The model construction module is used to add an external attention mechanism to the pooling layer of the PointStack model to form a learnable pooling layer, replacing the pooling layer in the backbone network of the original model. A multi-resolution feature learning module is added to the feature extraction network of the PointStack model to form an improved PointStack model. This improved PointStack model is then trained to obtain a point cloud segmentation model.

[0083] The point cloud segmentation module is used to input livestock point cloud data into the point cloud segmentation model, process the livestock point cloud data through the convolution layer in the backbone network of the model, and obtain local features of the livestock point cloud; perform single-resolution pooling on the local features of the livestock point cloud through the learnable pooling layer in the backbone network, calculate the weighted sum of all point features for aggregation, and generate a global feature vector; extract the full semantic and full-resolution feature information in the global feature vector through the multi-resolution feature learning module; after the full semantic and full-resolution feature information are processed in turn by a multi-layer perceptron and one-dimensional convolution, the point cloud data of different body parts of the livestock after segmentation are obtained.

[0084] The body size measurement module is used to extract the key points of the point cloud data of different body parts of livestock and calculate the body size parameters of livestock based on the key points.

[0085] Each module in the livestock body measurement system described above can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.

[0086] The present invention also provides a computer device comprising a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the livestock body size measurement method embodiment. The specific implementation method can be found in the method embodiment and will not be repeated here.

[0087] Furthermore, the present invention also provides a non-transitory computer-readable storage medium containing instructions, wherein a computer program is stored on the storage medium. For example, a memory containing instructions, wherein the instructions can be executed by a processor of a computer device to perform the above-mentioned method. For example, the non-transitory computer-readable storage medium can be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. When the computer program is executed by the processor, the steps of the livestock body size measurement method embodiment can be implemented. The specific implementation method can be referred to the method embodiment and will not be repeated here.

[0088] This paper utilizes an improved PointStack model and a multi-resolution feature learning mechanism to achieve high-precision segmentation of different livestock body parts. It also innovatively proposes a coordinate normalization method based on component segmentation, making the key points of body measurement based on component segmentation more accurate in different postures. This reduces the impact of posture changes on measurement results, ensuring the stability and consistency of measurement results. This solves the problems of high computational complexity and inaccurate key point positioning associated with traditional methods that extract geometric features from the entire point cloud, locate key measurement points, and calculate body dimensions.

[0089] Those skilled in the art will appreciate that embodiments of the present invention may provide methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0090] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0091] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0092] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0093] It should be pointed out that the specific implementation methods described above can enable those skilled in the art to understand the invention more comprehensively, but do not limit the invention in any way. Therefore, although the present specification and examples have described the invention in detail, those skilled in the art should understand that the invention can still be modified or replaced by equivalents; and all technical solutions and improvements that do not deviate from the spirit and scope of the invention are included in the scope of protection of the patent for the invention. Any figure mark in the claims should not be regarded as limiting the claims involved. Any simple change or equivalent replacement of the technical solution that can be obviously obtained by any person familiar with the art within the technical scope disclosed in the present invention falls within the scope of protection of the present invention.

Claims

1. A method for measuring livestock body size, characterized in that: include: Obtain point cloud data of livestock from different perspectives at the same time; An external attention mechanism is added to the pooling layer of the PointStack model to form a learnable pooling layer, which replaces the pooling layer in the backbone network of the original model. A multi-resolution feature learning module is added to the feature extraction network of the PointStack model to form an improved PointStack model. The improved PointStack model is then trained to obtain a point cloud segmentation model. The livestock point cloud data is input into the point cloud segmentation model. The convolutional layer in the backbone network of the model processes the livestock point cloud data to obtain local features of the livestock point cloud. The learnable pooling layer in the backbone network performs single-resolution pooling on the local features of the livestock point cloud, calculates the weighted sum of all point features for aggregation, and generates a global feature vector. The multi-resolution feature learning module extracts the full semantic and full-resolution feature information in the global feature vector. After the full semantic and full-resolution feature information is processed sequentially by a multi-layer perceptron and a one-dimensional convolution, the point cloud data of different parts of the livestock body after segmentation is obtained. The key points of the point cloud data of different body parts of livestock are extracted respectively, and the body size parameters of livestock are calculated based on the key points.

2. A method for measuring livestock body size according to claim 1, characterized in that: The step of obtaining point cloud data of livestock from different perspectives at the same time includes the following steps: Collect depth images of livestock from different perspectives at the same time; Convert the collected livestock depth images into scene point cloud data; Detect the ground in the scene point cloud data and separate the livestock point cloud from the ground point cloud; A three-dimensional point cloud of the livestock is extracted from the livestock point cloud, and the extracted three-dimensional point cloud of the livestock is denoised to generate point cloud data of the livestock.

3. A method for measuring livestock body size according to claim 1, characterized in that: The convolutional layer in the backbone network of the model processes the point cloud data of livestock to obtain the local features of the livestock point cloud. The following steps are also included: The point cloud data of livestock is downsampled to obtain the downsampled point cloud, which is sent to the embedding layer of the multilayer perceptron for farthest point sampling and grouping. Features are extracted from point cloud data of different groups through residual blocks of different resolutions, and the extracted features are input into the point cloud segmentation model.

4. A method for measuring livestock body size according to claim 3, characterized in that: The key points of the point cloud data of different body parts of the livestock are extracted respectively, specifically including: The point cloud data are processed in sequence using coordinate normalization, key point cluster acquisition, key point optimization and edge detection methods to extract the key points of the point cloud data of different parts of livestock.

5. A method for measuring livestock body size according to claim 4, characterized in that: The method of calculating the body size parameters of livestock based on key points specifically includes: The principal component analysis method and RANSAC algorithm are used to obtain the normalized coordinate system of the segmented livestock body parts and the ground normal vector, and the three-dimensional point cloud coordinates of the body measurement points are obtained according to the normalized coordinate system; The body size parameters of livestock are calculated through the three-dimensional point cloud coordinates of key points of various body parts and body size measurement points.

6. A method for measuring livestock body size according to claim 5, characterized in that: The body measurement parameters of the livestock include body length, body height, hip height, body width and chest circumference. The specific calculation of each parameter is as follows: The body length is measured by determining the key points of the greater tubercle of the sternum and the base of the tail. The greater tubercle of the sternum is determined by analyzing the head point cloud data and the minimum Z coordinate value, and the base of the tail is determined by the maximum X coordinate value in the tail point cloud data. The Euclidean distance between the two key points is used as the body length data. Body height was determined by measuring the vertical distance from the top of the shoulder blade to the ground, and hip height was determined by measuring the vertical distance from the top of the sciatic tuberosity to the ground; Body width includes chest width and hip width. Chest width and hip width are based on the width of the posterior edge of the shoulder blade and the distance between the hip joints, respectively. Key points are determined by analyzing the segmented chest and hip point cloud data. During the measurement process, the body direction is first defined as the X-axis. Then, point pairs are sorted and filtered to identify points on the same vertical plane. The point pair with the largest Y coordinate difference is selected to calculate the width. An optimized traveling salesman problem algorithm is used to process the segmented chest point cloud data. The TSP is solved through dynamic programming to determine the connection order of the points on the chest contour. By calculating the angle change between adjacent points, outliers are identified and removed. Then, the remaining contour points are connected in sequence, and the sum of the distances between them is calculated to finally obtain the chest length.

7. A livestock body measurement system, characterized in that: include: The data acquisition module is used to obtain point cloud data of livestock from different perspectives at the same time; The model construction module is used to add an external attention mechanism to the pooling layer of the PointStack model to form a learnable pooling layer, replace the pooling layer in the backbone network of the original model, add a multi-resolution feature learning module to the feature extraction network of the PointStack model to form an improved PointStack model, and train the improved PointStack model to obtain a point cloud segmentation model; The point cloud segmentation module is used to input livestock point cloud data into the point cloud segmentation model, process the livestock point cloud data through the convolution layer in the backbone network of the model to obtain local features of the livestock point cloud; perform single-resolution pooling on the local features of the livestock point cloud through the learnable pooling layer in the backbone network, calculate the weighted sum of all point features for aggregation, and generate a global feature vector; extract full semantic and full-resolution feature information from the global feature vector through the multi-resolution feature learning module; after processing the full semantic and full-resolution feature information through a multi-layer perceptron and one-dimensional convolution, obtain the segmented point cloud data of different parts of the livestock body; The body size measurement module is used to extract the key points of the point cloud data of different body parts of livestock and calculate the body size parameters of livestock based on the key points.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is loaded into a processor, it can execute the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for obtaining human body size information from image data

    US20240296579A1

  • Livestock weight estimation system and method using livestock barn image

    WO2022145614A1