Livestock body size measuring method and system, computer equipment and storage medium

By improving the PointStack model, the problems of inaccurate measurement and positioning of domestic animal body rulers and inaccurate measurement results in the prior art are solved, and high-precision measurement of domestic animal body rulers is achieved, reducing the calculation amount and improving the measurement stability.

CN119478006AActive Publication Date: 2025-02-18NORTHWEST A & F UNIV

Patent Information

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

AI Technical Summary

Technical Problem

The existing domestic animal body ruler measurement methods based on point cloud data have problems such as inaccurate positioning and inaccurate measurement results, especially when domestic animal posture changes.

Method used

Improved PointStack model by adding external attention mechanisms and multi-resolution feature learning modules, build a learning pooling layer and feature extraction network to generate a point cloud segmentation model. This model can perform high-precision segmentation of livestock point cloud data, extract key points in different body parts, and calculate body ruler parameters.

Benefits of technology

Through high-precision part segmentation and key point positioning, the impact of posture changes on measurement results is reduced, the accuracy and stability of body ruler measurement is improved, and the calculation amount is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478006A_ABST
    Figure CN119478006A_ABST
Patent Text Reader

Abstract

The invention provides a livestock body size measurement method and system, computer equipment and a storage medium, and belongs to the field of computer three-dimensional visual point clouds, and the method comprises the steps: segmenting automatically collected point cloud data of livestock into a plurality of parts through a three-dimensional point cloud segmentation technology; the segmented point cloud is combined with the physiological features of the livestock to accurately position the key points of body size measurement. In order to improve the key point positioning precision, the invention provides a novel key point detection method which comprises the steps of coordinate normalization, key point cluster acquisition, key point optimization and edge detection. By means of the method, key point deviation and measurement errors possibly occurring in the body size measurement process are effectively reduced. According to the method, non-contact, rapid and accurate livestock body size parameter measurement is achieved, and the method has important application prospects in the fields of gene improvement, health screening, animal welfare evaluation and the like. Experimental results show that the method has high accuracy and robustness, and can significantly improve the efficiency and precision 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, and in particular relates to a livestock body size measurement method, system, computer equipment and storage medium. Background Art

[0002] Accurately obtaining livestock body measurements is the key foundation of precision animal husbandry. Traditional livestock body measurement is usually performed manually using tools such as tape measures and calipers, but this manual measurement method is easily affected by the operator's subjective factors and may cause stress reactions to livestock, or even cause injury. In order to reduce the negative impact on livestock, modern livestock body measurement is increasingly tending to non-contact and automated methods.

[0003] With the rapid development of computer vision technology, especially the breakthrough of 3D vision technology in point cloud data processing, more and more studies have begun to use point cloud data to measure livestock body size. This 3D point cloud-based measurement technology has made some progress in the field of livestock body size measurement.

[0004] However, the existing automated livestock body measurement methods based on 3D point clouds still face some challenges. First, in actual operation, the point cloud data of livestock collected by multi-view depth cameras is high-density and disordered. Existing automated measurement methods usually extract geometric features based on the entire point cloud, locate key measurement points and calculate body size, which not only leads to a large amount of calculation, but also may cause inaccurate positioning of key measurement points due to different postures of various parts of the livestock, thus affecting the accuracy of body measurement.

[0005] Secondly, most of the existing automated measurement methods are based on standard postures. However, in actual farm environments, livestock may walk freely in the data collection area, resulting in large differences in the obtained point cloud postures. This posture deviation will cause the position of the key measurement points to shift, thus 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 the existing livestock body size measurement method 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 the body size of livestock 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 trained to obtain a point cloud segmentation model.

[0011] The point cloud data of livestock is input into the point cloud segmentation model, and the point cloud data of livestock is processed by the convolution layer in the backbone network of the model to obtain the local features of livestock point cloud; the local features of livestock point cloud are pooled at a single resolution by the learnable pooling layer in the backbone network, and the weighted sum of all point features is calculated to aggregate and generate a global feature vector; the full semantic and full resolution feature information in the global feature vector is extracted by the multi-resolution feature learning module; the full semantic and full resolution feature information is processed in turn by the multi-layer perceptron and the one-dimensional convolution to obtain the point cloud data of different body parts of livestock after segmentation;

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

[0013] Preferably, the step of obtaining point cloud data of livestock at different viewing angles 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 convolution 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 are downsampled to obtain the downsampled point cloud, which is sent to the embedding layer of the multi-layer perceptron for farthest point sampling and grouping, and 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 comprises:

[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 the livestock according to the key points specifically includes:

[0023] The normalized coordinate system of each body part of the livestock after segmentation and the ground normal vector is obtained by using the principal component analysis method and the RANSAC algorithm, 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 parts of the body 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 of the greater tubercle of the sternum and the base of the tail 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 obtained by measuring the vertical distance from the top of the sciatic tuberosity to the ground;

[0028] Body width includes chest width and hip width. The 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. The 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, and then the points on the same vertical plane are identified by sorting and filtering the point pairs. The point pairs with the largest Y coordinate difference are 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 by dynamic programming to determine the connection order of the points on the chest contour. The abnormal points are identified and removed by calculating the angle change between adjacent points. 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] A data acquisition module is used to acquire point cloud data of livestock at different viewing angles at the same time;

[0032] The model building 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 the point cloud data of the livestock into the point cloud segmentation model, process the point cloud data of the livestock through the convolution layer in the backbone network of the model, and obtain the 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 a one-dimensional convolution, the point cloud data of different body parts of the livestock after segmentation are obtained;

[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 size 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 data of livestock are processed by the point cloud segmentation model, and different body parts of livestock can be segmented with high precision by adopting a multi-resolution feature learning mechanism, so that point cloud data of different body parts of livestock after segmentation are obtained. The entire point cloud is no longer used in the subsequent body measurement, 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 respectively, and the positioning of the key points is clear to the specific parts, and the positioning is more accurate. Since the key point extraction and body size calculation are performed in a part-by-part manner, the whole process is not limited by the posture of livestock, and the influence of posture changes on the measurement results is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiment of the present invention and its design scheme, the following briefly introduces the drawings required for this embodiment. The drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 A flow chart of a method for measuring livestock body size proposed in an embodiment of the present invention;

[0041] Figure 2 It is a flow chart of the method for automatic 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 The body size measurement diagram of livestock body size measurement method provided by the embodiment of the present invention is shown in FIG. 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 implement it, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used 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 livestock from the livestock depth images.

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

[0050] In order to obtain complete point clouds of livestock of different growth states and sizes, a passage with automatic doors through which a single livestock can pass is set up. Depth cameras are arranged on the left, right and top of the passage. The cameras are about 0.8 meters away from the passage and about 0.5 meters high. The cameras are connected by synchronization lines to ensure that the depth image data of the livestock from three perspectives are collected at the same time. In order to reduce the noise caused by the environment and lighting, the collection scene and the passage are arranged in an area that avoids direct sunlight as much as possible. The passage only allows a single livestock to pass through, ensuring that the depth camera only captures the data of a single livestock; when collecting livestock depth maps, ensure that livestock of different sizes and motion states can be obtained to improve the capture rate of livestock data passing through, and maximize the collection of livestock depth image data. After point cloud registration, background removal, ground detection, point cloud segmentation and point cloud denoising, a complete livestock point cloud is obtained.

[0051] Ransac is used to detect the ground and extract the ground point cloud. In this way, the livestock point cloud actually has no direct contact with the scene point cloud. Therefore, 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 mechanism enhances the network's understanding ability by capturing global context information; external attention mechanism allows the network to focus on global context information in the point cloud, rather than just local features. This is very beneficial for point cloud segmentation because it can capture the relationship between distant points and help understand the overall structure. Points with similar local features but belonging to different objects can be distinguished. It helps to deal with 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; multi-resolution feature learning can improve segmentation results by extracting features at different scales. Low-resolution features can capture large-scale structures and global context. High-resolution features retain detail information, which is conducive to accurate segmentation boundaries. Combining features of different resolutions, the network can understand both the overall structure and local details of the point cloud at the same time.

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

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

[0057] Step 31: Downsample the point cloud data of livestock to obtain a uniformly distributed downsampled point cloud. The number of sampling points is set to 4096, and 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, and then 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, a multi-layer perceptron and one-dimensional convolution are used to output the segmentation results.

[0060] Specifically, the features extracted at each step are passed to the external learnable pooling layer, which performs single-resolution pooling, exploits the correlation between point features and training parameters, and aggregates by calculating the weighted sum of all point features to generate a global feature vector, which is then returned to the external learnable pooling layer to extract full semantic and full-resolution feature information. The segmentation result of the point cloud is obtained after processing the data with the multi-layer 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 body parts of livestock, such as Figure 5 As shown in the figure, the body size parameters of livestock are calculated based on key points. Specifically including:

[0062] Step 41: First, the RANSAC algorithm is used to detect the ground and determine the Z axis, then the point cloud of the main part of the livestock body is analyzed by PCA to determine the X axis, and finally the Y axis is calculated by cross product, 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 the interference from the head, tail and limbs, so as to more accurately determine 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: The body length is measured by determining the key points of the greater tubercle of the sternum and the base of the tail, wherein 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 key points initially determined are optimized using a clustering method to remove possible outliers, and finally the Euclidean distance between the two optimized key points is calculated as the body length data.

[0065] Specifically, the body length is measured by determining the point from the greater tuberosity of the sternum to the base of the tail, the location of the greater tuberosity of the sternum is determined by analyzing the head point cloud data, and in the calibration coordinate system, the point with the minimum Z coordinate value is searched. Then, the tail end of the sciatic tuberosity is detected by calculating the point with the maximum X coordinate in the tail point cloud data.

[0066] After the key points are initially determined, the five points closest to each key point are calculated, regarded as a key cluster, and the center of the cluster is calculated. If the distance from the 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 is removed. Repeat this step until the distance condition is met. The body length data of livestock are obtained by determining 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, and the specific method is to find the point with the largest 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, and the method is to find the point with the largest 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 the 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 the body height.

[0069] The measurement of livestock hip height 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 width and hip width of livestock are measured based on the width of the rear edge of the shoulder blade and the distance between the hip joints, respectively. The 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, and then the points on the same vertical plane are identified by sorting and filtering the point pairs. Finally, the point pair with the largest Y coordinate difference is selected to calculate the width. This method is applied to both chest width and hip width.

[0071] Specifically: The chest width of livestock is determined by the width of the rear edge of the shoulder blade, and the hip width is the distance between the hip joints perpendicular to the back. The chest width of livestock is defined by analyzing the point cloud data of the segmented chest to calculate key points to locate the width behind the shoulder blade. 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. In order 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 the left and right adjacent points, in the sorted sequence, the difference is calculated as ΔP = P i+1 -P i =(Δx, Δy, Δz). Then, filter and select the point pairs that meet the conditions, |Δx|≤t and, |Δz|≤t. This threshold setting is intended to ensure that the X and Z coordinates of the selected points are similar enough to be considered to be in the same vertical plane. Finally, among the point pairs that meet the above conditions, the point pair with the largest difference in Y coordinates is identified as representing the farthest endpoints on both sides of the livestock chest. The distance between them is the chest width, and the same method used to determine the chest width should be used to calculate the hip width.

[0073] Step 45: Use the optimized traveling salesman problem (TSP) algorithm to process the segmented chest point cloud data, and 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, the abnormal points are identified and removed, and then the remaining contour points are connected in sequence, and the sum of the distances between them is calculated, such as 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 chest 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 the 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 returns to the starting point s; c ik It represents the distance from vertex i to vertex k, which is equivalent to solving the subproblem 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 circumference 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, thus noise points are identified and eliminated. After noise removal, the contour points are connected sequentially and the distance between each pair of points is calculated, ultimately yielding the total length of the livestock’s chest circumference.

[0080] like Figure 4 As shown in the figure, it is the process of manually measuring body size. Figure 5 The figure shows the result of the automatic body size measurement of the present invention. It can be seen that compared with the traditional method, the present invention selects the "non-contact, non-harmful, high-yield, and high-efficiency" deep learning method, which is more efficient than the traditional livestock body size estimation method; the present invention not only realizes a method for quickly obtaining livestock body size, but also provides a direction for estimating the body size of related poultry and livestock, while also saving the time cost of related personnel and improving animal welfare, which is worthy of promotion.

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

[0082] Specifically, 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.

[0083] The point cloud segmentation module is used to input the point cloud data of livestock into the point cloud segmentation model, and process the point cloud data of livestock through the convolution layer in the backbone network of the model to obtain local features of livestock point clouds; perform single-resolution pooling on the local features of livestock point clouds 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 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 can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

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

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

[0088] The present invention can segment different body parts of livestock with high precision by using an improved PointStack model and a multi-resolution feature learning mechanism, and innovatively proposes a coordinate normalization method based on component segmentation, making the key points of body measurement based on component segmentation detection in different postures more accurate, reducing the impact of posture changes on the measurement results, and ensuring the stability and consistency of the measurement results. It solves the problem of large amount of calculation and inaccurate key point positioning in the traditional method of extracting geometric features based on the entire point cloud, locating key measurement points and calculating body size.

[0089] It will be appreciated by those skilled in the art that embodiments of the present invention may provide methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, 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 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 flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, 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 flowchart and / or block diagram. 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 capable of directing a computer or other programmable data processing device to operate 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 A 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 operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions 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 invention has been described in detail in this specification and embodiments, 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 protection scope 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 technician familiar with the field within the technical scope disclosed in the present invention belongs to the protection scope of the present invention.

Claims

1. A method for measuring the body size of livestock, 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 trained to obtain a point cloud segmentation model. The point cloud data of livestock is input into the point cloud segmentation model, and the point cloud data of livestock is processed by the convolution layer in the backbone network of the model to obtain the local features of livestock point cloud; the local features of livestock point cloud are pooled at a single resolution by the learnable pooling layer in the backbone network, and the weighted sum of all point features is calculated to aggregate and generate a global feature vector; the full semantic and full resolution feature information in the global feature vector is extracted by the multi-resolution feature learning module; the full semantic and full resolution feature information is processed by the multi-layer perceptron and the one-dimensional convolution in turn to obtain the point cloud data of different body parts of livestock after segmentation; The key points of the point cloud data of different body parts of the livestock are extracted respectively, and the body size parameters of the livestock are calculated based on the key points.

2. A method for measuring the body size of livestock according to claim 1, characterized in that: The step of obtaining point cloud data of livestock at different viewing angles 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. The method for automated livestock body size measurement based on point cloud component segmentation according to claim 1, characterized in that: Before processing the point cloud data of livestock through the convolutional layer in the backbone network of the model to obtain the local features of the livestock point cloud, it also includes: The point cloud data of livestock are downsampled to obtain the downsampled point cloud, which is sent to the embedding layer of the multi-layer perceptron for farthest point sampling and grouping, and 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. The method for automated livestock body size measurement based on point cloud component segmentation 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. The method for automated livestock body size measurement based on point cloud component segmentation according to claim 4, characterized in that: The method of calculating the body size parameters of livestock according to the key points specifically includes: The normalized coordinate system of each body part of the livestock after segmentation and the ground normal vector is obtained by using the principal component analysis method and the RANSAC algorithm, 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 parts of the body and body size measurement points.

6. The method for automated livestock body size measurement based on point cloud component segmentation according to claim 5, characterized in that: The body size 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 of the greater tubercle of the sternum and the base of the tail 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 obtained by measuring the vertical distance from the top of the sciatic tuberosity to the ground; Body width includes chest width and hip width. The 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. The 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, and then the points on the same vertical plane are identified by sorting and filtering the point pairs. The point pairs with the largest Y coordinate difference are 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 by dynamic programming to determine the connection order of the points on the chest contour. The abnormal points are identified and removed by calculating the angle change between adjacent points. 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: A data acquisition module is used to acquire point cloud data of livestock at different viewing angles at the same time; The model building 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 the point cloud data of the livestock into the point cloud segmentation model, process the point cloud data of the livestock through the convolution layer in the backbone network of the model, and obtain the 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 a one-dimensional convolution, the point cloud data of different body parts of the livestock after segmentation are obtained; 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, characterized in that: 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

  • Dairy cow body surface point cloud three-dimensional reconstruction method under shielding condition

    CN112258651A

  • Non-contact cow body size information acquisition method

    CN113470106A

  • Livestock point cloud bidirectional fault region segmentation method and device

    CN114022489A

  • Method for measuring body size of living Qinchuan cattle based on 3D camera

    CN114429497A

  • Multi-view cattle body size automatic measuring method based on single PC

    CN115272237A

Cited By

  • Method for automatically measuring body size of livestock from breeding scene

    CN121527165A

  • Livestock body size measuring method and system, computer equipment and medium

    CN122312741A