Biomechanically aware behaviour recognition using accelerometers

Accelerometers, Ground Truthing, and Supervised Learning

Accelerometers are sensitive to movement and the lack of it. Accelerometers are not sentient and must recognise animal behaviour based on a human observer’s cognition. Therefore, remote recognition of behaviour using accelerometers requires ground truth data which is based on human observation or knowledge. The need for validated behavioural information and for automating the analysis of the vast amounts of data collected today, have resulted in many studies opting for supervised machine learning approaches.

Ground-truthing. The acceleration data stream (recorded using the animal-borne data logger, bottom-left) is synchronised with simultaneously recorded video (near top right). Click on photo to view larger version. Photo credit: Kamiar Aminian.

In such approaches, the process of ground truthing involves time-synchronising acceleration signals with simultaneously recorded video, having an animal behaviour expert create an ethogram, and then annotate the video according to this ethogram. This links the recorded acceleration signal to the stream of observed animal behaviours that produced it. After this, acceleration signals are chopped up into finite sections of pre-set size (e.g. two seconds), called windows. From acceleration data within windows, quantities called ‘features’ are engineered with the aim of summarising characteristics of the acceleration signal. Typically, ~15-20 features are computed. Good features will have similar values for the same behaviour, and different values for different behaviours.

To automatically find robust rules to separate behaviours based on feature values, machine learning algorithms (e.g. Random Forest etc) are used. Here, candidate algorithms are trained (i.e. each algorithm is shown which datapoints correspond to which ground truthed behaviours). From here, algorithms are then tested by asking them to classify datapoints they haven’t seen yet into one of the behaviours. How well the algorithm does on testing data determines its ‘performance’. The model with the best performance wins and is selected for final use. Different ways of doing training and testing give rise to different forms of ‘cross-validation’.

 

Leveraging the Biomechanics Underlying Common Animal Behaviour

All animal behaviour is performed for a finite duration, following which the animal transitions to a different behaviour. The animal may be static for a while (e.g. resting), then begin foraging (involving movement), and then, perhaps perceiving threat, run (involving vigorous, periodic motion). Different behaviours may be performed in different postures (e.g. upright during vigilance, and horizontal while running).

We targeted an ethogram applicable to most animals: resting, foraging, and fast locomotion. This ethogram is a good match between covering most of an animal’s time budget and includes behaviours that an accelerometer is capable of ‘seeing’. For this however, features developed from the accelerometer signal must somehow be able to quantify posture, movement intensity, and movement periodicity. We reasoned that three well-engineered features – one each to quantify the posture, intensity, and periodicity – should be able to tell these three behaviours apart.

Feature engineering. Three biomechanically meaningful features were engineered from acceleration data – one each to characterise posture, movement intensity, and periodicity.

 

Using this approach, we predefined a hierarchical tree-like scheme that classifies broader behavioural categories into increasingly specific ones up to the desired level of behavioural resolution. Each node of this tree uses one or more features tailored to the classification at that node. Robust machine learning algorithms find optimised decision boundaries to separate classes at each node.

We demonstrate the application of this approach on data collected from free-living, wild meerkats (Suricata suricatta). The model accurately recognised common behaviours constituting >95% of the typical time budget: resting, vigilance, foraging, and running.

 

Model Performance: Leave-One-Individual-Out (LOIO) Cross-Validation

The ultimate goal of many behaviour recognition studies is to build models that will accurately classify data from a new individual previously unseen by the model. Leave-one-individual-out (LOIO) cross-validation is most appropriate to characterise the model’s ability to do this. Here, training is performed using data from all individuals but one, and the left-out individual’s data is used as the testing set. This process is carried out until each individual’s data has been the testing set exactly once.

In other forms of cross-validation, such as validation splits (also called hold out) or 10-fold cross-validation, both training and testing sets contain datapoints extracted from a single continuous recording on the same individual. This violates these methods’ assumption that datapoints are independent and identically distributed, since they are extracted from the same time series. LOIO cross-validation, however, has been shown to mitigate the effects of non-independence of data in human neuroimaging studies. Only one other study has performed LOIO CV (for animal behaviour recognition), and ours is the first study to do so on data from free-ranging, wild individuals.

Model validation. When it comes to evaluating model performance, a crucial aspect that sets leave-one-individual-out cross-validation (CV) apart is that it can test how well the model performs on data from an individual unseen by the trained model. Other approaches, such as train-test split (hold-out) mix data from different individuals, and hence cannot evaluate the model’s capability to generalise to new individuals. Note that for the sake of clarity, we’ve shown all individuals to have an equal number (M) of datapoints; in general, this might not be the case.

 

Reporting Metrics for Each Behaviour Reveals Fuller Picture of Model Performance

Overall accuracy (i.e. the sum of diagonal elements divided by the sum of elements in the confusion matrix), alone can be misleading and uninformative when it comes to characterising model performance in animal behaviour recognition applications. This is because of the issue of imbalanced classes, where durations of continuously filmed behaviours are naturally unequal. This makes the detection of rarer behaviours problematic.

Thus, overall accuracy alone cannot reliably guide model selection. A good model is one that has good sensitivity and precision for each behaviour of interest. This automatically guarantees good overall accuracy, whereas good overall accuracy does not guarantee good behaviour-wise performance.

 

Benefits of Biomechanically ‘Aware’ Learning

In our paper ‘A novel biomechanical approach for animal behaviour recognition using accelerometers’, we show that the proposed biomechanically driven classification scheme performs better than classical approaches based on black-box machine learning. Further, it is better able to handle the issue of imbalanced classes. Biomechanical considerations in the model can help provide valuable feedback on processes further upstream that are inaccessible to classical machine learning, such as defining the ethogram. The interpretability of the model sheds light on why some classes get consistently misclassified.

Grouping behaviours by biomechanical similarity in a hierarchical classification scheme can allow model sharing between studies on the same species. This eliminates the need to build entire models from scratch every time a new set of behaviours are to be recognised, as would have to be done with classical machine learning approaches.

Finally, we recently showed in this Movement Ecology methodological paper that our classification framework can be extended to magnetometer data as well. This helped to understand the similarity and complementarity of accelerometers versus magnetometers for behaviour recognition.

 

To find out more about biomechanical approach for animal behaviour recognition, check out our Methods in Ecology and Evolution article, ‘A novel biomechanical approach for animal behaviour recognition using accelerometers’.

 

This article was shortlisted for the Robert May Prize 2019. You can find out more about the shortlisted articles here.

Human presence weakens social relationships of wild giraffes

A new study by an international team of scientists from the University of Zürich, Max Planck Institute of Animal Behavior and the University of Konstanz, Pennsylvania State University, and Wild Nature Institute showed that communities of giraffes living in proximity to human settlements have a tell-tale signature of disturbed social networks. While many of the most charismatic animal species are social, the effects of human-caused disturbances on the social relationships of wild animals has rarely been studied. The authors applied state-of-the-art social network analyses on 6 years of observations from more than 500 wild adult female giraffes to reveal that human proximity is correlated with weaker and more exclusive relationships with fewer individuals among giraffes. The study, published in the Journal of Animal Ecology, provides the first robust evidence that humans modify social structure in this iconic megaherbivore.

photo by Sonja Metzger

Effects of humans on social structure of wild animal populations has not been widely studied
For social animals, including species such as elephants, lions, and giraffes, social behaviour is critical for survival and reproduction. Recent studies on laboratory populations of birds have suggested that disturbances to social groups can precipitate changes to the social structure of those groups, which then has consequences on how the groups can perform at tasks that are important for survival—such as feeding together. Scientists know little about the effects on wild animal social relationships from subtle or indirect disruptions caused by human presence and encroachment into natural habitats.

Field research in Tanzania yields new insights into giraffe social relationships
“Detecting signals of natural versus human-caused influences on social relationships among wild animals is challenging,” noted Monica Bond, member of the Population Ecology group at the University of Zürich and primary author of the study. “It requires large-scale studies of individually identified animals across numerous social groups living under different environmental conditions.” Individual giraffes can by identified by their unique and unchanging spot patterns. Over a period of 6 years, Bond and her research collaborators collected photographic identification data spanning 540 adult female Masai giraffes inhabiting a large, unfenced landscape in the Tarangire Ecosystem of Tanzania—an environment that features varying levels of anthropogenic (human-caused) disturbances. Bond’s team documented that the female giraffes in Tarangire live in a complex multilevel society, with individuals preferring to associate with some females while avoiding others. The result of these preferences are discrete social communities comprising 60-90 females with little mixing among the communities, even when these share the same general area. “This study reveals that social structuring is clearly an important feature of female giraffe populations,” noted Barbara König, professor at the University of Zürich and co-author of the study.

In Tanzania, giraffes are tolerated by humans because they do not create conflicts with farmers or livestock. “Despite the public tolerance and hunting restrictions, Masai giraffe populations have declined 50% in recent years,” stated co-author Derek Lee, associate research professor at Pennsylvania State University and leader of the long-term giraffe demography study. Several reasons have been suggested, including illegal poaching, habitat loss and fragmentation, lion predation on calves when migratory herds decline, and changes in food supply. Disruption to social systems also may be a contributing factor in population declines, but until now, anthropogenic effects on social structure of giraffes were unclear.

Using one of the largest-scale metapopulation networks ever studied in a wild mammal, the research team revealed that giraffes living closer to traditional compounds of indigenous Masai people exhibit weaker relationship strengths and more exclusive social associations. “This result signifies a disrupted social environment based upon previous experimental research,” noted Damien Farine of the Max Planck Institute of Animal Behavior and the Centre for the Advanced Study of Collective Behaviour at the University of Konstanz, and senior author of the study. “The patterns we characterise in wild giraffe’s response to proximity to humans reflect the predictions from experimentally disrupted social systems.”

Photo by Christian Kiffner

Near traditional human settlements called bomas, fuelwood cutting can reduce giraffe food resources, and groups of giraffes are more likely to encounter livestock and humans on foot, potentially causing groups of giraffes to split. However, human settlements might also provide protection from lions and hyenas which are fewer near bomas, and in other research the team found that groups of female giraffes with calves tended to occur closer to bomas, and giraffe communities closer to bomas produced more calves per female. “It seems that female giraffes face a trade-off between maintaining important social bonds and reducing risk to their calves near these traditional settlements,” stated Bond. She suggests that traditional pastoralist livelihoods do not necessarily pose a significant risk to giraffe population persistence as long as care is taken not to cause excessive disturbance.

The study’s results imply that human presence could potentially be playing an important role in determining the conservation future of this megaherbivore. Further, the study’s leading-edge methodology highlights the importance of using the social network approach to reveal otherwise hidden potential causes of population declines. “The effects of ever-increasing anthropogenic pressure on wildlife populations are determined by complex interactions of individuals with their social, biological, and physical environment,” said Arpat Ozgul, study co-author, professor at the University of Zürich, and head of the Population Ecology group. “Our study highlights the importance of characterising these complex interactions accurately for gaining much needed insight into population responses to environmental change [or anthropogenic pressure].”

Bond ML, König B, Lee DR, Ozgul A, Farine D (2020) Proximity to humans affects local social structure in a giraffe metapopulation. Journal of Animal Ecology