Automatic livestock dimension measurement driven by omnidirectional scanning selective state-space segmentation

Authors

  • Kai Zhang 1. College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China; 2. Integrated Scientific Experimental Base for Precision Agriculture Technology of the Ministry of Agriculture and Rural Affairs(Animal Husbandry), Beijing 100097, China
  • Qin Ma 1. College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China; 2. Integrated Scientific Experimental Base for Precision Agriculture Technology of the Ministry of Agriculture and Rural Affairs(Animal Husbandry), Beijing 100097, China
  • Xiaochen Shi 1. College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China; 2. Integrated Scientific Experimental Base for Precision Agriculture Technology of the Ministry of Agriculture and Rural Affairs(Animal Husbandry), Beijing 100097, China

Keywords:

Point cloud segmentation, Deep learning, Selective state space, Livestock body measurement

Abstract

Existing methods often struggle to accurately and automatically separate livestock from complex background environments and are further hindered by severe noise interference in point cloud data, which leads to insufficient segmentation accuracy and ultimately affects the precision of livestock body measurements. To address these challenges, this study proposes a livestock body measurement method based on omnidirectional spatial localization segmentation. First, an omnidirectional point cloud segmentation model (Omni-PointMamba) was designed, which adopts an eight-directional scanning strategy in 3D space and an alternating dual-module architecture that integrates Point Mamba Blocks with convolutional modules. By enhancing spatial neighborhood modeling capabilities, the model efficiently fuses region-specific geometric features with comprehensive structural context, thereby achieving precise separation of livestock from background interference. Second, a spatial localization-based measurement method was developed. This method constructs a spatial coordinate system using ground normal vectors to achieve automatic rotation and alignment of the point cloud. It employs a two-step clustering strategy to identify key body parts, including the head and tail, and determines measurement landmarks through geometric point distribution analysis, enabling accurate, non-contact estimation of body size parameters. Experiments conducted on 20 pigs and 103 cattle demonstrate that the proposed model achieves outstanding segmentation performance, with mean Intersection over Union (mIoU) values of 0.9930 for pigs and 0.9685 for cattle. Furthermore, the model yields low mean absolute percentage errors (MAPE) in morphological measurements. For pigs, the MAPE for body width, hip width, and chest girth are 1.34%, 1.99%, and 1.37%, respectively. For cattle, the MAPE for body slant length, chest width, hip height, and heart girth are 2.24%, 3.28%, 2.18%, and 4.22%, respectively. These results indicate that the proposed method provides highly accurate segmentation and morphological measurement capabilities for both pigs and cattle.      

Keywords: point cloud segmentation; deep learning; selective state space; livestock body measurement

DOI: 10.25165/j.ijabe.20261903.9846

Citation: Zhang K, Ma Q, Shi X C. Automatic livestock dimension measurement driven by omnidirectional scanning selective state-space segmentation. Int J Agric & Biol Eng, 2026; 19(3): 99–109.

References

[1] Chu M Y, Si Y S, Li Q, Liu G. Research advances in the automatic measurement technology for livestock body size. Transactions of the Chinese Society of Agricultural Engineering, 2022; 38(13): 228–240. (in Chinese)

[2] Liu D, He D J, Norton T. Automatic estimation of dairy cattle body condition score from depth image using ensemble model. Biosystems Engineering, 2020; 194: 16–27.

[3] Salau J, Haas J H, Junge W, Thaller G. Extrinsic calibration of a multi-Kinect camera scanning passage for measuring functional traits in dairy cows. Biosystems Engineering, 2016; 151: 409–424. doi: 10.1016/j.biosystemseng. 2016;10.008.

[4] Nir O, Parmet Y, Werner D, Adin G, Halachmi I. 3D computer-vision system for automatically estimating heifer height and body mass. Biosystems Engineering, 2018; 173: 4–10.

[5] Wang T H, Chen B, Zhang Z Q, Li H, Zhang M. Applications of machine vision in agricultural robot navigation: A review. Computers and Electronics in Agriculture, 2022; 198: 107085.

[6] Zhan L N, Wu P, Wuyun T, Jiang X H, Xuan C Z, Ma Y H. Algorithm of sheep body dimension measurement and its applications based on image analysis. Computers and Electronics in Agriculture, 2018; 153: 33–45.

[7] Xie C Q, Cang Y J, Lou X Z, Xiao H, Xu X, Li X J, et al. A novel approach based on a modified mask R-CNN for the weight prediction of live pigs. Artificial Intelligence in Agriculture, 2024; 12: 19–28. doi: 10.1016/j.aiia.20 24.03.001

[8] Li R, Wen Y C, Zhang S J, Xu X S, Ma B L, Song H B. Automated measurement of beef cattle body size via key point detection and monocular depth estimation. Expert Systems with Applications, 2024; 244: 123042.

[9] Salau J, Haas J H, Junge W, Thaller G. A multi-Kinect cow scanning system: Calculating linear traits from manually marked recordings of Holstein-Friesian dairy cows. Biosystems Engineering, 2017; 157: 92–98.

[10] le Cozler Y, Allain C, Caillot A, Delouard J M, Delattre L, Luginbuhl T, et al. High-precision scanning system for complete 3D cow body shape imaging and analysis of morphological traits. Computers and Electronics in Agriculture, 2019; 157: 447–453.

[11] Yang G Y, Xu X S, Song L, Zhang Q R, Duan Y C, Song H B. Automated measurement of dairy cows body size via 3D point cloud data analysis. Computers and Electronics in Agriculture, 2022; 200: 107218.

[12] Wang Y X, Shi Y Y, Chen Z D, Wu Z F, Cai G Y, Zhang S M, et al. Pig back transformer: Automatic 3D pig body measurement model. Smart Agriculture, 2024; 6(4): 76–90.

[13] Du A, Guo H, Lu J, Su Y, Ma Q, Ruchay A, et al. Automatic livestock body measurement based on keypoint detection with multiple depth cameras. Computers and Electronics in Agriculture, 2022; 198: 107059.

[14] Li J W, Ma W H, Bai Q, Tulpan D, Gong M L, Sun Y, et al. A posture-based measurement adjustment method for improving the accuracy of beef cattle body size measurement based on point cloud data. Biosystems Engineering, 2023; 230: 171–190.

[15] Qi C R, Su H, Mo K, Guibas L J. PointNet: Deep learning on point sets for 3D classification and segmentation. In: 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA: IEEE, 2017; pp.77–85. doi: 10.1109/CVPR.2017.16.

[16] Li Y Y, Bu R, Sun M C, Wu W, Di X H, Chen B Q. PointCNN: Convolution on X-transformed points. In: Proceedings of the 32nd International Conference on Neural Information Processing Systems (NIPS’18). Red Hook, NY, USA: Curran Associates Inc., 2018; pp.828–838.

[17] Wu W X, Qi Z G, Li F X. PointCONV: Deep convolutional networks on 3D point clouds. In: 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA: IEEE, 2019; pp.9613–9622. doi: 10.1109/CVPR.2019.00985.

[18] Lin Z H, Huang S Y, Wang Y C F. Learning of 3D graph convolution networks for point cloud analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022; 44: 4212–4224.

[19] Xu Q G, Sun X D, Wu C Y, Wang P Q, Neumann U. Grid-GCN for fast and scalable point cloud learning. In: 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA: IEEE, 2020; pp.5660–5669. doi: 10.1109/CVPR42600.2020.00570.

[20] Wu P X, Chai B S, Li H B, Zheng M H, Peng Y S, Wang Z Y, et al. Spiking point transformer for point cloud classification. Proceedings of the AAAI Conference on Artificial Intelligence, 2025; 39(20): 21563–21571.

[21] Zhao H S, Li J, Jia J Y, Torr P, Koltun V. Point transformer. In: 2021 IEEE/CVF International Conference on Computer Vision (ICCV), Montreal, QC, Canada: IEEE, 2021; pp.16239–16248, doi: 10.1109/ICCV48922.2021.01595.

[22] Zeng Z X, Wu Z M, Xie R T, Lin K, Tan S W, He X Y, et al. MACA-Net: Mamba-driven adaptive cross-layer attention network for multi-behavior recognition in group-housed pigs. Agriculture (Switzerland), 2025; 15(9): 968. doi: 10.3390/agriculture15090968.

[23] . . , ; (): –. Bai X, Liang D K, Tan X, Xu W, Ye X Q, Zhou X, et al. PointMamba: A simple state space model for point cloud analysis. In: Advances in Neural Information Processing Systems 37, Vancouver, Canada: Neural Information Processing Systems Foundation, Inc. (NeurIPS), 2024; 32653–32677. doi: 10.52202/079017-1026

[24] Zhang T, Yuan H B, Qi L, Zhang J N, Zhou Q Y, Ji S P, et al. Point cloud mamba: Point cloud learning via state space model. Proceedings of the AAAI Conference on Artificial Intelligence, 39(10): 10121–10130. doi: 10.1609/aaai.v39i10.33098

[25] Wang K, Guo H, Ma Q, Su W, Chen L C, Zhu D H. A portable and automatic Xtion-based measurement system for pig body size. Computers and Electronics in Agriculture, 2018; 148: 291–298.

[26] Ruchay A, Kober V, Dorofeev K, Kolpakov V, Miroshnikov S. Accurate body measurement of live cattle using three depth cameras and non-rigid 3-D shape recovery. Computers and Electronics in Agriculture, 2020; 179: 105821.

[27] Lyons T, Cirone N M, Orvieto A, Salvi C, Walker B. Theoretical foundations of deep selective state-space models. In: Advances in Neural Information Processing Systems 37, Vancouver, Canada: Neural Information Processing Systems Foundation, Inc. (NeurIPS), 2024; pp.127226–127272.

[28] Qi C R, Yi L, Su H, Guibas L J. PointNet++: Deep hierarchical feature learning on point sets in a metric space supplementary material. arXiv: 1706.02413, 2017: In Press. doi: 10.48550/arXiv.1706.02413.

[29] Ma X, Qin C, You H X, Ran H X, Fu Y. Rethinking network design and local geometry in point cloud: A simple residual MLP framework. arXiv: 2202.07123, 2022; In press. doi: 10.48550/arXiv.2202.07123.

[30] Engel N, Belagiannis V, Dietmayer K. Point transformer. IEEE Access, 2021; 9: 134826–134840.

[31] Liu Y, Zhou J, Bian Y F, Wang T S, Xue H X, Liu L S. Estimation of weight and body measurement model for pigs based on back point cloud data. Animals, 2024; 14: 1046.

[32] Wang K, Zhu D H, Guo H, Ma Q, Su W, Su Y. Automated calculation of heart girth measurement in pigs using body surface point clouds. Computers and Electronics in Agriculture, 2019; 156: 565–573.

[33] Weng Z, Lin W Z, Zheng Z Q. Cattle body size measurement based on DUOS–PointNet++. Animals, 2024; 14(17): 2553.

[34] Han B B, Zhang J R, Xiang Y Y, Li X P, Li S Q. Shapewarp: A “global-to-local” non-rigid sheep point cloud posture rectification method. Expert Systems with Applications, 2025; 270: 126524.

[35] Hou Z X, Zhang Q, Zhang B, Zhang H M, Huang L W, Wang M L. CattlePartNet: An identification approach for key region of body size and its application on body measurement of beef cattle. Computers and Electronics in Agriculture, 2025; 232: 110013.

[36] Lu H X, Zhang J L, Yuan X F, Lv J H, Zeng Z W, Guo H, et al. Automatic coarse-to-fine method for cattle body measurement based on improved GCN and 3D parametric model. Computers and Electronics in Agriculture, 2025; 231: 110017.

Downloads

Published

2026-07-14

How to Cite

(1)
Zhang, K.; Ma, Q.; Shi, X. Automatic Livestock Dimension Measurement Driven by Omnidirectional Scanning Selective State-Space Segmentation. Int J Agric & Biol Eng 2026, 19, 99–109.

Issue

Section

Animal, Plant and Facility Systems