Detection and tracking of pigs in natural environments based on video analysis

Deqin Xiao, Aijing Feng, Jian Liu

Abstract


Detection and tracking of pigs are important for analyzing pig behavior using computer vision. However, in natural environments, illumination changes, complex scenes, adhesion, occlusion, and individual identification from multiple objects are challenges for detection and tracking. This paper provided an anti-interference algorithm for pig detection and tracking based on video analysis. Firstly, pigs were recognized in natural environment based on color information, and noises were removed based on the analysis of connected regions in the binary images. Secondly, multiple pigs were separated by contours and edges. Thirdly, pigs were tracked based on a set of association rules with constraint items (DT-ACR). When DT-ACR fails, targets that are not lost were tracked continuously, while lost targets were retrieved in the nearby location, which effectively increased the duration of tracking. Experiments showed that the algorithm was able to track each individual pig in the following conditions: no-light scenes, sun glint scenes, adhesion scenes and occlusion scenes. The overall tracking accuracy reached up to 87.32% (83.85% for serious adhesion, 87.4% for occlusion, 82.4% for strong light, 82.17% for no light and dark, 96.58% for 2 pigs, 88.33% for 3 pigs and 77.63 for 4 pigs). A pig activity analysis study based on the pig detection and tracking algorithm was carried out, and the results showed that the proposed method was able to track pigs for a long period of time and extract the values that reflected pigs’ movements.
Keywords: computer vision, pigs, animal behaviors, tracking, detection
DOI: 10.25165/j.ijabe.20191204.4591

Citation: Xiao D Q, Feng A J, Liu J. Detection and tracking of pigs in natural environments based on video analysis. Int J Agric & Biol Eng, 2019; 12(4): 116–126.

Keywords


computer vision, pigs, animal behaviors, tracking, detection

Full Text:

PDF

References


Ma C, Wang Y, Ying G. The pig breeding management system based on RFID and WSN. 2011 Fourth International Conference on Information and Computing. IEEE, 2011; pp.30–33.

Zhu W, Zhong F, Li X. Automated monitoring system of pig behavior based on RFID and ARM-LINUX. 2010 Third International Symposium on Intelligent Information Technology and Security Informatics. IEEE, 2010; pp.431–434.

Zhu J, Zhang L. Detection method on single pig target based on image processing. Computer and Communication, 2014; 12: 11–12. (in Chinese)

Ma L, Ji B, Liu H, Zhu W, Li W, Zhang T. Differentiating profile based on single pig contour. Transactions of the CSAE, 2013; 29(10): 168–174. (in Chinese)

Shao B, Xin H. A real-time computer vision assessment and control of thermal comfort for group-housed pigs. Computers and Electronics in Agriculture, 2008; 62(1): 15–21.

Nasirahmadi A, Richter U, Hensel O, Edwards S, Sturm B. Using machine vision for investigation of changes in pig group lying patterns. Computers and Electronics in Agriculture, 2015; 119: 184–190.

Bloemen H, Aerts J M A, Berckmans D, Goedseels V. Image analysis to measure activity index of animals. Equine Veterinary Journal, 1997; 29(S23): 16–19.

Oczak M, Viazzi S, Ismayilova G, Sonoda L, Roulston N, Fels M, Bahr C, Hartung J, Guarino M, Berckmans D, Vranken E. Classification of aggressive behavior in pigs by activity index and multilayer feed forward neural network. Biosystems Engineering, 2014; 119(4): 89–97.

Pu X, Zhu W, Lu C. Sick pig behavior monitor system based on symmetrical pixel block recognization. Computer Engineering, 2019; 35(21): 250–252.

Zhu W, Pu X, Li X, Lu C. Automatic identification system of suspected diseased pig based on behavior monitoring. Transactions of the CSAE, 2010; 26(1): 188–192. (in Chinese)

Kashiha M, Bahr C, Ott S, Moons C, Niewold T, Odberg F, Berckmans D. Automatic identification of marked pigs in a pen using image pattern recognition. Computers and Electronics in Agriculture, 2013; 93: 111–120.

Ahrendt P, Gregersen T, Karstoft H. Development of a real-time computer vision system for tracking loose-housed pigs. Computers and Electronics in Agriculture, 2011; 76(2): 169–174.

Zhou Y, Yu S, Ou J. Intelligent tracking of pigs combining camshift and Kalman filtering. Guangdong Agricultural Sciences, 2013; 40(9): 174–177, 188. (in Chinese)

Yu S, Chen Z, Ou J. Tracking algorithm based on multi-feature detection and target association of pigs on large-scale pig farms. Journal of Information and Computational Science, 2015; 12(10): 3837–3844.

Feng A, Xiao D. Motion parameter extraction algorithm for pigs under natural conditions. Journal of Computer Applications, 2016; 36(10): 2900–2906.

Xiao D, Feng A, Yang Q, Liu J, Zhang Z. Fast motion detection for pigs based on video tracking. Transactions of the CSAM, 2016; 47(10): 331, 351–357. (in Chinese)

Fu E Y, Leong H V, Ngai G, Chan S. Automatic fight detection based on motion analysis. IEEE International Symposium on Multimedia (ISM), 2015; pp.57–60.

Xiao Q, Hu X, Gao S, Wang H. Object detection based on contour learning and template matching. The 8th World Congress on Intelligent Control and Automation, IEEE, 2010; pp.6361–6365.

Bai X, Li, Q, Latecki L J, Liu W, Tu Z. Shape band: A deformable object detection approach. IEEE Conference on Computer Vision and Pattern Recognition, 2009; pp.1335–1342.

Yu S, Chen J, Ou J, Xu D. Multi-target tracking based on regional correlation and color histogram match. Advanced Materials Research, 2014; 631–637.

Tkalcic M, Tasic J F. Colour spaces: perceptual, historical and applicational background. IEEE, 2003; 1: 304–308.

Wei X, Jia K, Lan J, Li Y, Zeng Y, and Wang C. Automatic method of fruit object extraction under complex agricultural background for vision system of fruit picking robot. Optik - International Journal for Light and Electron Optics, 2014; 125(19): 5684–5689.

Zhou L P, Chen Z, Chen D, Yuan Y W, Li Y S, Zheng J H. Pig ear root detection based on adapted Otsu. Transactions of the CSAM, 2016; 47(4): 1–7. (in Chinese)

Otsu N. A threshold selection method from gray-level histograms. IEEE Transactions on Systems, Man, and Cybernetics, 1979; 9(1): 62–66.

Kashiha M, Bahr C, Ott S, Moons C, Niewold T, Tuyttens F, Berckmans D. Automatic monitoring of pig locomotion using image analysis. Livestock Science, 2014; 159: 141–148.

Argyros A, Lourakis M. Real-time tracking of multiple skin-colored objects with a possibly moving camera. In Pajdla T, Matas J (eds.), Computer Vision – ECCV 2004, Springer, 2004; pp.368–379.

Edwards-Murphy F, Magno M, Whelan P, O’Halloran J, Popovici E. b+WSN: Smart beehive with preliminary decision tree analysis for agriculture and honey bee health monitoring. Computers and Electronics in Agriculture, 2016; 124: 211–219.

Jiang J A, Wang C H, Chen C H, Liao M S, Su Y L, Chen W S, et al. A WSN-based automatic monitoring system for the foraging behavior of honey bees and environmental factors of beehives. Computers and Electronics in Agriculture, 2016; 123: 304–318.




Copyright (c) 2019 International Journal of Agricultural and Biological Engineering



2023-2026 Copyright IJABE Editing and Publishing Office