PRE2017 3 Groep5
Bogdans Afonins, 0969985
Andrei Pintilie, 0980402
Stijn Slot, 0964882
Andrei Agaronian, 1017525
Veselin Manev, 0939171
The world population continues to grow and is expected to reach 9.8 billion by 2050 and 11.2 billion by 2100. The increase in population, combined with the development of poorer nations, is projected to double the global food intake by 2050. There will be a greater demand for commodities such as eggs, meat, milk, leather and wool. The supply can be increased by either increasing the number of livestock or its productivity. To keep up with increasing demand, farmers are forced to keep ever larger number of animals. This makes the manual tracking of the individual animals timeconsuming, unpractical, and ineffective. Domestic animals can get sick, which can decrease productivity and runs the risk of a large disease outbreak. Detecting sickness among hundreds of animals can prove difficult. However, current advances in technology can be adopted for use in the farming sector to track animals, and, by doing so, solve the problem mentioned earlier. Accurately tracking the animals welfare will not only improve the animal's wellbeing but also increase productivity and ease the work of farmers around the world.
The objective is to create a design for the automation of the dairy farming sector. More precisely, realize a cow tracking model using cameras, which is capable of first distinguishing the individual animals and after that determining their health status, based on their behavior. We will explore possible tracking methods, outline a design and create a simulation for tracking cows.
Diseases can come in many forms in animals. Recent disease epidemics are estimated to have cost billions of dollars and millions of animal lives. The most affected species are cattle and swine. Therefore, there is a large incentive to try and find and cure these diseases as early as possible. Luckily, there are various clues and methods for detecting when an animal is sick.
A physical exam is most often needed for finding and treating sick animals. The role of this physical exam is to identify, treat, prevent the spreading of diseases, protect the food supply and improve animal welfare. Once a cow is identified as sick (some of the measured vitals are abnormal: heart rate, respiration rate, temperature, rumen contractions), the problem should be determined. Several potential disorders are presented depending on the group of animals. The subjects are mostly “fresh” cows which are newly achieved animals. Their stress level is of huge importance to determine sick animals, especially when a new animal has to adapt to the environmental changes. When multiple types of stress are gathered together, that’s a breaking point and the immune system starts falling apart. This immune suppression makes them not react to vaccines and more likely to get infected by diseases. There are 4 areas to determine diseases in new cows: temperature, appetite, uterine discharge, hydration status. In order to determine if a cow is sick, watch the attitude(lie down in corners, less energy, look depressed), the appetite(aggressive eating, not eating), check the hydration(by checking the skin). Even normal cows must be monitored.
In a paper by Weary et al, behavioral clues are used for identifying illness in animals. The scope of this paper is to teach animal caregivers how to predict and identify sick animals by using their behavior. There are several examples of behavior related to sickness: hydrophobia – rabies, head throwing seizures – sodium salt toxicity in pigs, star-gazing – polioencephalomalacia in cattle, abnormal feeding and drinking – malaise and others. The paper is concerned about what valid behavioral indicators can be used to determine sick animals. Typically it is done by clinical evaluations, controlled exposure to a pathogen, or by induction models. Recently behavioral indicators are also taken into account. A first category behavior aims to is health. There are changes in the behavior in response to pain(physical injuries can be spotted), a general feeling of Malaise(decrease in feeding, reproductive activities, increasing rest time to conserve energy) or other diseases. It is essential to understand which behaviors respond and why. Another category in the discussion is Behavior as a communication system, where behavior is used as a signal of vigor or of need. Lastly, a category of behavior as predictive of illness is discussed.
In a paper by Frost and Hamm, the objective is to improve animal wealth worldwide while posing transparency on global animal disease, collecting veterinary scientific information, improving a legal framework and resources of national Veterinary Services. The group involved in this prevention program are World Trade Organization(WTO), United Nations and others(around 40). Animal health is seen as a global public good since the eradication of a disease will have international benefits, while the failure of a country may endanger the whole planet. So, the impact of animal diseases is huge for both economically and socially. There are also diseases that transfer from animals to persons, and since the world is interconnected, everybody can get any disease from any point of the planet(international transfer of meat). The paper continues to study what is needed to control the animal disease. The key elements are biosecurity, surveillance, diagnosis and awareness, early detection and rapid response, fast treatment. An agreement OIE(Organization for Animal Health) set some standards and released a list of diseases in order to keep everybody informed about them. Countries can report new diseases to OIE, so the interoperation of countries is a must. OIE also has a tool called Evaluation of Performance of VS(PVS) which asses the level of compliance with OIE standards and aim for voluntary process of countries. Although, this tool produces a gap between quality and quantitative information, a gap which must be solved.
Thermography can be also be used for detecting when an animal is sick. Veterinarian and researcher Mari Vainionpää consider thermal imaging cameras to be a great tool to find out whether an animal is in pain, for instance.  It is stated that if there are changes in the organic activity there are also changes in the amounts of heat that are emitted and these deviations in the heat pattern can be detected with a thermal imaging camera. Moreover, in Vainionpää’s experience, thermal imaging cameras can be used to reveal inflammations, bruises, tendon or muscle related injuries, superficial tumors, nerve damage, blood circulation issues It is pointed out that thermal imaging is quick and reliable as there is no need to sedate the animal, no need to touch it and using a thermal imaging camera doesn’t expose the animal to potentially harmful radiation. Moreover, it is proposed that the animal paw and teeth can be thermally viewed to gain additional data for more precise results.
In a paper by Church et al, It is pointed out that eye temperature, measured using infrared thermography (IRT), is a non-invasive tool for evaluating the stress response in cattle, bison and elk to surgical procedures. Moreover, infrared thermography has recently revealed that a rapid drop in eye temperature is likely a sympathetically mediated response via vasoconstriction that can be used to detect fear and/or pain related responses in animals to different handling procedures. Infrared thermography may be used in the future as an objective outcome-based measure for the evaluation and assessment of animal welfare. It is mentioned that recent data has demonstrated that IRT scans of the orbital area in calves allow for the efficacious identification of animals at earlier stages of illness, often several days to over one week before clinical signs were manifest. What is in the most interest is that it compare IRT to other indicators and points out that the first has more advantages as long as it minimizes the confounding factors that are often associated with other techniques. In the conclusion, it is again pointed out that eye temperature measures using IRT is especially promising, and are fast becoming an essential component in the development of a complementary index used to measure pain and stress in animals, and could eventually replace invasive procedures, such as the measurement of plasma catecholamines to measure autonomic nervous system responses for assessing animal welfare. Moreover, as it is stated, IRT will have wider applications such as testing the efficacy of different analgesics and measuring animal emotions such as fear in the very near future.
For farmers, it can be very useful to track animal locations and detect when an animal does a certain action. At the moment, ear tags are mostly used for identification of animals, but with modern technology, animals can be more closely tracked. For example, identifying and tracking animals can show an animal's history and detecting animals at the food station can give insights into its food intake.
Greene describes in a paper the effort of U.S. Department of Agriculture’s (USDA’s) to trace farm animals by identifying them and rapidly reacting to diseases as soon as they occur. The identification is done by using a national animal ID, which will allow the users to track the previous ownership, to prevent theft and check all detail about an animal. The U.S. National Identification System(NAIS) has the role to set standards and rules for animals’ health, living conditions, and trade of animals. NAIS and USDA work together to establish a new approach to animal disease traceability. The main objectives of this project are to identify animals, to track their food habits and their origins and owners. As advantages can be remembered the disease eradication, minimize economic impact, increase marketing opportunities, provide a tool for producers, address national safety regulations. But there are also some disadvantages like invasion of privacy(collection of personal data), increase costs for the farmers(to install the systems), and market domination by large retailers.
Radio Frequency Identification (RFID) tags can store and transmit data through an electromagnetic transmission. RFID readers can be used to detect RFID tags within certain ranges. Combination of RFID tags and readers can be used for detecting a moving object such as animals.
In a paper by Seol et al, RFID tags are used for tracking large number of moving objects. The idea is as follows: each entity that is supposed to be tracked must be equipped with a basic RFID tag, that can receive queries and respond to so-called readers. The readers are static and are supposed to be positioned all around the area. Every reader has a certain range it can operate in. So it can communicate/detect entities only within that range, for example, 5 or 10 meters. The readers will pass the presence information of a certain tag to the central server that stores this information appropriately. The central server is responsible for gathering data and operating on it, for example by approximating a path that a tag took, keeping track of the number times that a certain tag appeared in a certain location.
In a US patent by Huisma, RFID tags are used for detecting animal visits to feeding stations. Animals are equipped with an RFID tag, that can be read in close proximity to the feeding stations. These detected visited are used together with weighing devices in the feeding troughs to measure the difference in weight before and after a consumption event, using a mathematically weighted filter technique. The reduction in food is divided between the RFID tag last seen and the next one. By detecting animals at the food stations with RFID tags, the food intake of each animal can be recorded. This information can be used for finding animals with abnormal feeding behavior. The patent mentions the obstacles with this method, namely inaccurate RFID readings (few seconds delay, readings by other stations) and inaccurate food reduction measurements (wind, rodents, inaccurate division).
Cameras and Computer Vision can be used to detect and monitor animals. Different cameras technologies, such as RGB, Infrared (IR) and Time-of-Flight (TOF) can all be used for animal identification, location tracking, and status monitoring.
In a paper by Zhu et al, a 3D machine vision of livestock is described. In previous papers, Internet Protocol(IP) cameras have been implemented to track the weight of animals and to ensure they do not get unhealthy. IP cameras capture RGB images, which makes them dependent on the room light, shadows and contacts between animals. In order to tackle those problems, the method used in the paper adds an IR camera to the RGB image. This gives information about the depth of every pixel thus giving a true 3D data for more accurate detection of the animals. The authors of the paper use Microsoft Kinect, which has RGB camera, IR projector, and IR camera. By setting different thresholds and creating a software, it is possible to estimate the weight of a pig very accurately and find ones which are over- or under-weighted.
In a paper by Salau et al, a TOF camera is used for determining body traits of cows. They first introduce the manual method of body trait determination which relies on two measures that are used to describe a cow’s body condition - Body Condition Score, which is gathered by visually and manually judging the fat layer upon specific bone structures and how sunken the animal’s rear area is, and the BackFat Thickness. However, this manual system for body trait determination has higher costs, more stressful for the animals, doesn’t avoid errors during manual data transcription, and cannot provide large volumes of data for use in genetic evaluation, rather than an automated method would do. Then the paper fully focuses on introducing and further explaining of the automated system which relies on collecting data from the camera - Time Of Flight. Technical aspects of TOF method, which is based on using a camera mounted into a cow barn, and its implementation with testing and numbers are present in this paper. It is clearly indicated that this automated system was able to carry out the tasks camera setup, calibration, animal identification, image acquisition, sorting, segmentation and the determination of the region of interest as well as the extraction of body traits automatically. In the end, it is summed up that the application of TOF in determination of body traits is promising since traits could be gathered at comparable precision as BFT. However, the animal effect is very large and thus further analyses to specify the cows’ properties leading to the differences in image quality, reliability in measurement and trait values need to be carried out.
A paper by Kumar et al focuses on tracking pet animals that are lost. They mention the fact that there is an increase in the number of pet animals that are abandoned, lost, swapped, etc., and that the current methods to identify and distinguish them are manual and not effective. For example, ear-tagging, ear-tipping or notching and embedding of microchips in the body of pet animals for their recognition purpose. The authors point out that these methods are not robust and do not help to solve the problem of identification of an animal. The idea is to use animal biometric characteristics to recognize an individual animal. To recognize and monitor pet animals (dogs) an automatic recognition system is proposed in the paper. Facial images are used for the recognition part and surveillance cameras are used for the tracking purposes. Results of the research are quite impressing, but it has yet to be tested in a real-life environment.
Similarly, a paper by Yu et al describes an automated method of identifying wildlife species using pictures captured by remote camera traps. Researchers not only described the technical aspects of the method but also tested the method on a dataset with over 7,000 camera trap images of 18 species from two different field sites. After all, they’ve achieved an average classification accuracy of 82%. Summing up, it was shown that object recognition techniques from computer vision science can be effectively used to recognize and identify wild mammals on sequences of photographs taken by camera traps in nature, which are notorious for high levels of noise and clutter. In the future work, the authors say, some biometric features that are important for species analysis will be included in the local features, such as color, spots, and size of the body, which are partly responsible for determining body traits.
Monitoring animals can be of great importance for farmers and the animals themselves. First of all, it is a common situation when farmers/feedlot operators miss the time when a certain animal is market ready. This increases the costs of running a farm. Also, detecting whether an animal is sick requires the presence of a feedlot operator. This causes more stress for animals. What is more, even when an animal is detected to be sick if will be treated with a range of different antibiotics regardless if the animal needs treatment for all of these illnesses.
A method is proposed by Guichon et al, for gathering reference movement patterns of the animals, for example, the ones that resemble the behavior of a sick/overfed/underfed/market ready/etc. and then compare with the movement patterns of the current livestock. These patterns can be used as well to identify the exact illness an animal has. This is because the system can track all places that the animal visited and therefore can narrow the scope of possible illnesses. Animals are tracked with a GPS tracker that every 15 seconds poll the GPS satellites and collect raw GPS data representing the associated animal's position. Then the data is loaded to a server that stores it and runs several smoothing/filtering programs to “clean” the raw GPS data. Since the data is processed continuously, the SQL database with coordinates and timestamps gets updated. Afterwards, the collected data is compared with reference patterns to count, for example, how many times a particular animal through different zones in a cowshed like to the water zone/feedlot/activity zone/etc.
Similarly, in a paper by Panckhurst et al, an ear tag for livestock is developed, which is lightweight (less than 40g) and solar powered. It has a GPS module, which is used for determining the location of the animals and this is then sent to a base station, where the data is collected. In the paper, a technical description of the ear tag and the base station are given
To monitor an animal and possibly detect sickness, sensory data can be used. By placing sensors on/in an animal that measure information such as blood pressure, temperature, or activity, it is possible to gain knowledge on an animal's conditions.
In a paper by Umega and Raja, different sensors are placed on the animal to monitor its wellbeing. Those sensors include heart rate sensor, Accelerometer, humidity sensor and others. RFID tags are used to identify the different animals, and the data is transmitted by wifi. The authors of the paper realize the design using Arduino Uno Microcontroller. The data from the sensors is extracted by the controller and can be displayed for the end user.
Similarly, a paper by Zhou and Dick proposes an intelligent system for livestock disease surveillance. The main purpose is to detect if animals are sick/or about to be sick and treat it to avoid the diseases spreading among other animals and infect the whole livestock. In this method, special sensors are used that are attached to every animal collecting both - animals (cows) temperature and ambient temperature every 5 minutes. Each sensor is uniquely identifiable. Then, the collected data is sent via a network to the main server, where it is processed. The processed temperature readings can then be used to detect diseases.
In a paper by Maina, the use of IoT and Big Data is explored for determining an animals health status and increase productivity. Interconnected sensors can be used to sample and collect the vital signs of the animals and based on that determine their health status. They have developed a prototype sensor system which was attached to the necks of cows. This sensor can distinguish between several different activities as eating grass, standing and walking. This paper, however, does not explore the actual connection of many sensors in a single network.
Lastly, in a US patent by Yarden, a system of basic tags, smart tags, a mobile unit and a PC unit for monitoring cattle and detecting illness. The basic tag is put on the ear of an animal and collects data from sensors on various locations on/in the cattle’s body. The smart tag is similar to the basic tag, but also collects information from various basic tags in proximity. Either the raw sensory data is sent, or the basic tag will process this data and only send a health indicator. The smart tag periodically sends the information to the mobile unit, which relays it to the PC unit, where it is displayed to the end user and stored. When illness is detected, the basic tags can display alarm with a LED and buzzer, and a message is sent to the PC unit.
Similarly to using various sensors, animals can also be monitored by attaching a single monitoring device to them that gathers sensory data such as location and vitals. This information can then be used for tracking the animals and determining their health status. These devices can be used to detect sickness in animals at an early stage.
A US patent by Ridenour describes a monitoring device that is placed on an animal’s appendage, that contains biosensors that can measure vitals. Additionally, it can be expended with a GPS tracker or a tag for monitoring visits to food and water stations. These measurements are used to determine when an animal is sick, by detecting when conditions fall outside normal ranges. When sickness is detected, it will send out an alarm. A transmitter can also be included, to send physiological information to a base station where all animals are monitored. Advantages of this device compared to other monitoring devices is that the system is non-intrusive, easy to use and can be adapted to a users need.
Similarly, a US patent by Ingley and Risco outlines a device for monitoring activity, ketone emission and vitals such as body temperature, nose wetness and humidity of cows. The device will be placed as either a nose ring or an ear tag. The device will take measurements and log this for at least 8 hours. When entering a milking facility, the data can be downloaded and used as an indicator of the cow’s health.
In a paper by Lopes and Carvalho, a low power monitoring device is attached to livestock for preventing theft. There will be a lower power module on the animal with a wake-up radio. A drone will be used to wake up the animal's module and collect the gathered information. Furthermore, the module should also be highly resistant to water, impacts, and dust. With such a system, each animal can be identified with the drone and theft can be caught early.
In order to complete the project within deadlines, we plan to start reading and summarizing the papers in the first week, being followed by establishing the USE aspect plus the impact of the technology on the animals. In the fifth week already, we plan to start working on the prototype which will be a simulation in Java that will show a location(has to be determined) and few types of animals(chosen according to the sick behavior study). Then, by allowing the user to select an animal, that animal becomes sick, the simulation detects that and finally reports it to the user. During last weeks we also have to specify why is it robotics and what advantages or disadvantages are present.
Milestones are shown in the planning picture.
- In the first week, we already plan to have summarized the papers and use them to identify patterns in sick animals behavior and what technologies can be used to detect these changes.
- In the 3rd week, the milestone is to deliver a full analysis of the USE aspects.
- During the following two weeks, we expect the simulation to work.
- In the last week, a milestone will be preparing and holding the final presentation.
- The last milestone is to prepare all deliverables for handing in.
As deliverables we decided to prepare the following:
- A presentation, which will be held in the last week. During this presentation, all of our work will be presented and a simulation will run.
- A simulation of the subject treated. For example, a barn that has a lot of animals(about 200-300) of different species(cows, pigs, chickens). The user will be allowed to place the identification technologies around the barn and "make" some of the animals sick. The simulation shall be able to discover which animal is sick by analyzing its behavior. The user is notified which animal might be sick.
- Research paper of the technology described above, which will take into account the advantages, disadvantages, costs, and impact of such an implementation.
Locations of interest
Our main location of interest is, of course, a farm and in particular a cow barn. To observe and track the cows with cameras, we need to be able to monitor them, preferably at all times. Since cows will spend (most of) their time in the barn, this is the place where monitoring can be done most succesfully.
Inside the barn, we can further distinguish certain regions. The place where food is put and the cows eat is the food zone. This zone is of importance, since visits to a food station and feeding time are prime indicators of sickness. Similarly, we can distinguish a water zone as the place the cows will drink. Furthermore, in some farms there is a further divide between activity zones and resting zones, while other farms might just have a general area for both these purposes. Tracking cows in these locations can also provide very meaningful information on the wellbeing of cows. For example, an indicator of the common disease mastitis in dairy cows is an increase in standing over lying down.  Lastly, the farm might contain a dedicated hospital and/or processing area, where actions such as treating sick animals and preparing new animals can take place.
Other locations of interest are the milking facility and the slaughterhause, for dairy cows and beef cows respectively. For these facilities, the welfare of the cows are of importance for productivity. Whether or not an animal is sick can have an effect on the quality of the product. Additionally, handling sick animals in this location can be time-consuming and reduce productivity.
A set of devices we decided to use in order to automate cow tracking and health monitoring contains only regular surveillance cameras. The number of cameras depends on the size of a barn. We require that the whole indoor area is covered such that every animal can be tracked at any given time. In the previous sections, we discussed several promising technologies that could be or are already used for animal tracking purposes, for example, thermal cameras, RFID, GPS and other. Despite that, we narrow the scope of involved devices only to cameras. The reason behind this is simplicity in video surveillance - cameras need to be placed only once in specific areas and do not require regular maintenance. Also, the animals will not feel the presence of the cameras, as it is the case for the RFID tags, where during maintenance, for example, the animal will be disturbed.
There are three main camera types which can be used, each of them being in a different electromagnetic spectrum (Fig. TBD) - RGB in visible light, thermal cameras or infrared camera at a specific wavelength, which uses triangulation to find the depth of every pixel using the Microsoft Kinect technology 
The RGB camera uses CMOS technology to identify the wavelength of the wave which “hits” every pixel in the range 380-780 nm. It is the simplest and cheapest camera technology from the ones, mentioned above. By using image processing techniques, the valuable information can be extracted. The disadvantage, about using only the RGB technology is that it does not give depth information. One possible way of obtaining depth information is by combining more than one cameras and triangulate the distance to every single point, but this is not reliable due to the fact that there are shadows and if the foreground and the background have the same color, it is impossible to find which point of the first camera corresponds to point on the second one.
Infrared camera with projector based on Microsoft Kinect technology
This technology works based on a patent by Microsoft. Its purpose is to obtain the depth of an image, independent of its visible spectrum color, or presence of ambient light and shadows. It uses an infrared projector, which casts many points on the observed surface with different tags. The infrared camera "sees" those points and using triangulation, calculates the distance to every point ( or every pixel). The advantage is, as mentioned, the independence of ambient light and the color of the objects. For example, if the pig is covered in mud and the background is also mud, then the Kinect sensor will still be able to calculate the depth accurately. The disadvantages are that the price is much larger, compared to the RGB cameras, and a definite requirement is that the Kinect sensor must be used inside because the projected dots will be "wiped" by the sunlight's infrared radiation.
Thermal cameras are based on the idea that all objects – living or not – have heat energy. That energy is used by thermal cameras, instead of contrast between objects that are illuminated by either the sun or another form of light. Because of that, a thermal camera can operate at all times, even in complete darkness. In order to present heat in a format appropriate for human vision, thermal cameras convert the temperature of objects into shades of grey. Thermal imagery is very rich in data, sensing small temperature variations down to 1/20th of a degree. Thermal cameras convert these temperature variations – representing 16.384 shades of grey into about 250 grey scales to more closely match the capability of human vision to decipher shades of grey. Despite the fact, that thermal cameras are used more frequently for commercial applications these days, their prices are high in comparison to, say, RGB cameras.
What is more, machine vision based technologies are evolving rapidly and currently, there are plenty of open source solutions that can be used as a base platform for the software part of the project. After researching we decided to focus on two of them - OpenCV and YOLO. In this section, we give an overview of both projects and describe how a particular software solution can be used to fulfill our needs in animal tracking.
OpenCV - is an open source, machine vision library that exposes rich functionality for application that requires image and video processing in 2D and 3D as part of their programs
You Look Only Once (YOLO)
YOLO - is a real-time object detection system that is free of charge and is based on an open source neural network framework Darknet
Sickness in cows
Visual tests that can be carried on cows
Since using a camera is the decision agreed on, the test that can be carried are going to be divided into four categories: injuries, skin related problems, behavioral related problems, feeding problems.
The injuries are the easiest to identify and report since most of them are immediately visible. It can either be seen on the camera, or it will affect the movement of the cows. A really important examination described in Basic clinical exampaper is the one taken on the feet and legs of animals. They are intended to spot this type of injuries. Even though it might be difficult to use cameras to identify lower level problems, the movement can betray the problem without actually being seen by the camera, but the feet problem is emphasized since it can reveal true problems.
Skin problems are often present during the winter season, the most often problems being warts and ringworm. These two problems appear especially in young cattle until their immune system has built immunity. If this problem occurs in the older cattle, an immune deficiency is suspected. Besides these sever diseases, there are also unusual spots, dry skin, changes in shape or different signs of problems.
Behavior is a good sign of problems. Behavior related problems are easy to find out most of them being related to attitude, appetite, and movement. The attitude of a cow can be either stressed, alert, depressed or others, but all of them change the normal flow of things. A cow that is not in the right mood, might refuse to eat and isolate itself from the others. The feeding routine of the cow is also important to determine underfed or obese animals.
All of these problems are related to each one and one can lead to another, indeed exposing the cow to sickness. Any of these factors can be the sign of a disease and it requests a detailed clinical examination after it is found.
A not-uncommon cause of injuring of cattle is the penetration of foreign objects into the sole of the foot.  This action leaves a wound in the feet of the animal which will provide a good environment for bacterias. Another injury that can produce a high amount of pain is the damage or even removing part of the hoof wall. The most common hoof defects are cracks which can be both vertical or horizontal. The horizontal crack is related to stress or disruption in the animal’s health, while the vertical one can be formed by environmental conditions or by the weight of the animal. It is not easy to spot most of these problems, but as described in the visual tests that can be carried, their effect often affects the movement of the animal.
It is also possible that the animal will not present signs of pain, so the visual identification might be a problem. Thermal imaging cameras could be considered for users who wanna invest more into their herd verification in order to detect all these problems. Thermal imaging cameras can provide an interesting solution to the problem while it does not involve touching the animal. It is an effective way to increase the range of signs found, but also more expensive.
Viruses in cattle are often visible at the skin level. Two of the most common are warts and ringworm spots.
Warts are caused by a virus and there are at least 12 different papillomaviruses that cause this sickness. It often shows up in the skin that has broken(for example in ears after tagging). It can even appear from a scratch, but fortunately, most of them disappear in few months. This virus can be spread from animal to animal just by simple touch, or by cows that are itching of the same fence. Also, if one new cow having this problem is bring in the herd, it may infect the animals which did not develop the immunity to this virus. There are vaccines for this virus and can be easily removed if detected in due time.
The ringworm is a fungal disease skin that usually appears in calves during winter, but it disappears in the spring. The problem with this fungus is that it can also be spread to other species, like humans, and the variety of types of fungus is immense, so it is unlikely somebody to have immunity against all. The disease can be spread by direct contact, or by spores which can spread on equipment that was used on that cow. That’s why in the same paper it is recommended to disinfect the utensils. Another important aspect is that “Spores may survive in the environment for years. Young cattle may develop ringworm in the fall and winter even if there weren't animals in the herd with ringworm during summer;”, which makes treating of the ringworm frustrating. There are medications, but they are expensive to use on large animals, so prevention is the best solution.
There are also other skin viruses and diseases, which can be identified  by visual inspection. Most of them are represented by spots and changes in shape or color of the skin, or in immediate visual problems like nasal discharges and coughing.
Behavior and feeding
According to Dr. Ruth Wonfor, it is possible to detect some illnesses even before there are any visible symptoms and clinical signs by understanding dairy cow behavior. 
Clearly, illness affects animal behavior, as in the human case. Behavioral changes in self-isolation or appetite loss. And there are even more aspects to track changes, including social exploration. As an example, lame cows spend more time lying down, change their weight distribution and walk much slower compared to healthy animals. Dairy cows with mastitis idle more and spend shorter lying down, eating, ruminating and grooming. As chronic illnesses appear to instigate more behavioral changes, monitoring of this can distinguish whether an animal has an acute or chronic illness.
Furthermore, there has been a research carried out for a number of clinical production diseases in order to find out whether behavior indicators can act as early disease indicators. Worth to mention that in most of the cases that were examined, feeding behavior so far seems to be a relatively reliable predictor of disease onset. Cows with acute lameness have shown a reduction of time spent at the feeder of around 19 minutes every day for the week before lameness was visualized, along with a reduction in the number of visits to the feeder. Cows who develop metritis 7-9 days after calving, spend less time at the feed bunker before they have even calved. For animals with ketosis, feeding and activity behavior changes, with a reduction in feed intake in the 3 days before diagnosis and a 20% increase in standing time in the week before calving.
Moreover, the research made by Thompson Rivers University demonstrated eye temperature was more effective at detecting bovine viral diarrhea as changes occurred as early as one day, compared to 5-6 days for other areas such as the nose, ear, body, and hooves, which are commonly used as clinic signs. As the authors suggest, infrared values, which can be obtained using a thermal camera, for example, were as much or even more efficient than clinical scores. Nevertheless, not only the temperature of eyes matters - sunken eyes in combination with droopy ears indicate a sign of something wrong. Coming back to appetite as a factor, panting and excessive salivation are also know to sign the cow isn’t feeling well.
Pattern in cows movement
Finding out if the animal feels pain can sometimes be a real challenge for a vet. Most animals will try to hide their weakness and will only show that they’re in pain when the pain has become unbearable. So a common method to determine whether an animal is in pain consists of touching the animal in the area where the pain is suspected and monitoring the animal’s response closely. This is, however, not always reliable, for the animal might be very determined not to show signs of pain and another consideration is that the owner of the animal often doesn’t like the fact that the veterinarian is causing more pain to their beloved animal. Thermal imaging cameras can provide an interesting solution to that problem, for it does not involve touching the animal and it can be used to show anomalies in the thermal pattern.
The technology we focus on is about improving the process of monitoring and tracking domestic animals. Hence the main users are people involved in the process of delivering commodities to the market and animals themselves. These are:
- Feedlot operators
- Slaughterhouse workers
- Domestic animals
We also consider people that can possibly be involved in maintaining the technology described here.
- Maintenance engineers
Slaughterhouse workers must be able to
- verify that a particular domestic animal or a product is market ready
- be informed if a product or an animal is infected or most probably will be infected in the near future
Feedlot operators should be
- informed if a particular animal deviates from standard behavior
- informed if a particular animal or its product is market ready
- able to examine animals health state without manually examining the animal
- informed if a particular animal is underfed/overfed
Veterinars should be able to
- have information about the animals health state, such as
- animals temperature for some specific period of time (to be determined later)
- ambient temperate at the farm
- latest location that the animal visited (this can help narrow the scope of possible diseases)
- information about previous health issues
- feeding statistics
Farmers should be able to
- examine statistics of the livestock, such as
- ill animals
- market-ready animals
- animals that do not meet quality/yield standards
Maintenance engineers should be able to
- adjust the technology for different number of animals at a farm/cowshed/etc.
- adjust the technology for varying indoor capabilities and constraints.
Domestic animals should
- not be harmed by the technology
- not be distracted by the technology
If the technology described will come to existence, then it will definitely have a huge impact on the society, both positive and negative. Automatization often leads to controversial effects and this case is not an exception. In many states, dairy farms strongly rely on the immigrant labor force. Wisconsin case is a great example of a situation when low-paid workers form a backbone of dairy operations. Obviously, such a labor force is used since immigrants are willing to work for a way lower reward and for much longer shifts, which in points of view of many is a complete injustice. However, it is hard to blame entrepreneurs, as in many cases that is the only option in order not to go bankrupt. And this is where the controversial part comes into play: implementation of such a system would eliminate a need for low-cost labour and hugely decrease the level of violating workers rights at dairy farms, which is clearly a positive outcome, but at the same moment that would mean a huge work lost among these people, which is a really bad consequence that has to be withstand for a greater good. Speaking of the second set of actors for society, consumers, it is worth to mention that implementing a system that is less costly would, after all, result in price shortage, which would make products like beef, milk, cheese and etc. way more affordable. Secondly, since this technology implies the early sickness detection and elimination of human factor in monitoring processes at cow farms, everything that is produced at these farms will become a greater quality, which obviously has a good impact on consumers. The government might also be considered as an actor for the society, as in the long term this technology might lead to the farm expansions, which in turn might result in a shortage of role of import in the field of products like milk and beef.
The enterprise sector would be hardly affected by any negative impact of the described technology on farms. This impact is amplified by the fact that farmers usually do not have a second source of income. So, they expect somehow to sell products made out of milk, to sell cow beef or either selling the whole animal in order to earn money for their living. Besides that, trades are necessary to improve farm’s facilities and their development.
As it is described on the Organization for Economic Cooperation and Development(), beef represents one of the main sources of meat in some countries, while for many others it is in top three. Following all these data it is easy to find out why enterprises invest more and more money in such cow farms that will produce a huge revenue.
Among all the possible enterprise actors, the most influential ones are the companies which ask for goods like milk and meat. Their request is that the products must be fresh and edible. Here is the point, where our technology takes over others. Camera detection is not intrusive. It is not like a tag(where the skin has to be pierced) or like a collar(that can harm the cow), both technologies being really good factors for bacterias(as described in the sickness section). The camera which the only scope is to track and detect possible issues can increase the detection rate, without posing any damage to the animals. This is a good reason for companies to start investing money in such a technology.
A second major actor would be the general owner of the farm. Even if he/she can be considered also as one of the users, when the point of view is focused on money and income, the owner becomes part of the enterprise. His point of view will be focused to get as many and accurate predictions as possible while keeping the costs low, aspects which are treated by our technology.
Other enterprise interests might arise from the cameras’ companies which will try to provide competitive prices for their products such that farmers will buy them, transport companies which will have to increase the transport rates(according to our description, by detecting more sick animals, they can be treated or the sickness can be stopped from spreading, resulting in more viable products to release on markets) and others. Overall, everybody who invests or expects money from such a technology is part of the enterprise sector, but the main beneficiaries are the goods sellers and the farm owners.
System Requirements, Constraints and Preferences
- The cows rarely leave the barn (only for special occasions)
- The cows do not have any other species of animals inside their enclosure.
- The barn does not have areas which are obscured from view by cameras mounted at ceiling level.
- The barn has a distinguished food zone, where feeding takes place.
- Cows cannot be on top of each other
- The system should identify cows.
- The system should distinguish between cows to uniquely identify an animal.
- The system should provide simple navigation for the farm workers to the cow of interest.
- The system should inform the farm workers about deviations from the standard behavior of a cow.
- The system should track the position of each cow at any given moment.
- The system should persist historical data of every cow.
- The system should gather information from the whole barn area.
- The system should detect visits to a feeding station by a cow.
- The system should operate remotely.
- The system should operate without disturbing the cows in any way.
- The system should be possible to set up by a layman.
- The system should be able to exchange data between different farms.
- The system should be as cheap as possible.
- The system should be as accurate as possible.
- Total maintenance and operational costs should be cheaper than the manual operations that the system replaces.
- The system should be at least as effective as doing manual inspection.
As explained in the project definition, it is our objective to automatically detect diseases in animals. Doing this early can save cost, decrease the chance of disease outbreaks and increase productivity. Since there are infinite design choices to achieve this objective, we have laid down the reqiurements. our system should implement.
Because all farm animals differ, the system cannot be uniquely made to support all possible animals. For simplicity, only one animal will be supported. The choice of animal is based on mutual agreement of the group - cows (Requirement 1). This does not mean that cows are more important than the other animals, it is solely for simplicity reasons. After identifying the technology and where it is going to be used, more details will be given. As mentioned in the beginning, the purpose of this system is to increase the productivity of farms. One way to do that is by detecting which animals are sick. By automating this process, one can prevent the death of animals or decrease in their productivity because of sickness. In case manual inspection is present, the system must be more effective than it (Constraint 2).
Many technologies can be used for monitoring cows and tracking behavior. In the section on identification technologies many possible solutions are proposed.
We chose cameras as our technology for monitoring cows and detecting diseases. Camera(s) can be used to identify, distinguish and monitor cows continuously, satisfying requirements 1, 2, 6, and 8. Multiple cameras can be used to monitor the entire barn, satisfying requirements 7. Furthermore, cameras do not disturb the cows in any way and are easy to set up by a layman, like a farmer. Cameras are also “passive” since they do not physically contact the animal.
Other technologies can also be used to accomplish our objectives. Cows can be monitored using wearable devices or inserted chips containing sensors, and/or RFID/GPS technology. However, such devices would break requirement 10, which states the system should not disturb the cows in any way. We believe this is important, because we are obliged to keep animal welfare and wellbeing in check, and by implementing a new technology we would like to reduce its negative impact on the animal as much as possible. Requirement 2 also excludes technologies that cannot easily differentiate between different animals, like pressure sensors, microfones, etc.
We decided that the cameras will be mounted on the ceiling of the barn, possibly with a very slight angle. Mounting them in this way allows easy identifying and distinguishing between the individual cows (requirement 1, 2), as long as cows are not on top of eachother (assumption 5). This is important because in order to determine if an animal is sick, it should be uniquely tracked and not confused with neighboring animals.
Other position, for example placing the camera on ground level for a side view may result in an animal hiding behind a different one. This would hinder the ability to identify and distinguish between different animals (requirement 1, 2).
- World population prospects: The 2017 revision. United Nations, 1(6042), 587-92.
- Tilman, David, et al. Global food demand and the sustainable intensification of agriculture. Proceedings of the National Academy of Sciences 108.50 (2011): 20260-20264.
- Greene, J. (2010). Animal identification and traceability: overview and issues. Congressional Research Service, 29.
- Bruno R., Jordan E., Hernandez-Rivera J., & Lager K. Basic Clinical Exam: Key to early identification of sick animals. Texas AgriLife Extension Service
- Weary, D. M., Huzzey, J. M., & Von Keyserlingk, M. A. G. (2009). Board-invited review: Using behavior to predict and identify ill health in animals. Journal of animal science, 87(2), 770-777.
- Frost, W. W., & Hamm Jr, T. E. (1990). Prevention and control of animal disease. The experimental animal in biomedical research. Boca Raton, FL: CRC Press, 1, 133-1.
- Thermal imaging cameras help diagnose health issues in small animals. Flir Systems
- Church, J. S., Cook, N. J., & Schaefer, A. L. (2009). Recent applications of infrared thermography for animal welfare and veterinary research: everything from chicks to elephants. Proceedings Inframation, 10, 215-224.
- Seol, S., Lee, E. K., & Kim, W. (2017). Indoor mobile object tracking using RFID. Future Generation Computer Systems, 76, 443-451.
- Huisma, C. (2015). U.S. Patent No. 8,930,148. Washington, DC: U.S. Patent and Trademark Office.
- Zhu, Q., Ren, J., Barclay, D., McCormack, S., & Thomson, W. (2015, October). Automatic animal detection from Kinect sensed images for livestock monitoring and assessment. In Computer and Information Technology; Ubiquitous Computing and Communications; Dependable, Autonomic and Secure Computing; Pervasive Intelligence and Computing (CIT/IUCC/DASC/PICOM), 2015 IEEE International Conference on (pp. 1154-1157). IEEE.
- Salau, J., Haas, J. H., Junge, W., Bauer, U., Harms, J., & Bieletzki, S. (2014). Feasibility of automated body trait determination using the SR4K time-of-flight camera in cow barns. SpringerPlus, 3(1), 225.
- Kumar, S., & Singh, S. K. (2016). Monitoring of pet animal in smart cities using animal biometrics. Future Generation Computer Systems.
- Yu, X., Wang, J., Kays, R., Jansen, P. A., Wang, T., & Huang, T. (2013). Automated identification of animal species in camera trap images. EURASIP Journal on Image and Video Processing, 2013(1), 52.
- Guichon, P. T., Jim, G. K., Kotelko, P. B., Kotelko, M. J., Booker, C. W., & Tollens, Y. T. (2003). Patent No. 6,569,0920. Washington, DC: U.S. Patent and Trademark Office.
- Panckhurst, B., Brown, P., Payne, K., & Molteno, T. C. A. (2015, April). Solar-powered sensor for continuous monitoring of livestock position. In Sensors Applications Symposium (SAS), 2015 IEEE (pp. 1-6). IEEE.
- Umega, R., & Raja, M. A. (2017, March). Design and implementation of the livestock barn monitoring system. In Innovations in Green Energy and Healthcare Technologies (IGEHT), 2017 International Conference on (pp. 1-6). IEEE.
- Yazdanbakhsh, O., Zhou, Y., & Dick, S. (2017). An intelligent system for livestock disease surveillance. Information Sciences, 378, 26-47.
- wa MAINA, C. (2017, May). IoT at the grassroots—Exploring the use of sensors for livestock monitoring. In IST-Africa Week Conference (IST-Africa), 2017 (pp. 1-8). IEEE.
- Yarden, M. (2017). U.S. Patent No. 9,538,729. Washington, DC: U.S. Patent and Trademark Office.
- Ridenour, K. W. (2000). U.S. Patent No. 6,113,539. Washington, DC: U.S. Patent and Trademark Office.
- Ingley, H., & Risco, C. (2005). U.S. Patent Application No. 11/010,988.
- Lopes, H. F., & Carvalho, N. B. (2016, January). Livestock low power monitoring system. In Wireless Sensors and Sensor Networks (WiSNet), 2016 IEEE Topical Conference on (pp. 15-17). IEEE.
- González, L. A., Tolkamp, B. J., Coffey, M. P., Ferret, A., & Kyriazakis, I. (2008). Changes in feeding behavior as possible indicators for the automatic monitoring of health disorders in dairy cows. Journal of Dairy Science, 91(3), 1017-1028.
- Cyples, J. A., Fitzpatrick, C. E., Leslie, K. E., DeVries, T. J., Haley, D. B., & Chapinal, N. (2012). The effects of experimentally induced Escherichia coli clinical mastitis on lying behavior of dairy cows. Journal of dairy science, 95(5), 2571-2575.
- J. Mahoney, “Testing the goods: Xbox Kinect,” Microsoft, 2010.
- L. Pettigrew; R. Green, Depth correction: Methods for approximating depth information in web camera depth maps, IEEE, 2010
- OpenCV library
- YOLO: Real-Time Object Detection
-  Darknet - Open Source Neural Networks in C
- Russ Daly, DVM, DACVPM. (2014) Lameness in cattle causes associated with injury. iGrow.
- Heather Smith Thomas. (2013) Skin problems in young cattle wards and ringworm. Tri-State Livestock News.
- Dr Ruth Wonfor. Using dairy cow behavior early detection disease. Farming Connect.
- OECD Data on meat consumption