Next Article in Journal
Increased Erythrocyte Sedimentation Rate in Dogs: Frequency in Routine Clinical Practice and Association with Hematological Changes
Previous Article in Journal
Shape Evolution in Two Acts: Morphological Diversity of Larval and Adult Neoaustraranan Frogs
Previous Article in Special Issue
Female Deer Movements Relative to Firearms Hunting in Northern Georgia, USA
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Automated Detection and Counting of Wild Boar in Camera Trap Images

1
Institute of Epidemiology, Friedrich-Loeffler-Institut, Federal Research Institute for Animal Health, Südufer 10, 17493 Greifswald-Insel Riems, Germany
2
Animal Health and Animal Welfare, Faculty of Agricultural and Environmental Science, University of Rostock, Justus-von-Liebig-Weg 6, 18059 Rostock, Germany
3
Institute of Mathematics and Computer Science, University of Greifswald, Walther-Rathenau-Straße 47, 17487 Greifswald, Germany
4
Federal Ministry for Economic Cooperation and Development, Stresemannstraße 94, 10963 Bonn, Germany
*
Author to whom correspondence should be addressed.
Animals 2024, 14(10), 1408; https://doi.org/10.3390/ani14101408
Submission received: 22 March 2024 / Revised: 30 April 2024 / Accepted: 2 May 2024 / Published: 8 May 2024
(This article belongs to the Special Issue Evolution, Ecology and Management of Wild Boar and Deer)

Abstract

:

Simple Summary

This study shows that automated computer vision techniques are highly effective when used to analyze images and to extract valuable information from them. We trained an algorithm with a set of 1600 images obtained from a study where wildlife approaching wild boar carcasses were monitored. This enabled the model to detect different classes of animals automatically in their natural environment with a mean average precision of 98.11%.

Abstract

Camera traps are becoming widely used for wildlife monitoring and management. However, manual analysis of the resulting image sets is labor-intensive, time-consuming and costly. This study shows that automated computer vision techniques can be extremely helpful in this regard, as they can rapidly and automatically extract valuable information from the images. Specific training with a set of 1600 images obtained from a study where wild animals approaching wild boar carcasses were monitored enabled the model to detect five different classes of animals automatically in their natural environment with a mean average precision of 98.11%, namely ‘wild boar’, ‘fox’, ‘raccoon dog’, ‘deer’ and ‘bird’. In addition, sequences of images were automatically analyzed and the number of wild boar visits and respective group sizes were determined. This study may help to improve and speed up the monitoring of the potential spread of African swine fever virus in areas where wild boar are affected.

1. Introduction

The use of camera traps to monitor and manage wildlife has increased in recent years [1]. It is a cost-effective, non-invasive method for capturing images of wildlife in their natural habitat with little or no disturbance [2,3]. Meanwhile, images and videos from camera traps are widely shared on social media and are also used for citizen science projects [4,5]. Silver et al. [6] used camera traps to estimate jaguar abundance, and Harvey et al. [7] used them for monitoring wild horses. Data from camera traps can also be used to calculate the density of an animal population [8]. Garabedian and Kilgo [9] used camera trap surveys to monitor the recovery of wild boar populations following density reductions. The European Observatory of Wildlife (EOW) estimated wild ungulate densities by camera trapping in 37 European areas [10].
Susceptible host density is a key factor for the transmission dynamics of infectious diseases, including in wildlife. Therefore, knowledge of the density of local populations is crucial for guiding decisions regarding disease prevention and control measures and for assessing their success [11]. In Europe, wild boar are considered important in the epidemiology of African swine fever (ASF). There seems to be a close link between ASF in domestic pig holdings and wild boar abundance and population dynamics [12,13]. In particular, the density of the local wild boar population is considered crucial in the spread of ASF [14] and is used alongside other factors, such as satellite data, for ASF risk assessment [15]. Morelle et al. [16] used camera trap data to study wild boar density and abundance following an ASF outbreak in Poland. Bollen et al. [17] investigated the use of camera traps to monitor wild boar densities in ASF-affected and non-affected areas in Belgium.
Wildlife camera traps can produce large datasets [1]. For instance, in a study of wild horses, over 200,000 camera trap images were manually analyzed by experienced observers [7]. Manual analysis of huge image datasets is expensive, time-consuming and error-prone [18]. An automated evaluation system may help to overcome at least some of the above-mentioned limitations [19,20]. Computer vision techniques have already been demonstrated to yield outstanding results in image analysis for the identification of animal species with high accuracy [20,21].
Norouzzadeh et al. [20] applied computer vision techniques to classify and count animals in the Serengeti (Africa). Their model had a classification accuracy of 93.8% and was trained with the Snapshot Serengeti dataset [22]. Banupriya et al. [23] trained a convolutional neural network (CNN) to identify elephants and cheetahs with accuracies of 79% and 86%, respectively. Both networks identified the animals, but did not locate them in the image. Miao et al. [19] used a CNN to classify 20 African wildlife species with an overall accuracy of 87.5%.
In the present study, we applied computer vision techniques to wildlife images collected by motion sensor camera traps in natural settings. These images were obtained from a study by Probst et al. [24], in which wild boar carcasses were monitored under field conditions. Probst et al. [24] studied the behavior of wild boar toward their dead conspecifics to assess the risk of ASF spreading via wild boar carcasses. We thus focused on typical Central European wildlife species, such as wild boar (Sus scrofa), red fox (Vulpes vulpes), raccoon dog (Nyctereutes procyonoides), deer (i.e., red deer (Cervus elaphus), fallow deer (Dama dama) and roe deer (Capreolus capreolus)) and birds, that visited wild boar carcasses [25]. Open-source databases like the Open Image Dataset V6 [26] or Snapshot Serengeti [22] are not suitable for European wildlife, as only a few European wildlife animals are included and especially not all classes that are considered here. Carl et al. [27] used a pre-trained model (FasteRCNN + InceptionResNetV2 network) for an automated detection of European wild mammal species with a classification accuracy of 71%.
Therefore, the aim of this study was to first train a CNN, YOLOv4 (You only look once version 4) [28], to detect five classes of typical European wildlife species, namely ‘wild boar’, ‘fox’, ‘racoon dog’, ‘deer’ and ‘bird’. Subsequently, the results of the model were used to develop an algorithm to determine the visits and group sizes of wild boar sounders in a sequence of camera trap images.

2. Materials and Methods

2.1. Class Selection

We defined five classes of animals—‘wild boar’, ‘fox’, ‘racoon dog’, ‘deer’ and ‘bird’—which represent or include the most frequently detected animals. For methodological reasons, we do not use the term “class” in the biological sense of a taxonomic rank, but rather to refer to one species or a group of related species: Due to the limited number of images for some species in the dataset, it was not possible to train the model to identify these taxa. Hence, we combined such species in classes. The classes ‘wild boar’, ‘fox’ and ‘raccoon dog’ include one single species each, namely the wild boar (Sus scrofa), red fox (Vulpes vulpes) and raccoon dog (Nyctereutes procyonoides). The class ‘deer’ includes three species: red deer (Cervus elaphus), roe deer (Capreolus capreolus) and fallow deer (Dama dama). The class ‘bird’ includes a large variety of bird species, e.g., the white-tailed sea eagle (Haliaeetus albicilla), raven (Corvus corax), buzzard (Buteo buteo) and jay (Garrulus glandarius).

2.2. Image Data

The image set was generated from motion sensor camera traps used in a study to investigate the behavior of wild boar toward their dead conspecifics in the period of October 2015–October 2016 in a limited area in North-Eastern Germany around Greifswald [24]. Most of the cameras were installed on trees at a height of 1 to 2.2 m above the ground, but if this was not possible, they were installed slightly lower. A total of 122,160 images were taken. From these, a subset of 113,716 images was made available for this study.
The images have a resolution of 3200 × 2400, 4000 × 3000, 2560 × 1920 or 1648 × 1236 pixels (length × height). Five different camera types were used, namely Moultry I40 and Moultry A5 (Moultrie Alabaster, AL, USA), Seissinger Special-Cam 3 Classic (Anton Seissiger GmbH, Würzburg, Germany), Maginon WK 3 HD (Supra, Kaiserslautern, Germany) and Dörr Snapshot UV555 (Dörr GmbH, Neu-Ulm, Germany). Figure 1 illustrates examples of the different image qualities.
From the total set of images, 2000 images were selected. It was ensured that the image set contained at least 200 images per class. These images were taken by different cameras (different resolutions); they displayed different animal classes (namely ‘wild boar’, ‘fox’, ‘raccoon dog’, ‘deer’ and ‘bird’) or showed no animals. The images were sampled from the dataset covering the entire study period and with different light conditions (day and night scenes). The software LabelImg [29] was used for manually labeling animals in these images and assigning them to the classes. To this end, a bounding box (BB) was drawn around each animal in the image and labeled with the animal class. The number of images, the number of labels and the split between the training and test set are listed in Table 1. For this purpose, the images of each animal class were randomly divided into training and test sets in a ratio of 80:20 so that the relative proportions of the different classes in the training and test sets are equal.
The 2000 images have almost a 50:50 ratio of day and night scenes (1011:989 images). This splits the 400 images of the test set into test set day scenes (203 images) and test set night scenes (197 images).

2.3. Environment Configuration

The environment configuration used in this study is shown in Table 2. The workflow was developed using a Jupyter notebook [30] and Python 3.6.8 [31].

2.4. Model Training and Evaluation of the Model Performance

We used the deep learning algorithm YOLOv4 [28]. YOLO is a one-stage object detection algorithm; i.e., a single convolutional neural network (CNN) is used to process the images, and it is able to directly calculate the localization and classification of the detected objects [32]. Bochkovskiy et al. [28] showed that YOLOv4 is faster and more accurate than other available detectors. The algorithm was trained with the training set and then evaluated with the test set. The parameters of YOLOv4 for training are shown in Table 3.
The trained object detection algorithm returns for each image whether there are detections or not, and if so, the class (‘wild boar’, ‘fox’, ‘racoon dog’, ‘deer’ and ‘bird’), the confidence of each detection and the position of the predicted BB (coordinates of the center and width and height) are given. To verify the performance of the trained wildlife detector, manually labeled images (test set, test set day and test set night) are compared with the automated detection results. This allows the determination of the following values: precision, recall, mean average precision (mAP) and detection speed.
In order to distinguish between true positive and false positive detection, the inter-section over union (IoU) was used. To this end, the area of overlap between the predicted BB and the ground-truth BB (manually labeled) is divided by the area of the union of both BBs (see Equation (3)). Whenever IoU < 0.5, we assume it to be false positive. Whenever IoU ≥ 0.5, we assume it to be true positive. If the model detects nothing in an image, although an object was manually labeled, it is false negative.
The calculations are shown in the following Equations (1)–(6) (for more detail, see [33,34]):
p r e c i s i o n = T P T P + F P
r e c a l l = T P T P + F N
I o U = a r e a B B p a r e a ( B B g t ) a r e a B B p a r e a ( B B g t )
m A P = c = 1 C A P c C
where TP is the number of true positive detections, FP is the number of false positive detections, FN is the number of false negative detections, BBp is the predicted bounding box (BB) of the model, BBgt is the ground-truth BB (i.e., manually labeled), C is the number of classes (here C = 5), AP is the average precision and mAP is the mean average precision. The precision is the ratio of TP to the number of positive predictions (TP + FP). The recall is the ratio of TP to the total number of objects (TP + FN). The AP is the precision average of all recall values between 0 and 1, and can be calculated as the area under the precision–recall curve. Here, we used an 11-point interpolated AP:
A P = 1 11 r 0,0.1 , , 1 p i n t e r p r
p i n t e r p r = max r ^ : r ^ r p r ^
where p( r ^ ) is the precision at recall r ^ .

2.5. Automated Wild Boar Counting

For a single image, the trained wild animal detector is applied and the number of detections of the class ‘wild boar’ corresponds to the automatically determined number of wild boar in the image.
For a sequence of images (e.g., camera trap images of a whole day), the detector is applied to each image, and the number of visits of wild boar as well as the group size of wild boar per visit is determined. A visit is defined as any presence of an animal in an image, according to Probst et al. [25]. All images with the same class and a temporal context belong to the same visit: If the time interval from the last detection of the class is longer than eight minutes, the image is assigned to a new visit; otherwise, it is assigned to the same visit. To count the number of wild boar in one visit automatically, the number of wild boar in each image of the visit is determined and ultimately the maximum number is taken.
The workflow of the algorithm for automatic evaluation of the image data and the determination of the number of visits of wild boar with the respective number of wild boar is shown in Figure 2.

3. Results

3.1. Performance of the Model

The performance of the model was determined by comparing the results of the automatic detection with the manually labeled test set. The performance for each class is shown in Table 4, and the overall performance is shown in Table 5. The mAP of the model is 98.11%, the average IoU is 0.81, the precision and recall are 0.95 and 0.96, respectively, and the detection speed reaches 103 ms per image. Figure 3 shows the detection of each class, i.e., ‘wild boar’, ‘deer’, ‘fox’, ‘bird’ and ‘racoon dog’. The detection works for all classes, single or multiple animals in the same image, only partially visible animals and different lighting conditions. In addition, multiple classes in the same image and wild boar with different fur colors were detected.
The performance of the model for day and night scenes was determined using the day scene or night scene test sets, respectively; the overall performance for both scenes is shown in Table 6. The mAP of the model for the day scene test set is 96.62% and for the night scene test set is 98.51%.

3.2. Wild Boar Counting

There are several values for counting wild boar that were determined: the number of wild boar per image, the number of wild boar visits and the group size per visit. For a single image, the number of detections was defined as an automated count of wild boar per image. Figure 4 depicts automated detection of wild boar and the number of detections for different images. Figure 4a shows the detection of six piglets, and even partially hidden piglets behind the branches were found. The detection and counting of wild boar in night scene images are shown in Figure 4b,d; in each image, two wild boar are detected—even the ones that are only partially covered in the image. Figure 4c depicts three detected wild boar. Here, the two back wild boar are slightly blurred because they are in motion and the front one has a different fur color. Nevertheless, all three are detected.

3.2.1. Number of Wild Boar Visits

The automated evaluation of an image sequence provides the number of visits as well as the respective group size. In order to analyze the result of the automated evaluation, we evaluated eight image sequences with 9669 images manually and automatically. Thirty-six visits were determined with the manual evaluation. The automatic evaluation identified 34 of these 36 visits. Therefore, the probability of missing a visit is 5.56%. Table A1 in Appendix A presents all determined visits with the respective manual and automated evaluation and the difference in group size.

3.2.2. Number of Wild Boar per Visit

An interesting complementary piece of information is the group size per visit, which is also relevant for the determination of wild boar density. Exemplarily, we considered a visit that was documented with 10 images and a duration of 5 min and 22 s. The automated and manual evaluations for the number of wild boar are shown in Table 7. In addition, two images with BBs of the automatic detection are shown in Figure 5. All images of the visit are attached in Figure A6 in Appendix A.
Regarding the group size, for all 34 detected visits, the difference between automated and manual evaluation is at most 1 (see Table A1). More specifically, for 23 visits the group size is correct. For three visits, one false positive wild boar was detected, and for eight visits one false negative wild boar was detected. During these 34 visits, a total of 121 wild boar were counted manually; in total, the automated evaluation here resulted in 116 counted wild boar. Thus, the total number of wild boar detected automatically is 95.86% of the total number of wild boar counted manually.

4. Discussion

This study demonstrates that computer vision techniques can effectively assist in evaluating large image datasets produced by camera trapping under different conditions in natural environments. Our model was trained to detect five classes of European wildlife species, as well as to determine the number of wild boar visits and the number of individual wild boar per visit. The range of species was likely to be influenced by the experimental setting in which the pictures were obtained, i.e., monitoring wild boar carcasses that had been exposed in particular sites in a limited area in North-Eastern Germany [25]. We are confident, however, that the algorithm can also be applied to other datasets if sufficient training data are available for the expected wildlife species.
We trained YOLOv4, an existing open-source object recognition model, to analyze camera trap images. The trained detector has a high mAP for detection and can differentiate between five classes of wildlife animals, namely ‘wild boar’, ‘fox’, ‘racoon dog’, ‘deer’ and ‘bird’, and a detection speed of 103 ms per image. In addition, the detector can classify and locate multiple animals in the same image, as well as different classes in the same image, and animals with different fur colors, such as the wild boar in Figure 3c. Our algorithm for automated evaluation of image sequences demonstrates high sensitivity (i.e., a low probability of missing a visit) and high accuracy (i.e., a low wild boar count error). Furthermore, our approach has the advantage that the evaluation is always the same, in contrast to manual observation [35].
One limitation of counting visits is missed visits, i.e., visit 15 and visit 21 (see Table A1, Appendix A). In both visits, the wild boar are difficult to see even for the human observer, especially in the image of visit 21 (Figure A7) with fog. This limitation could be improved by including images in the training set that show these conditions. Even with better pictures, it is difficult for experienced observers to recognize the exact number of wild boar, and sometimes this is only possible by making comparisons within the visit sequence.
In addition, the AP or mAP can be improved by re-running the training with more images of the classes or in different conditions (e.g., day and night scenes) with a lower AP or mAP. This allows the detector to be adapted to the respective image set.
Due to the limited number of images for some species, it was not possible to train the model for all species identified in the images. We decided to combine species with similar shapes and sizes to test if they can be classified. The study showed that the detection rate for these artificial classes was very high and the model can be used to preselect animal species. If more images are available, the model can also be trained to recognize these species. For wild ruminants grouped as ‘deer’ in this study, species identification was not necessary as these animals represent herbivores. They do not feed on wild boar carcasses and might spread ASFV only mechanically if they come into contact with wild boar carcasses. We assume that the risk of mechanical spread is similar for the members of the ‘deer’ class in the study region. Further differentiation of the class of ‘birds’ is desirable, in particular for taxa feeding on carrion or birds of prey, but was not feasible in this study due to the limited number of images for individual bird species. This limitation may be overcome by increasing the number of images for training or by improving the performance of the algorithm, in this case YOLOv4.
The determination of the group size of a visit worked accurately. For all determined visits, the group size differs by a maximum of 1 from the manual evaluation (see Table A1, Appendix A). Figure 6b shows a false positive detection (lower left BB) corresponding to an overestimation of the group size. A reason for undetected wild boar may be that some wild boar are overlapping in the images. Figure 6a shows an example of overlapping wild boar; behind the large animal on the left hides another, and there is a small one under its abdomen. These conditions exist in a small number of images, but they are a minor problem in image sequences, where the wild boar are moving and therefore may not be overlapping in every frame. This is supported by the fact that the group size matches in more than half of all visits for the manual and automatic evaluation.
Here, we showed the method of determination of visits and group sizes only for wild boar. The algorithm for determining the group size and the number of visits can be easily adapted to the other animal classes and the length of the time interval between two consecutive detections of the same visit. Here we were particularly interested in wild boar in view of controlling and monitoring ASF. In most cases, hunting statistics are used to draw conclusions about wild boar densities [36]. Therefore, camera traps are a non-invasive method to monitor wild boar. The automated evaluation enables a very fast evaluation of camera trap images. The detection speed of 103 ms per image makes it possible to evaluate large image data quickly; e.g., it takes less than three hours to evaluate 100,000 images. Automatically analyzed data can be used directly to calculate wildlife densities, for example, using the technique of Rowcliffe et al. [8] for calculating animal densities based on camera trap rates. Determination of wild boar density in an area may be part of a follow-up study.
For the determination of the group size, no distinction is made between individuals, and furthermore, no distinction is made between piglets and adult wild boar or males and females. It is possible to determine the respective number of piglets and adults per visit and not only the total group size with the manual evaluation. In further studies, a detector could be trained to distinguish between piglets and adults or even individual animals.

5. Conclusions

This study shows that automated computer vision techniques can support rapid and effective analysis of large image datasets generated by camera traps with respect to Central European wildlife. The method is suitable for many different research questions. Here we showed that the method was able to detect different classes as well as the number of each class. Regarding wild boar, the technique provides the possibility of determining the number of wild boar visits and the respective group sizes in an automated way. The trained model achieves a high mAP. The detection speed of 103 ms per image makes it possible to evaluate 9669 images (see Section 3.2. Wild Boar Counting) in less than 20 min, compared to several days evaluating the images manually. The automatic evaluation of the number of wild boar visits and the group sizes provides accurate results.
These results may be used in the field of risk analysis, animal disease control and surveillance to estimate animal densities rapidly and reliably. The trained detector achieves a mean average precision of 98.11%. The results of detection can be used to count the number of animals per class per image. In addition, the number of visits and group size can be analyzed automatically. This study may help to improve and speed up the monitoring of the potential spread of ASF in areas where wild boar are affected by the disease.

Author Contributions

Conceptualization, A.K.S. and T.H.-B.; methodology, A.K.S.; software, A.K.S.; validation, C.P., J.M.G. and A.K.S.; formal analysis, A.K.S.; resources, C.P., J.M.G. and F.J.C.; data curation, A.K.S.; writing—original draft preparation, A.K.S.; writing—review and editing, A.K.S., H.L., M.F., J.M.G., F.J.C. and T.H.-B.; visualization, A.K.S.; supervision, T.H.-B. and H.L.; project administration, T.H.-B.; funding acquisition, T.H.-B. All authors have read and agreed to the published version of the manuscript.

Funding

Funded by the Federal Ministry of Food and Agriculture on the basis of a resolution of the German Bundestag. FKZ 28KIDA001.

Institutional Review Board Statement

Not applicable since only data were processed.

Informed Consent Statement

Not applicable since this study did not involve humans or client-owned animals.

Data Availability Statement

The datasets found or analyzed during the current study are available from the corresponding author on reasonable request.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A

Table A1. Results of automatic and manual evaluation of wild boar visits in image sequences.
Table A1. Results of automatic and manual evaluation of wild boar visits in image sequences.
VisitNumber of ImagesManual CountAutomatic CountDifferenceAbsolute Difference
1126600
211100
3154400
4516600
591211
671100
7121100
821100
9106600
1051100
111332−11
122543−11
1361100
14321−11
15210−11
1611100
1722311
18456600
19306600
20155500
211520−22
22198911
231465−11
24732−11
2554400
2611100
2731100
28208800
2931100
30832−11
31707700
3286600
33407700
3482200
351121−11
36543−11
Sum503124116−814
Figure A1. Detection examples for the class ‘wild boar’: (a,b) day scene, (c,d) night scene. The BB depicted as a purple box.
Figure A1. Detection examples for the class ‘wild boar’: (a,b) day scene, (c,d) night scene. The BB depicted as a purple box.
Animals 14 01408 g0a1
Figure A2. Detection examples for the class ‘deer’: (a,b) day scene, (c,d) night scene. The BB depicted as a blue box.
Figure A2. Detection examples for the class ‘deer’: (a,b) day scene, (c,d) night scene. The BB depicted as a blue box.
Animals 14 01408 g0a2
Figure A3. Detection examples for the class ‘fox’: (a,b) day scene, (c,d) night scene. The BB depicted as a red box.
Figure A3. Detection examples for the class ‘fox’: (a,b) day scene, (c,d) night scene. The BB depicted as a red box.
Animals 14 01408 g0a3
Figure A4. Detection examples for the class ‘bird’: (a,b) day scene, (c,d) night scene. The BB depicted as a yellow box.
Figure A4. Detection examples for the class ‘bird’: (a,b) day scene, (c,d) night scene. The BB depicted as a yellow box.
Animals 14 01408 g0a4
Figure A5. Detection examples for the class ‘other species’: (a,b) day scene, (c,d) night scene. The BB depicted as a green box.
Figure A5. Detection examples for the class ‘other species’: (a,b) day scene, (c,d) night scene. The BB depicted as a green box.
Animals 14 01408 g0a5
Figure A6. A visit of wild boar with a group size of 6 wild boar. On the left side is the images and on the right side is each image with a BB (depicted as purple box) around the detection of the automatic evaluation.
Figure A6. A visit of wild boar with a group size of 6 wild boar. On the left side is the images and on the right side is each image with a BB (depicted as purple box) around the detection of the automatic evaluation.
Animals 14 01408 g0a6aAnimals 14 01408 g0a6bAnimals 14 01408 g0a6c
Figure A7. One example image of visit 21 with fog. Both the manual and the automatic evaluation had problems recognizing the two wild boar.
Figure A7. One example image of visit 21 with fog. Both the manual and the automatic evaluation had problems recognizing the two wild boar.
Animals 14 01408 g0a7

References

  1. Newey, S.; Davidson, P.; Nazir, S.; Fairhurst, G.; Verdicchio, F.; Irvine, R.J.; van der Wal, R. Limitations of recreational camera traps for wildlife management and conservation research: A practitioner’s perspective. Ambio 2015, 44 (Suppl. S4), 624–635. [Google Scholar] [CrossRef] [PubMed]
  2. Delisle, Z.J.; Flaherty, E.A.; Nobbe, M.R.; Wzientek, C.M.; Swihart, R.K. Next-Generation Camera Trapping: Systematic Review of Historic Trends Suggests Keys to Expanded Research Applications in Ecology and Conservation. Front. Ecol. Evol. 2021, 9, 617996. [Google Scholar] [CrossRef]
  3. Wearn, O.R.; Glover-Kapfer, P. Snap happy: Camera traps are an effective sampling tool when compared with alternative methods. R. Soc. Open Sci. 2019, 6, 181748. [Google Scholar] [CrossRef] [PubMed]
  4. Fisher, J.T. Camera trapping in ecology: A new section for wildlife research. Ecol. Evol. 2023, 13, e9925. [Google Scholar] [CrossRef] [PubMed]
  5. Hsing, P.-Y.; Hill, R.A.; Smith, G.C.; Bradley, S.; Green, S.E.; Kent, V.T.; Mason, S.S.; Rees, J.; Whittingham, M.J.; Cokill, J.; et al. Large-scale mammal monitoring: The potential of a citizen science camera-trapping project in the United Kingdom. Ecol. Solut. Evid. 2022, 3, e12180. [Google Scholar] [CrossRef]
  6. Silver, S.C.; Ostro, L.E.T.; Marsh, L.K.; Maffei, L.; Noss, A.J.; Kelly, M.J.; Wallace, R.B.; Gómez, H.; Ayala, G. The use of camera traps for estimating jaguar Panthera onca abundance and density using capture/recapture analysis. Oryx 2004, 38, 148–154. [Google Scholar] [CrossRef]
  7. Harvey, A.M.; Morton, J.M.; Mellor, D.J.; Russell, V.; Chapple, R.S.; Ramp, D. Use of Remote Camera Traps to Evaluate Animal-Based Welfare Indicators in Individual Free-Roaming Wild Horses. Animals 2021, 11, 2101. [Google Scholar] [CrossRef]
  8. Rowcliffe, J.M.; Field, J.; Turvey, S.T.; Carbone, C. Estimating animal density using camera traps without the need for individual recognition. J. Appl. Ecol. 2008, 45, 1228–1236. [Google Scholar] [CrossRef]
  9. Garabedian, J.E.; Kilgo, J.C. Rapid recovery of invasive wild pig (Sus scrofa) populations following density reduction. Biol. Invasions 2024, 26, 1075–1089. [Google Scholar] [CrossRef]
  10. Guerrasio, T.; Pelayo Acevedo, P.; Apollonio, M.; Arnon, A.; Barroqueiro, C.; Belova, O.; Berdión, O.; Blanco-Aguiar, J.A.; Bijl, H.; Bleier, N.; et al. Wild ungulate density data generated by camera trapping in 37 European areas: First output of the European Observatory of Wildlife (EOW). EFSA Support. Publ. 2023, 20, 7892E. [Google Scholar] [CrossRef]
  11. Barlow, N.D. The Ecology of Wildlife Disease Control: Simple Models Revisited. J. Appl. Ecol. 1996, 33, 303–314. [Google Scholar] [CrossRef]
  12. Rogoll, L.; Güttner, A.-K.; Schulz, K.; Bergmann, H.; Staubach, C.; Conraths, F.J.; Sauter-Louis, C. Seasonal Occurrence of African Swine Fever in Wild Boar and Domestic Pigs in EU Member States. Viruses 2023, 15, 1955. [Google Scholar] [CrossRef] [PubMed]
  13. Jurado, C.; Martínez-Avilés, M.; De La Torre, A.; Štukelj, M.; de Carvalho Ferreira, H.C.; Cerioli, M.; Sánchez-Vizcaíno, J.M.; Bellini, S. Relevant Measures to Prevent the Spread of African Swine Fever in the European Union Domestic Pig Sector. Front. Vet. Sci. 2018, 5, 77. [Google Scholar] [CrossRef] [PubMed]
  14. Podgórski, T.; Borowik, T.; Łyjak, M.; Woźniakowski, G. Spatial epidemiology of African swine fever: Host, landscape and anthropogenic drivers of disease occurrence in wild boar. Prev. Vet. Med. 2020, 177, 104691. [Google Scholar] [CrossRef] [PubMed]
  15. Bergmann, H.; Czaja, E.-M.; Frick, A.; Klaaß, U.; Marquart, R.; Rudovsky, A.; Holland, D.; Wysocki, P.; Lehnau, D.; Schröder, R.; et al. Remote Sensing Provides a Rapid Epidemiological Context for the Control of African Swine Fever in Germany. Sensors 2023, 23, 8202. [Google Scholar] [CrossRef] [PubMed]
  16. Morelle, K.; Bubnicki, J.; Churski, M.; Gryz, J.; Podgórski, T.; Kuijper, D.P.J. Disease-Induced Mortality Outweighs Hunting in Causing Wild Boar Population Crash After African Swine Fever Outbreak. Front. Vet. Sci. 2020, 7, 378. [Google Scholar] [CrossRef] [PubMed]
  17. Bollen, M.; Neyens, T.; Fajgenblat, M.; de Waele, V.; Licoppe, A.; Manet, B.; Casaer, J.; Beenaerts, N. Managing African Swine Fever: Assessing the Potential of Camera Traps in Monitoring Wild Boar Occupancy Trends in Infected and Non-infected Zones, Using Spatio-Temporal Statistical Models. Front. Vet. Sci. 2021, 8, 726117. [Google Scholar] [CrossRef] [PubMed]
  18. Figueroa, K.; Camarena-Ibarrola, A.; García, J.; Villela, H.T. Fast Automatic Detection of Wildlife in Images from Trap Cameras. In Advanced Information Systems Engineering: 25th International Conference Proceedings; Achour-Salinesi, C.B., Norrie, M.C., Pastor, O., Eds.; Springer: Berlin/Heidelberg, Germany, 2013; pp. 940–947. ISBN 978-3-642-38708-1. [Google Scholar]
  19. Miao, Z.; Gaynor, K.M.; Wang, J.; Liu, Z.; Muellerklein, O.; Norouzzadeh, M.S.; McInturff, A.; Bowie, R.C.K.; Nathan, R.; Yu, S.X.; et al. Insights and approaches using deep learning to classify wildlife. Sci. Rep. 2019, 9, 8137. [Google Scholar] [CrossRef] [PubMed]
  20. Norouzzadeh, M.S.; Nguyen, A.; Kosmala, M.; Swanson, A.; Palmer, M.S.; Packer, C.; Clune, J. Automatically identifying, counting, and describing wild animals in camera-trap images with deep learning. Proc. Natl. Acad. Sci. USA 2018, 115, E5716–E5725. [Google Scholar] [CrossRef]
  21. Tabak, M.A.; Norouzzadeh, M.S.; Wolfson, D.W.; Sweeney, S.J.; Vercauteren, K.C.; Snow, N.P.; Halseth, J.M.; Di Salvo, P.A.; Lewis, J.S.; White, M.D.; et al. Machine learning to classify animal species in camera trap images: Applications in ecology. Methods Ecol. Evol. 2019, 10, 585–590. [Google Scholar] [CrossRef]
  22. Swanson, A.; Kosmala, M.; Lintott, C.; Simpson, R.; Smith, A.; Packer, C. Snapshot Serengeti, high-frequency annotated camera trap images of 40 mammalian species in an African savanna. Sci. Data 2015, 2, 150026. [Google Scholar] [CrossRef] [PubMed]
  23. Banupriya, N.; Saranya, S.; Jayakumar, R.; Swaminathan, R.; Harikumar, S.; Palanisamy, S. Animal detection using deep learning algorithm. JCR J. Crit. Rev. 2020, 7, 434–439. [Google Scholar] [CrossRef]
  24. Probst, C.; Globig, A.; Knoll, B.; Conraths, F.J.; Depner, K. Behaviour of free ranging wild boar towards their dead fellows: Potential implications for the transmission of African swine fever. R. Soc. Open Sci. 2017, 4, 170054. [Google Scholar] [CrossRef] [PubMed]
  25. Probst, C.; Gethmann, J.; Amler, S.; Globig, A.; Knoll, B.; Conraths, F.J. The potential role of scavengers in spreading African swine fever among wild boar. Sci. Rep. 2019, 9, 11450. [Google Scholar] [CrossRef]
  26. Kuznetsova, A.; Rom, H.; Alldrin, N.; Uijlings, J.; Krasin, I.; Pont-Tuset, J.; Kamali, S.; Popov, S.; Malloci, M.; Kolesnikov, A.; et al. The Open Images Dataset V4. Int. J. Comput. Vis. 2020, 128, 1956–1981. [Google Scholar] [CrossRef]
  27. Carl, C.; Schönfeld, F.; Profft, I.; Klamm, A.; Landgraf, D. Automated detection of European wild mammal species in camera trap images with an existing and pre-trained computer vision model. Eur. J. Wildl. Res. 2020, 66, 62. [Google Scholar] [CrossRef]
  28. Bochkovskiy, A.; Wang, C.-Y.; Liao, H.-Y.M. YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934v1. [Google Scholar]
  29. Tzutalin. LabelImg: Git Code (2015). Available online: https://github.com/tzutalin/labelImg (accessed on 16 February 2023).
  30. Kluyver, T.; Ragan-Kelley, B.; Pérez, F.; Granger, B.; Bussonnier, M.; Frederic, J.; Kelley, K.; Hamrick, J.; Grout, J.; Corlay, S.; et al. Jupyter Notebooks—A publishing format for reproducible computational workflows. In Positioning and Power in Academic Publishing: Players, Agents and Agendas; IOS Press: Amsterdam, The Netherlands, 2016; pp. 87–90. [Google Scholar] [CrossRef]
  31. van Rossum, G.; Drake, F.L. The Python Language Reference, Release 3.0.1 [Repr.]; Python Software Foundation; SoHo Books: Hampton, NH, USA; Redwood City, CA, USA, 2010; ISBN 1441412697. [Google Scholar]
  32. Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. arXiv 2015, arXiv:1506.02640v5. [Google Scholar]
  33. Schütz, A.K.; Krause, E.T.; Fischer, M.; Müller, T.; Freuling, C.M.; Conraths, F.J.; Homeier-Bachmann, T.; Lentz, H.H.K. Computer Vision for Detection of Body Posture and Behavior of Red Foxes. Animals 2022, 12, 233. [Google Scholar] [CrossRef]
  34. Everingham, M.; van Gool, L.; Williams, C.K.I.; Winn, J.; Zisserman, A. The Pascal Visual Object Classes (VOC) Challenge. Int. J. Comput. Vis. 2010, 88, 303–338. [Google Scholar] [CrossRef]
  35. Potter, L.C.; Brady, C.J.; Murphy, B.P. Accuracy of identifications of mammal species from camera trap images: A northern Australian case study. Austral. Ecol. 2019, 44, 473–483. [Google Scholar] [CrossRef]
  36. Acevedo, P.; Croft, S.; Smith, G.C.; Blanco-Aguiar, J.A.; Fernandez-Lopez, J.; Scandura, M.; Apollonio, M.; Ferroglio, E.; Keuling, O.; Sange, M.; et al. ENETwild modelling of wild boar distribution and abundance: Update of occurrence and hunting data-based models. EFSA Support. Publ. 2019, 16, 1674E. [Google Scholar] [CrossRef]
Figure 1. Examples of camera trap images, diverse camera types, different seasons, day scenes (a,b,d,e) and night scenes (c,f). The camera types used were Maginon WK3 HD (a), Dörr Snapshot UV555 (b), Seissinger Special-Cam 3 Classic (c,e), Moultry I40 (d) and Moultry A5 (f). For details, please refer to [24].
Figure 1. Examples of camera trap images, diverse camera types, different seasons, day scenes (a,b,d,e) and night scenes (c,f). The camera types used were Maginon WK3 HD (a), Dörr Snapshot UV555 (b), Seissinger Special-Cam 3 Classic (c,e), Moultry I40 (d) and Moultry A5 (f). For details, please refer to [24].
Animals 14 01408 g001
Figure 2. Workflow image data evaluation. Determination of the number of visits of wild boar and the number of wild boar per visit. One image after the other is analyzed with the detector until all images are evaluated. If wild boar detection is positive, it is tested if the last wild boar detection was less than 8 min ago, in which case it is the same visit. Otherwise, it is a new visit. For a visit that has already started, the maximum number of wild boar in the visit is compared with the number in the current image and updated if necessary. For a new visit, the number of detected wild boar is saved as the maximum number of wild boar. In both cases, the last detection time is updated.
Figure 2. Workflow image data evaluation. Determination of the number of visits of wild boar and the number of wild boar per visit. One image after the other is analyzed with the detector until all images are evaluated. If wild boar detection is positive, it is tested if the last wild boar detection was less than 8 min ago, in which case it is the same visit. Otherwise, it is a new visit. For a visit that has already started, the maximum number of wild boar in the visit is compared with the number in the current image and updated if necessary. For a new visit, the number of detected wild boar is saved as the maximum number of wild boar. In both cases, the last detection time is updated.
Animals 14 01408 g002
Figure 3. Detection examples for each class, two day scene images and two night scene images each. The BBs are depicted as colored boxes. ‘Wild boar’: (ad), ‘deer’: (eh), ‘raccoon dog’: (il), ‘fox’: (mp) and ‘bird’: (qt). (All images are shown in higher resolution in Appendix A, attached in Figure A1, Figure A2, Figure A3, Figure A4 and Figure A5).
Figure 3. Detection examples for each class, two day scene images and two night scene images each. The BBs are depicted as colored boxes. ‘Wild boar’: (ad), ‘deer’: (eh), ‘raccoon dog’: (il), ‘fox’: (mp) and ‘bird’: (qt). (All images are shown in higher resolution in Appendix A, attached in Figure A1, Figure A2, Figure A3, Figure A4 and Figure A5).
Animals 14 01408 g003
Figure 4. Example of automated wild boar detection and group size estimation in complex settings. The BB depicted as a purple box. (a) the detection of six piglets, (b,d) detection of wild boar in night scene images; in each image, two wild boar are detected, (c) three detected wild boar, one with a special fur color.
Figure 4. Example of automated wild boar detection and group size estimation in complex settings. The BB depicted as a purple box. (a) the detection of six piglets, (b,d) detection of wild boar in night scene images; in each image, two wild boar are detected, (c) three detected wild boar, one with a special fur color.
Animals 14 01408 g004
Figure 5. A visit of wild boar with a group of 6 animals. (a) First image of the visit. Two wild boar were automatically detected. (b) Image with the largest number of wild boar during the visit; 6 wild boar were detected automatically. The BB depicted as a purple box.
Figure 5. A visit of wild boar with a group of 6 animals. (a) First image of the visit. Two wild boar were automatically detected. (b) Image with the largest number of wild boar during the visit; 6 wild boar were detected automatically. The BB depicted as a purple box.
Animals 14 01408 g005
Figure 6. (a) Missed detection—overlapping wild boar; (b) additional detection. The BB depicted as a purple box.
Figure 6. (a) Missed detection—overlapping wild boar; (b) additional detection. The BB depicted as a purple box.
Animals 14 01408 g006
Table 1. Splitting of image set (2000 images with labels) into training and test sets in the ratio 80% to 20%. The numbers of images and labels per animal species and the numbers of images without animals for the training set and test set are also shown. The relative proportion of images and labels for each class shows that the distribution of classes is almost the same in both datasets. Note: In both image sets, there are images with several animal species; e.g., in the test set, there is an image showing both a raccoon dog and a fox.
Table 1. Splitting of image set (2000 images with labels) into training and test sets in the ratio 80% to 20%. The numbers of images and labels per animal species and the numbers of images without animals for the training set and test set are also shown. The relative proportion of images and labels for each class shows that the distribution of classes is almost the same in both datasets. Note: In both image sets, there are images with several animal species; e.g., in the test set, there is an image showing both a raccoon dog and a fox.
Training SetTest Set
Number of
Images (Relative
Proportion in %)
Number of
Labels (Relative
Proportion in %)
Number of
Images (Relative
Proportion in %)
Number of
Labels (Relative Proportion in %)
Wild boar522 (32.6)1330 (54)130 (32.5)318 (53.1)
Fox474 (29.6)481 (19.5)119 (29.8)119 (19.9)
Raccoon dog197 (12.3)263 (10.7)50 (12.5)65 (10.9)
Deer160 (10)176 (7.1)40 (10)45 (7.5)
Bird160 (10)215 (8.7)40 (10)52 (8.7)
No animal88 (5.5)0 (0)22 (5.5)0 (0)
Total16002465400599
Table 2. Environment configuration used in this study for model training and automatic evaluation of the images.
Table 2. Environment configuration used in this study for model training and automatic evaluation of the images.
Specification
Operating systemCentOS 7
Graphics cardNVIDIA K80 with 2 GPUs and 24 GB video RAM
ProcessorIntel Xeon E5-2667 v4 with 3.20 GHz
RAM377 GB
Table 3. Parameters of YOLOv4 for the wild animal detection model.
Table 3. Parameters of YOLOv4 for the wild animal detection model.
ParameterValue
Input size416 pixels × 416 pixels
Classes5
Maxbatches10,000
Filters30
Steps8000 and 9000
Learning rate0.001
Batch size64
Table 4. Performance of the trained model for the distinct classes ‘wild boar’, ‘fox’, ‘racoon dog’, ‘deer’ and ‘bird’ with AP—average precision and IoU—intersection over union.
Table 4. Performance of the trained model for the distinct classes ‘wild boar’, ‘fox’, ‘racoon dog’, ‘deer’ and ‘bird’ with AP—average precision and IoU—intersection over union.
ClassPrecisionRecallAverage IoUAP
Wild boar0.950.940.8296.41%
Fox0.951.00.8399.88%
Racoon dog0.920.970.7496.53%
Deer0.980.910.8498.08%
Bird1.00.980.8399.64%
Table 5. Overall performance of the trained model (with IoU—intersection over union and mAP—mean average precision).
Table 5. Overall performance of the trained model (with IoU—intersection over union and mAP—mean average precision).
PrecisionRecallAverage IoUmAPDetection Speed
0.950.960.8298.11%103 ms
Table 6. Overall performance of the trained model for day and night scenes (with IoU—intersection over union and mAP—mean average precision).
Table 6. Overall performance of the trained model for day and night scenes (with IoU—intersection over union and mAP—mean average precision).
PrecisionRecallAverage IoUmAP
Day0.980.950.8596.62%
Night0.950.970.8298.51%
Table 7. Manual and automatic counting of wild boar for all images of a visit (corresponds to visit 9 from Table A1). The maximum group sizes of the visit for both of the two counting methods are shown in bold.
Table 7. Manual and automatic counting of wild boar for all images of a visit (corresponds to visit 9 from Table A1). The maximum group sizes of the visit for both of the two counting methods are shown in bold.
ImageAutomatic CountManual CountDifference
1220
2440
3440
4341
5660
6550
7341
8440
9340
10132
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Schütz, A.K.; Louton, H.; Fischer, M.; Probst, C.; Gethmann, J.M.; Conraths, F.J.; Homeier-Bachmann, T. Automated Detection and Counting of Wild Boar in Camera Trap Images. Animals 2024, 14, 1408. https://doi.org/10.3390/ani14101408

AMA Style

Schütz AK, Louton H, Fischer M, Probst C, Gethmann JM, Conraths FJ, Homeier-Bachmann T. Automated Detection and Counting of Wild Boar in Camera Trap Images. Animals. 2024; 14(10):1408. https://doi.org/10.3390/ani14101408

Chicago/Turabian Style

Schütz, Anne K., Helen Louton, Mareike Fischer, Carolina Probst, Jörn M. Gethmann, Franz J. Conraths, and Timo Homeier-Bachmann. 2024. "Automated Detection and Counting of Wild Boar in Camera Trap Images" Animals 14, no. 10: 1408. https://doi.org/10.3390/ani14101408

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop