Sleeping and Eating Behavior Recognition of Horses Based on an Improved SlowFast Network
<p>Schematic diagram of data collection scenario.</p> "> Figure 2
<p>Dataset samples.</p> "> Figure 3
<p>Example of data enhancement.</p> "> Figure 4
<p>Overall technical route.</p> "> Figure 5
<p>The architecture of spatiotemporal convolutional network for horse posture and behavior recognition: The backbone network uses ResNet50, and the dimension size of the kernel is <math display="inline"><semantics> <mrow> <mfenced open="{" close="}" separators="|"> <mrow> <mi mathvariant="normal">T</mi> <mo>×</mo> <msup> <mrow> <mi mathvariant="normal">S</mi> </mrow> <mrow> <mn>2</mn> </mrow> </msup> <mo>,</mo> <mi mathvariant="normal">C</mi> </mrow> </mfenced> </mrow> </semantics></math>, where <math display="inline"><semantics> <mrow> <mi mathvariant="normal">T</mi> </mrow> </semantics></math> represents the time dimension size, <math display="inline"><semantics> <mrow> <msup> <mrow> <mi mathvariant="normal">S</mi> </mrow> <mrow> <mn>2</mn> </mrow> </msup> </mrow> </semantics></math> represents the spatial dimension size, and <math display="inline"><semantics> <mrow> <mi mathvariant="normal">C</mi> </mrow> </semantics></math> represents the channel size.</p> "> Figure 6
<p>Structure diagram of SE Module.</p> "> Figure 7
<p>Structural diagram of YOLOX.</p> "> Figure 8
<p>The accuracy of YOLOX training.</p> "> Figure 9
<p>YOLOX vs. other versions of YOLO.</p> "> Figure 10
<p>Example of Slow pathway Feature Learning: Res<sub>2</sub>, Res<sub>3</sub>, Res<sub>4</sub>, Res<sub>5</sub> correspond to <a href="#sensors-24-07791-f005" class="html-fig">Figure 5</a>. Each feature map learned after the convolution operation has sizes: 56<sup>2</sup>, 28<sup>2</sup>, 14<sup>2</sup>, and 7<sup>2</sup>.</p> "> Figure 11
<p>Model performance comparison under different loss functions.</p> "> Figure 12
<p>Comparison of different algorithms for video frame detection and Spatio-Temporal Action Detection time.</p> "> Figure 13
<p>Examples of predicting horse postures and behaviors. (<b>a</b>) Predictions of horse postures. (<b>b</b>) Predictions of horse behaviors.</p> "> Figure 14
<p>Examples of misjudged and missed detections. (<b>a</b>–<b>c</b>) is misjudged, (<b>d</b>) is missed detections.</p> ">
Abstract
:1. Introduction
- (1)
- Developed an AVA-format dataset specifically for horse behavior recognition, encompassing five categories: standing, sternal recumbency, lateral recumbency, sleeping, and eating.
- (2)
- Integrated a Squeeze-and-Excitation (SE) attention module into the SlowFast network and proposed an improved loss function, which enhances the accuracy of horse behavior recognition using the SlowFast network.
- (3)
- Incorporated YOLOX into the SlowFast network, increasing the efficiency of recognizing horse targets in video data.
2. Materials and Methods
2.1. Label Definition of Horse Posture and Behavior
2.2. Experiment and Data Collection
2.3. Dataset Construction
2.4. Data Enhancement
2.5. Overall Technical Route
2.6. Model Implementation
2.6.1. SE-SlowFast Network
SlowFast Network
SE Module
2.6.2. YOLOX Network
2.7. Improved Loss Function
2.8. Model Evaluation Metrics
3. Experiments and Results
3.1. Horse Object Detection
3.2. Behavior Recognition of Horses
3.2.1. Feature Learning Effect of SE-SlowFast Network
3.2.2. Comparison of Loss Functions
3.2.3. Ablation Experiment
3.3. Recognition Results
4. Discussion
4.1. Analysis of Misjudgments and Missed Detections in Horse Behavior Recognition
4.2. The Connection Between Horse Basic Behavior Recognition and Horse Health
4.3. Follow-Up Research Directions for Horse Behavior Recognition
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Brubaker, L.; Udell, M.A.R. Cognition and Learning in Horses (Equus caballus): What We Know and Why We Should Ask More. Behav. Process 2016, 126, 121–131. [Google Scholar] [CrossRef] [PubMed]
- Danby, P.; Grajfoner, D. Human–Horse Tourism and Nature-Based Solutions: Exploring Psychological Well-Being Through Transformational Experiences. J. Hosp. Tour. Res. 2022, 46, 607–629. [Google Scholar] [CrossRef]
- Lesimple, C.; Reverchon-Billot, L.; Galloux, P.; Stomp, M.; Boichot, L.; Coste, C.; Henry, S.; Hausberger, M. Free Movement: A Key for Welfare Improvement in Sport Horses? Appl. Anim. Behav. Sci. 2020, 225, 104972. [Google Scholar] [CrossRef]
- Fogarty, E.S.; Swain, D.L.; Cronin, G.M.; Moraes, L.E.; Trotter, M. BehavIoUr Classification of Extensively Grazed Sheep Using Machine Learning. Comput. Electron. Agric. 2020, 169, 105175. [Google Scholar] [CrossRef]
- Price, E.; Langford, J.; Fawcett, T.W.; Wilson, A.J.; Croft, D.P. Classifying the Posture and Activity of Ewes and Lambs Using Accelerometers and Machine Learning on a Commercial Flock. Appl. Anim. Behav. Sci. 2022, 251, 105630. [Google Scholar] [CrossRef]
- Evans, C.A.; Trotter, M.G.; Manning, J.K. Sensor-Based Detection of Predator Influence on Livestock: A Case Study Exploring the Impacts of Wild Dogs (Canis familiaris) on Rangeland Sheep. Animals 2022, 12, 219. [Google Scholar] [CrossRef]
- Wu, Y.; Liu, M.; Peng, Z.; Liu, M.; Wang, M.; Peng, Y. Recognising Cattle BehavIoUr with Deep Residual Bidirectional LSTM Model Using a Wearable Movement Monitoring Collar. Agriculture 2022, 12, 1237. [Google Scholar] [CrossRef]
- Balasso, P.; Taccioli, C.; Serva, L.; Magrin, L.; Andrighetto, I.; Marchesini, G. Uncovering Patterns in Dairy Cow BehavIoUr: A Deep Learning Approach with Tri-Axial Accelerometer Data. Animals 2023, 13, 1886. [Google Scholar] [CrossRef]
- Scheurwater, J.; Jorritsma, R.; Nielen, M.; Heesterbeek, H.; van den Broek, J.; Aardema, H. The Effects of Cow Introductions on Milk Production and BehavIoUr of the Herd Measured with Sensors. J. Dairy. Res. 2022, 88, 374–380. [Google Scholar] [CrossRef]
- Cheng, M.; Yuan, H.; Wang, Q.; Cai, Z.; Liu, Y.; Zhang, Y. Application of Deep Learning in Sheep Behavior Recognition and Influence Analysis of Training Data Characteristics on the Recognition Effect. Comput. Electron. Agric. 2022, 198, 107010. [Google Scholar] [CrossRef]
- Xu, Y.; Nie, J.; Cen, H.; Wen, B.; Liu, S.; Li, J.; Ge, J.; Yu, L.; Pu, Y.; Song, K.; et al. Spatio-Temporal-Based Identification of Aggressive Behavior in Group Sheep. Animals 2023, 13, 2636. [Google Scholar] [CrossRef] [PubMed]
- Zhao, H.; Mao, R.; Li, M.; Li, B.; Wang, M. SheepInst: A High-Performance Instance Segmentation of Sheep Images Based on Deep Learning. Animals 2023, 13, 1338. [Google Scholar] [CrossRef] [PubMed]
- Gu, Z.; Zhang, H.; He, Z.; Niu, K. A Two-Stage Recognition Method Based on Deep Learning for Sheep Behavior. Comput. Electron. Agric. 2023, 212, 108143. [Google Scholar] [CrossRef]
- Bai, Q.; Gao, R.; Zhao, C.; Li, Q.; Wang, R.; Li, S. Multi-Scale Behavior Recognition Method for Dairy Cows Based on Improved YOLOV5s Network. Trans. Chin. Soc. Agric. Eng. 2022, 38, 163–172. [Google Scholar]
- Wang, R.; Gao, Z.; Li, Q.; Zhao, C.; Gao, R.; Zhang, H.; Li, S.; Feng, L. Detection Method of Cow Estrus Behavior in Natural Scenes Based on Improved YOLOv5. Agriculture 2022, 12, 1339. [Google Scholar] [CrossRef]
- Yu, Z.; Liu, Y.; Yu, S.; Wang, R.; Song, Z.; Yan, Y.; Li, F.; Wang, Z.; Tian, F. Automatic Detection Method of Dairy Cow Grazing BehavIoUr Based on YOLO Improved Model and Edge Computing. Sensors 2022, 22, 3271. [Google Scholar] [CrossRef] [PubMed]
- Shang, C.; Wu, F.; Wang, M.; Gao, Q. Cattle Behavior Recognition Based on Feature Fusion Under a Dual Attention Mechanism. J. Vis. Commun. Image Represent. 2022, 85, 103524. [Google Scholar] [CrossRef]
- Tu, S.; Zeng, Q.; Liang, Y.; Liu, X.; Huang, L.; Weng, S.; Huang, Q. Automated Behavior Recognition and Tracking of Group-Housed Pigs with an Improved DeepSORT Method. Agriculture 2022, 12, 1907. [Google Scholar] [CrossRef]
- Kim, J.; Moon, N. Dog Behavior Recognition Based on Multimodal Data from a Camera and Wearable Device. Appl. Sci. 2022, 12, 3199. [Google Scholar] [CrossRef]
- Zhou, H.; Li, Q.; Xie, Q. Individual Pig Identification Using Back Surface Point Clouds in 3D Vision. Sensors 2023, 23, 5156. [Google Scholar] [CrossRef]
- Chen, C.; Zhu, W.; Steibel, J.; Siegford, J.; Han, J.; Norton, T. Recognition of feeding behaviors of pigs and determination of feeding time of each pig by a video-based deep learning method. Comput. Electron. Agric. 2020, 176, 105642. [Google Scholar] [CrossRef]
- Yu, R.; Choi, Y. OkeyDoggy3D: A Mobile Application for Recognizing Stress-Related Behaviors in Companion Dogs Based on Three-Dimensional Pose Estimation through Deep Learning. Appl. Sci. 2022, 12, 8057. [Google Scholar] [CrossRef]
- Ji, H.; Yu, J.; Lao, F.; Zhuang, Y.; Wen, Y.; Teng, G. Automatic Position Detection and Posture Recognition of Grouped Pigs Based on Deep Learning. Agriculture 2022, 12, 1314. [Google Scholar] [CrossRef]
- Chen, H.-Y.; Lin, C.-H.; Lai, J.-W.; Chan, Y.-K. Convolutional Neural Network-Based Automated System for Dog Tracking and Emotion Recognition in Video Surveillance. Appl. Sci. 2023, 13, 4596. [Google Scholar] [CrossRef]
- Ji, H.; Teng, G.; Yu, J.; Wen, Y.; Deng, H.; Zhuang, Y. Efficient Aggressive Behavior Recognition of Pigs Based on Temporal Shift Module. Animals 2023, 13, 2078. [Google Scholar] [CrossRef]
- Zhang, K.; Li, D.; Huang, J.; Chen, Y. Automated Video Behavior Recognition of Pigs Using Two-Stream Convolutional Networks. Sensors 2020, 20, 1085. [Google Scholar] [CrossRef] [PubMed]
- Wang, Y.; Li, R.; Wang, Z.; Hua, Z.; Jiao, Y.; Duan, Y.; Song, H. E3D: An Efficient 3D CNN for the Recognition of Dairy Cow’s Basic Motion Behavior. Comput. Electron. Agric. 2023, 205, 107607. [Google Scholar] [CrossRef]
- Li, B.; Xu, W.; Chen, T.; Cheng, J.; Shen, M. Recognition of Fine-Grained Sow Nursing Behavior Based on the SlowFast and Hidden Markov Models. Comput. Electron. Agric. 2023, 210, 107938. [Google Scholar] [CrossRef]
- Sun, G.; Liu, T.; Zhang, H.; Tan, B.; Li, Y. Basic Behavior Recognition of Yaks Based on Improved SlowFast Network. Ecol. Inform. 2023, 78, 102313. [Google Scholar] [CrossRef]
- Feichtenhofer, C.; Fan, H.; Malik, J.; He, K. SlowFast Networks for Video Recognition. In Proceedings of the IEEE International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019. [Google Scholar]
Label | Posture/Behavior | Description |
---|---|---|
Standing | Posture | All 4 hooves of the horse touch ground, supporting the horse's body. |
Sternal recumbency | Posture | Lying in sternal recumbency, the horse is lying on its chest with all four legs stretched out to one side. |
Lateral recumbency | Posture | Lying in lateral recumbency, the horse is lying flat on the side, with head and legs touching the ground. |
Eating | Behavior | The horse lowers its head to eat food on the ground. |
Sleeping | Behavior | Sleep includes Drowsiness, Slow Wave Sleep (SWS), and Paradoxical Sleep. Horses in these sleep states may be standing, lying in sternal recumbency, or lying in lateral recumbency, with their eyes either open or closed. |
Postures and Behaviors | Number of Videos | Video Duration (s) | Number of Frame Images |
---|---|---|---|
Standing | 3 | 60 | 5580 |
Standing, Eating | 11 | 60 | 20,460 |
Standing, Sleeping | 4 | 60 | 7440 |
Sternal recumbency | 4 | 60 | 7440 |
Sternal recumbency, Sleeping | 3 | 60 | 5580 |
Lateral recumbency | 3 | 60 | 5580 |
Lateral recumbency, Sleeping | 4 | 60 | 7440 |
Backbone Network | SE Module at the Front of the Slow Pathway | SE Module at the End of the Slow Pathway | CW_F_Combined Loss | Accuracy of Postures and Behaviors Recognition | ||||||
---|---|---|---|---|---|---|---|---|---|---|
r = 2 | r = 3 | r = 4 | Standing | Sternal Recumbency | Lateral Recumbency | Sleeping | Eating | |||
SlowFast | × | × | √ | 0.8945 | 0.9051 | 0.8829 | 0.9011 | 0.8947 | ||
× | × | √ | 0.8705 | 0.8624 | 0.8744 | 0.9198 | 0.9029 | |||
× | × | √ | 0.8691 | 0.8369 | 0.8601 | 0.9035 | 0.9172 | |||
√ | × | √ | 0.9023 | 0.9122 | 0.8754 | 0.9123 | 0.9189 | |||
√ | × | √ | 0.9048 | 0.8793 | 0.8597 | 0.8945 | 0.8803 | |||
√ | × | √ | 0.8958 | 0.8382 | 0.8447 | 0.8795 | 0.9108 | |||
× | √ | √ | 0.9273 | 0.9187 | 0.9258 | 0.9356 | 0.9877 | |||
× | √ | √ | 0.9156 | 0.8834 | 0.9102 | 0.9213 | 0.9544 | |||
× | √ | √ | 0.9135 | 0.8525 | 0.9012 | 0.9124 | 0.9725 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Liu, Y.; Zhou, F.; Zheng, W.; Bai, T.; Chen, X.; Guo, L. Sleeping and Eating Behavior Recognition of Horses Based on an Improved SlowFast Network. Sensors 2024, 24, 7791. https://doi.org/10.3390/s24237791
Liu Y, Zhou F, Zheng W, Bai T, Chen X, Guo L. Sleeping and Eating Behavior Recognition of Horses Based on an Improved SlowFast Network. Sensors. 2024; 24(23):7791. https://doi.org/10.3390/s24237791
Chicago/Turabian StyleLiu, Yanhong, Fang Zhou, Wenxin Zheng, Tao Bai, Xinwen Chen, and Leifeng Guo. 2024. "Sleeping and Eating Behavior Recognition of Horses Based on an Improved SlowFast Network" Sensors 24, no. 23: 7791. https://doi.org/10.3390/s24237791
APA StyleLiu, Y., Zhou, F., Zheng, W., Bai, T., Chen, X., & Guo, L. (2024). Sleeping and Eating Behavior Recognition of Horses Based on an Improved SlowFast Network. Sensors, 24(23), 7791. https://doi.org/10.3390/s24237791