Who has not already heard about milking robots and the so-called Precision Agriculture? Yes, the tech for farm animals is gaining momentum and is taking advantage of recent trends in computing, such in cloud computing, edge computing and Internet of Things (IoT) computing, networking and sensing. Yet, technologies for farm animals is not just about production in farming, but is likely to be much more than that. With the assumption that there is a permanent, or at least intermittent, Internet connectivity for end-devices to be used on farm animals there is also scope for computing to perform the sensing and actuation. As such, the future of computing for farms can be about breaking barriers between farm animals and humans in the way they interact and understand each other with help of information and communication technologies. It can help to create intelligent and live links and connections between real worlds (of animals) and virtual worlds (our computational models of animals). It can also help to understand the state of animals (physical, cognitive) through sensing data both in real-time and offline and also intelligently predict, estimate, and analyze the dynamic changes in animal behavior and welfare.
In this post, first, we will briefly survey the computing and networking concepts concerning farm animals and contexts. Building from this, we then introduce various hardware and software technology solutions for farm animals and the farm environment. Lastly, we present our guide to building animal IoT-Edge-Cloud systems presenting current open challenges.
Computing and Networking Concepts
The previously mentioned trends of cloud computing, edge/fog/mist computing and, of course, IoT not only individually play an important role in the farm, but more interestingly, all together form an ensemble. These three concepts are most useful when used together, or in a coordinated fashion, since no solution alone can meet all requirements such as processing speed, data storage and even security and privacy.
IoT is systems which can send data over a network without requiring human intervention. IoT devices are expected to be programmable and easy to customize but are expected to become more and more also intelligent. Here we define intelligent by making decisions locally and close to the animals. More on this when we get to the role of Machine Learning (ML).
One of the main trends for farm computing is in edge/fog/mist computing – all these terms having similar concepts with a common idea to compute closer to the user (for the farm this is the farm animal). The idea of architecture is to process data, pictures, or audio locally, and without sending data to the cloud.
Lastly, there is cloud computing. Cloudification of the farming sector is indeed significant and is closely related to another trend, called Big Data, whereby a large amount of data about the farm animals, farming environment, climate, production etc, are sent to the cloud for processing and analysis.
Other notable technologies include but are surely not limited to:
Robotics and Drones: Used especially in outdoor regions, such as robots as used as shepherd dogs, and the already well-known automatic milking robots.
Blockchain: Defined as a crypto-based secure database is also increasingly important in animal farming to making sure all data entries are properly recorded and securely linked together (e.g., veterinary health records).
Energy Efficient Computing: Consideration of battery life or battery-less operation on animal wearables is the key issue to making animal wearables well-designed for animals, so they are not heavy, uncomfortable and thus unhealthy for animals. (See our blog on kinetic energy wearables.)
Virtual Fencing: Fencing plays an incredibly important for the new concepts of regenerative farming, where animals forage freely outside, but the areas of foraging are intelligently and programmable defined for their species-appropriate management of animal spaces (e.g., outdoor).
Veterinary Telemedicine: This is not a new idea and has been tried decades ago in various parts of the world. Today, however, the technology is ripe and widely available for veterinarians to perform remote diagnostics based on sensing indicators (e.g., to detect issues with heart rate, heat stress, lameness).
Machine Learning (ML) is probably one of the most rapidly growing tech trends in farm animals. In traditional computing, algorithms are a set of explicitly programmed instructions used by computers to solve a problem. With ML, algorithms calculate the desired outcome from a set of data without having to write custom code, unlike traditional computing, where algorithms are explicitly programmed to solve a problem. Thus ML can be used for animal species identification, pain detection, behavior predictions (such as animal seasonal migrations) etc. Two, or we should say, three classes of ML are of interest: supervised learning, unsupervised learning and reinforcement learning (a combination of the previous two).
Supervised learning in a nutshell uses labelled data mapped with desired output and has been extremely popular in veterinary and animal behavior sciences. It conducts learning by comparing the actual output with the taught outputs to find errors and update the model accordingly. For instance, if you label lots of data as dogs, and other data as trees, supervised learning can easily say whether the picture you show is a dog or a tree. For farm animals, it can be used for posture detection, such as lameness, which eventually indicates serious health conditions.
Unsupervised learning, as the name indicates, does not label data, and instead can classify raw data. For instance, if you have a lot of data about various dogs, and trees, the outcome can give you two groups of data: dogs in one group and trees in the other. For instance, for farm animals, one can cluster activity levels (sleep, walk, eat, drink), or extract features automatically for animal vocalizations.
Reinforcement learning is the third category, and it neither labels the data nor it classifies it in that sense, but it analyses raw data so it can answer a question: “[..If we have data about dogs and trees] – Is this a picture of a dog?”. Reinforcement learning has not been used much in farm animals, instead, it is known for bird migratory path prediction, for instance.
Other software solutions are known from Precision Livestock Farming (PLF) systems, including video monitoring solutions and electronic tagging and virtual fencing.
Video monitoring: This is popular in e.g., pigs, hens and cattle, for detecting zones of abnormal occupation, problems with climate control, malfunctioning feed or water lines, and trigger an automatic alarm alerting the farmer.
Electronic tagging and virtual fencing: This is also interesting, as it provides a combination of auditory signals with positive reinforcement to guide farm animals towards food, freshwater or shelter. It can also be used to monitor for injuries or illness, without limiting their freedom.
In terms of interesting hardware solutions, here we focus on those open for experimentation and providing open hardware and software. Two categories of interest: Single Board Computer (SBC), such as Raspberry Pis, including CPU, RAM, ports and storage on a board and a full stack operating system. Microcontrollers are also interesting, including single chips which consist of RAM, Storage and CPU programmed using C/C++ through an API to connect to sensors and actuators. These then can be used to monitor animals and their environment. Typical sensors that are used and are readily available at low cost include GPS, accelerometer, pedometer, body temperature, ECG, camera, IR sensors, RFID sensors, etc.
There is much to be learned about farm animals by using these sensors! First one needs to distinguish though between ambient vs. wearable sensors. For this the difference is in species, and whether we use indoor vs. outdoor farming. Wearable sensing is quite common in dairy cows, including multiple sensors in tagging, pedometers, accelerometers. Wearable sensing in dairy cows and goats are especially useful for tracking and activity monitoring, movement and diseases. Wearables also have been heavily used on goats, and in the context of virtual fencing. For pigs and chickens though, one cannot use wearables (pigs tend to play and temper with them, so the electronics can be hazardous!). Hence, ambient sensing plays a comparably bigger role with these animals.
How to Build Your Own Farm Animal IoT-Edge-Cloud System
Let’s say you would like to build now an IoT – edge – cloud system to monitor a farm animal or a group of animals based on the state of the art software and hardware technology – what do you need to know and have?
First, we would consider microservice-based architecture and those based on open-source (wherever possible). In terms of software, we would use Docker as containerization system and Firebase as Backend as a Service (BaaS). In terms of hardware we have found the following IoT devices can be useful:
- ARM-based SBC (e.g. RPis) and microcontrollers (e.g. Arduinos),
- Edge computing devices: x86-64 based computers (e.g. servers, desktop computers, laptops).
These are the operating system that you need to get familiar with:
- Arduino: None (Arduino IDE to upload programs to the board)
- Raspberry Pis: Linux (ARM Debian or Arch Linux based distros)
- Linux (x86-64 Debian or Arch Linux based distros)
To connect IoT, edge, and cloud systems, there is also an issue of communications. There are a few protocols of choice, including MQTT (Message Queuing Telemetry Transport), HTTP (Hypertext Transfer Protocol) and CoAP (Constrained Application Protocol). The current state of the art points at MQTT as a great choice due to its maturity and excellent performance when used in constrained IoT devices. This is followed closely by HTTP as the widely adopted solution and one of the best choice of developers. Finally, CoAP is evolving as a promising IoT messaging standard communication alternative to these two protocols due to its lightweight characteristics and as a consequence better performances in resource-constrained environments. Finally, using Apache Kafka as a highly scalable platform to support a high number of devices is also a good idea, along with some basic skills in Python, Java and C/C++.
Do not worry if this sounds too much, most of the systems mentioned here have good adequate tutorials available and developer’s support from the online community. We also provide some links at the bottom of this post to get you started!
Open Research Challenges
So you are interested in farming technologies but unsure which problems to focus on? Well, there are quite a few open challenges:
Wearable or Non-Wearables for Farm Animals?
Wearables for farm animals tend to be sizable and consideration of their experiences as users of technologies is important for their health and welfare. Just like with humans, we need also technology to help us understand the true role of computing and networking technology in the life of an animal.
How Can Robots and Virtual Systems Help Animal Science?
Are virtual veterinary visits enough, and how can robots to exercise animals, are grand challenges that the animal welfare science needs to address as well as understanding social needs of animals to meeting other animals and humans. Technology can help us understand these issues better.
How Do We Protect People And Animals Privacy?
We must not forget that in addition to performance, efficiency, data analysis, preserving the privacy of people and their animals is paramount. Papers have been written about Privacy for Tigers, but similar studies need to be written about farm animals in their specific settings.
How Can AI Prevent Diseases and Detect Conditions?
Early prevention of diseases and the detection of wrong conditions with AI is probably one of the most exciting trends. Case in point: early signs of pain or changes in activity or social interactions can be detected with methods of machine learning. Stressed animals are also prone to diseases and infections (pandemics!) so prevention and early detection is paramount!
Open System Solutions That Are Across Species
What is currently missing in tech for farm animals are open systems, with a combination of various open-source, open hardware and software technologies, where the systems can be experimented with. Also, many systems are species-specific. Yet it would be of great benefit from cross-species and cross-sectorial work to look at how to build and use these systems across the whole ecosystem. For instance, pain recognition based facial expression in dogs may be useful in developing similar systems for pigs.
Understanding Animals As Users
One of the things that are missing in farm technologies is our understanding of the view of animals as users. To this end, the Quality-of-Experience (QoE) studies can be also conducted with animals and trying to understand the animal’s perspective!
Computers For Smart Emergency and Disaster Response in Farms
Finally, farm animal and animals in general are granted the biggest casualties in natural disasters, including those related to climate change (bushfires, floodings, tsunamis). Technology can greatly help to create smart emergency and disaster response for farm animals. More recently, also pandemic response for farm animals is becoming a topic of interest in the research community. Promoting education and awareness about computing, networking and sensing technologies can make great strides towards addressing these challenges.
With all this in mind, we look forward to seeing the next generation of farm technologies. If you have any questions, information to add to this post or want to collaborate on farm technology projects your welcome to get in touch with us at email@example.com.
MQTT standard, broker and client implementations:
CoAP standard and implementations
Framework for creating REST APIs