Assessing goats fecal avoidance using image analysis based monitoring

Recent advances in sensor technologies and data analysis helped monitoring animal behavior over long time periods. This is particularly interesting to study the link between behavior and animal health. In this work, we studied the capacity of Creole goats to avoid feces on pasture. We developed an experimental framework, composed of a small pasture of 12x12=144m2 with two zones of 6x2=12m2 infested with feces, and a monitoring system, based on a time lapse camera, taking pictures every 20s from 6:30 to 18:00. A set of 3,800 images were manually labeled to (i) train a Yolo based CNN, ables to detect goats on the images and (ii) train a resNet50 based CNN, ables to identify the goats present on pasture. We used the framework to monitor the location of four Creole goats, selected for their various colors, to make automatic animal identification easier. We were able to determine when the animals were on the infested areas or not. Goats were allowed to graze for two weeks, separated from more than 2 months. Goats were worm free when grazing started and the level of infection was evaluated after grazing, using fecal egg count. Goats were detected in 88% of the cases and the precision for animal identification was estimated to 95%. Although goats exhibited various level of avoidance, it increased for all goats during the second grazing week, and the level of increase was proportional to the level of infection resulting from the first grazing week.


INTRODUCTION
Goats are an important ressource mainly for meat and milk production.In 2019, the number of farmed animals was estimated to be more than 870 millions (http://www.fao.org/faostat), with approximately 94% of the animals located in Asia and Africa.Infection to gastro-intestinal nematodes (GIN) is the number one health constraint and is responsible for reduced production and increased mortality, especially for the young and adult females, during the periparturient period.There exists different species of GIN, the most important being Haemonchus contortus, known as the barber pole.Adult worms are located inside the abomasum and an adult female can release from 5 to 10,000 eggs on the pasture daily.Haemonchus contortus is blood feeding and heavy infection can results in anemia.In the past, GIN management successfully relied on systematic anthelmintic (AH) treatment.Unfortunately, resistant nematodes to AH was gradually selected (Kaplan and Vidyashankar, 2012) and it is now admitted that relying only on AH is not a sustainable strategy (Charlier et al., 2018).
There exists several alternatives to manage GIN infection in small ruminants, most of them relying on prevention.For example with genetic selection of resistant animals or with optimal pasture management to limit the number of GIN on pasture during grazing.Modelling is an important tool to understand the interactions between the alternative management options, and could be used to design sustainable strategies, adapted to the farmer's constraints.This requires a good understanding of the GIN population dynamic and to predict the impact of management.Models of GIN population dynamic on pasture (Rose et al., 2015) or inside the host (Louie et al., 2005;Saccareau et al., 2016) are available in the literature, but the dynamic of GIN ingestion, i.e. timing and quantity of ingested GIN, is not well described.However, accounting for the dynamic of GIN ingestion and for individual variability can have important impact on the entire GIN population dynamic (Cornell et al., 2004;Fox et al., 2013;Bonneau et al., 2018).Modelling ingestion is a difficult task, mainly because it is difficult to estimate the spatial distribution of GIN on pasture and the number of GIN included in each bite.The recent developments in precision livestock farming tools offer new opportunities, especially to characterize animal behavior, and to study the relationship with GIN infection.
Most of the studies considering the relationship between animal behavior and GIN infection were on the capacity of the animal to avoid feces.To the best of our knowledge, all the studies relied on visual observations, either directly or from video recording, and most of them were for sheep.In particular, several studies found that sheeps were able to avoid feces during grazing (Hutchings et al., 2006), that the avoidance level was greater for the infected animals (Hutchings et al., 1999;Cooper et al., 2000), and that the avoidance level decreased with the age of feces (Hutchings et al., 1998).For goat, we were aware of only one study (Brambilla et al., 2013), which underlined the fecal avoidance capacity of wild Alpine Ibex.However, they did not found a relationship between avoidance and infection level.Dominance status can influence the animal diet, with the dominant animals having the opportunity to be more selective (Barroso et al., 2000), and thus potentially avoid more easily the infected areas.We found only one article that studied the relationship between social behavior and GIN infection in goat (Ungerfeld and Correa, 2007).
They found that the most dominant goats had a fecal egg count (FEC), i.e. the number of GIN eggs per gram of feces, significantly lower.
In this article, we proposed an experimental framework to study the relationship between animal behavior and GIN infection.We designed a pasture where the quantity and location of infected feces were known.A group of four animals were released on the pasture and monitored during one week to estimate the time spent inside infected and non-infected areas.The first objective was to study the ability of the goats to avoid feces.The second objective was to study the relationship between the time spent on infected areas and the animal level of infection after grazing.The third objective was to study the relationship between social behavior and GIN infection.The experimental framework is based on automatic monitoring of the animals using image analysis (Li et al., 2021).Convolutional neural networks (CNN) are generally the most adapted image analysis method and has been used successfully, mostly for pigs (Yang et al., 2019;Zhang et al., 2019;Marsot et al., 2020;Zheng et al., 2020;Gan et al., 2021), but also for goats (Wang et al., 2018;Bonneau et al., 2020;Jiang et al., 2020;Su et al., 2021).Several methods for cattle monitoring also successfully identified animals using deep-learning technics (Andrew et al., 2017;Qiao et al., 2019;Achour et al., 2020).The main advantage of using CNN is that powerful models, trained on millions of images and designed by research teams with relevant engineering skills, are available free of charge.Then, new users can almost directly use these CNN, just by retraining some parameters in order to be able to detect and classify their objects of interest.In this article, we proposed to use Yolo associated with resNet-50 to detect and identify the animals.

Experimental setup
The aim of the experiment was to monitor animals during a natural GIN infection.To control GIN infection, the animals were allowed to graze on a contaminated pasture during one week.Before and after grazing, the animal was maintained in a worm-free environment, in order to guaranty that infection can only occurred during grazing.
The experiment was decomposed into three stages.The first stage, is a worm-free environment stage, where the worm burden of each animal is controlled and maintained to zeros.The second stage is the grazing stage, where the animals are exposed to GIN during grazing.The third stage, is a worm-free environment stage, where the GIN level of infection due to contamination in the second stage is assessed.
We repeated the experiment two times, in Try 1 and Try 2, with 2 months and 16 days between the two tries.The same pasture and animals were used for the two tries.
All the experiments were conducted at the INRA-PTEA experimental facilities located in Guadeloupe.
Illustrations and schematic representation of the experiment are available in figure 1.

Animals
Four male Creole goats were selected to maximize color differences between individuals.The first goat, referred as white, weighted 34.13kg and was 16 months old at the beginning of the experiment.It had black coat with white color patches on the belly.The second goat, referred as brown, weighted 33.93kg and was 12 months and 17 days old at the beginning of the experiment.It has brown coat with a black strip on the back.The third goat, referred as black, weighted 31.62kgkg and was 12 months and 17 days old at the beginning of the experiment.It had homogeneous black coat.The last goat, referred as red, weighted 39.92kg and was 12 months and 11 days old at the beginning of the experiment.It had reddish brown coat with a black strip on the back.

Stage 1 and stage 3: worm free environment
The animal were drenched with cydectine 0.1% at the beginning of the first try and with biaminthic 5% for the second try.To control the efficacy of the anthelmintic treatment, we assessed the FEC one week before grazing.For the second try, we observed that animals still had non zeros FEC and they were drenched a second time.The individual FEC was re-assessed on the first grazing day, to confirm that animals were worm-free.In any case, the anthelmintic treatment was gave more than 6 days before grazing in order to avoid anthelmintic remanence.To assess the individual FEC, approximately 5g of feces were collected from the rectum and directly transported to the laboratory using plastic tubes to avoid contamination.The feces samples were analyzed individually using a modified McMaster technic.The FEC was expressed as the number of eggs per gram of feces (Aumont et al., 1997).Before and after grazing, the animals were maintained together in a stall and were fed with dry hay to avoid parasite ingestion outside of the grazing week.After grazing, FEC was assessed at least every week, starting 8 days after grazing.FEC is a common proxy of the animal worm burden, it makes the hypothesis that the number of eggs in the feces increases with the number of parasites inside the host.Although in general the animals with the highest FEC are also the animals with the highest worm burden, this might not be true in some extreme cases (Bishop and Stear, 2000).

Stage 2: Grazing
We designed a square pasture of 144m 2 , with a semi-closed adjacent area of 9m 2 , equipped with water.This area was used by the animals to rest and to be protected from the rain and sun.To define the infected areas, we delimited two rectangles of 2m×6m=12m 2 each.The areas were delimited with metallic bars sinked into the ground, with only 20cm of the bar above the ground, to avoid disrupting animal behavior.
The pasture was approximately flat, to limit GIN movement on pasture due to water flow.
The pasture was worm free before the experiment and was mowed approximately 1 month before the beginning of grazing on Try 1.When grazing started, grass was in average 7.32cm (n=22) in the non infected areas, 8cm (n=8) in the first infected area and 8.3cm (n=9) in the second.At the end of grazing on Try 1, grass was mowed at ground level in order to limit the persistance of parasites on the infected areas.20 days before grazing on Try 2, grass and ground samples were collected in the infected and non-infected areas in order to guarantee that parasites were not present on pasture.We used a Baerman technic to extract parasites from the samples and was not able to detect any gastro-intestinal nematodes.When grazing starts on Try 2, the grass was in average 10.7cm (n=23) in the non-infected area, 10.8cm (n=11) in the first infected area and 9.3cm (n=12) in the second infected area.900g of infected feces were dropped homogeneously inside each of the infected area.Feces were dropped manually 13 days before grazing on Try 1 and 10 days before grazing on Try 2, expecting to maximise the number of infected larvae on pasture during grazing.On Try 1, feces were obtained from 10 naturally infected animals.The feces were mixed homogeneously and FEC was estimated from 10 different samples (mean FEC = 576 eggs/g, std = 265 eggs/g).On Try 2, feces were obtained from 16 experimentally infected animals.FEC was assessed for each animals (mean FEC = 4431 eggs/g, std = 43.8eggs/g) and feces was mixed together homogeneously.
In order to estimate the number of larvae on the infected areas, 6 control feces samples of 80g each were dropped in 30cm square quadrats, outside of pasture.Two grass samples were then collected from two quadrats, on the 1st, 3rd and 6th grazing days for Try 1, and on the 1st, 3rd and last grazing days for Try 2.
The number of infected larvae was then estimated with a Baerman technic.We averaged the number of larvae found from the two control samples to extrapolate the number of larvae present in the infected areas, from the 900g of feces: Where n p L3 is the estimated number of larvae inside an infected area, n c 1 L3 and n c 2 L3 are the number of larvae found in the first and second control samples.

Recording with time-lapse cameras
We used a construction time-lapse cameras (Brinno TLC2000 pro 2018), equipped with waterproof plastic protection.The camera records at 1.3 Mpx with a resolution of 1208 × 720 using jpeg compression.
It was setup to take one picture every 20s from 6:30 to 18:00.When we controlled the images acquired during Try 1, we realized that the camera was facing the sun during sunrise, which decreases the quality of the images.As a consequence, the location of the camera was adapted accordingly for Try 2 (see figure 1).
This is a provisional file, not the final typeset article

Animal monitoring
We developed an algorithm to analyze each image of the time-lapse camera independently.The algorithm was decomposed into two steps: (i) to detect the animals on the picture, and (ii) to estimate the identity of the animal, i.e. white, brown, black or red.

Animal detection
To detect animals, we used a common approach, based on the CNN Yolo v2 (Redmon and Farhadi, 2017), which is known to run fast, with high accuracy and high learning capacities.
Yolo divides the image into grid cells of various sizes and predicts what objects are present into each cell.
Then a combination of different technics allow to find back the exact bounding boxes around the detected objects, by reasoning on the global image.For image feature extraction, Yolo can be used with classical CNNs for image classification.For our purpose, we trained one version of Yolo, based on inception v3 (Szegedy et al., 2016) and another version based on resNet-50 (He et al., 2016).Each network was trained on the same set of 3,820 images where the goats were manually labelled.We performed an empirical evaluation of the two networks and found that the architecture based on resNet provided better results.
In very few cases, Yolo returned more than 4 detections, mostly when multiple bounding boxes was associated to the same animal.When more than four bounding boxes was found, we simply used a non-max suppression method to remove the overlapping bounding boxes, and selected the four bounding boxes with the highest probability.
The detections inside the resting area were not accounted for.

Individual identification
The results of the Yolo detection stage is a set of bounding boxes, (x a , y a , w a , h a ) a=1...n , around the detected animals, where x a and y a are the column and row numbers of the top left corner of the bounding box number a. w a and h a are the width and height of the bounding box, and n is the number of bounding boxes/detected animals.From the original image, we then extracted n sub-images, corresponding to the bounding boxes, and move to the next step: identify the animal inside each bounding box.
This second step is an image classification problem, with 4 different classes, white goat, brown goat, black goat and red goat.There is several CNN that are available free of charge, and trained on more than one million of images to perform image classification.Even though these CNNs are generally trained to recognize common objects such as dogs, stop signs or humans, their architecture and most of their layers can be directly used to recognize new classes, which is known as transfert learning.This is due to the quality of their architecture to extract useful features from images.
We also tested two different CNNs, resNet-50 and inceptionV3.In each case, only the parameters of the last 10 layers were re-trained.When labelling the training images for Yolo, we also labeled the color of the animals.We thus used the 3,200 training images labeled for Yolo, to extract 12,236 images with color labels.In total, approximately 3,400 images were available for the white goat and 2,900 images for the other goats.70% of the dataset was used to retrain the CNNs and 30% to evaluate their performance.
resNet-50 provided higher sensitivity and precision values, and was used for the analysis.
Compared to other image classification problem, we had an extra information, two detections cannot be in the same class.Instead of directly using the prediction of the CNN, we used it to compute the probability of each bounding box being from an animal of the four different color.For each bounding box (x a , y a , w a , h a ),

Hal INRAE
the CNN associated a set of probabilities (p a white , p a brown , p a red , p a red ).A score was then calculated for each possible color configuration of the bounding boxes.If c a is the color of the bounding box number a, the score of a configuration c 1 , . . ., c n is simply the sum of the probabilities of the bounding boxes to be in that colors: We finally chose the color configuration with the highest score.

Evaluation
To evaluate the capacity of the method to detect and identify animals, we designed a MATLAB application, which selected randomly an image on the data bank and displayed the detected animals and their identifications.For each color (i.e.white, brown, black and red), the user first selected if the animal was detected, non-detected or absent (i.e.inside the resting area).When the animal was detected, the user also had to select the detected color.A second script was designed to manually record the location of the missed detection.
We ran the application to control more than 600 images for each try.In order to assess the capacity of the method to detect the animals, we computed the percentage of detected animals.For each color, the percentage of detection is equals to 100 * nbD nbD+nbN D .Where nbD is the number of images where the animal is detected and nbN D is the number of images where the animal is not detected.
In order to assess the capacity of the method to identify the animals, we compared the estimated and true color of each detection.Then we evaluated the sensitivity and precision for each color class.

Avoidance capacity
To characterize the capacity of the animals to avoid infected areas, we computed the number of times each animal was detected on the infected, and non infected areas.In order to be able to compare the two quantities, the number of detection was normalized by the surface area of each zone, which provides a number of detection per m 2 .Finally, we defined the avoidance index as the ratio of the number of detection per m 2 inside the non-infected and the infected areas: Where d nia is the number of detection inside the non infected area and d ia is the number of detection inside the two infected areas.We recall that the non infected area is 120m 2 and the infected areas is An avoidance index > 1 means that the number of detections per m 2 is strictly higher for the non-infected area.The greater is the avoidance index, the greater is the feces avoidance.
We computed a daily avoidance index, where d nia and d ia were computed daily.We also computed the weekly avoidance index, where d nia and d ia were computed over the entire grazing week.
This is a provisional file, not the final typeset article

Larval exposure and FEC
We explored the relationship between the time spent on infected areas, the number of larvae on pasture and the animal's FEC after grazing.
To quantify the individual grazing time inside the infected areas, we first calculated the proportion of time each animal spent in these areas, which was easily obtained from the animal monitoring framework.
Then, we simply extrapolated the amount of time, in minutes, on the entire day, from sunrise to sunset.
To quantify the daily quantity of larvae inside the pasture, we first computed a linear interpolation of the number of larvae inside the two infected areas during the 7 grazing days.The linear interpolation consisted in connecting two observations with a straight line.
To summarize these two informations, we defined the exposure index, as the sum of the daily products between the grazing time inside the infected areas and the number of larvae.For an animal, the exposure index is thus: Where p t ia is the proportion of time spent inside infected areas during day t, t Daylight is the daylight duration, in minutes.And nl t is the number of estimated larvae, inside the two infected areas, on day t.
We defined the exposure index to quantify animal exposure to larvae, it is monotonically increasing with the quantity of larvae available on pasture and the time spent on infected areas.
A better approximation of nl t should take into account the quantity of larvae that has been ingested by the animals during grazing.Unfortunately, this quantity is hardly predictable.
Finally, in order to express the animal level of infection, we used the logarithm of the area under the FEC curve (LAF) of each animal.The area under the FEC curve is a useful information as it allows characterizing the infection over the entire infection period.We used the logarithm for clarity of the graphical representation.

Social Distance
The inter-individual distance is a good indicator of the dominance relationship between the animals (Aschwanden et al., 2008).To reduce the risk of aggressive behavior from the dominant animals, subordinate animals tend to be more distant from the dominant ones.To characterize the distance between the detected animals, we first used a geometric transformation to transform the coordinates of the detected animals, in pixels, to spatial coordinates.Then, we estimated the spatial coordinates of the animals center of gravity on the pasture ground.
The location of the detected animal in the image was derived from the bounding boxes estimated by Yolo.
It is particularly complicated to project the center of gravity of the animal on the pasture ground, because it can take many different postures and can be located at various angles from the camera.As in Bonneau et al.

Hal INRAE
Where (px, py) are the coordinates, in pixels, of the bounding box top left corner, (w, h) are the width and height of the bounding box and (ppx, ppy) are the coordinates, in pixels, of the estimated projection on the pasture ground.
In order to estimate the geometric transformation from pixels to spatial coordinates, 16 marks were setup on the pasture grounds (see figure 4).We used the 8 corners of the infected areas, the 4 corners of the pen, and the 4 middles of the pen on each side of the pasture.Marks were then manually identified on the image to calculate their coordinates in pixels.The spatial coordinates of the marks were easily know, according to the dimension of the pen and of the infected areas.We estimated the relationship between the marks coordinates in pixels and in spatial coordinates by fitting a projective transformation.The transformation was then use to estimate the spatial coordinates of the detected animals.The convertion of pixels in image to spatial coordinates in real world is known as an image registration problem (Zitova and Flusser, 2003).
Finally, for each image, we computed the inter-individual distance between each detected animals, based on their estimated spatial coordinates.

Sward height
The sward height at the start and at the end of the grazing week is available Table 1.For both try, grass intake was relatively similar inside the first infected area and the non-infected area.Grass intake was lower inside the second infected area, which is explained by a small patch of non-grazed grass (voir si on peut aller savoir ce que c'était).

Number of larvae in the infected areas
The estimated number of larvae per infected areas is available figure 2. When grazing started, there were more than 14,000 larvae available on the grass of each infected area.Surprisingly, in Try 2, where the feces were much more infected than in Try 1, the number of available larvae is approximately the same at the beginning.However, the population was increasing until grazing day 3 in Try 2, whereas it decreased in Try 1.This was anticipated because the feces were dropped later in Try 2.

Post grazing worm burden
The individual fecal egg count (FEC) for the first and second try are available figure 3. The FEC stayed relatively low (< 4, 000) during the evaluation period of Try 1.The brown goat had the highest FEC value.
The black and white goat had relatively similar FEC values, close to 2,000 on the last FEC assessment.The FEC of the red goat did not exceed 700 eggs/g, which corresponds to a benign infection.A voir avec JC.
For the second Try, the black goat got heavily infected with a maximal FEC value close to 17,000 eggs/g.
The number of excreted eggs was relatively similar for the white and brown goats, with a maximal value close to 3,000 eggs/g.The red goat had an excretion pic . . .
A reprendre avec JC.

Animal detection and identification
The percentage of animal detected is available in Table 2.In average, 86% of the goats were detected during Try 1 and 89.9% during Try 2. The white goat had the highest detection rate.This goat had a white coat patches on the belly, which is highly discriminant and certainly helped the detection and identification This is a provisional file, not the final typeset article algorithms.The brown and black goats had similar detection rates, whereas the brown goat was the one with the lowest detection rate.As shown on figure 4, most of the missed detections were located on the opposite side of the camera.We also noted that missed detection can occurred when the goats were close from each other.In this case, only one goat was detected.
The sensitivity and precision of the animal identification method are available Table 3.The average sensitivity was close to 95% for each try.We observed confusion between the brown and red goats, which had similar tint.There was also some confusion between black and white goats, which had most of the coat of black color.When the white coat patches on the belly was not visible, the identification method recognized the white goat as the black one.As for the detection method, we observed a better sensitivity and precision during Try2.During this try, the camera was never facing the sun, which increased the image quality and as a consequence, the quality of the detection and identification methods.
As it is shown on figure 5, the number of missed detection is highest between 6:00 to 8:00 for Try 1.

Avoidance capacity
The daily and cumulated avoidance index for Try 1 and Try 2 are available figure 6.
During the first Try, the white and black goats favored the non-infected area during the first 3 grazing days.From grazing day 4, they started to choose the infected areas rather than non-infected one.The avoidance index of the red goat is lower than one only on days 4 and 7.The brown goat favored the infected areas during the entire grazing week.
Over the entire grazing week, only the red goat had an avoidance index > 1.
For the second Try, the black and red goats had an avoidance index > 1 during the entire grazing week.
Unlike during the first Try, the brown goat had an avoidance index ≥ 1 during the first 6 grazing days and only favored the infected areas during the last grazing day.During the first 4 days, the avoidance index of the brown goat is in average equal to 2. Then, it started decreasing and is in average equal to 0.96 during the last 3 days.The white goat generally had the lower avoidance index, it is < 1 only during days 3, 4 and 5.
Over the entire grazing week, all the animals had an avoidance index > 1.However, it is only 1.04 for the white goat.
When comparing the weekly avoidance index between Try 1 and 2, it is increasing for all the animals.
The white goat increased its weekly avoidance index by 76%, and by 207%, 142%, 60% for the brown, black and red goats.
It is interesting to note that the greater was the LAF value during Try 1, the greater was the increase in the weekly avoidance index on Try 2. The Pearson correlation coefficient between the LAF on Try -1 and the increase in the weekly avoidance index on Try 2 is equal to 0.93.

Larval exposure and level of infection
The logarithm of the area under the curve of the FEC curve (LAF) against the exposure coefficient is available figure 7.
It is hard to find a simple relationship between the LAF and the exposure coefficient.The LAF is between 10.5 and 11.2 for most of the exposure coefficient.It is important to note that similar exposure coefficient can have different LAF.For example, the red goat had an exposure coefficient equal to 8,417 during Try

Hal INRAE
1, and it was equal to 8,374 for the black goat during Try 2.Even if their exposure coefficient were very closed, their LAF are respectively the minimal and maximal observed value.

Social Distance
The distribution of the inter-individual distances are available in figure 8.
During the first Try, the inter-individual distance between the brown, black and red goats were homogeneous, and in average equals to 3.7m.On the contrary, the white goat tends to be more distant from the others.For the white goat, the average distance with the others is equal to 5.6m.
During the second Try, the white goat was still more distant from the other, but decreased the average distance to 5m.On the contrary, the black goat slightly increases its inter-individual with the brown and red goats.The inter-individual distance was equal to 3.8m during the first Try and increased to 4m during the second Try.

DISCUSSION
We provided a conceptual framework to study the interaction between animal behavior and parasitism.It is based on automatic animal monitoring using image analysis, to detect and identify the animals on the images, allowing to record the spatial coordinates of the animals over time.We were able to derive several interesting indicator, such that the avoidance index, the exposure index and the inter-individual distance.
We then studied the relationship between these indicators and the animals level of infection, which was assessed with the FEC.
We showed that animals had heterogeneous avoidance capacity, which also varies with time.We observed that avoidance capacity increases during the second try, for all animals.This could reveal the ability of the animals to memorize the location of the infected areas.In addition, we observed that the more the animals were infected during the first try, the more they increased their avoidance capacity during the second try.For sheep, it has been shown that the avoidance capacity increases with the level of infection (Hutchings et al., 1999;Cooper et al., 2000), similar mechanisms are maybe observed here.Some animals had an avoidance capacity > 1 during the first grazing days, and then became < 1 for the rest of the week.
Several explanations can be proposed, such as the age of feces, which can decrease the avoidance capacity (Hutchings et al., 1998).But also because animals naturally dropped feces inside the pasture, gradually increasing the quantity of feces inside the non-infected area.This is a limitation of our study, and futur works should use feces bag to avoid contaminating the non-infected area, as suggested in Hutchings et al. (2001).
We were not able to distinguish a clear relationship between the larval exposure and the level of infection, neither between the avoidance index and the level of infection.This suggest that larval intake is a random process and is not directly proportional to the time spent on contaminated areas.Finally, we were not able to find a clear relationship between the inter-individual distance and the infection level.The biological interpretation resulting from our analysis should be interpreted with caution, due to the low number of monitored animals.
However, our work provides interesting insights to develop routine studies that characterize the behavior of animals and can be improved in different ways.First, our work could benefit from a daily estimation of the number of larvae inside the infected areas, to improve the estimation of the exposure index.For the second try, the larval population was possibly increasing after the third grazing day.However, we were not able to observe this dynamic, as we only had an observation on the last grazing day.Second, This is a provisional file, not the final typeset article the performance of the animal detection and identification could also be improved.We used time-lapse construction camera with a resolution of 1208 x 720 and 1.3 Mpx, which was convenient because it ran on batteries and stored the image on a SD card for the entire grazing week.This is particularly adapted to outdoor conditions, where the pasture can be located far from any facilities.However, using a camera with higher definition can improve the details in the image, especially when the object are located far from the camera, and thus potentially increase detection rate.Animal identification can be improved by using video recording instead of images generated from time-lapse camera.With videos, animal identification can benefit from object tracking technics (Li et al., 2021;van der Zande et al., 2021).With video, it could be possible to estimate the speed and acceleration of the animals, and to classify its activity.Using color marks on the animals can be an interesting solution to increase both the detection and identification method.
This color marks should be visible from the camera, no matter the animal posture and its angle from the camera.Finally, as it is shown in this article, it is important to consider the sun trajectory when deciding the camera location.
Most studies on small ruminant behavior rely on human observation.This is particularly time consuming, and in general, observations are limited in time and frequency.Automatic monitoring will allow to acquire long-term individual data, necessary to study the link between behavior and several aspect of animal health and welfare.However, visual observation enables to compute useful information, such that the number of bites (Hutchings et al., 1998), and to identify when the animal is eating or not.Futur development could focus on tracking the animal head, and possibly detect when the animal head is in contact with grass.This is a provisional file, not the final typeset article 20

Figure 1 .
Figure 1.(a) Pasture setup.The blue and green dashed areas are the two infected areas.The black dashed square is the resting area.During experiment, we placed a sheet of metal inside the area to produce shade.The red area is the control area, to estimate the number of infected larvae on pasture.During Try 2, the control area was located on the opposite side of pasture.On Try 1, we used the camera located on the bottom right corner of the pasture and on the bottom right on Try 2. (b) Picture example of the four Creole goats used during the experiment.(c) Schematic representation of the experiment.

Figure 2 .
Figure2.Estimated number of larvae inside each infected areas for Try 1 (left) and Try 2 (right).We used square mark when the number of larvae was estimated from the control samples, and star mark when it was extrapolated from the observations.

Figure 4 .
Figure 4. Spatial frequency of missed detections.The pasture is delimited by the black lines.The green and red lines define the first and second infected areas.The white disks provide the locations of the marks used to fit the geometric transformation from pixels to spatial coordinates.For each try, the location of the camera is defined by the purple disk.

Figure 5 .
Figure 5. Number of missed detection as a function of time of the day, for Try 1 and Try 2.

Figure 6 .
Figure 6.Avoidance index.(a) Daily avoidance index for Try -1 and (b) for Try -2.(c) Cumulated avoidance index for Try -1 and (d) for Try -2.For Try -2, we provided the percentage of increase compared to Try -1.

Figure 7 .Figure 8 .
Figure 7. Logarithm of the area under the curve (AUC) of the FEC curve against the exposure coefficient.

Table 1 .
Sward height when grazing started and ended.The last row gives the height different, in percentage, between start and end.

Table 2 .
Percentage of detection of the animal detection method.The average is computed over all color classes.

Table 3 .
Sensitivity and precision of the animal identification method.The average is computed over all color classes.