Publications
Sort:
Issue
Multi-view voxel-based 3D skeleton reconstruction for pig lameness detection
Transactions of the Chinese Society of Agricultural Engineering 2026, 42(4): 291-299
Published: 28 February 2026
Abstract PDF (2.5 MB) Collect
Downloads:1

Pig lameness is one of the most important health indicators for the production efficiency and animal welfare in modern pig farming. Existing lameness detection is mostly constrained walkway system using a single-view camera, which is highly sensitive to occlusion and self-occlusion. Walkway-based acquisition is further required for the special facilities. The stress-related and unnatural locomotion can be induced to limit the reliability and representativeness of the gait data. In this study, an end-to-end multi-view 3D pose estimation network without 3D annotations, termed the Multi-View Voxel Network (MV-VoxelNet), was proposed for the natural, non-contact, and high-precision pig lameness detection under free-moving conditions. A lameness detection was developed using reconstructed 3D skeletons. Accurate 3D pig keypoints were extracted from the synchronized multi-view RGB images using a coarse-to-fine process with the global localization followed by local refinement. MV-VoxelNet was then reconstructed after extraction. In the global localization stage, a coarse 3D representation of the pig was constructed to fuse the multi-view observations into a voxel grid. A voxel cross-view attention (VCVA) module was introduced to adaptively fuse the features from the different camera views, in order to effectively integrate the multi-view information for robustness under occlusion. The voxel features were processed by a 3D voxel-to-voxel network. An initial 3D skeleton was obtained after fusion. In the local refinement stage, a lightweight refinement voxel-to-voxel network (RefineV2V) was refined for each keypoint. A small voxel region was constructed to center on its initial prediction. More precise localization was realized with a low computational cost. The continuous 3D keypoint coordinate sequences were obtained from the consecutive video frames using the reconstructed 3D skeletons. A dynamic local coordinate system was constructed to normalize the gait representations in order to handle free movement and varying walking directions. Specifically, four hoof contact points were extracted to estimate an optimal ground support plane via singular value decomposition. The plane normal was defined as the vertical axis. The forward body direction was determined using the orientation of the trunk keypoints, together with the support plane. A stable local coordinate system was established for each frame. All 3D keypoints were then transformed into this coordinate system, effectively eliminating the influence of the global orientation for the consistent gait analysis under free-walking conditions. Furthermore, 6 gait features were designed to characterize the pig locomotion using this dynamic local coordinate system. These features captured the complementary aspects of the gait abnormality, including the hoof symmetry, trunk vertical stability, lateral trunk inclination, gait phase imbalance, swing initiation and termination consistency, and fore–hind hoof following behavior. The extracted features were subsequently fed into a support vector machine (SVM) classifier to identify the normal, mildly lame, and severely lame pigs. Results showed that the MV-VoxelNet achieved a reprojection error (RE) of 10.17 pixels and a percentage of correct keypoints at a normalized threshold of 0.05 (PCK@0.05) of 88.83% without any 3D ground-truth annotations, which improved the baseline by 13.59 percentage points, respectively. Moreover, the lameness detection was achieved in an overall classification accuracy of 88.51%, indicating the effectiveness of the framework. Overall, a unified pipeline was presented to reconstruct the 3D pig skeletons from the synchronized multi-view RGB images. The gait features were extracted in a dynamic local coordinate system. The lameness severity was classified using a machine learning classifier. The framework required no 3D annotations using only a few standard RGB cameras, indicating the low annotation cost and easy deployment. Accurate, contact-free monitoring of the pig gait can be expected in the real-world pig farms. These finding can also provide a scalable solution for the 3D pig pose modeling and lameness detection.

Issue
Detecting piglet crushing events using amodal instance segmentation
Transactions of the Chinese Society of Agricultural Engineering 2025, 41(12): 219-229
Published: 30 June 2025
Abstract PDF (4.6 MB) Collect
Downloads:1

Piglet crushing by sows is one of the primary causes of piglet mortality before weaning. The occlusion of piglets by sows can make it highly challenging to detect the crushing events using existing computer vision. In this study, an accurate and rapid detection of piglet crushing events was proposed using amodal instance segmentation (AIS). Firstly, an improved AIS model, BCNet-FF (bilayer convolutional network-focused fusion), was developed by enhancing the baseline bilayer convolutional network (BCNet). The FLA-DSC (focused linear attention-depthwise separable convolution) module, an enhanced version with focused linear attention was integrated into the backbone network in order to improve the feature extraction for the occluded objects. Additionally, the FreqFusion feature fusion enhancement module was introduced into the feature pyramid networks (FPN), which strengthened multi-scale feature representation and enhanced feature extraction and fusion for occluded object contours. Consequently, high-precision segmentation was achieved. Secondly, a custom dataset was constructed, and the video sequences were processed using BCNet-FF. Sow posture information and pig instance segmentation results was extracted. Among them, the dorsal region of the sow was detected when the posture of the sow was identified as the lateral lying. A regression equation was formulated to estimate the actual contact contour between the sow and the ground. According to this contour, a risk region was delineated to highlight the areas with a high likelihood of piglet crushing. Thirdly, a multi-object tracking algorithm was applied using the target mask intersection over union (IoU) between adjacent frames. The piglets within the risk region were tracked. Finally, the risk region overlap ratio of piglets was calculated to determine whether a crushing event had occurred. The results show that the BCNet-FF was achieved in the precision rates of 97.8%, 98.2%, and 99.5% for the standing, sternal lying, and lateral lying postures, respectively, with the recall rates of 98.2%, 97.2%, and 97.8%, respectively. Segmentation ablation experiments showed that there was an improvement of 2.2 percentage points in the mAP@50, 2.5 percentage points in the mIoU, and an increase of 3.1 percentage points in the AP@50 for piglets using BCNet-FF, compared with the BCNet. The model size increased by 47.5 MB, and the inference speed was 11.4 frames per second. In the comparative experiments, BCNet-FF demonstrated superior performance in instance segmentation of sows and piglets, achieving an AP@50 of 97.4% in piglet segmentation, thereby exceeding Mask R-CNN, CenterMask2, Transfiner, YOLOv11x-seg, and BCNet by 7.8, 4.6, 5.6, 2.3, and 3.1 percentage points, respectively. In the evaluation of 90 video samples, the multi-object tracking method for piglets achieved an average IDF1 of 94.5% and MOTA of 93.8%. The proposed method achieved an accuracy of 91.1% in detecting piglet crushing events, with a sensitivity of 90.6%, a specificity of 91.9%, and an average inference speed of 8.9 frames per second. The better performance of the BCNet-FF model was highlighted to segment the sows and piglets in the occlusion scenarios, particularly for the segmentation accuracy of occluded piglet masks. The multi-object tracking with the target mask IoU can be expected to accurately track the occluded piglets. The constructed regression equation and risk region enabled accurate differentiation between occluded and crushed piglets, which significantly improved piglet crushing event detection accuracy. The practicality and reliability can be achieved to detect the piglet crushing events. The finding can provide an effective approach to monitor the piglet crushing events using computer vision.

Total 2