Search papers, labs, and topics across Lattice.
This study introduces PigFormer, a novel two-stage system that utilizes RGB-D camera data to accurately predict swine body condition metrics, specifically subcutaneous backfat thickness and loin muscle depth. By employing a geometric front-end for height map standardization and a Slice Attention Encoder for spatial relationship modeling, PigFormer achieves a mean absolute error of 2.43 mm for backfat and 3.87 mm overall on a diverse dataset of 319 sows and gilts. The results indicate that PigFormer significantly outperforms traditional single-stage models, providing a scalable solution for automated body condition monitoring in swine production.
Automated body condition monitoring in swine production can now be achieved with unprecedented accuracy using a ceiling-mounted RGB-D camera.
Sow body condition is an important indicator for growers as it has a large impact on lactation performance and piglet survival. However, body condition measures used during production, such as visual scoring and calipers, correlate poorly with underlying tissue composition. Ultrasound scans can provide direct measurements of subcutaneous backfat thickness and loin muscle depth, but their operation is labor intensive and not scalable for production. We present PigFormer, an end-to-end two-stage system that takes raw depth frames from a ceiling-mounted RGB-D camera and predicts subcutaneous backfat thickness, loin muscle depth, and total tissue thickness at the last rib. Stage 1 is a geometric front-end that converts raw depth into a standardized height map via SAM3-to-MaskDINO segmentation distillation, ground-plane removal, and orientation normalization. Stage 2 is a Slice Attention Encoder that treats each height map as a sequence of cross-sectional slices and captures spatial relationships along the full dorsal surface. On a multi-site dataset of 319 sow and gilt instances from two facilities, PigFormer achieves 2.43 mm backfat MAE and 3.87 mm overall MAE. It outperforms strong single-stage ResNet-18 and ViT-small baselines. PigFormer offers a practical path toward continuous, automated, non-contact body condition monitoring in commercial swine production. Code is available at https://github.com/iambashar/Pigformer.