An Intelligent Monitoring System for Sheep Behavior Based on ActiGraph Sensors
Abstract
1. Introduction
2. Materials and Data Processing
2.1. Sensor System and Local Data Collection
2.2. Data Preprocessing and Feature Construction
- Raw acceleration signals: , , and , representing the acceleration components along the three orthogonal axes at sample i.
- Vector Magnitude (): The Euclidean norm of the tri-axial acceleration vector [15], computed as:which quantifies the overall intensity of movement independently of sensor orientation.
- Delta Vector Magnitude (ΔVM): The absolute difference between consecutive vector magnitude values, defined as:capturing abrupt motion changes and transitions between behavioral or postural states.
2.3. Supervised Learning Framework
2.3.1. Supervised Learning Framework and Model Configuration
2.3.2. Deep Learning Architectures
LSTM Model
BLSTM Model
CNN–BLSTM Model
2.3.3. Classical Machine Learning Models
Random Forest (RF)
Support Vector Machine (SVM)
3. Architecture of the End-to-End IoT and AI-Driven Sheep Monitoring System
3.1. Network Communication and Data Acquisition Architecture
3.2. Cloud-Based Application Architecture and Automated Data Processing Pipeline
- GitHub repositories for version control and workflow automation;
- Cloud storage (Drive) for intermediate data handling;
- InfluxDB as a time-series database for storing raw and predicted behavioral data;
- Streamlit [27] for deploying an interactive web application accessible to end users.
3.3. Intelligent User Interaction and Large Language Model Integration Architecture
4. Experimental Results and Discussion
4.1. Feature-Level Analysis Across Behavioral Classes
4.2. Classification Models
4.3. Limitations of the Study
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| AI | Artificial Intelligence |
| BLSTM | Bidirectional Long Short-Term Memory |
| CNN | Convolutional Neural Network |
| CNN–BLSTM | Convolutional Neural Network–Bidirectional Long Short-Term Memory |
| CSV | Comma-Separated Values |
| ΔVM | Delta Vector Magnitude |
| Hz | Hertz |
| IoT | Internet of Things |
| LTE | Long-Term Evolution |
| LSTM | Long Short-Term Memory |
| LoRaWAN | Long Range Wide Area Network |
| ML | Machine Learning |
| PLF | Precision Livestock Farming |
| RF | Random Forest |
| ReLU | Rectified Linear Unit |
| SMOTE | Synthetic Minority Over-sampling Technique |
| SVM | Support Vector Machine |
| TA | Tri-Axial Accelerometry |
| VM | Vector Magnitude |
References
- Ding, L.; Zhang, C.; Yue, Y.; Yao, C.; Li, Z.; Hu, Y.; Yang, B.; Ma, W.; Yu, L.; Gao, R.; et al. Wearable Sensors-Based Intelligent Sensing and Application of Animal Behaviors: A Comprehensive Review. Sensors 2025, 25, 4515. [Google Scholar] [CrossRef] [PubMed]
- Riaboff, L.; Shalloo, L.; Smeaton, A.F.; Couvreur, S.; Madouasse, A.; Keane, M.T. Predicting Livestock Behaviour Using Accelerometers: A Systematic Review of Processing Techniques for Ruminant Behaviour Prediction from Raw Accelerometer Data. Comput. Electron. Agric. 2022, 192, 106610. [Google Scholar] [CrossRef]
- Barwick, J.; Lamb, D.W.; Dobos, R.; Welch, M.; Trotter, M. Categorising Sheep Activity Using a Tri-Axial Accelerometer. Comput. Electron. Agric. 2018, 145, 289–297. [Google Scholar] [CrossRef]
- Barwick, J.; Lamb, D.W.; Dobos, R.; Welch, M.; Schneider, D.; Trotter, M. Identifying Sheep Activity from Tri-Axial Acceleration Signals Using a Moving Window Classification Model. Remote Sens. 2020, 12, 646. [Google Scholar] [CrossRef]
- Martiskainen, P.; Järvinen, M.; Skön, J.-P.; Tiirikainen, J.; Kolehmainen, M.; Mononen, J. Cow Behaviour Pattern Recognition Using a Three-Dimensional Accelerometer and Support Vector Machines. Appl. Anim. Behav. Sci. 2009, 119, 32–38. [Google Scholar] [CrossRef]
- Asmare, B. A Review of Sensor Technologies Applicable for Domestic Livestock Production and Health Management. Adv. Agric. 2022, 2022, 1599190. [Google Scholar] [CrossRef]
- Mozo, R.; Alabart, J.L.; Rivas, E.; Folch, J. New Method to Automatically Evaluate the Sexual Activity of the Ram Based on Accelerometer Records. Small Rumin. Res. 2019, 172, 16–22. [Google Scholar] [CrossRef]
- Snowder, G.D.; Stellflug, J.N.; Van Vleck, L.D. Heritability and Repeatability of Sexual Performance Scores of Rams. J. Anim. Sci. 2002, 80, 1508–1511. [Google Scholar] [CrossRef][Green Version]
- Rahman, A.; Smith, D.; Little, B.; Ingham, A.B.; Greenwood, P.L.; Bishop-Hurley, G.J. Cattle Behaviour Classification from Collar, Halter, and Ear Tag Sensors. Inf. Process. Agric. 2018, 5, 124–136. [Google Scholar] [CrossRef]
- Khattach, O.; Moussaoui, O.; Hassine, M. End-to-End Architecture for Real-Time IoT Analytics and Predictive Maintenance Using Stream Processing and ML Pipelines. Sensors 2025, 25, 2945. [Google Scholar] [CrossRef]
- Giovanetti, V.; Decandia, M.; Molle, G.; Acciaro, M.; Mameli, M.; Cabiddu, A.; Cossu, R.; Serra, M.G.; Manca, C.; Rassu, S.P.G.; et al. Automatic classification system for grazing, ruminating and resting behaviour of dairy sheep using a tri-axial accelerometer. Livest. Sci. 2017, 196, 42–48. [Google Scholar] [CrossRef]
- Jakobsson, T.; Lauruschkus, K.; Tornberg, Å.B. An Evaluation of Data Processing When Using the ActiGraph GT3X Accelerometer in Non-Ambulant Children and Adolescents with Cerebral Palsy. Clin. Physiol. Funct. Imaging 2022, 43, 85–95. [Google Scholar] [CrossRef]
- Goldsmith, E.L.; Rickard, J.P.; Mercorelli, L.R.; González, L.A.; de Graaf, S.P. The Use of Accelerometers for the Remote Detection of Mounting in Rams and Testosterone-Treated Wethers. Comput. Electron. Agric. 2022, 199, 107129. [Google Scholar] [CrossRef]
- Turner, K.E.; Thompson, A.; Harris, I.; Ferguson, M.; Sohel, F. Deep Learning Based Classification of Sheep Behaviour from Accelerometer Data with Imbalance. Inf. Process. Agric. 2023, 10, 377–389. [Google Scholar] [CrossRef]
- Lee, S.-M.; Yoon, S.M.; Cho, H. Human Activity Recognition from Accelerometer Data Using Convolutional Neural Network. In Proceedings of the IEEE International Conference on Big Data and Smart Computing (BigComp), Jeju, Republic of Korea, 13–16 February 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 131–134. [Google Scholar] [CrossRef]
- Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Schuster, M.; Paliwal, K.K. Bidirectional Recurrent Neural Networks. IEEE Trans. Signal Process. 1997, 45, 2673–2681. [Google Scholar] [CrossRef]
- Graves, A.; Schmidhuber, J. Framewise Phoneme Classification with Bidirectional LSTM and Other Neural Network Architectures. Neural Netw. 2005, 18, 602–610. [Google Scholar] [CrossRef] [PubMed]
- Ordóñez, F.J.; Roggen, D. Deep Convolutional and LSTM Recurrent Neural Networks for Multimodal Wearable Activity Recognition. Sensors 2016, 16, 115. [Google Scholar] [CrossRef]
- Zhao, B.; Lu, H.; Chen, S.; Liu, J.; Wu, D. Convolutional Neural Networks for Time Series Classification. J. Syst. Eng. Electron. 2017, 28, 162–169. [Google Scholar] [CrossRef]
- Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
- Burges, C.J.C. A Tutorial on Support Vector Machines for Pattern Recognition. Data Min. Knowl. Discov. 1998, 2, 121–167. [Google Scholar] [CrossRef]
- Wang, L.; Arablouei, R.; Alvarenga, F.A.P.; Bishop-Hurley, G.J. Classifying animal behavior from accelerometry data via recurrent neural networks. Comput. Electron. Agric. 2023, 206, 107647. [Google Scholar] [CrossRef]
- ActiGraph. User Guide: ActiGraph™ wGT3X-BT + ActiLife; Revision A; ActiGraph: Pensacola, FL, USA, 2016; Available online: https://actigraphcorp.jp/support/pdf/gt3xbt_usersguide.pdf (accessed on 22 January 2026).
- Adelantado, F.; Vilajosana, X.; Tuset-Peiró, P.; Martínez, B.; Melia-Segui, J.; Watteyne, T. Understanding the Limits of LoRaWAN. IEEE Commun. Mag. 2017, 55, 34–40. [Google Scholar] [CrossRef]
- Botta, A.; de Donato, W.; Persico, V.; Pescapé, A. Integration of Cloud Computing and Internet of Things: A Survey. Future Gener. Comput. Syst. 2016, 56, 684–700. [Google Scholar] [CrossRef]
- Streamlit. Streamlit Documentation. Available online: https://docs.streamlit.io/ (accessed on 1 December 2025).
- Groq. Groq Documentation (GroqCloud API/LPU Inference). Available online: https://console.groq.com/docs (accessed on 26 January 2026).
- Powers, D.M.W. Evaluation: From Precision, Recall and F-Measure to ROC, Informedness, Markedness and Correlation. J. Mach. Learn. Technol. 2011, 2, 37–63. [Google Scholar]










| Date | Time Interval | ID | Category | Duration | Mating Events | Flehmen Events |
|---|---|---|---|---|---|---|
| 7–16 July 2025 | 10:22–10:34 | 1 | Ram | 11:31 | 9 | 0 |
| 16:11–16:23 | 1 | Ram | 11:45 | 6 | 2 | |
| 11:54–12:11 | 2 | Ram | 16:52 | 0 | 1 | |
| 13:04–13:15 | 3 | Ram | 11:06 | 0 | 3 | |
| 10:37–10:47 | 4 | Ram | 10:18 | 0 | 0 | |
| 12:42–12:52 | 4 | Ram | 10:14 | 5 | 1 | |
| 07:52–08:02 | 5 | Ram | 10:07 | 0 | 0 | |
| 10:22–10:34 | 1 | Ewe | 11:31 | – | – | |
| 10:22–10:34 | 2 | Ewe | 11:31 | – | – | |
| Total (Rams) | 01:44:55 | 20 | 7 | |||
| Model | Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|
| LSTM | 0.7468 | 0.7475 | 0.7468 | 0.7328 |
| BLSTM | 0.7704 | 0.7673 | 0.7704 | 0.7635 |
| CNN–BLSTM | 0.7921 | 0.7894 | 0.7921 | 0.7843 |
| SVM | 0.8017 | 0.7980 | 0.8017 | 0.7953 |
| Random Forest | 0.8272 | 0.8312 | 0.8272 | 0.8197 |
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| Flehmen | 0.7826 | 0.8750 | 0.8262 |
| Grazing | 0.8091 | 0.8203 | 0.8146 |
| Lying | 0.8440 | 0.9675 | 0.9015 |
| Mating | 0.8880 | 0.7101 | 0.7880 |
| Standing | 0.7556 | 0.8039 | 0.7790 |
| Walking | 0.7226 | 0.4308 | 0.5398 |
| Study | Animal | Behaviors | Method | Accuracy |
|---|---|---|---|---|
| Barwick et al. (2020) [4] | Sheep | Basic | ML (window-based classification) | 48–95% (sensor-dependent) |
| Martiskainen et al. (2009) [5] | Cow | Daily | SVM-based approach | ∼75–85% |
| Rahman et al. (2018) [9] | Cattle | Multiple | ML models | ∼0.15–0.93% |
| Turner et al. (2022) [14] | Sheep | Imbalanced | Deep learning models | ∼88% |
| Mozo et al. (2019) [7] | Ram | Mounting | ML-based detection | ∼0.78–0.94% |
| This work | Sheep | Rare + common | RF/SVM/DL | 82.7% |
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. |
© 2026 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.
Share and Cite
Ghadir, S.; Ghadir, D.; Mehari Berhe, T.; Adami, D.; Giordano, S.; Pagano, M.; Rossi, P.; Sotgiu, F.D.; Mossa, F.; Berlinguer, F. An Intelligent Monitoring System for Sheep Behavior Based on ActiGraph Sensors. Network 2026, 6, 31. https://doi.org/10.3390/network6020031
Ghadir S, Ghadir D, Mehari Berhe T, Adami D, Giordano S, Pagano M, Rossi P, Sotgiu FD, Mossa F, Berlinguer F. An Intelligent Monitoring System for Sheep Behavior Based on ActiGraph Sensors. Network. 2026; 6(2):31. https://doi.org/10.3390/network6020031
Chicago/Turabian StyleGhadir, Setayesh, Delaram Ghadir, Tesfalem Mehari Berhe, Davide Adami, Stefano Giordano, Michele Pagano, Pietro Rossi, Francesca Daniela Sotgiu, Francesca Mossa, and Fiammetta Berlinguer. 2026. "An Intelligent Monitoring System for Sheep Behavior Based on ActiGraph Sensors" Network 6, no. 2: 31. https://doi.org/10.3390/network6020031
APA StyleGhadir, S., Ghadir, D., Mehari Berhe, T., Adami, D., Giordano, S., Pagano, M., Rossi, P., Sotgiu, F. D., Mossa, F., & Berlinguer, F. (2026). An Intelligent Monitoring System for Sheep Behavior Based on ActiGraph Sensors. Network, 6(2), 31. https://doi.org/10.3390/network6020031

