Exploiting Computer Vision and Machine Learning for Sheep Activity Detection

The history of livestock farming is almost 11,000 years old, when human being started to domesticate animals. With the passage of time it has become an essential part of our food supply chain. The rapidly growing human population has disrupted the demand and food supply chain. To meet the requiremen

2025-06-28 16:27:09 - Adil Khan

Project Title

Exploiting Computer Vision and Machine Learning for Sheep Activity Detection

Project Area of Specialization Artificial IntelligenceProject Summary

The history of livestock farming is almost 11,000 years old, when human being started to domesticate animals. With the passage of time it has become an essential part of our food supply chain. The rapidly growing human population has disrupted the demand and food supply chain. To meet the requirements of growing population livestock farming has been introduced on a larger scale all around the world. This larger scale farming gave rise to several issues such as monitoring and looking after the animals. With this increase in numbers, it not only became difficult for human observers and sheepdogs to physically monitor and manage the animals but this has also caused shortage of skilled labor. Resultantly labor wages also increased. Due to these numerous reasons the traditional methods are no more effective and are almost obsolete. Recently CCTV camera system has been explored to monitored animal activity. This CCTV monitoring has several limitations. For example, CCTV monitoring does not make use of modern computer technologies to automate the monitoring task. It still requires few human observers to monitor animals all the time on computer screen. Recently computer assisted approaches have been explored to observe animal activities. In developed countries the use of sensor based systems has become a common practice. These sensor based systems require set of sensors is placed at either the ear, neck, collar or leg of an animal. This approach coupled with machine learning models can effectively detect animal activity. This approach has been widely used in last decade. However this technology is costly and medium size farms, especially in third world countries cannot afford to spend much amount towards animal monitoring and activity detection. This gave rise to the need of some cost effective alternative solutions. Recent research indicates the computer vision technology can provide low cost alternative solutions to sensor based activity detection. Computer Vision based models require huge dataset to be trained to perform a specific task. However, due to lack of proper dataset availability there is very limited research work done in animal activity detection using computer vision technology. The existing research is only limited to cows. To the best of our knowledge there is no research work that aims at sheep activity detection.

Project Objectives

This project aims at proposing and developing a prototype that is low cost alternative to sensor based sheep activity detection. In this project a dataset will be collected, cleaned and labeled. Upon that dataset a proof of concept sheep activity detection model will be trained. A mobile application will be developed through which user can monitor the farm. Since this project is a proposed prototype thus it is restricted to only three major activities of sheep. Which include Active (Walking/Running), Standing and Sitting. Apart from detecting these activities, system will also be able to generate alerts on mobile application if any abnormal activity is detected at farm such as human presence. Furthermore the app provides facility to view live footage of farm. This mobile app will be developed using Flutter cross platform app development framework.

Project Implementation Method

This research will be carried out in two phases, the first phase deals with dataset collection and model training for sheep activity detection. The second phase deals with developing a full fledge ready to deploy application capable of covering all the aspect of sheep activities at a farm, ranging from grazing, walking, running, sitting, standing etc. At this stage the scope of the project is limited only to first phase and next phase will be carried out as our future study.

The initial phase of this research is to collect and label the dataset. Afterwards a sheep activity detection model will be trained. This prototype model will have tendency to detect sheep activities such as walking and running, Standing, Sitting etc. This project will make use of deep transfer learning methodology to fine tune YOLOv5 model for sheep activity detection. Fine tuning is a process where deep transfer learning technology is used to tune a pre-trained model to perform a new task while retaining its initial knowledge of similar task for which it has already been trained. This method saves training time and increases accuracy even with small dataset.

This model will also detect suspicious activity such as human presence in farm. It will generate an alert when any it detect any human presence in animal bounded area.

The first part of this project is collecting and annotating the dataset. Dataset will be recorded using mobile phone cameras. After collection it will be labeled (also known as annotation) using Dark Label 2.4 open source video annotation software.

Second part of this project is developing and training model that is capable of detecting sheep activity and also generating alert if any abnormal activity is detected. For second part we will use YOLOv5 model which will be fine-tuned for sheep activity detection. This method is known as Deep Transfer Learning. Fine tuning is unfreezing a pre-trained model and retraining it with a new dataset. This approach adapts pre-trained features to new data thus giving high accuracy. Project also aims at developing Cross platform android applications based on Flutter.

Flutter is an open source cross platform application development framework developed by Google.

To train the model in question, a high performance GPU is required. For training of model Applied Computing Research group of Liverpool John Moorse University UK will provide virtual access of their research lab’s high performance GPU.

Benefits of the Project

Dataset collected can be used in many other ways as mentioned below:

1) It can be used for Activity detection.

2) It can be used for sheep age prediction.

3) It can be used for time series behavior analysis.

4) It can be used for sheep recognition.

The Trained Model can be used for the following:

1) Sheep activity detection at farm.

2) Animal activity detection at Zoo.

3) After fine tuning, the developed model can be used for various other animal activity detection applications.

Technical Details of Final Deliverable

This project is based on a mobile application which can be downloaded through play store or from directly installing the APK file provided through a web page.

The system can detect three activities of sheep which are Moving, Standing and Sitting.

System can also detect suspicious activity such as human presence at the farm.

User can use the app to view live video footage of animals at farm

User can get alerts of any abnormal activity at farm

Users can navigate to the alerts section in the mobile app to view current and previous alerts generated by the system

Final Deliverable of the Project Software SystemCore Industry ITOther IndustriesCore Technology Artificial Intelligence(AI)Other TechnologiesSustainable Development Goals Industry, Innovation and InfrastructureRequired Resources
Item Name Type No. of Units Per Unit Cost (in Rs) Total (in Rs)
Total in (Rs) 80000
Mobile Phone Equipment15500055000
2 TB External Hard-drive for backup of dataset Equipment11500015000
Printing Miscellaneous 5200010000

More Posts