A pig body posture perception method and system based on point cloud completion
By using single-view point cloud completion technology and feature interaction learning module, the problems of occlusion and non-rigid deformation in pig posture perception are solved, realizing low-cost and high-precision pig posture perception, which is suitable for the needs of large-scale breeding.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INSTITUTE OF ANIMAL SCIENCES OF CHINESE ACADEMY OF AGRICULTURAL SCIENCES
- Filing Date
- 2026-05-27
- Publication Date
- 2026-07-14
AI Technical Summary
Existing pig posture sensing technologies are susceptible to occlusion, have high system costs, are complex to deploy, have poor adaptability to non-rigid deformation of pigs, insufficient point cloud completion accuracy, and weak generalization ability, which cannot meet the high-frequency, non-contact dynamic monitoring needs of large-scale farming.
A single-view point cloud completion technology is adopted. Point cloud data of pig body surface is collected by three-dimensional sensors. The point cloud completion model is combined with the feature interaction learning module and the inverted residual multilayer perceptron module to achieve high-precision completion of missing point clouds. Combined with continuous non-rigid deformation sample amplification and multi-mode occlusion simulation, a point cloud completion model adapted to the non-rigid deformation of live pigs is trained.
It achieves low-cost, high-precision pig body posture perception, reducing hardware costs by 70%, shortening deployment cycle by 80%, improving completion accuracy by 50%, and increasing body posture analysis accuracy to over 95%. It is adaptable to complex breeding environments and has good scalability and compatibility.
Smart Images

Figure CN122392099A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary technical fields of livestock and poultry intelligent sensing, pig phenomics and three-dimensional point cloud information processing. Specifically, it involves a pig body posture sensing method based on point cloud completion, a matching model training method and a corresponding system, which is suitable for non-contact, low-cost, high-precision three-dimensional sensing and full-cycle analysis of pig body posture in a large-scale intelligent farming environment. Background Technology
[0002] In large-scale pig farming, pig body condition information is the core foundational data for growth performance assessment, health status monitoring, welfare-oriented farming, and improved breed selection, directly determining production efficiency, disease control capabilities, and core breeding competitiveness. Currently, the industry still relies primarily on manual contact measurement for obtaining pig body condition information, which suffers from inherent drawbacks such as low measurement efficiency, high labor intensity, poor data consistency, and a tendency to induce stress in pigs. This approach is completely inadequate for meeting the needs of large-scale farming for dynamic monitoring throughout its entire lifecycle, at high frequency, and without physical contact.
[0003] With the rapid development of computer vision and 3D sensing technologies, non-contact pig body posture sensing technology has become a hot topic in industry research and application. Existing technical solutions mainly fall into two categories: The first category is body posture perception solutions based on two-dimensional machine vision, such as Chinese invention patent CN112308707A, which discloses a machine vision-based method for measuring the body size of pigs. This method uses a monocular camera to acquire planar images of pigs and combines image segmentation to measure body size parameters. This solution has low hardware costs and is simple to deploy, but it is highly susceptible to changes in lighting conditions in the breeding environment, pen occupancy obstructions, and pig posture interference. It cannot obtain accurate three-dimensional spatial information, and the body size measurement error generally exceeds 8%, which cannot meet the precision requirements of refined farming.
[0004] The second category is posture perception solutions based on multi-view 3D reconstruction, such as Chinese invention patent CN114596518A, which discloses a 3D posture reconstruction system for pigs based on multi-view depth cameras. This system uses four or more depth cameras to simultaneously acquire data and achieve 3D reconstruction of pigs. While this solution can acquire 3D posture information, it suffers from high hardware costs, complex camera calibration processes, and stringent requirements for pen layout. Furthermore, in group-housed settings, it is susceptible to occlusion between pigs and self-occlusion, resulting in a reconstruction success rate of less than 70%, making it difficult to widely promote and apply in large-scale farming scenarios.
[0005] In recent years, single-view point cloud sensing solutions have been gradually applied to the livestock and poultry farming sector due to their advantages of low cost and convenient deployment. However, in actual farming environments, due to multiple factors such as the limitation of the sensor's field of view, self-occlusion caused by the pig's own posture, environmental occlusion caused by pen facilities and pigs in the same pen, and sensor noise interference, single-view pig point clouds generally have 30%-70% missing areas and a large number of local holes. Directly conducting body posture analysis based on missing point clouds will lead to fatal problems such as large deviations in body size measurement, low accuracy of body posture classification, and poor robustness of posture recognition.
[0006] To address the issue of missing point clouds, existing general point cloud completion techniques are mostly designed for rigid objects, such as PCN, PoinTr, and GRNet. These algorithms perform well in point cloud completion of rigid objects like cars and furniture. However, pigs are living animals, and their bodies undergo continuous non-rigid deformations due to respiration, muscle movement, and posture changes. Existing algorithms cannot adapt to the biological deformation characteristics of live pigs. The completion accuracy drops significantly under complex occlusion, and the chamfer distance (CD) loss is more than three times higher than that for rigid objects. At the same time, the training of existing algorithms relies on large-scale labeled complete point cloud datasets. However, collecting complete point clouds of live pigs is difficult, the labeling cost is high, and the effective sample size is limited. This makes the models prone to overfitting, and their generalization ability and scene adaptability are seriously insufficient, failing to meet the normalized and highly stable body perception requirements of large-scale farming.
[0007] In summary, the industry urgently needs a pig posture perception technology solution that is single-view, low-cost, adaptable to the non-rigid deformation characteristics of pigs, capable of high-precision completion of missing point clouds, easy to deploy, and highly generalizable, to solve the core pain points of existing technologies. Summary of the Invention
[0008] The purpose of this invention is to overcome the shortcomings of existing pig posture perception schemes, such as susceptibility to occlusion, high system cost, complex deployment, poor adaptability to non-rigid deformation of pigs, insufficient point cloud completion accuracy, and weak generalization ability. This invention provides a pig posture perception method based on point cloud completion, along with a corresponding model training method and system. This invention achieves high-precision completion of missing point clouds of pigs through low-cost single-view acquisition, accurately restoring the complete three-dimensional geometric structure of the pig's posture. It effectively alleviates the interference of occlusion on posture analysis, significantly improves the accuracy and stability of posture analysis, and simultaneously reduces system hardware costs and deployment complexity, fully adapting to the application needs of large-scale intelligent farming.
[0009] To achieve the above-mentioned objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for pig posture perception based on point cloud completion, comprising the following core steps: S1 point cloud acquisition: Three-dimensional point cloud data of the pig's body surface is acquired from a single viewpoint using a three-dimensional sensor; S2 point cloud preprocessing: The collected raw 3D point cloud data is denoised, the background is cropped, downsampled, and the coordinates are normalized to obtain a standardized missing point cloud. S3 Point Cloud Completion: The preprocessed missing point cloud is input into a pre-trained point cloud completion model. Through the model's built-in feature interaction learning module, the local geometric features and global structural features of the point cloud are jointly modeled to predict and complete the missing regions, generating a structurally complete and geometrically continuous completed point cloud. The training of the point cloud completion model uses a weighted sum of chamfer distance and bulldozer distance as the total loss function, with the formula: in, The chamfer distance loss is used to constrain the overall structural differences between the completed point cloud and the true complete point cloud; The bulldozer distance loss is used to constrain the local detail distribution of the completed point cloud; The value range is 0.8-1.2. The value range is 0.3-0.7; the model training uses the AdamW optimizer, the initial learning rate is set to 5e-5~5e-4, the batch size is set to 8-32, the total number of training rounds is set to 100-300 rounds, the learning rate decays to 0.4-0.6 of the original value every 40-60 rounds, and training is terminated early when the validation set loss does not decrease for 8-12 consecutive rounds; S4 Body Reconstruction and Analysis: Based on the completed point cloud, complete the three-dimensional reconstruction of the pig's body and execute the preset body analysis task; S5 Results Output: Visualizes the results of pig body posture analysis and synchronizes the data to the smart farming management system.
[0010] The point cloud completion model adopts a Transformer-based encoder-decoder architecture, and the feature interaction learning module is embedded after each encoding layer of the encoder. The feature interaction learning module groups the local neighborhood of the point cloud using the k-nearest neighbor algorithm, performs self-attention interaction calculation on the features within the group, aggregates them to obtain fine-grained local geometric features, and then fuses the local geometric features with the global structural features output by the encoder across dimensions to enhance the model's ability to express features of pig limb edges, body surface wrinkles, and contact boundaries. The feature transformation path of the encoder-decoder structure embeds an Inverted Residual Multilayer Perceptron (InvResMLP) module, which enhances the high-dimensional feature expression capability through an extended-compression feature mapping mechanism and alleviates the feature degradation problem of deep networks.
[0011] Secondly, the present invention provides a training method for a pig body posture perception point cloud completion model, used to prepare the point cloud completion model used in the above perception method, comprising the following core steps: T1 baseline complete point cloud construction: Through multi-view 3D acquisition and point cloud registration, a pig baseline complete point cloud with closed topology and noise below 0.5mm threshold is obtained; T2 Non-rigid Deformation Sample Augmentation: The baseline complete point cloud is deformed by a continuous non-rigid deformation model to generate a complete point cloud sample set covering the deformation space of pig body shape. T3 dataset construction: Apply multi-mode occlusion operation to the complete point cloud sample set to construct a one-to-one corresponding "complete point cloud-missing point cloud" pair sample set, and divide it into training sample set and validation sample set in an 8:2 ratio; T4 Model Training: Based on the training and validation sample sets, the deep learning network with embedded feature interaction learning module and inverted residual multilayer perceptron module is trained. The model parameters are optimized by combining transfer learning and multi-dataset joint training strategies to obtain a pre-trained point cloud completion model.
[0012] The continuous non-rigid deformation model adopts a thin plate spline (TPS) deformation model driven by a continuous kernel function. Under the premise of maintaining the consistency of the pig's body topology, it simulates the changes in the body surface morphology during the pig's breathing, muscle movement, and posture fine-tuning. A single set of baseline complete point clouds can generate no less than 50 sets of deformed complete point cloud samples. The multi-mode occlusion operation includes at least one of the following: overall occlusion based on spatial region, slice occlusion based on view direction, and random occlusion based on local region, or any combination of two or more, which can accurately simulate various point cloud missing situations in real breeding scenarios.
[0013] Thirdly, this invention provides a pig posture perception system based on point cloud completion, used to implement the aforementioned pig posture perception method. It includes a point cloud acquisition module, a point cloud preprocessing module, a point cloud completion module, a posture analysis module, and a result output module, all connected in sequence via communication. It also includes a model training module connected in communication with the point cloud completion module. The core functions of each module are as follows: Point cloud acquisition module: The core is a 3D sensor, which is used to acquire 3D point cloud data of the pig's body surface from a single perspective through the 3D sensor. It supports the access and data acquisition of depth cameras, LiDAR, and millimeter-wave radar. Point cloud preprocessing module: It has built-in noise reduction unit, background cropping unit, downsampling unit and normalization unit, which are used to perform systematic preprocessing on the acquired raw 3D point cloud data and output standardized missing point clouds; Point cloud completion module: It has a built-in pre-trained point cloud completion model, which is used to input the pre-processed missing point cloud into the model and output a structurally complete point cloud; Body posture analysis module: It has a built-in 3D reconstruction unit and body posture analysis unit, which is used to complete the 3D reconstruction of pig body posture based on the completed point cloud and execute the preset body posture analysis task; the body posture analysis unit includes at least one of body size measurement unit, body posture classification unit, and posture recognition unit; Results output module: includes a touch screen and a standardized communication interface, used to visualize the results of pig body shape analysis and synchronize the data to the smart breeding management system; Model training module: includes a baseline point cloud construction unit, a sample augmentation unit, a dataset construction unit, and a training execution unit, used to complete the pre-training and parameter update of the point cloud completion model, and supports the customization of special models for different breeds and growth stages of pigs.
[0014] The beneficial effects of this invention are as follows: 1. This invention achieves high-precision perception of pig body posture at low cost and easy deployment through single-view point cloud completion technology. It does not require multi-sensor synchronous acquisition and complex calibration processes. The system hardware cost is reduced by more than 70% compared with the traditional multi-view solution, and the deployment cycle is shortened by 80%. It is fully adaptable to the complex environment of large-scale breeding pens and has extremely strong promotion and application value.
[0015] 2. This invention addresses the non-rigid deformation characteristics of live pigs by designing a continuous non-rigid deformation sample amplification method and a multi-mode occlusion simulation scheme. This effectively solves the industry pain points of difficulty in obtaining complete point cloud samples of live pigs and insufficient sample size. The generated training samples highly match the point cloud missing patterns of real breeding scenarios, improving the model's adaptability to complex occlusion and non-rigid deformation by more than 40%, and significantly improving the model's generalization performance and scenario robustness.
[0016] 3. The point cloud completion model of this invention achieves joint modeling of local geometric features and global structural features through the feature interaction learning module. Combined with the inverted residual multilayer perceptron module, it achieves accurate restoration of fine-grained local details while ensuring the consistency of the overall topological structure of the pig's body shape. The completion accuracy is improved by more than 50% compared with the general point cloud completion algorithm, and the completion chamfer distance (CD) loss is reduced to below 0.8. It effectively solves the interference of point cloud missingness on downstream analysis tasks, reduces the body size measurement error from more than 8% to less than 3%, and improves the body shape classification accuracy to more than 95%.
[0017] 4. This invention adopts an optimization strategy of transfer learning and joint training with multiple datasets, which achieves efficient training and performance optimization of the model under the condition of limited pig point cloud data, effectively avoiding the overfitting problem of small sample training. At the same time, the point cloud completion step of this invention can be used as a general preprocessing module, adapting to the body posture perception needs of pigs of different types of 3D sensors, different breeds, and different growth stages. It has good scalability and compatibility and can be seamlessly connected to existing smart farming management systems. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the pig posture perception method based on point cloud completion described in this invention. Detailed Implementation
[0019] The following is combined with Figure 1 The present invention will be further described in detail with reference to specific embodiments. Unless otherwise stated, the techniques, reagents, materials, and equipment used in the following embodiments are all conventional methods well known to those skilled in the art and are commercially available products; those skilled in the art can completely reproduce the present invention based on these embodiments without any creative effort, and it fully meets the requirements of sufficient disclosure under patent law.
[0020] The underlying Transformer point cloud completion network PoinTr used in this invention Its core structure has been disclosed in existing technologies (see the literature "PoinTr: Diverse Point Cloud Completion with Geometry-Aware Transformers", CVPR 2021, published in June 2021). This invention improves the core structure on its basic network and embeds a self-developed feature interaction learning module and an inverse residual multilayer perceptron module to adapt to the completion requirements of non-rigid deformation of live pigs.
[0021] Example 1 This embodiment provides a pig posture perception method based on point cloud completion, applied to single-view posture perception in a gestation pen in a large-scale fattening pig farming scenario. The specific steps are as follows: S1 Point Cloud Acquisition: An Intel RealSense D435i consumer-grade RGB-D depth camera is fixedly deployed 1.8m directly above the fattening pig gestation pen as a 3D sensor to acquire 3D point cloud data of the fattening pig's body surface from a single perspective. The acquisition frame rate is set to 15fps, the depth measurement range is set to 0.5m-2.5m, and the acquisition area completely covers the entire fattening pig. The acquisition process does not require the pig to be in a fixed posture, and can realize normalized dynamic acquisition.
[0022] S2 Point Cloud Preprocessing: The following preprocessing operations are performed sequentially on the acquired raw 3D point cloud data: A statistical filtering algorithm is used, with the k-nearest neighbor number set to 20 and the distance standard deviation factor set to 2, to remove outlier noise points; a pass-through filter is used to limit the spatial range of the point cloud, and then the Random Sample Consensus (RANSAC) algorithm is used to fit and remove background point clouds such as the ground, pens, and feed troughs, retaining only the point cloud in front of the pig's body surface; a voxel downsampling algorithm is used, with the voxel grid size set to 5mm, to unify the number of point clouds to 2048 points; the center coordinates of the point cloud in front are calculated, the point cloud is translated to the origin, and then the point cloud coordinates are mapped to the unit sphere space of [-1,1] using the maximum modulus of the point cloud as the scaling factor, to obtain the standardized missing point cloud.
[0023] The S3 point cloud completion model pre-training process is as follows: T1 baseline complete point cloud construction: Using a FaroFocus S350 high-precision structured light 3D scanner, multi-view 3D acquisition was performed on 80 fattening pigs of different weights (30kg-120kg) and different breeds (Large White, Landrace, Duroc). Point cloud data from 12 different views were collected for each pig. The multi-view point clouds were stitched and fused using the Iterative Closest Point (ICP) registration algorithm. After denoising, hole filling, and topology optimization, 80 sets of baseline complete point clouds of pigs with closed topological structures and no missing regions were obtained. The noise threshold was controlled within 0.5mm. T2 Non-rigid Deformation Sample Augmentation: A TPS deformation model driven by a continuous kernel function was adopted. 16 control points were randomly selected on each set of baseline complete point clouds. A Gaussian continuous kernel function was used to drive the control points to generate smooth displacement within a range of ±10mm, leading to continuous non-rigid deformation of the overall point cloud. 50 sets of deformed complete point cloud samples were generated for each set of baseline complete point clouds, resulting in a final set of 4000 complete point cloud samples. T3 Dataset Construction: Three occlusion operations were applied to the 4000 sets of complete point cloud combinations to construct one-to-one "complete point cloud - missing point cloud" pairs of samples, which were divided into a training sample set (3200 sets) and a validation sample set (800 sets) in an 8:2 ratio. The multi-mode occlusion operations included: slice occlusion based on viewpoint direction (simulating field of view loss in single-view acquisition), random occlusion based on local regions (simulating pig self-occlusion), and overall occlusion based on spatial regions (simulating pen facility occlusion). T4 Model Training Optimization: The point cloud completion model uses PoinTr as its base network structure. The encoder consists of six cascaded Transformer encoding layers, each followed by a feature interaction learning module, with the k-nearest neighbor number set to 16. An InvResMLP module is embedded in the feature transformation path of the encoding layers, with a channel expansion factor of 3. The decoder consists of six cascaded Transformer decoding layers, ultimately outputting a complete point cloud of 16384 points. Training employs a transfer learning strategy, loading the pre-trained weights of PoinTr on the ShapeNet dataset as initial parameters, and freezing the parameters of the first three encoder layers for fine-tuning. The loss function is a weighted sum of chamfer distance and bulldozer distance, as shown in the formula: In this embodiment , The AdamW optimizer was used with an initial learning rate of 1e-4, a batch size of 16, and a total of 200 training rounds. The learning rate was reduced to 0.5 every 50 rounds. Training was terminated early when the validation set loss did not decrease for 10 consecutive rounds, resulting in a pre-trained point cloud completion model.
[0024] S4 Point Cloud Completion: The pre-processed single-view missing point cloud is input into the pre-trained point cloud completion model. The model completes inference within 30ms and outputs a complete point cloud of 16384 points with complete structure and geometric continuity, which fully restores the body structure of the fattening pig.
[0025] S5 Body Shape Reconstruction and Analysis: Based on the completed point cloud, a 3D mesh model of the fattening pig's body shape is generated using the Poisson surface reconstruction algorithm. This model performs tasks such as body size parameter measurement, body shape health classification, and behavioral posture recognition. Specifically, body size parameter measurement locates key anatomical sites such as the shoulder, rump, withers, and chest floor through key point detection, and calculates growth parameters such as body length, height, chest circumference, and abdominal circumference based on the 3D coordinates of these sites. Body shape health classification, based on the estimated body fat percentage from the 3D mesh model, categorizes pigs into three body shapes: healthy, lean, and obese. Behavioral posture recognition identifies daily behaviors such as standing, lying down, feeding, and drinking. Compared with the gold standard of manual measurement, the average measurement error of body size in this embodiment is 2.7%, and the body shape classification accuracy reaches 96.2%.
[0026] S6 Output: The body size parameters, body shape classification results, and three-dimensional body shape model of fattening pigs are output in real time through a touch-screen visualization interface. At the same time, they are synchronized to the farm's smart breeding management system through the MQTT communication interface, providing core data support for precise feeding of pigs, growth performance assessment, early warning of diseases, and breeding of superior breeds.
[0027] Example 2 This embodiment is an endpoint verification embodiment for the numerical range of the claims. The difference between this embodiment and Embodiment 1 is that in the loss function for training the point cloud completion model, , The initial learning rate was set to 5e-5, the batch size to 8, and the total number of training rounds to 100. The learning rate was reduced to 0.4 every 40 rounds, and training was terminated early if the validation set loss did not decrease for 8 consecutive rounds. Testing showed that the completion CD loss in this embodiment was 0.78, the average error in body size measurement was 2.9%, and the body shape classification accuracy was 95.7%, still meeting the high-precision application requirements of large-scale aquaculture.
[0028] Example 3 This embodiment is an endpoint verification embodiment for the numerical range of the claims. The difference between this embodiment and Embodiment 1 is that in the loss function for training the point cloud completion model, , The initial learning rate was set to 5e-4, the batch size to 32, and the total number of training rounds to 300. The learning rate was reduced to 0.6 every 60 rounds, and training was terminated early if the validation set loss did not decrease for 12 consecutive rounds. Testing showed that the completion CD loss in this embodiment was 0.75, the average error in body size measurement was 2.8%, and the body shape classification accuracy was 95.9%, still meeting the high-precision application requirements of large-scale aquaculture.
[0029] Example 4 This embodiment provides a pig posture perception system based on point cloud completion, used to implement the pig posture perception method described in Embodiment 1. The system includes a point cloud acquisition module, a point cloud preprocessing module, a point cloud completion module, a posture analysis module, and a result output module that are sequentially connected via industrial Ethernet communication. It also includes a model training module that is communicatively connected to the point cloud completion module.
[0030] The core of the point cloud acquisition module 1 is an Intel RealSense D435i depth camera, which is fixedly deployed above the fattening pig gestation enclosure. The point cloud preprocessing module is mounted on an NVIDIA Jetson Xavier NX edge computing box, which can complete point cloud preprocessing in real time. The point cloud completion module has a built-in point cloud completion model pre-trained in Example 1, which can realize real-time completion inference of missing point clouds. The body posture analysis module has a built-in 3D reconstruction unit, body size measurement unit, body posture classification unit, and posture recognition unit, which can complete multi-dimensional body posture analysis. The result output module includes a 10.1-inch touch screen and RS485, Ethernet, and MQTT communication interfaces, which can visualize the analysis results and synchronize them to the smart breeding management system. The model training module is deployed on a cloud GPU server, which can complete the pre-training, fine-tuning, and parameter update of the model.
[0031] The system in this embodiment has a total hardware cost of no more than 1,500 yuan per channel, which is more than 75% lower than the traditional multi-view 3D reconstruction scheme. The deployment cycle is no more than 2 hours, and the average error of body size measurement is less than 3%, which fully meets the normal application needs of large-scale breeding.
[0032] Example 5 This embodiment provides a pig body posture perception method based on point cloud completion, applied to the passageway body posture perception of large-scale fattening pig group rearing. The difference from Embodiment 1 is that: the three-dimensional sensor uses a 16-line LiDAR, which is fixedly deployed on both sides of the exit passage of the pig pen, and collects three-dimensional point cloud data of the body surface of the passing pigs from a single perspective; during the point cloud completion model training process, the multi-mode occlusion operation focuses on strengthening the overall occlusion based on spatial region, simulating the scenario of multiple pigs occluding each other in a group rearing setting; in the body posture analysis step, the effective frames of the pigs passing in front are selected by posture recognition, and the body size parameters are continuously measured. The measurement time for a single pig does not exceed 2 seconds, and the average measurement error is ≤3.2%, which can realize large-scale, non-contact body posture survey of group rearing pigs.
[0033] Controlled experiment and effect verification To verify the technical effectiveness of this invention, three control experiments were set up, employing the scheme of Example 1 of this invention, the traditional multi-view 3D reconstruction scheme, and the general PoinTr algorithm + single-view acquisition scheme, respectively. These experiments were conducted under the same breeding environment and with the same sample of 100 fattening pigs. In this test, each pig was sampled 10 times repeatedly, and the results were averaged. Differences between groups were analyzed using a t-test; P < 0.05 was considered statistically significant. The test results are shown in the table below: The test results show that, under the premise of single-view and low cost, the present invention achieves completion accuracy and body analysis accuracy far exceeding the existing technology, while having extremely strong scene robustness, and completely solves the core pain points of the existing technology.
[0034] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for pig posture perception based on point cloud completion, comprising the following steps: S1 point cloud acquisition: Three-dimensional point cloud data of the pig's body surface is acquired from a single viewpoint using a three-dimensional sensor; S2 point cloud preprocessing: The collected raw 3D point cloud data is denoised, the background is cropped, downsampled, and the coordinates are normalized to obtain a standardized missing point cloud. S3 Point Cloud Completion: Input the pre-processed missing point cloud into the pre-trained point cloud completion model, predict and complete the missing regions, and generate a complete point cloud with a complete structure and geometric continuity. S4 Body Reconstruction and Analysis: Based on the completed point cloud, complete the three-dimensional reconstruction of the pig's body and execute the preset body analysis task; S5 Result Output: Visualizes the results of pig body posture analysis and synchronizes the data to the intelligent farming management system; its key feature is that... In S3, the point cloud completion model adopts a Transformer-based encoder-decoder architecture. Each encoding layer of the encoder is followed by a feature interaction learning module. The feature interaction learning module groups the local neighborhood of the point cloud using the k-nearest neighbor algorithm, performs self-attention interaction calculation on the features within the group, aggregates them to obtain fine-grained local geometric features, and then fuses the local geometric features with the global structural features output by the encoder across dimensions. The feature transformation path of the encoder-decoder structure is embedded with an inverse residual multilayer perceptron module. The inverse residual multilayer perceptron module enhances the high-dimensional feature representation capability through an extended-compression feature mapping mechanism.
2. The pig posture perception method based on point cloud completion according to claim 1, characterized in that, In S1, the three-dimensional sensor is any one of a consumer-grade depth camera, lidar, or millimeter-wave radar. The data acquisition method is to be fixedly deployed above the aisle, gestation pen, or feeding area of the breeding pen, and to collect data from a single perspective in a normalized manner.
3. The pig posture perception method based on point cloud completion according to claim 2, characterized in that, The point cloud preprocessing steps of S2 are as follows: a statistical filtering algorithm is used to remove outlier noise points in the point cloud; a random sampling consensus algorithm is used to remove the ground and pen background point clouds, retaining only the point cloud in front of the pig's body surface; a voxel downsampling algorithm is used to unify the number of point clouds to 2048 points; and the point cloud coordinates are normalized to a unit space of [-1,1] by center translation and scale scaling to obtain the preprocessed missing point cloud.
4. The pig posture perception method based on point cloud completion according to claim 3, characterized in that, In step S3, the point cloud completion model is trained using a weighted sum of chamfer distance and bulldozer distance as the total loss function, as shown in the formula: in, The chamfer distance loss is used to constrain the overall structural differences between the completed point cloud and the true complete point cloud; The bulldozer distance loss is used to constrain the local detail distribution of the completed point cloud; The value range is 0.8-1.
2. The value range is 0.3-0.7; the model training uses the AdamW optimizer, with an initial learning rate set to 5e-5~5e-4, a batch size set to 8-32, and a total number of training rounds set to 100-300 rounds. Every 40-60 rounds, the learning rate decays to 0.4-0.6 of the original value. Training is terminated early when the validation set loss does not decrease for 8-12 consecutive rounds. The encoder of the point cloud completion model includes 6 cascaded Transformer encoding layers, and the decoder includes 6 cascaded Transformer decoding layers, ultimately outputting a complete point cloud of 16384 points. The k-nearest neighbor number of the feature interaction learning module is set to 16, and the channel expansion factor of the inverted residual multilayer perceptron module is set to 3.
5. The pig posture perception method based on point cloud completion according to claim 4, characterized in that, The specific steps of the body reconstruction and analysis in S4 are as follows: a three-dimensional mesh model of the pig's body shape is generated based on the completed point cloud using the Poisson surface reconstruction algorithm, and at least one body shape analysis task is performed based on the three-dimensional mesh model; the body shape analysis task includes pig body size parameter measurement, body shape health classification, and behavioral posture recognition; wherein body size parameter measurement locates key anatomical sites of the pig through key point detection, and growth parameters are calculated based on the three-dimensional coordinates of the sites; body shape health classification divides the pig's body shape into three categories: healthy, emaciated, and obese; and behavioral posture recognition is used to identify the pig's daily behaviors such as standing, lying down, eating, and drinking.
6. A training method for a pig body posture perception point cloud completion model, used to prepare the point cloud completion model used in any one of claims 1-5, comprising the following steps: T1 baseline complete point cloud construction: Through multi-view 3D acquisition and point cloud registration, a pig baseline complete point cloud with closed topology and noise below 0.5mm threshold is obtained; T2 Non-rigid Deformation Sample Augmentation: The baseline complete point cloud is deformed by a continuous non-rigid deformation model to generate a complete point cloud sample set covering the deformation space of pig body shape. T3 dataset construction: Apply multi-mode occlusion operation to the complete point cloud sample set to construct a one-to-one corresponding "complete point cloud-missing point cloud" pair sample set, and divide it into training sample set and validation sample set in an 8:2 ratio; T4 Model Training: Based on the training sample set and the validation sample set, a deep learning network with an embedded feature interaction learning module and an inverted residual multilayer perceptron module is trained. The model parameters are optimized by combining transfer learning and multi-dataset joint training strategies to obtain a pre-trained point cloud completion model. The characteristic is that in T2, the continuous non-rigid deformation model adopts a thin plate spline deformation model driven by a continuous kernel function, and a single set of reference complete point clouds generates no less than 50 sets of deformed complete point cloud samples. In T3, the multi-mode occlusion operation includes at least one of the following: overall occlusion based on spatial region, slice occlusion based on viewing direction, and random occlusion based on local region, or any combination of two or more.
7. The training method according to claim 6, characterized in that, Specifically, T1 involves using a high-precision structured light 3D scanner to acquire 3D point clouds from no less than 8 perspectives of a live pig model or a pig in a fixed posture. The point clouds from multiple perspectives are then stitched together using an iterative nearest-point registration algorithm. After denoising, hole filling, and topology optimization, a baseline complete point cloud is obtained. The transfer learning strategy in T4 involves first pre-training the basic network using the ShapeNet general large-scale point cloud dataset to obtain initial model parameters with general geometric feature extraction capabilities. Then, the initial model is fine-tuned using the constructed pig body posture point cloud dataset.
8. A pig posture perception system based on point cloud completion, used to implement the pig posture perception method according to any one of claims 1-5, comprising a point cloud acquisition module, a point cloud preprocessing module, a point cloud completion module, a posture analysis module, and a result output module connected in sequence via communication; the point cloud acquisition module is primarily a three-dimensional sensor, used to acquire three-dimensional point cloud data of the pig's body surface from a single perspective using the three-dimensional sensor; the point cloud preprocessing module includes a built-in denoising unit, a background cropping unit, a downsampling unit, and a normalization unit, used to perform denoising, background cropping, and normalization on the acquired raw three-dimensional point cloud data. Downsampling and coordinate normalization processes are used to obtain a preprocessed missing point cloud. The point cloud completion module has a pre-trained point cloud completion model built-in, used to input the preprocessed missing point cloud into the model and output a structurally complete completed point cloud. The body posture analysis module has a built-in 3D reconstruction unit and body posture analysis unit, used to complete 3D reconstruction of the pig's body posture based on the completed point cloud and execute preset body posture analysis tasks. The result output module includes a touch screen and a standardized communication interface, used to visually output the pig's body posture analysis results and synchronize the data to the intelligent breeding management system. Its features include... The point cloud completion module has a built-in point cloud completion model that adopts a Transformer-based encoder-decoder structure. Each encoding layer of the encoder is followed by a feature interaction learning module. The feature interaction learning module groups the local neighborhood of the point cloud using the k-nearest neighbor algorithm, performs self-attention interaction calculation on the features within the group, aggregates them to obtain fine-grained local geometric features, and then fuses the local geometric features with the global structural features output by the encoder across dimensions. The feature transformation path of the encoder-decoder structure is embedded with an inverse residual multilayer perceptron module.
9. The pig posture perception system based on point cloud completion according to claim 8, characterized in that, It also includes a model training module that is communicatively connected to the point cloud completion module; the model training module includes a baseline point cloud construction unit, a sample amplification unit, a dataset construction unit, and a training execution unit, used to complete the pre-training and parameter update of the point cloud completion model; the posture analysis unit includes at least one of a body size measurement unit, a posture classification unit, and a pose recognition unit; the point cloud preprocessing module is mounted in an edge computing box, and the model training module is deployed on a cloud server.
Citation Information
Patent Citations
Information recommendation method and device and electronic equipment
CN112308707A
Construction site safety monitoring method and system based on dynamic and static detection
CN114596518A