Depth-Based Detection of Standing-Pigs in Moving Noise Environments
Abstract
:1. Introduction
- Standing-pigs are detected at night (i.e., with a light turned off) with a low-cost depth camera. It is well known that most pigs sleep at night [44,45,46]. For the purpose of 24 h individual pig tracking, we only need to detect standing-pigs (i.e., we do not need to detect the majority of lying-pigs at night). Recently, low-cost depth cameras, such as Microsoft Kinect, have been released, and thus we can detect standing-pigs using depth information. However, the size of a 20-kg weaning pig is much smaller than that of a 100-kg adult pig. Furthermore, the accuracy of the depth data measured from a topview Kinect degrades significantly, because there is a limited distance (e.g., a maximum range of 4.5 m) and field-of-view (e.g., horizontal degree of 70.6 and vertical degree of 60) in which depth values are covered. If we install a Kinect at 3.8 m above the floor to cover the entire area of a pen (i.e., ), thus minimizing the installation cost for a large-scale farm, then it is difficult to classify a weaning pig as standing or lying. To increase the accuracy, we consider the undefined depth values around standing-pigs.
- A practical issue caused by moving noises is resolved. For example, in a commercial pig farm with a harsh environment (i.e., disturbances from dust and dirt), there are many moving noises (i.e., undefined depth values varying across frames) at night. Because these moving noises occlude pigs (i.e., even up to half of a scene can be occluded by moving noises), we need to recover the depth values that are occluded by the moving noises. Because we utilize the undefined depth values around standing-pigs to increase the detection accuracy, we need to classify undefined depth values as useful ones (i.e., caused by standing-pigs) and useless ones (i.e., caused by moving noises). We apply spatial and temporal interpolation techniques to reduce the moving noises. In addition, we combine the detection results of standing-pigs from the interpolated images and the undefined depth values around standing-pigs to detect standing-pigs more accurately.
- A real-time solution is proposed. Detecting standing-pigs is a basic low-level vision task for intermediate-level vision tasks such as tracking and/or high-level vision tasks such as aggressive analysis. To complete the entire vision tasks in real-time, we need to decrease the computational workload of the detection task. Without any time-consuming techniques to improve the accuracy of depth values, we can detect standing-pigs accurately at a processing speed of 494 frames per second (fps).
2. Background
3. Proposed Approach
3.1. Noise Removal and Outline Detection
3.2. Detection of Standing-Pigs
Algorithm 1 Standing-pigs detection algorithm |
Input: Depth Image Output: Detected Image Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
|
4. Experimental Results
4.1. Experimental Environments and Dataset
4.2. Detection of Standing-Pigs under Moving Noise Environment
4.3. Evaluation of Detection Performance
5. Conclusions
Acknowledgments
Author Contributions
Conflicts of Interest
References
- Banhazi, T.; Lehr, H.; Black, J.; Crabtree, H.; Schofield, P.; Tscharke, M.; Berckmans, D. Precision Livestock Farming: An International Review of Scientific and Commercial Aspects. Int. J. Agric. Biol. 2012, 5, 1–9. [Google Scholar]
- Neethirajan, S. Recent Advances in Wearable Sensors for Animal Health Management. Sens. Bio-Sens. Res. 2017, 12, 15–29. [Google Scholar] [CrossRef]
- Tullo, E.; Fontana, I.; Guarino, M. Precision Livestock Farming: An Overview of Image and Sound Labelling. In Proceedings of the 6th European Conference on Precision Livestock Farming (EC-PLF 2013), Leuven, Belgium, 10–12 September 2013; pp. 30–38. [Google Scholar]
- Matthews, S.; Miller, A.; Clapp, J.; Plötz, T.; Kyriazakis, I. Early Detection of Health and Welfare Compromises through Automated Detection of Behavioural Changes in Pigs. Vet. J. 2016, 217, 43–51. [Google Scholar] [CrossRef] [PubMed]
- Tscharke, M.; Banhazi, T. A Brief Review of the Application of Machine Vision in Livestock Behaviour Analysis. J. Agric. Inform. 2016, 7, 23–42. [Google Scholar]
- Han, S.; Zhang, J.; Zhu, M.; Wu, J.; Kong, F. Review of Automatic Detection of Pig Behaviours by using Image Analysis. In Proceedings of the International Conference on AEECE, Chengdu, China, 26–28 May 2017; pp. 1–6. [Google Scholar] [CrossRef]
- Wouters, P.; Geers, R.; Parduyns, G.; Goossens, K.; Truyen, B.; Goedseels, V.; Van der Stuyft, E. Image-Analysis Parameters as Inputs for Automatic Environmental Temperature Control in Piglet Houses. Comput. Electron. Agric. 1990, 5, 233–246. [Google Scholar] [CrossRef]
- Schofield, C. Evaluation of Image Analysis as a Means of Estimating the Weight of Pigs. J. Agric. Eng. Res. 1990, 47, 287–296. [Google Scholar] [CrossRef]
- Wongsriworaphon, A.; Arnonkijpanich, B.; Pathumnakul, S. An Approach based on Digital Image Analysis to Estimate the Live Weights of Pigs in Farm Environments. Comput. Electron. Agric. 2015, 115, 26–33. [Google Scholar] [CrossRef]
- Tu, G.; Karstoft, H.; Pedersen, L.; Jorgensen, E. Illumination and Reflectance Estimation with its Application in Foreground. Sensors 2015, 15, 12407–12426. [Google Scholar]
- Tu, G.; Karstoft, H.; Pedersen, L.; Jorgensen, E. Segmentation of Sows in Farrowing Pens. IET Image Process. 2014, 8, 56–68. [Google Scholar] [CrossRef]
- Tu, G.; Karstoft, H.; Pedersen, L.; Jorgensen, E. Foreground Detection using Loopy Belief Propagation. Biosyst. Eng. 2013, 116, 88–96. [Google Scholar] [CrossRef]
- Nilsson, M.; Herlin, A.; Ardo, H.; Guzhva, O.; Astrom, K.; Bergsten, C. Development of Automatic Surveillance of Animal Behaviour and Welfare using Image Analysis and Machine Learned Segmentation Techniques. Animal 2015, 9, 1859–1865. [Google Scholar] [CrossRef] [PubMed]
- Brünger, J.; Traulsen, I.; Koch, R. Randomized Global Optimization for Robust Pose Estimation of Multiple Targets in Image Sequences. Math. Model. Comput. Methods 2015, 2, 45–53. [Google Scholar]
- Buayaui, P.; Kantanukul, T.; Leung, C.; Saikaew, K. Boundary Detection of Pigs in Pens based on Adaptive Thresholding using an Integral Image and Adaptive Partitioning. CMU J. Nat. Sci. 2017, 16, 145–156. [Google Scholar] [CrossRef]
- Lu, M.; Xiong, Y.; Li, K.; Liu, L.; Yan, L.; Ding, Y.; Lin, X.; Yang, X.; Shen, M. An Automatic Splitting Method for the Adhesive Piglets’ Gray Scale Image based on the Ellipse Shape Feature. Comput. Electron. Agric. 2016, 120, 53–62. [Google Scholar] [CrossRef]
- Ma, C.; Zhu, W.; Li, H.; Li, X. Pig Target Extraction based on Adaptive Elliptic Block and Wavelet Edge Detection. In Proceedings of the International Conference on Signal Processing Systems, Auckland, New Zealand, 27–30 November 2016; pp. 15–19. [Google Scholar] [CrossRef]
- Guo, Y.; Zhu, W.; Jiao, P.; Ma, C.; Yang, J. Multi-object Extraction from Topview Group-Housed Pig Images based on Adaptive Partitioning and Multilevel Thresholding Segmentation. Biosyst. Eng. 2015, 135, 54–60. [Google Scholar] [CrossRef]
- Guo, Y.; Zhu, W.; Jiao, P.; Chen, J. Foreground Detection of Group-Housed Pigs based on the Combination of Mixture of Gaussians using Prediction Mechanism and Threshold Segmentation. Biosyst. Eng. 2014, 125, 98–104. [Google Scholar] [CrossRef]
- Nasirahmadi, A.; Edwards, S.; Matheson, S.; Sturm, B. Using Automated Image Analysis in Pig Behavioural Research: Assessment of the Influence of Enrichment Substrate Provision on Lying Behavior. Appl. Anim. Behav. Sci. 2017, 196, 30–35. [Google Scholar] [CrossRef]
- Nasirahmadi, A.; Hensel, O.; Edwards, S.; Sturm, B. A New Approach for Categorizing Pig Lying Behavior based on a Delaunay Triangulation Method. Animal 2017, 11, 131–139. [Google Scholar] [CrossRef] [PubMed]
- Nasirahmadi, A.; Hensel, O.; Edwards, S.; Sturm, B. Automatic Detection of Mounting Behaviours among Pigs using Image Analysis. Comput. Electron. Agric. 2016, 124, 295–302. [Google Scholar] [CrossRef]
- Nasirahmadi, A.; Richter, U.; Hensel, O.; Edwards, S.; Sturm, B. Using Machine Vision for Investigation of Changes in Pig Group Lying Patterns. Comput. Electron. Agric. 2015, 119, 184–190. [Google Scholar] [CrossRef]
- Ahrendt, P.; Gregersen, T.; Karstoft, H. Development of a Real-Time Computer Vision System for Tracking Loose-Housed Pigs. Comput. Electron. Agric. 2011, 76, 169–174. [Google Scholar] [CrossRef]
- Oczak, M.; Maschat, K.; Berckmans, D.; Vranken, E.; Baumgartner, J. Automatic Estimation of Number of Piglets in a Pen during Farrowing, using Image Analysis. Biosyst. Eng. 2016, 151, 81–89. [Google Scholar] [CrossRef]
- Ott, S.; Moons, C.; Kashiha, M.; Bahr, C.; Tuyttens, F.; Berckmans, D.; Niewold, T. Automated Video Analysis of Pig Activity at Pen Level Highly Correlates to Human Observations of Behavioural Activities. Livest. Sci. 2014, 160, 132–137. [Google Scholar] [CrossRef]
- Kashiha, M.; Bahr, C.; Ott, S.; Moons, C.; Niewold, T.; Tuyttens, F.; Berckmans, D. Automatic Monitoring of Pig Locomotion using Image Analysis. Livest. Sci. 2014, 159, 141–148. [Google Scholar] [CrossRef]
- Kashiha, H.; Bahr, C.; Ott, S.; Moons, C.; Niewold, T.; Odberg, F.; Berckmans, D. Automatic Weight Estimation of Individual Pigs using Image Analysis. Comput. Electron. Agric. 2014, 107, 38–44. [Google Scholar] [CrossRef]
- 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. Comput. Electron. Agric. 2013, 93, 111–120. [Google Scholar] [CrossRef]
- Kashiha, M.; Bahr, C.; Haredasht, S.; Ott, S.; Moons, C.; Niewold, T.; Odberg, F.; Berckmans, D. The Automatic Monitoring of Pigs Water Use by Cameras. Comput. Electron. Agric. 2013, 90, 164–169. [Google Scholar] [CrossRef]
- Viazzi, S.; Ismayilova, G.; Oczak, M.; Sonoda, L.; Fels, M.; Guarino, M.; Vranken, E.; Hartung, J.; Bahr, C.; Berckmans, D. Image Feature Extraction for Classification of Aggressive Interactions among Pigs. Comput. Electron. Agric. 2014, 104, 57–62. [Google Scholar] [CrossRef]
- Chung, Y.; Kim, H.; Lee, H.; Park, D.; Jeon, T.; Chang, H. A Cost-Effective Pigsty Monitoring System Based on a Video Sensor. KSII Trans. Internet Inf. 2014, 8, 1481–1498. [Google Scholar]
- Zuo, S.; Jin, L.; Chung, Y.; Park, D. An Index Algorithm for Tracking Pigs in Pigsty. In Proceedings of the ICITMS, Hong Kong, China, 1–2 May 2014; pp. 797–803. [Google Scholar] [CrossRef]
- Khoramshahi, E.; Hietaoja, J.; Valros, A.; Yun, J.; Pastell, M. Real-Time Recognition of Sows in Video: A Supervised Approach. Inf. Process. Agric. 2014, 1, 73–81. [Google Scholar] [CrossRef]
- Costa, A.; Ismayilova, G.; Borgonovo, F.; Viazzi, S.; Berckmans, D.; Guarino, M. Image-Processing Techniques to Measure Pig Activity in response to Climatic Variation in a Pig Barn. Anim. Prod. Sci. 2014, 54, 1075–1083. [Google Scholar] [CrossRef]
- Brendle, J.; Hoy, S. Investigation of Distances Covered by Fattening Pigs Measured with VideoMotionTracker. Appl. Anim. Behav. Sci. 2011, 132, 27–32. [Google Scholar] [CrossRef]
- Cook, N.; Bench, C.; Liu, T.; Chabot, B.; Schaefer, A. The Automated Analysis of Clustering Behavior of Piglets from Thermal Images in response to Immune Challenge by Vaccination. Animal 2017, 15, 1–12. [Google Scholar] [CrossRef] [PubMed]
- Shi, C.; Teng, G.; Li, Z. An Approach of Pig Weight Estimation using Binocular Stereo System based on LabVIEW. Comput. Electron. Agric. 2016, 129, 37–43. [Google Scholar] [CrossRef]
- Kongsro, J. Estimation of Pig Weight using a Microsoft Kinect Prototype Imaging System. Comput. Electron. Agric. 2014, 109, 32–35. [Google Scholar] [CrossRef]
- Lao, F.; Brown-Brandl, T.; Stinn, J.; Liu, K.; Teng, G.; Xin, H. Automatic Recognition of Lactating Sow Behaviors through Depth Image Processing. Comput. Electron. Agric. 2016, 125, 56–62. [Google Scholar] [CrossRef]
- Stavrakakis, S.; Li, W.; Guy, J.; Morgan, G.; Ushaw, G.; Johnson, G.; Edwards, S. Validity of the Microsoft Kinect Sensor for Assessment of Normal Walking Patterns in Pigs. Comput. Electron. Agric. 2015, 117, 1–7. [Google Scholar] [CrossRef]
- Zhu, Q.; Ren, J.; Barclay, D.; McCormack, S.; Thomson, W. Automatic Animal Detection from Kinect Sensed Images for Livestock Monitoring and Assessment. In Proceedings of the International Conference on Computational Cybernetics and Information Technology, Liverpool, UK, 26–28 October 2015; pp. 1154–1157. [Google Scholar] [CrossRef]
- Lee, J.; Jin, L.; Park, D.; Chung, Y. Automatic Recognition of Aggressive Pig Behaviors using Kinect Depth Sensor. Sensors 2016, 16, 631. [Google Scholar] [CrossRef] [PubMed]
- Robert, S.; Dancosse, J.; Dallaire, A. Some Observations on the Role of Environment and Genetics in Behaviour of Wild and Domestic Forms of Sus Scrofa (European Wild Boars and Domestic Pigs). Appl. Anim. Behav. Sci. 1987, 17, 253–262. [Google Scholar] [CrossRef]
- Wood, D.; Vestergaard, K.; Petersen, H. The Significance of Motivation and Environment in the Development of Exploration in Pigs. Biol. Behav. 1990, 15, 39–52. [Google Scholar]
- Ekkel, E.; Spoolder, H.; Hulsegge, I.; Hopster, H. Lying Characteristics as Determinants for Space Requirements in Pigs. Appl. Anim. Behav. Sci. 2003, 80, 19–30. [Google Scholar] [CrossRef]
- Mallick, T.; Das, P.P.; Majumdar, A.K. Characterization of Noise in Kinect Depth Images: A Review. IEEE Sens. J. 2014, 14, 1731–1740. [Google Scholar] [CrossRef]
- Open Source Computer Vision, OpenCV. Available online: http://opencv.org (accessed on 28 November 2017).
- Otsu, N. Threshold Selection Method from Gray-Level Histograms. IEEE Trans. Syst. Man Cybern. 1979, 9, 62–66. [Google Scholar] [CrossRef]
- Redmon, J.; Farhadi, A. YOLO9000: Better, faster, stronger. arXiv, 2016; arXiv:1612.08242. [Google Scholar]
- Greff, K.; Brandão, A.; Krauß, S.; Stricker, D.; Clua, E. A Comparison between Background Subtraction Algorithms using a Consumer Depth Camera. In Proceedings of the International Conference on Computer Vision Theory and Applications, Rome, Italy, 24–26 February 2012; pp. 431–436. [Google Scholar]
- Qiu, X.; Zhang, S. Hand Detection for Grab-and-Go Groceries. In Stanford University Course Project Reports—CS231n Convolutional Neural Network for Visual Recognition. Available online: http://cs231n.stanford.edu/reports.html (accessed on 28 November 2017).
- Bottger, T.; Follmann, P.; Fauser, M. Measuring the Accuracy of Object Detectors and Trackers. arXiv, 2017; arXiv:1704.07293. [Google Scholar]
- Lin, B.S.; Su, M.J.; Cheng, P.H.; Tseng, P.J.; Chen, S.J. Temporal and Spatial Denoising of Depth Maps. Sensors 2015, 15, 18506–18525. [Google Scholar] [CrossRef] [PubMed]
- He, Y.; Liang, B.; Zou, Y.; He, J.; Yang, J. Depth Errors Analysis and Correction for Time-of-Flight (ToF) Cameras. Sensors 2017, 17, 92. [Google Scholar] [CrossRef] [PubMed]
Information | Camera Type | No. of Pigs in a Pen | Pig Type | Classification between Standing and Lying Postures | Management of Moving Noise | Processing Speed (fps) | Reference |
---|---|---|---|---|---|---|---|
2D | Color | 1 | Fattening Pig | No | No | Not Specified | [9] |
Gray-Scale | 1 | Sow | No | No | 1.0 | [10] | |
Gray-Scale | 1 | Sow | No | No | 2.0 | [11] | |
Gray-Scale | Not Specified | Sow + Piglets | No | No | 4.0 | [12] | |
Color | 9 | Piglets | No | No | Not Specified | [13] | |
Color | 12 | Piglets | No | No | 4.5 | [14] | |
Color | 11 | Fattening Pigs | No | No | 1.0 | [15] | |
Gray-Scale | 2–12 | Piglets | No | No | Not Specified | [16] | |
Color | 7 | Not Specified | No | No | Not Specified | [17] | |
Color | 7 | Not Specified | No | No | Not Specified | [18] | |
Color | 7 | Not Specified | No | No | Not Specified | [19] | |
Color | 17–20 | Fattening Pigs | No | No | Not Specified | [20] | |
Color | 22 | Fattening Pigs | No | No | Not Specified | [21] | |
Color | 22 or 23 | Fattening Pigs | No | No | Not Specified | [22] | |
Color | 22 | Fattening Pigs | No | No | Not Specified | [23] | |
Color | 29 | No | No | 3.7 | [24] | ||
Color | 3 | Not Specified | No | No | 15.0 | [25] | |
Color | 10 | Piglets | No | No | Not Specified | [26] | |
Color | 10 | Piglets | No | No | Not Specified | [27] | |
Color | 10 | Piglets | No | No | Not Specified | [28] | |
Color | 10 | Piglets | No | No | Not Specified | [29] | |
Color | 10 | Piglets | No | No | Not Specified | [30] | |
Color | 10 | Piglets | No | No | Not Specified | [31] | |
Color | 12 | Piglets | No | No | 1–15 | [32] | |
Color | 22 | Piglets | No | No | Not Specified | [33] | |
Infrared | 1 | Sow | No | No | 8.5 | [34] | |
Infrared | ~16 | Fattening Pigs | No | No | Not Specified | [35] | |
Infrared | 6 or 12 | Fattening Pigs | No | No | Not Specified | [36] | |
Thermal | 7 | Piglets | No | No | Not Specified | [37] | |
3D | Stereo | 1 | Piglet | Not Specified | No | Not Specified | [38] |
Depth | 1 | 29–139 kg Pig | Not Specified | No | Not Specified | [39] | |
Depth | 1 | Sow | Yes | No | Not Specified | [40] | |
Depth | 1 | Fattening Pig | Not Specified | No | Not Specified | [41] | |
Depth | 10 | 25 or 60 kg Pigs | Yes | No | Not Specified | [42] | |
Depth | 22 | Piglets | Yes | No | 15.1 | [43] | |
Depth | 13 | Piglets | Yes | Yes | 494.7 | Proposed Method |
Category | Definition | Explanation |
---|---|---|
Types of images | Depth input image | |
Background image | ||
Image to which spatiotemporal interpolation is applied | ||
Image to which background subtraction is applied | ||
Image of candidates detected | ||
Image of candidate edges | ||
Image of outlines detected around standing-pigs | ||
Image overlapped between and | ||
Image to which dilation operator is applied | ||
Image combining with | ||
Result image of standing-pigs | ||
Types of undefined values | Undefined values caused by slates on the floor | |
Undefined values for outlines generated around standing-pigs | ||
Undefined values of moving noises in an input image | ||
Undefined values of Kinect’s limited distance and field-of-view |
Method | Accuracy (%) |
---|---|
Proposed method | 94.47 |
YOLO9000 | 86.25 |
No. of Undefined Pixels (%) | No. of Standing-Pigs | Proposed Method | YOLO9000 [50] | |||
---|---|---|---|---|---|---|
No. of True Standing-Pigs Detected | No. of False Standing-Pigs Detected | No. of Actual Standing-Pigs Detected | No. of False Standing-Pigs Detected | |||
01:00 | 21.06 | 28 | 28 | 0 | 28 | 33 |
04:00 | 19.80 | 39 | 39 | 3 | 39 | 9 |
07:00 | 21.52 | 496 | 496 | 21 | 468 | 20 |
10:00 | 23.95 | 121 | 121 | 5 | 114 | 4 |
13:00 | 23.75 | 202 | 202 | 15 | 199 | 8 |
16:00 | 22.83 | 190 | 190 | 12 | 186 | 6 |
19:00 | 21.73 | 59 | 59 | 2 | 57 | 18 |
22:00 | 20.51 | 51 | 51 | 5 | 48 | 18 |
Total | - | 1186 | 1186 | 63 | 1139 | 116 |
Method | Frames per Second |
---|---|
Proposed method | 494.7 |
YOLO9000 | 87.0 |
© 2017 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 (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Kim, J.; Chung, Y.; Choi, Y.; Sa, J.; Kim, H.; Chung, Y.; Park, D.; Kim, H. Depth-Based Detection of Standing-Pigs in Moving Noise Environments. Sensors 2017, 17, 2757. https://doi.org/10.3390/s17122757
Kim J, Chung Y, Choi Y, Sa J, Kim H, Chung Y, Park D, Kim H. Depth-Based Detection of Standing-Pigs in Moving Noise Environments. Sensors. 2017; 17(12):2757. https://doi.org/10.3390/s17122757
Chicago/Turabian StyleKim, Jinseong, Yeonwoo Chung, Younchang Choi, Jaewon Sa, Heegon Kim, Yongwha Chung, Daihee Park, and Hakjae Kim. 2017. "Depth-Based Detection of Standing-Pigs in Moving Noise Environments" Sensors 17, no. 12: 2757. https://doi.org/10.3390/s17122757
APA StyleKim, J., Chung, Y., Choi, Y., Sa, J., Kim, H., Chung, Y., Park, D., & Kim, H. (2017). Depth-Based Detection of Standing-Pigs in Moving Noise Environments. Sensors, 17(12), 2757. https://doi.org/10.3390/s17122757