| Literature DB >> 32788633 |
Ali Alameer1,2, Ilias Kyriazakis3, Jaume Bacardit4.
Abstract
Changes in pig behaviours are a useful aid in detecting early signs of compromised health and welfare. In commercial settings, automatic detection of pig behaviours through visual imaging remains a challenge due to farm demanding conditions, e.g., occlusion of one pig from another. Here, two deep learning-based detector methods were developed to identify pig postures and drinking behaviours of group-housed pigs. We first tested the system ability to detect changes in these measures at group-level during routine management. We then demonstrated the ability of our automated methods to identify behaviours of individual animals with a mean average precision of [Formula: see text], under a variety of settings. When the pig feeding regime was disrupted, we automatically detected the expected deviations from the daily feeding routine in standing, lateral lying and drinking behaviours. These experiments demonstrate that the method is capable of robustly and accurately monitoring individual pig behaviours under commercial conditions, without the need for additional sensors or individual pig identification, hence providing a scalable technology to improve the health and well-being of farm animals. The method has the potential to transform how livestock are monitored and address issues in livestock farming, such as targeted treatment of individuals with medication.Entities:
Mesh:
Year: 2020 PMID: 32788633 PMCID: PMC7423952 DOI: 10.1038/s41598-020-70688-6
Source DB: PubMed Journal: Sci Rep ISSN: 2045-2322 Impact factor: 4.379
Figure 1The scored (a) standing, (b) lateral lying, (c) sternal lying, (d) sitting and (e) drinking indices per day (11:00–15:00) across the study period. The indices were calculated to provide consistent measures across various data frames. Control bars represent indices averaged across 2 days immediately before and after the food restriction period. These metrics were obtained using the developed/validated primary model.
Figure 2Estimation of anchor boxes using the K-Medoids clustering algorithm. (a) shows the ground truth box distribution of our training data with respect to box aspect ratio and box area. (b) visualises three clusters, obtained using the K-Medoid algorithm, from which three anchor boxes were selected. (c) exhibits the trade-off between the number of anchor boxes (a maximum of 15; x-axis) and the mean IoU (y-axis) of each subset anchor boxes.
The mean average precision (mAP) ± standard deviation (SD) and the detection (inference) speed/image ± standard deviation (SD) for YOLO and Faster R-CNN detectors across all proposed anchor boxes. The mean speed was calculated/averaged across 1,000 selected images.
| Anchor boxes | YOLO | Faster R-CNN | ||
|---|---|---|---|---|
| Mean average precision ± SD | Speed per image ± SD | Mean average precision ± SD | Speed per image ± SD | |
| 2 | 0.9695 ± 0.0269 | 0.8987 ± 0.0713 | ||
| 3 | 0.9054 ± 0.0580 | |||
| 4 | 0.9674 ± 0.0282 | |||
| 5 | 0.9663 ± 0.0288 | 0.8919 ± 0.0842 | ||
| 6 | 0.9657 ± 0.0295 | 0.9039 ± 0.0766 | ||
Figure 3A comparison between the average class precision of YOLO and faster R-CNN detectors. Markers of the scattered diagram represent the classes of both detectors with a specific anchor box. Classes below the diagonal indicate that the YOLO detector outperforms the faster R-CNN detector.
The average class precision and average class miss-rate for our primary model, YOLO detector with 3 anchor boxes. This model achieves high precision and low miss-rate across classes of both: the food-restriction trial and an independent commercial pig trial. The drinking sources were outside the camera field-of-view in the latter trial.
| Class | Food-restriction trial | Independent commercial trial | ||
|---|---|---|---|---|
| Average precision | Average miss-rate | Average precision | Average miss-rate | |
| Standing | 0.9845 | 0.0196 | 0.9867 | 0.0204 |
| Sitting | 0.9864 | 0.0130 | 0.9012 | 0.0982 |
| Sternal lying | 0.9968 | 0.0049 | 0.9929 | 0.0070 |
| Lateral lying | 0.9998 | 0.0004 | 0.9984 | 0.0017 |
| Drinking | 0.9766 | 0.0093 | – | – |
Figure 4The performance of our primary model. Upper row: precision-recall curve. A point on the precision-recall curve is determined by considering all pig behaviours detected with a given threshold as positive predictions, then calculating the resulting precision and recall for that threshold. Below row: miss rate against FPPI. This characteristic curve obtained with similar mechanisms of the PR curve however to represent miss detected pigs; both axes are logarithmically scaled.
Figure 5Example of detecting pig postures across a period of 900 consecutive frames, with an interval of 300, using our primary model. The proposed model generated indices to each pig behaviour; it also assigned a vID to each pig to associate these across frames. The images in the figure were extracted from our dataset (‘Methods’ section).
Figure 8Three-dimensional trajectory of individual pigs: (a) vID = 9, (b) vID = 14. Each point represents the centroid of the detected pig in the pen x,y space. The z-axis expresses behaviours at each point in time, e.g., drinking, standing, sitting, sternal lying and lateral lying. Bar chart represents the relative proportion of time a pig exhibited a given behaviour.
Figure 6Architecture proposed for the automatic recognition of postures and drinking behaviour in commercially housed pigs. Each pig behaviour within the selected frames of our dataset was annotated by an animal behaviour scientist. The architecture above is capable of generating (a) group-level profiles for each pen; (b) individual profiles for each pig that include their postures, drinking and locomotion activities. Only pen-wise profiles were used to detect changes in behaviour at group-level during the feed-restrictions protocol period. The images in the figure were extracted from our dataset (‘Methods’ section).
Figure 7An example of (a) an input image with (b) the corresponding activations of the base model of the primary platform, i.e., YOLO detector with three anchor boxes. This visualisation technique highlights the areas of the image that drive the method to detect pig behaviours, standing in this specific example, showing how this model makes decisions and (potentially) identifying confounders. The images in the figure were extracted from our dataset (‘Methods’ section).
Definitions of the behaviours recorded in the dataset.
| Behaviour | Definition |
|---|---|
| Standing | Pig has feet (and possibly snout) in contact with the pen floor |
| Sitting | Only the feet of the front legs and the posterior portion/bottom of the pig body are in contact with the floor |
| Lateral Lying | The side of the trunk of the pig is in contact with the floor |
| Sternal Lying | The chest / sternum of the pig is in contact with the floor |
| Drinking | The pig snout is in contact with a nipple drinker |
Parameter selection used to train the proposed systems. The exact parameters were used to evaluate each detector proposed in this work; this includes numbers and values of anchor boxes, i.e., pre-defined sets of bounding boxes established to capture the scale and aspect ratio of pigs based on their sizes in each class of the training dataset. All image datasets were resized to match the network input size. The parameters were selected using a nested-cross validation with an independent dataset.
| Parameter | Value |
|---|---|
| Solver | Stochastic gradient descent with momentum optimiser |
| Momentum | 0.9 |
| Learning rate | |
| Max number of epoch | 5 |
| Size of mini-batch | 64 |
| Network input size | [224 224 3] |
| Number of anchor boxes | [2, 3, 4, 5, 6] boxes values calculated with K-medoids clustering algorithm |
| Feature extraction network | ResNet-50 |