Abstract
In precision livestock farming, 3D point clouds provide important data support for analyzing pig behavior and monitoring their health. However, due to environmental occlusions, limited sensor viewpoints, and mutual shielding between pigs, the acquired point clouds are often severely partial, which affects the accuracy of body shape modeling and behavior recognition. To address these challenges, this study constructed a pig pose point cloud dataset using multi-view depth camera acquisition and point cloud registration techniques. Based on this dataset, an improved point cloud completion model, IIR-PoinTr, is proposed to enhance the reconstruction of geometric and topological structures in pig bodies. By strengthening local geometric perception and high-dimensional feature representation, the model improves the reconstruction quality of partial pig point clouds and produces more structurally consistent pig body shapes. Experimental results show that, on the self-constructed pig posture dataset, the proposed method reduces Chamfer Distance (CD-L1) by 3.6%, CD-L2 by 6.9%, and Earth Mover’s Distance (EMD) by 2.0%, while improving the F-score by 5.4% compared with the baseline model. In single-view point cloud completion tasks, the method is capable of reconstructing geometrically consistent pig body structures and increases downstream classification accuracy by 34.9%. These results indicate that the proposed method can improve the reconstruction quality of partial pig point clouds and provide preliminary technical support for posture analysis under occlusion.
1. Introduction
Pigs are one of the most economically valuable livestock species worldwide and are an important source of animal protein for humans [1,2]. The behavior and posture of pigs are closely related to their welfare status, feeding condition, reproductive performance, and early signs of disease. Subtle changes in standing, lying, walking, or posture transitions often reflect health issues such as stress, lameness, and gastrointestinal diseases. Therefore, accurate acquisition and analysis of pig posture are of great importance in modern precision livestock farming, as they can support automated monitoring, early intervention, and improvements in production efficiency [3,4,5,6].
Precision animal husbandry is increasingly relying on continuous three-dimensional perception of animal posture to support animal welfare assessment, health monitoring and automated behavior analysis [7,8]. Three-dimensional point clouds can provide detailed geometric descriptions of animal body surfaces, enabling reliable posture recognition without the need for invasive markers. However, in practical applications, due to factors such as self-occlusion, significant body deformation, and limited sensor viewpoints, the acquired pig point clouds are often partial. Missing regions in areas such as the back, abdomen, head, and limbs can reduce the accuracy of downstream tasks, including posture estimation and motion analysis, highlighting the necessity of effective point cloud completion techniques for deformable livestock structures.
Traditional point cloud completion methods usually involve machine learning and manual feature extraction [9]. For example, Kazhdan et al. [10] and Li et al. [11] proposed geometry-based methods that utilize geometric cues from partial input data to infer the shapes of missing regions, thereby reconstructing the overall shape of the model without relying on external auxiliary data. Sipran et al. [12] and Speciale et al. [13] exploited symmetry to extend the visible regions of 3D models into occluded spaces, thereby predicting the shapes of missing components. Traditional methods, by constructing explicit geometric constraints, can achieve point cloud shape completion with relatively low computational complexity and demonstrate high effectiveness for specific 3D models. However, their strong reliance on prior knowledge and parameter tuning limits their generalization performance in complex environments and diverse scenarios.
In recent years, deep learning (DL) algorithms have been widely applied in the field of point cloud processing and have demonstrated superior performance over traditional methods in point cloud completion tasks. DL-based point cloud completion methods typically rely on graphics processing units for accelerated computation, enabling high-quality point cloud reconstruction within a relatively short time, and offering higher efficiency and automation compared with traditional geometric approaches [14,15,16]. For point cloud completion tasks, various deep learning-based model architectures have been proposed, with representative works summarized in Table 1. However, the existing DL-based point cloud completion research mainly focuses on standard datasets at the component level or object level, such as ShapeNet [17], ModelNet [18] and PCN [19]. Such datasets usually contain common objects with regular structures and relatively fixed shapes, such as chairs, tables and aircraft. In contrast, research on DL-based point cloud completion in animal posture scenarios remains relatively limited, especially for pig posture point clouds with significant non-rigid deformation, where the applicability and stability of existing methods still lack systematic validation.
Table 1.
Summary of DL algorithms for point cloud completion.
Pig posture point clouds exhibit geometric characteristics that differ significantly from those of rigid objects. Their body surfaces undergo non-rigid deformation with posture changes, accompanied by severe self-occlusion and substantial local structural variations, which limit the performance of existing point cloud completion models under complex shapes and high missing rates. Meanwhile, DL-based completion methods rely heavily on large-scale, high-quality training data, whereas existing pig point cloud datasets are limited in size and mostly consist of partial data, making it difficult to satisfy the “complete–partial” paired training requirement. In addition, factors such as acquisition viewpoints, self-occlusion, and sampling density lead to widespread large-area missing regions in pig point clouds, further increasing the difficulty of dataset construction and model training.
To address the above research gap, this study investigates point cloud completion methods for body posture analysis based on the non-rigid surface characteristics of pigs. The main contributions are as follows:
- (1)
- A high-quality dedicated dataset is constructed: using multi-view depth cameras and point cloud registration techniques, a paired pig point cloud dataset of complete and partial samples is established, covering three core postures—standing, sitting, and lying—thereby providing a data foundation for related research.
- (2)
- A point cloud completion method, termed IIR-PoinTr, is proposed to address the reconstruction of deformable pig body structures under severe occlusion. By enhancing local geometric perception, the model better captures fine-grained structures such as body contours, limb boundaries, and surface curvature variations. In addition, high-dimensional feature representation is strengthened to alleviate feature degradation in deep networks, thereby improving the geometric accuracy and structural consistency of completed pig point clouds.
- (3)
- The proposed method will be further evaluated using partial point cloud data collected by a single-view depth camera under limited-view conditions, and its application potential in pig pose recognition will be preliminarily analyzed.
2. Materials and Methods
2.1. Complete Pig Posture Point Cloud Acquisition
To establish a high-quality data foundation for point cloud completion research, complete pig posture point clouds were acquired in a controlled experimental environment from October 10 to 25, 2025. As shown in Figure 1, the acquisition process follows the standard five-view 3D reconstruction pipeline, where a fixed measurement framework was constructed in the laboratory and a bionic pig model was placed at the center as the acquisition target. Through multi-view synchronous acquisition and point cloud fusion, high-density point cloud data covering the complete body surface structure were obtained, providing reliable complete point cloud references for subsequent dataset construction.
Figure 1.
Schematic diagram of pig complete posture point cloud acquisition and missing simulation process. (b) Multi-view acquisition setup, including sample acquisition scenes and the spatial layout of the five-view depth camera system. Four cameras (C2–C5) were installed around the acquisition frame, and one camera (C1) was mounted vertically above the frame.
In this paper, a complete pig point cloud acquisition system was built in a controlled experimental environment, and the pig model was synchronously scanned by a multi-view depth camera. The size of the acquisition frame is 2 m × 3 m, the acquisition device uses five LXPS-M4422-79E depth cameras (Zhejiang MRDVS Technology Co., Ltd., Hangzhou, China), and the computing platform is configured with Intel i7-4210M dual core four thread processor (Intel Corporation, Santa Clara, CA, USA) and 16 GB memory. Among them, four cameras are installed at the four corners of the acquisition frame to obtain the side view and squint point cloud of the pig, and the other camera is installed vertically above the frame to obtain the top view point cloud. The five-view layout can better cover the main surface area of the pig body and reduce the loss of local information caused by self-occlusion under the condition of single-view acquisition. All cameras work in synchronous trigger mode to ensure the consistency of point clouds from different perspectives in time.
In the aspect of collection object setting, this paper selects three typical poses of pigs, namely standing, sitting and lying, to collect point clouds respectively. Five different bionic pig models were selected as the acquisition objects under each posture, and were scanned synchronously from multiple perspectives to form the initial complete point cloud sample set. By setting up different poses and individual models at the same time, the coverage of the data in the aspects of body shape change, body contour and local geometry can be improved, and more abundant morphological prior information can be provided for the subsequent point cloud completion model training. Relevant samples are then uniformly saved in .pcd format for subsequent point cloud processing and dataset construction.
In order to ensure the acquisition quality, the pig model was fixed in the center of the acquisition area during the acquisition process, and the relative position between the camera and the target remained unchanged. The laboratory ambient light is stable to reduce the impact of strong reflection, local shadow and brightness fluctuation on depth imaging results. When collecting, each view synchronously outputs the original depth point cloud data, and respectively records the corresponding attitude category, model number and collected view information, so as to facilitate the subsequent sample management and registration processing. For each group of original point clouds, firstly, the non-target areas such as the edge of the acquisition frame, the ground and the plane background are removed according to the spatial range of the acquisition area. Then the main point cloud of the pig body is retained to provide clean input data for the subsequent multi-view fusion. The purpose of this step is to reduce the interference of environmental structure on the results of point cloud registration and surface reconstruction, and improve the geometric consistency of the target region.
In the phase of point cloud registration, firstly, each depth camera is calibrated geometrically to obtain the internal and external parameter matrices of each camera. The internal parameter is used to describe the imaging parameters of the camera, and the external parameter is used to describe the position and attitude relationship of each camera relative to the unified world coordinate system. Based on the calibration results, the original point clouds collected from different perspectives are unified into the same coordinate system to complete the initial alignment of multi-view point clouds. Then, the iterative closest point (ICP) [26] algorithm was used for precise registration and fusion of multi-view point clouds to further correct the local deviation between each view point cloud, and finally generate a high-density and geometrically consistent pig whole body point cloud model. Compared with the single-view point cloud, the multi-view fusion results can more completely restore the geometric shape of the back, abdomen, head and limbs of the pig, so as to provide a reliable and complete reference sample for subsequent missing simulation and completion training.
In the point cloud preprocessing stage, in order to further improve the quality of the fused point cloud, this paper performs statistical outlier removal, median filtering and mean filtering on the point cloud in turn. Firstly, statistical outlier removal is used to eliminate the isolated noise points and outliers generated in the process of depth acquisition. Secondly, median filtering is used to suppress local abrupt noise and reduce the influence of individual outliers on surface morphology. Finally, the mean filter is used to smooth the point cloud surface and reduce the local fluctuation caused by random noise. In this experiment, the point cloud data of three typical pig postures were collected, and 15 original complete point cloud samples were obtained. These complete point clouds are uniformly saved in .pcd format and named according to the corresponding pose labels. In order to meet the input requirements of subsequent data construction and model training, all samples were further uniformly down sampled to 16,384 points.
2.2. Data Construction for Point Cloud Completion
To expand the scale of training samples and improve the robustness of the point cloud completion model under complex postures and occlusion conditions, a systematic pipeline for data augmentation and partial point cloud generation was developed based on the collected complete pig posture point clouds. The overall process consists of two main stages: augmentation of complete point clouds and generation of partial point clouds through occlusion simulation. Finally, paired “partial–complete” point cloud samples are constructed following the PCN-style data format for point cloud completion.
2.2.1. Complete Point Cloud Data Augmentation
In the complete point cloud enhancement stage, each complete point cloud is normalized and scaled to the unit sphere range to eliminate the influence of scale difference on model training. Then, a series of random geometric transformations are applied to the point cloud to enrich the geometric diversity of the data and improve the generalization ability of the model. Specifically, it includes random rotation around the vertical axis (−180°, 180°), anisotropic scaling along the X, Y, and Z directions (the scaling factor ranges from 0.9 to 1.1), and adding Gaussian noise with a mean value of 0 and a standard deviation of 0.01 to simulate the noise interference in the actual sensor acquisition process.
In addition to the rigid geometry transformation, this paper further introduces the non-rigid deformation operation to simulate the natural deformation characteristics of pig posture under different postures. Set the complete point cloud as
Non-rigid deformation is realized by introducing = 8 control points into the point cloud space and smoothly interpolating the displacement of points based on radial basis function. Specifically, for each point , the coordinates after deformation are expressed as
where is the random displacement vector of the kth control point, is the weight calculated by the distance between the point and the control point, and its form is defined as follows:
In the present implementation, denotes the radial basis width parameter.
As shown in Figure 2, after processing pigs using non-rigid deformation methods, key parts such as the head, hooves, and back underwent natural and significant morphological adjustments, effectively reproducing the posture diversity of pigs in real breeding environments.
Figure 2.
Non-rigid deformation schematic diagram.
Through the above data enhancement processing, on the premise of not damaging the overall structure of the pig body, 15 original complete point cloud samples were collected under three postures, and each sample was expanded to 800 samples, and a total of 12,000 complete point cloud samples were finally obtained. The enhanced data is evenly distributed among the three poses, providing richer, complete and more representative training data for the subsequent point cloud completion task.
2.2.2. Missing Point Cloud Simulation Method
In the partial point cloud generation stage, this paper uses a variety of occlusion-based strategies to simulate the common point cloud missing modes under the actual single-view and multi-view acquisition conditions for the enhanced complete point cloud samples. In order to systematically evaluate the performance of the point cloud completion method under different missing degrees, this paper sets up eight missing ratios, which are 25%, 40%, 50%, 55%, 60%, 65%, 70% and 75% respectively.
In order to simulate the missing point cloud caused by limited viewing angle and self-occlusion in the actual single camera acquisition process, this paper uses three geometric occlusion strategies to generate partial point cloud samples based on the complete point cloud. Specifically, for each complete point cloud, an occlusion method is randomly selected for clipping, including box occlusion, slab occlusion and viewpoint occlusion, so as to build partial point cloud datasets with different deletion modes and unified deletion ratio control.
- (1)
- Box occlusion
- (2)
- Slab occlusion
- (3)
- Viewpoint occlusion
Through the above process, this paper constructs a pig point cloud dataset containing 3 poses, 8 missing rates and 3 missing patterns (Figure 3). Under the condition of 8 missing rates, a missing pattern is randomly applied to each complete point cloud sample, and 96,000 partial point cloud samples are finally generated. In order to avoid data leakage, the complete point cloud is used as the basic unit, and the dataset is divided into training set, verification set and test set according to the ratio of 8:1:1. Then, the deletion simulation is performed independently in each subset to generate the corresponding part of the point cloud sample. The division strategy ensures that different missing samples generated from the same complete point cloud will not appear in different data subsets at the same time, thus ensuring the reliability of model training and performance evaluation.
Figure 3.
Schematic diagram of three missing modes. Caption: Green dots: the simulated partial point cloud; gray dots: the point cloud retained after occlusion.
2.3. Environmental Settings
The training parameters of the experiment follow the default settings of the PoinTr model, as shown in Table 2.
Table 2.
Experiment configuration details.
2.4. IIR-PoinTr
The proposed IIR-PoinTr model (Figure 4) is designed for completing pig pose point cloud tasks, and contains two key improvements on the original PoinTr framework. Firstly, the feature enhancement process after the output of feature extractor is implemented by an ISL module [27] to improve the modeling ability of the model for local geometric structures. Secondly, the original feedforward network in the encoder is replaced by InvResMLP module [28] to enhance the feature expression. Finally, the improved model not only ensures the computational efficiency, but also improves the quality of point cloud completion.
Figure 4.
Schematic diagram of IIR-PoinTr point cloud completion network structure. Caption: Overall network architecture; red-highlighted boxes denote the key proposed modules (ISL and InvResMLP).
2.4.1. ISL Module
The ISL module (Figure 5) is mainly composed of three parts: neighborhood feature learning (NFL), self feature learning (SFL) and dynamic feature aggregation (DFA).
Figure 5.
Schematic diagram of ISL module structure. Caption: The NFL branch is used to model local geometric relationships, while the SFL branch extracts the self-response feature of the target point. The DFA branch adaptively fuses the outputs of the two branches to generate the final point representation. Here, denotes the input feature of point , and denotes the feature associated with the -th neighbor of . and represent the features produced by the NFL and SFL branches, respectively, and is the final output of the ISL module. denotes the channel dimension. denotes the sigmoid activation function, and denotes the weight generation mapping. is the adaptive weight vector. and denote element-wise addition and Hadamard product, respectively.
Specifically, the input partial point cloud is processed by dgcnn_grouper to obtain the downsampling coordinate and the corresponding local feature . Then, the KNN neighborhood with = 16 is constructed according to the point coordinates, and the grouping feature is input into the ISL module for structural enhancement.
For the central point , its own characteristic is , and the characteristic of its K neighborhood points is . In the NFL branch, a local relationship feature between the center point and the neighborhood point is constructed:
Then, input it into mlp1 and maximize the pool in the neighborhood dimension to obtain the neighborhood aggregation characteristics.
where represents the NFL branch output, denotes the convolution kernel parameter, denotes the convolution operation, denotes batch normalization, and denotes the activation function with a negative slope. At the same time, in the SFL branch, the self feature of the center point is mapped directly:
where represents SFL branch output, which is used to retain the semantic response of the center point itself. On this basis, the DFA branch generates the adaptive weight according to the two features, and weights the neighborhood features and its own features, and finally obtains the enhanced point feature representation:
where represents element by element multiplication, and is the output characteristic of ISL module.
To address severe local deformation and occlusion in pig body point clouds, a structure-aware feature enhancement strategy was developed to improve local topology reconstruction. Among them, the NFL branch strengthens the perception of fine structures such as trunk folds, limb edges and local surface changes by constructing the local relationship between the center point and the neighborhood point. The SFL branch reduces the problem of feature instability caused by the lack of neighborhood information under the condition of high missing rate and boundary noise by directly preserving the feature response of the point itself. The DFA branch adaptively integrates local structural features with its own semantic features according to the structural complexity and missing degree of different regions, so as to improve the ability of the model to restore local details and reconstruct the overall structure of the pig point cloud.
2.4.2. InvResMLP
In order to enhance the ability of feature transformation in the coding phase, InvResMLP module is introduced into the transformer encoder and used to replace the original feedforward network. InvResMLP, combined with local neighborhood aggregation, inverted bottleneck structure and residual connection, can improve the expression ability of point cloud features while keeping the parameter scale controllable, so as to improve the discrimination of coding features. According to the implementation in this paper, InvResMLP is only applied to an encoder block, while DecoderBlock still retains the original MLP structure to avoid excessive increase in overall network complexity.
Specifically, in the encoder, after the input feature is updated with self attention, it is first normalized, and then sent to the InvResMLP module together with the coordinates of the corresponding points (Figure 6). The module uses the local neighborhood information to complete the aggregation of geometric features, and uses the “expansion compression” inverted bottleneck method for channel mapping, in which the expansion ratio is set to 4, the number of neighborhood sampling points is set to 32, and the neighborhood radius is set to 0.1. Through this design, the module enhances the ability of high-dimensional feature representation on the basis of local structure modeling. Finally, the transformed feature is combined with the residual branch to obtain the current layer output of the encoder, so as to alleviate the deep feature degradation problem and improve the stability of the network.
Figure 6.
InvResMLP module network structure diagram.
For a given point feature , InvResMLP first uses local neighborhood aggregation to obtain the local structure enhanced feature , and then realizes the inverse residual feature transformation through extended mapping and compressed mapping. The final output can be expressed as
where and represent channel expansion and compression mapping, respectively, and represents nonlinear activation function.
From the implementation effect (Figure 4), InvResMLP does not directly replace the entire transformer structure, but is embedded in each block as an enhancement module of the encoder’s internal feedforward network. This local replacement method not only retains the overall structure of the original encoding decoding framework, but also strengthens the joint modeling ability of local geometric patterns and high-level semantic features in the encoding stage, providing a more discriminative feature representation for subsequent coarse completion point generation and decoding queries.
2.5. Evaluation Metrics
In order to comprehensively evaluate the performance of the point cloud completion model, this paper uses a variety of evaluation indicators to quantitatively analyze the difference between the predicted point cloud and the real point cloud from different angles. First, CD is used as the main evaluation index to measure the difference in the overall geometric structure between the predicted point cloud and the real point cloud. Let the predicted point cloud be and the real point cloud be , and its CD is defined as follows:
The CD used to evaluate the performance of the model has two versions: CD-L1 and CD-L2. CD-L1 uses Manhattan distance to calculate the distance between points and the absolute difference of coordinates. CD-L2 uses Euclidean distance to calculate the square root of the sum of squares of coordinate differences.
Secondly, by setting the distance threshold, F-score divides the matching relationship between predicted points and real points into correct matching and wrong matching, so as to comprehensively calculate the accuracy and recall rate of the model, which is defined as follows:
Among them, the precision rate represents the proportion of successful matches between the predicted point and the real point, while the recall rate represents the proportion of correct coverage of the predicted point in the real point.
On this basis, this paper further introduces EMD as a more stringent alignment evaluation index. Unlike CD, which is based on nearest neighbor matching, EMD measures the consistency of the global distribution of two groups of point clouds by calculating the minimum cost required to “transport” a point set to another point set as a whole. Let be a bijective mapping from point cloud to point cloud , then EMD is defined as follows:
In the experiment, CD and F-score are mainly used as the core evaluation index, supplemented by EMD as the supplementary index, in order to more comprehensively evaluate the overall quality and geometric consistency of the model in the point cloud completion task.
3. Results and Discussion
3.1. Comparative Experiment
Quantitative evaluation: Table 3 summarizes the evaluation indicators of different point cloud completion models under a 50% missing ratio. The F-score of IIR-PoinTr is 0.549, which is 5.37% and 14.13% higher than the baseline algorithm PoinTr and the mainstream algorithm AdaPoinTr, respectively, and achieves the lowest CD-L1 and CD-L2, which are 9.466 and 0.242, respectively. In terms of EMD index, IIR-PoinTr and PCN are both 15.915 in overall index, but IIR-PoinTr is better than PCN in Standing and Lying posture. Figure 7 shows the CD-L2 change curves of five DL algorithms during the training process. IIR-PoinTr always maintains a low CD-L2 value during the training process. The experimental results show that IIR-PoinTr performs better in the completion task under complex missing conditions, and the evaluation results are better than those of the baseline method, which verifies the effectiveness of IIR-PoinTr in complex geometric structure reconstruction.
Table 3.
Performance comparison of five deep learning completion models.
Figure 7.
CD-L2 curves of five completion models during training.
3.2. Quantitative Performance Evaluation and Visual Result Analysis
Table 4 shows that the IIR-pointr model has been tested in three scenarios with different missing ratios to complete all three poses of the point cloud: easy (25%), median (50%) and hard (75%). In the three difficulty levels, the model obtained the highest F-score (0.549) and the lowest CD-L1 (9.466), CD-L2 (0.242) and EMD (15.915) in the median-difficulty level, indicating that the point cloud completion evaluation index is the best. The performance of simple scenes is in the middle, while the performance of difficult scenes is relatively poor. This result may be related to the occlusion distribution of the training set. The average occlusion rate of the training data was approximately 50%, which is closer to the missing degree of the median-difficulty test scenario. Therefore, the model showed better adaptability under this condition. In the easy setting, although more original points were retained, the missing regions were relatively small and local, and the completion process may introduce slight point displacement or density inconsistency in visible regions, which can affect distance-based evaluation metrics. In contrast, in the hard setting, excessive missing information reduced the available geometric cues, especially in complex regions such as limb ends, abdominal boundaries, and body-contact areas, making accurate local structure reconstruction more difficult.
Table 4.
Point cloud completion evaluation results of IIR-PointTr model under different difficulty levels.
In the easy, median and hard scenarios, the point cloud completion results of the IIR-PoinTr model are shown in Figure 8. Each figure also shows the input partial point cloud, the real complete point cloud and the model completion results. The results show that the model can restore the overall geometric structure of the pig’s body more completely even in the complex scenes with high missing degree, which reflects the good completion ability and robustness of the model.
Figure 8.
Visual display of completion results in different difficulty scenarios.
3.3. Ablation Experiment
In order to fully verify the effectiveness of the proposed IIR-PoinTr model, systematic ablation experiments were carried out on the self-built pig point cloud dataset. The control variable method was used to evaluate the performance contribution of two core improved modules: ISL module and InvResMLP module. Experimental data (Table 5) shows that when ISL module is introduced, CD-L1 of the model decreases from 9.823 to 9.590 (2.4%), CD-L2 decreases from 0.260 to 0.249 (4.2%), EMD decreases from 16.235 to 15.975 (1.6%), and F-score increases by 3.1%. When the InvResMLP module replaced the encoder feedforward network, CD-L1 decreased from 9.823 to 9.631 (2.0%), CD-L2 decreased from 0.260 to 0.251 (3.5%), EMD decreased from 16.235 to 16.028 (1.3%), and F-score increased by 2.9%.
Table 5.
Overall ablation results of the IIR-PoinTr model.
When the two modules are integrated, the model achieves an F-score of 0.549, while CD-L1 decreases from 9.823 to 9.466 (3.6%), CD-L2 decreases from 0.260 to 0.242 (6.9%), and EMD decreases from 16.235 to 15.915 (2.0%). These results further indicate that the improvement in pig point cloud completion is not driven by a single factor, but depends on both local structure recovery and overall feature representation. The performance improvement after introducing the ISL module suggests that local geometric information is important for recovering incomplete regions of pig bodies, especially in areas with complex shapes or discontinuous structures, such as limbs, body edges, and contact regions. The improvement achieved by InvResMLP indicates that enhancing feature representation in the encoder also contributes to more accurate completion, suggesting that the model needs stable high-level features to infer the overall posture and body contour from partial observations. When the two modules are combined, the model achieves the best performance, indicating that local structural cues and global feature representation are complementary in the pig point cloud completion task. Therefore, the complete architecture can better handle both overall posture restoration and local detail recovery, leading to improved completion accuracy.
3.4. Visual Analysis of Single-View Point Cloud
Compared with manually cropped point clouds, point clouds collected by a single camera on site are more prone to uneven point cloud density and significant differences in point distribution in different areas, and may be accompanied by slight noise and depth measurement errors. To further verify the completion effect of the model under real single-view acquisition conditions, this paper selects two representative acquisition views: the oblique top view and the lateral view. Preprocess the point cloud data collected from pigs on site, use CloudCompare software (v2.13.2, 64-bit) to crop and extract the missing point cloud samples of individual pigs, save them in a unified .pcd format, and then perform point cloud completion and result analysis.
It can be seen from Figure 9 that IIR-PoinTr can better restore the overall contour and main geometric shape of the pig point cloud under the three postures, and the completion effect of the upper side view is better than that of the side view. This is mainly because the missing point cloud above the side can retain relatively complete pig structure information, meaning that the model can capture more effective geometric features, so as to obtain more stable completion results. At the same time, there are also significant differences in the difficulty of completing the point cloud of pigs with different postures. As shown in Figure 10, the left panels present representative partial pig point clouds under different postures, while the right panels enlarge the corresponding local regions with obvious missing structures or geometric discontinuities. In the standing posture, the partial point cloud retains relatively clear information on the back, trunk, and limb distribution, but some details are still missing at the limb ends and local edges. In the sitting posture, the bending and overlapping of limbs lead to incomplete geometric information around the limb connection regions and abdominal-adjacent areas, resulting in relatively weak completion performance in these regions. In the lying posture, the close contact between the body and limbs causes more serious local occlusion, and the enlarged regions show that the local structures are more prone to adhesion or blur. On the whole, although the model has limitations in detail recovery, it can effectively restore the overall structure and posture information of the three postures, providing a reliable geometric basis for subsequent downstream analysis.
Figure 9.
Point cloud completion effect based on single perspective acquisition.
Figure 10.
Representative complex local regions for pig point cloud completion.
3.5. Discussion
3.5.1. Complete Point Cloud to Improve Classification Accuracy
The experimental results show that the proposed IIR-PoinTr model can effectively improve the quality of the missing pig point cloud. In order to further verify the practicability of the completion results, this paper applies the completion point cloud to the pose classification task. In the experiment, 150 partial point cloud samples were constructed for each pose, and were equally set at three occlusion ratios of 25%, 50% and 75%, with a total of 450 partial point clouds. Then, IIR-PoinTr is used to complete these missing point clouds. The downstream classification task uses PointNet++ [29] as the classification model, and randomly extracts 600 complete point cloud samples from each pose, with a total of 1800 samples for the model classification training of three poses. After training, the classification model was tested on 450 partial point clouds and their corresponding 450 complementary point clouds.
As shown in Table 6, before point cloud completion, the OA (Overall Accuracy) and mloU (Mean Intersection over Union) of the missing point cloud were 0.651 and 0.481 respectively, indicating a relatively low accuracy. As can be seen from the normalized confusion matrix in Figure 11a, the recognition accuracy of lying posture is the highest, up to 78%. The reason is that the point cloud distribution of pigs in lying posture is relatively compact, and it is significantly different from sitting posture and standing posture in the vertical height dimension, and the discrimination of posture characteristics is higher, so it is easier to be correctly identified by the model.
Table 6.
Classification performance before and after point cloud completion.
Figure 11.
Comparison of confusion matrix.
Although some point clouds seriously affected the classification accuracy, after the application of point cloud completion, OA and mloU were both improved to 1.0. In addition, as shown in Figure 11b, all previously misclassified point clouds are accurately classified. This significant improvement highlights the effectiveness of point cloud completion in improving the accuracy of pig pose classification, even in the case of large occlusion.
3.5.2. Analysis of Problems in Complex Breeding Environment
Although this article constructs a self-built dataset of pig point clouds and proposes an improved IIR-PoinTr model, there are still certain limitations. Firstly, the effectiveness of this method has only been validated in controlled experimental environments and has not yet been deployed and tested in large-scale real pig farm scenarios. Its feasibility and robustness in complex dynamic breeding environments still need further evaluation [30]. Secondly, although the dataset in this article is based on real-world scene collection, there are still inherent limitations in covering all the variability of real-world occlusion [9]. The three occlusion simulation methods used in this study are unable to fully cover the complex and diverse occlusion scenes in actual pig farms. In particular, different housing conditions may introduce different types of point cloud interference. In slatted-floor systems, repeated floor gaps and discontinuous depth responses may generate background structures and boundary noise, which can interfere with pig body extraction and local point cloud completion. In litter-based pens, irregular bedding surfaces may increase background noise and cause additional occlusion around the abdomen, limbs, and body-contact regions. In addition, fences, feeders, drinkers, stocking density, and mutual occlusion among pigs may further increase the randomness and unpredictability of missing patterns. These factors are more complex than the simulated occlusion patterns used in this study and may affect the generalization performance of the model in actual deployment.
Finally, this article only preliminarily validated the application value of the completion results through posture classification tasks. The performance of the model in more complex downstream tasks such as pig behavior analysis and health monitoring, as well as generalization applications across pig farms and breeding environments, still needs further exploration and validation in subsequent research.
3.5.3. Follow up Research Ideas of Pig Point Cloud Supplement
- (1)
- The scale and diversity of the dataset can be continuously expanded, and the point cloud samples of pigs from different individuals, different growth stages and different collection perspectives can be included, so as to improve the generalization ability of the model in a complex breeding environment [31].
- (2)
- More targeted model optimization can be carried out around the recovery of local details, focusing on improving the completion accuracy and geometric consistency of difficult areas such as limb ends, abdominal surfaces and body-contact boundaries [32].
- (3)
- Training and modeling strategies closer to the real breeding scene can be explored, such as temporal point cloud association [33], multi-view geometric constraints and cross scene adaptive learning mechanisms, to enhance the robustness of the model in complex environments.
- (4)
- Point cloud segmentation can be introduced before completion to automatically distinguish individual pigs from complex backgrounds and provide clean partial point clouds for the completion model, thereby reducing manual intervention and improving the applicability of the method in real farm environments [34,35].
4. Conclusions
This study proposed IIR-PoinTr for completing partial pig body point clouds under occlusion. The method was designed according to the geometric characteristics and missing patterns of pig body structures, enabling improved local geometric perception and more robust feature representation. Experimental results showed that IIR-PoinTr reduced CD-L1, CD-L2, and EMD by 3.6%, 6.9%, and 2.0%, respectively, compared with the baseline model, while improving the F-score by 5.4%. The model also maintained reasonable reconstruction performance in single-view acquisition scenarios. In downstream posture classification, the completed point clouds increased OA and mIoU by 0.349 and 0.519, respectively. These findings indicate that this method can improve the accuracy and completeness of pig point cloud reconstruction, and provide reliable geometric support for automatic pose analysis in precision animal husbandry.
Author Contributions
Conceptualization, F.C. and M.Z.; methodology, F.C.; software, Z.Y.; validation, F.C., H.H. and Z.Y.; formal analysis, B.X.; investigation, F.C.; resources, X.T.; data curation, F.C.; writing—original draft preparation, F.C.; writing—review and editing, F.T.; visualization, F.C.; supervision, F.T.; project administration, X.T.; funding acquisition, X.T. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the Innovation Program of Chinese Academy of Agricultural Sciences (CAAS-CSSAE-202402), the Agriculture Research System of China (CARS-35), the Central Public-interest Scientific Institution Basal Research Fund of Chinese Academy of Agricultural Sciences (Y2025YC57), and the National Agriculture Science Data Center (NASDC2026XM02).
Data Availability Statement
The data presented in this study are available on request from the corresponding author.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Wang, S.; Jiang, H.; Qiao, Y.; Jiang, S.; Lin, H.; Sun, Q. The research progress of vision-based artificial intelligence in smart pig farming. Sensors 2022, 22, 6541. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Guo, Q.; Sun, Y.; Orsini, C.; Bolhuis, J.E.; de Vlieg, J.; Bijma, P.; de With, P.H. Enhanced camera-based individual pig detection and tracking for smart pig farms. Comput. Electron. Agric. 2023, 211, 108009. [Google Scholar] [CrossRef] [Scilit]
- Burns, R.T.; Spajić, R. Precision Livestock Farming in Swine Production. In Tracing the Domestic Pig; IntechOpen: London, UK, 2024. [Google Scholar]
- Reza, M.N.; Kabir, M.S.; Haque, M.A.; Jin, H.B.; Kyoung, H.; Choi, Y.K.; Kim, G.; Chung, S.O. Instance segmentation and automated pig posture recognition for smart health management. J. Anim. Sci. Technol. 2025, 67, 677–700. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Devi, S.J.; Doley, J.; Bharati, J.; Mohan, N.H.; Gupta, V.K. Analysis of pig posture detection in group-housed pigs using deep learning-based mask scoring instance segmentation. Anim. Sci. J. 2024, 95, e13975. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Hu, X.Y.; Huang, L.L.; Ye, X.H. PIG-YOLO: A lightweight oriented bounding box detection method for edge-deployable pig posture detection. Meas. Sci. Technol. 2026, 37, 195701. [Google Scholar] [CrossRef] [Scilit]
- Lei, K.; Tang, X.; Li, X.; Lu, Q.; Long, T.; Zhang, X.; Xiong, B. Research and Preliminary Evaluation of Key Technologies for 3D Reconstruction of Pig Bodies Based on 3D Point Clouds. Agriculture 2024, 14, 793. [Google Scholar] [CrossRef] [Scilit]
- Arulmozhi, E.; Bhujel, A.; Moon, B.-E.; Kim, H.-T. The application of cameras in precision pig farming: An overview for swine-keeping professionals. Animals 2021, 11, 2343. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Yue, H.; Wang, Q.; Yan, Y.; Huang, G. Deep learning-based point cloud completion for MEP components. Autom. Constr. 2025, 175, 106218. [Google Scholar] [CrossRef] [Scilit]
- Kazhdan, M.; Hoppe, H. Screened poisson surface reconstruction. ACM Trans. Graph. 2013, 32, 1–13. [Google Scholar] [CrossRef] [Scilit]
- Li, Y.; Wu, X.; Chrysathou, Y.; Sharf, A.; Cohen-Or, D.; Mitra, N.J. Globfit: Consistently Fitting Primitives by Discovering Global Relations; Association for Computing Machinery: New York, NY, USA, 2011; pp. 1–12. [Google Scholar]
- Sipiran, I.; Gregor, R.; Schreck, T. Approximate symmetry detection in partial 3d meshes. Comput. Graph. Forum 2014, 33, 131–140. [Google Scholar] [CrossRef] [Scilit]
- Speciale, P.; Oswald, M.R.; Cohen, A.; Pollefeys, M. A symmetry prior for convex variational 3d reconstruction. In Proceedings of the European Conference on Computer Vision; Springer: Cham, Switzerland, 2016; pp. 313–328. [Google Scholar]
- Zhang, K.; Zhang, A.; Wang, X.; Li, W. Deep-learning-based point cloud completion methods: A review. Graph. Model. 2024, 136, 101233. [Google Scholar] [CrossRef] [Scilit]
- Zhuang, Z.; Zhi, Z.; Han, T.; Chen, Y.; Chen, J.; Wang, C.; Cheng, M.; Zhang, X.; Qin, N.; Ma, L. A Survey of Point Cloud Completion. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2024, 17, 5691–5711. [Google Scholar] [CrossRef] [Scilit]
- Wu, L.; Cheng, X.; Xu, Y.; Zeng, H.; Hou, J. Unsupervised 3D Point Cloud Completion via Multi-View Adversarial Learning. IEEE Trans. Vis. Comput Graph 2025, 31, 7890–7905. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Chang, A.X.; Funkhouser, T.; Guibas, L.; Hanrahan, P.; Huang, Q.; Li, Z.; Savarese, S.; Savva, M.; Song, S.; Su, H. Shapenet: An information-rich 3d model repository. arXiv 2015, arXiv:1512.03012. [Google Scholar]
- Wu, Z.; Song, S.; Khosla, A.; Yu, F.; Zhang, L.; Tang, X.; Xiao, J. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2015; pp. 1912–1920. [Google Scholar]
- Yuan, W.; Khot, T.; Held, D.; Mertz, C.; Hebert, M. Pcn: Point completion network. In Proceedings of the 2018 International Conference on 3D Vision (3DV), Verona, Italy, 5–8 September 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 728–737. [Google Scholar]
- Yang, Y.; Feng, C.; Shen, Y.; Tian, D. Foldingnet: Point cloud auto-encoder via deep grid deformation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 206–215. [Google Scholar]
- Fan, H.; Su, H.; Guibas, L.J. A point set generation network for 3d object reconstruction from a single image. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 605–613. [Google Scholar]
- Tchapmi, L.P.; Kosaraju, V.; Rezatofighi, H.; Reid, I.; Savarese, S. Topnet: Structural point cloud decoder. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 383–392. [Google Scholar]
- Yu, X.; Rao, Y.; Wang, Z.; Liu, Z.; Lu, J.; Zhou, J. Pointr: Diverse point cloud completion with geometry-aware transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 10–17 October 2021; pp. 12498–12507. [Google Scholar]
- Tatarchenko, M.; Richter, S.R.; Ranftl, R.; Li, Z.; Koltun, V.; Brox, T. What do single-view 3d reconstruction networks learn? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 3405–3414. [Google Scholar]
- Yu, X.; Rao, Y.; Wang, Z.; Lu, J.; Zhou, J. AdaPoinTr: Diverse Point Cloud Completion with Adaptive Geometry-Aware Transformers. IEEE Trans. Pattern Anal. Mach. Intell. 2023, 45, 14114–14130. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Segal, A.; Haehnel, D.; Thrun, S. Generalized-icp. Robot. Sci. Syst. 2009, 2, 435. [Google Scholar]
- Cheng, S.; Chen, X.; He, X.; Liu, Z.; Bai, X. Pra-net: Point relation-aware network for 3d point cloud analysis. IEEE Trans. Image Process. 2021, 30, 4436–4448. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Qian, G.; Li, Y.; Peng, H.; Mai, J.; Hammoud, H.; Elhoseiny, M.; Ghanem, B. Pointnext: Revisiting pointnet++ with improved training and scaling strategies. Adv. Neural Inf. Process. Syst. 2022, 35, 23192–23204. [Google Scholar] [CrossRef] [Scilit]
- Qi, C.R.; Yi, L.; Su, H.; Guibas, L.J. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In Advances in Neural Information Processing Systems 30; Neural Information Processing Systems Foundation, Inc. (NeurIPS): San Diego, CA, USA, 2017. [Google Scholar]
- Zhou, H.; Li, Q.; Xie, Q. Individual Pig Identification Using Back Surface Point Clouds in 3D Vision. Sensors 2023, 23, 5156. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Romanelli, A.; Servi, M.; Magherini, R.; Carfagni, M.; Volpe, Y. Survey of Latest Advancements in Deep Learning for Point Cloud Completion. IEEE Trans. Vis. Comput. Graph. 2026. Online ahead of print. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Xu, Z.; Li, Q.; Ma, W.; Li, M.; Xue, X.; Zhao, C. A reconstruction method for incomplete pig point clouds based on stepwise hole filling and its applications. Biosyst. Eng. 2025, 255, 104171. [Google Scholar] [CrossRef] [Scilit]
- Freeman, H.; Kantor, G. Transformer-based spatio-temporal association of apple fruitlets. In Proceedings of the 2025 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Hangzhou, China, 19–25 October 2025; IEEE: Piscataway, NJ, USA, 2025; pp. 3018–3025. [Google Scholar]
- Lin, R.; Hu, H.; Wen, Z.; Yin, L.; Yin, L. Research on denoising and segmentation algorithm application of pigs’ point cloud based on DBSCAN and PointNet. In Proceedings of the 2021 IEEE International Workshop on Metrology for Agriculture and Forestry (MetroAgriFor), Trento-Bolzano, Italy, 3–5 November 2021; pp. 42–47. [Google Scholar]
- Chang, K.; Ma, W.; Xu, X.; Qi, X.; Xue, X.; Xu, Z.; Li, M.; Guo, Y.; Meng, R.; Li, Q. A Point Cloud Segmentation Method for Pigs from Complex Point Cloud Environments Based on the Improved PointNet++. Agriculture 2024, 14, 720. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.










