Philip Stoll

Philip Stoll

Master's Thesis

Long-Term Automated Behaviour Monitoring of Captive Polar Bears

Matthias Zürl (M.Sc.), René Raab (M.Sc.), Prof. Dr. Björn Eskofier

03 / 2022 – 09 / 2022


One of the key responsibilities of any animal-keeping institution is to ensure the welfare of their kept individuals. Therefore, indicators for poor animal welfare should be assessed regularly and ideally monitored continuously. Although this may be possible with manual observation methods on a small scale, it is very time-consuming for larger institutions like zoos with hundreds of individuals [1]. This gives rise to the usage of automated observation techniques for individual animals and the computer-based quantification of welfare metrics.

For some species, a well-documented and often clearly visible welfare indicator is stereotypical behaviour, which can be briefly described as repetitive and functionless behaviour patterns [2]. In the case of polar bears, these patterns often show as periodic walking or swimming routes [3]. One central goal of this thesis will be to automatically quantify the occurrence of this stereotypy in the Nuremberg Zoo, which is home to two individuals. The evaluation will be based on the video data from three cameras overlooking the majority of the enclosure.

The obtained data is processed in a three-step pipeline. For the first step, the detection and identification of the individuals, a dataset containing images sampled across a whole year is extracted and annotated by experts. Based on this dataset a deep learning approach to polar bear detection and identification using a combination of Yolov5 [4] and a ResNet architecture [5] will be trained and evaluated. In the second step, this combination is applied to the actual video data and the resulting detections are transformed from image plane to positions inside the enclosure. The last step is the postprocessing and analysis of the resulting spatio-temporal trajectories. This will include the correction of possible outliers or noise by smoothing and filtering as well as the quantification of stereotypical behaviour and other movement statistics. For both purposes, different approaches will be implemented, evaluated and compared.

[1] J. V. Watters, S. W. Margulis, and S. Atsalis, “Behavioral monitoring in zoos and aquariums: A tool for guiding husbandry and directing research,” Zoo Biology, vol. 28, no. 1, pp. 35–48, Jan. 2009. doi: 10.1002/zoo.20207.
[2] G. Mason and N. Latham, “Can’t stop, won’t stop: Is stereotypy a reliable wefare indicator?” Animal Welfare, vol. 13, no. 1, pp. 57–69, 2004, ISBN: 0962-7286 Publisher: Animal Welfare, issn: 09627286. [Online]. Available: https : / / art00009.
[3] B. Wechsler, “Stereotypies in polar bears,” Zoo Biology, vol. 10, no. 2, pp. 177–188, 1991, Publisher. doi: 10.1002/zoo.1430100209.
[4] G. Jocher, A. Stoken, A. Chaurasia, et al., ultralytics/yolov5: v6.0 – YOLOv5n ’Nano’ models, Roboflow integration, TensorFlow export, OpenCV DNN support, version v6.0, Oct. 2021. doi: 10.5281/zenodo.5563715. [Online]. Available:
[5] K. He, X. Zhang, S. Ren, and J. Sun, “Deep Residual Learning for Image Recognition,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, Jun. 2016, pp. 770–778, isbn: 978-1-4673-8851-1. doi: 10.1109/CVPR.2016.90. [Online]. Available: org/document/7780459/.