- Methodology article
- Open Access
Optimizing acceleration-based ethograms: the use of variable-time versus fixed-time segmentation
© Bom et al.; licensee BioMed Central Ltd. 2014
- Received: 16 January 2014
- Accepted: 11 March 2014
- Published: 28 March 2014
Animal-borne accelerometers measure body orientation and movement and can thus be used to classify animal behaviour. To univocally and automatically analyse the large volume of data generated, we need classification models. An important step in the process of classification is the segmentation of acceleration data, i.e. the assignment of the boundaries between different behavioural classes in a time series. So far, analysts have worked with fixed-time segments, but this may weaken the strength of the derived classification models because transitions of behaviour do not necessarily coincide with boundaries of the segments. Here we develop random forest automated supervised classification models either built on variable-time segments generated with a so-called ‘change-point model’, or on fixed-time segments, and compare for eight behavioural classes the classification performance. The approach makes use of acceleration data measured in eight free-ranging crab plovers Dromas ardeola.
Useful classification was achieved by both the variable-time and fixed-time approach for flying (89% vs. 91%, respectively), walking (88% vs. 87%) and body care (68% vs. 72%). By using the variable-time segment approach, significant gains in classification performance were obtained for inactive behaviours (95% vs. 92%) and for two major foraging activities, i.e. handling (84% vs. 77%) and searching (78% vs. 67%). Attacking a prey and pecking were never accurately classified by either method.
Acceleration-based behavioural classification can be optimized using a variable-time segmentation approach. After implementing variable-time segments to our sample data, we achieved useful levels of classification performance for almost all behavioural classes. This enables behaviour, including motion, to be set in known spatial contexts, and the measurement of behavioural time-budgets of free-living birds with unprecedented coverage and precision. The methods developed here can be easily adopted in other studies, but we emphasize that for each species and set of questions, the presented string of work steps should be run through.
- Behaviour classification
- Change-point model
- Crab plover
- Dromas ardeola
- Movement ethogram
- Random forest
- Supervised classification
- Tri-axial acceleration
- Video annotation
In trying to achieve a deeper understanding of the functions of, and the mechanisms underlying, animal movement, it helps to know the details of movement in relation to relevant behaviours, especially in well-known field contexts . This requires (1) the technology to measure movements [2, 3] and (2) a classification of behaviours, including different types of movement behaviour , a ‘movement ethogram’ as it were. With technology now going far beyond binoculars and notebooks, combinations of animal-borne GPS and tri-axial accelerometer devices present us with a solution to study the whereabouts and behaviour of animals on a precise and near-continuous basis . GPS receivers fix their location, while acceleration data can be used to classify animal behaviour .
A tricky part in this approach is the segmentation. So far, most, if not all studies aiming to obtain acceleration-based behavioural classification [4, 8–15] used fixed-time segments (e.g. of 1 second) as input for classification models. Fixed-time segments may well limit the classification power of the resulting models as they typically can consist of ‘contaminated’ acceleration data that represent two behavioural classes. To overcome this problem the idea of using variable-length segments has been proposed  but never fully examinated.
An eight step protocol for obtaining acceleration-based behavioural classification is summarized in Figure 1. Below we follow the workflow step by step, illustrated with the collected crab plover data and by emphasizing the data segmentation part.
In March 2011, November 2011 and November 2012, respectively 3, 11, and 8 adult crab plovers were fitted with the UvA Bird Tracking System  (Figure 2). All birds were caught with mist nets at night. The tracked crab plovers weighed an average of 375 g (SD ± 25 g), mean weight of the trackers and their attachments was 15.1 g (SD ± 0.5 g), so on average the birds had to cope with 4% added mass. The tracking device was solar powered and included a GPS receiver and a tri-axial accelerometer which measured acceleration in three directions: surge (X), sway (Y) and heave (Z). Each direction was measured at 20 Hz. All tracking devices were calibrated to convert the three components of the acceleration data in G-force (1 G = 9.8 m s-2). When tags were within reach of the antenna network, both the interval at which the GPS measures as well as the interval and duration at which the accelerometer measures could be changed. During daylight and low tide, trackers were set to measure positions at either 15 or 30 s intervals. Position fixes were always followed by 200 measurements of acceleration (thus, since acceleration is measured at 20 Hz, for a duration of 10 s).
In November and December 2011 and 2012, during daylight low tides, the intertidal mudflats were searched for tracked birds and whenever a bird was encountered, we filmed it through a 20-60× spotting telescope (Swarovski ATS 80HD) using a Canon VIXIA HG21 camera. We obtained video material on eight birds.
Behaviour annotation to videos
Ethogram of the behavioural classes of crab plovers distinguished on the video recording and the number of assignments per tracked bird
# of observations per tracked bird
Fast forwards prey attack, typically followed after a period of waiting
Cleaning and arranging feathers
Preparing prey for ingestion, usually crabs are stripped on the ground
All inactive behaviours, sit, sleep, stand, sit on tarsus, lurk
Pecking, similar to attack, but more downwards and slower
The bill is used to sense prey, similar to, but less irregular than handling
Moving legs forwards
As introduced, we make both variable- and fixed-time segments in our acceleration data and subsequently complete the classification procedure (Figure 1) for either approach. Variable-time segments were made using the change-point model framework. This framework provides a method for detecting multiple change points in a sequence, for instance a time series. The models work by evaluating at every possible split point the distribution of a parameter (e.g. mean, variance or both) using a two-sample test statistic . A change point, or in our case a segment boundary, is detected when a set threshold is exceeded. Within the R environment , a change-point model is implemented in the ‘cpm’ package  that provides the function ‘processStream’. This function uses a test statistics and the parameters ARL0 and startup (explained below) to detect sequential changes in a time series. Inspection of the acceleration bouts showed that the x signal responds most strongly to a behavioural change by changes in the mean and variance, so here we make segments based on changes in the x signal. To do so we used the Generalized Likelihood Ratio (GLR) test statistics which detect both mean and variance changes in a Gaussian sequence. Parameter ARL0 corresponds to the average number of observations before a false positive occurs. As we had no expectations, for ARL0 we used the values of 500 (the default value), 5,000 and 50,000 (the maximum value allowed) and tested the resulting classification performance for each value (see below). The parameter startup indicates the number of observations after which monitoring begins. The default and minimum value was set at 20, which in our case corresponds with 1 second as acceleration was measured at 20 Hz. As we noticed that crab plovers can change their behaviour within 0.25 seconds, we do not increase the value of startup. Fixed-time segments were made of different lengths, i.e. 0.5, 1, 2 and 3 s.
Behaviour assignment to segments
We calculated summary statistics to characterise the acceleration data within a segment and we used them as features for machine learning. The following were calculated: mean, standard deviation, maximum value, minimum value, skewness, kurtosis, dominant power spectrum, frequency at the dominant power spectrum (Hz), trend, dynamic body acceleration and the overall dynamic body acceleration (ODBA) [4, 8]. Summary statistics were calculated for the x, y and z separately except for the ODBA, which was calculated by taking the sum of the dynamic parts of the three dimensions together. Thus, a total of 31 summary statistics were calculated. The R package ‘moments’  was used to calculate the kurtosis and skewness.
The number of behavioural assignments for attack, fly and peck, and to a lesser extent body care, handle and search, were low. We up-sampled the number of observations of attack, fly and peck by a factor six, and of body care, handle and search by a factor two. To this end we used the Synthetic Minority Over-sampling Technique (implemented in the SMOTE function, R package ‘DMwR’), which creates synthetic instances of the minority class using nearest neighbours . For the actual model building part, we applied the random forest supervised algorithm to the selected summary statistics using the R package ‘randomForest’  (default settings used). It was concluded in another study that this method yields the best performance compared to linear discriminant analysis, support vector machines, classification and regression trees and artificial neural networks . Using a resampling procedure, we randomly split the data into two subsamples: 70% of the data was used to train the model and behaviour was classified for the remaining 30% of the data. This classified behaviour was then linked to every single record of acceleration. The classification performance was defined as the number of acceleration records with identical observed and classified behaviour divided by the total number of acceleration records. This procedure was repeated 1,000 times and for each behavioural mode the mean and 95% confidence intervals of the classification performance were calculated. For both approaches we identified settings that yielded the highest classification performance, and used these for further comparisons between the two approaches. For behaviours for which the 95% confidence intervals did not completely overlap, i.e. search, handle and inactive, we compared sample means of the variable-time and the fixed-time approach, using data generated by the resampling procedure. For each behaviour, we calculated the Z-statistic and p-value under the null hypothesis that the means do not differ (i.e. a two-tailed Z-test). The data were logit-transformed to meet the normality assumption.
As an example we show the movement ethogram and the hourly % of time devoted to each classified behaviour of Crab Plover #674 on 20th November 2012, starting 5 hours before, and ending 5 hours after low tide, using the variable-time segmentation approach (ARL0 is 50,000).
Classification performance (mean percentage and 95% confidence intervals) of the variable-time segmentation approach for different values of ARL 0 (upper three rows) and of the fixed-time segmentation approach for different fixed segment lengths (lower four rows)
Fixed length (s)
Body care (%)
Variable-time segmentation for acceleration based behaviour classification
We explored the use of variable-time segments and fixed-time segments for developing acceleration-based behavioural classification. By implementing variable-time segments to our data, very useful levels of classification performance were achieved for almost all behavioural classes, levels that were not always achieved by using fixed-time segments. Especially, the implementation of variable-time segments enabled us to satisfactorily raise the classification performance of two behaviours that may look similar in nature; i.e. handle and search (Table 1). These are behavioural classes we are particularly interested in from an ecological point of view (see below).
Given our results we think that other studies developing acceleration-based behavioural classification models will likely raise their classification performance when using the variable-time segmentation approach. Yet, we also realise that the extent to which this is true will depend on the kind of acceleration data that is available, on the studied species and on the aim of the study. The variable-time segmentation approach will be of limited use when few acceleration records are available (i.e. < 20), or impossible when the acceleration data are already summarized by the manufacturer . Also, studies on animals that have short sequences of vigorous behaviours (certainly true for crab plovers that are typical ambush predators which rapidly attack their prey after relatively long motionless waiting bouts) will benefit more from variable-time segmentation than studies that use data collected on animals that have long-lasting behaviours that are slow by nature, e.g. cows . Similarly, variable-time segmentation is probably not needed when the aim of the study is to classify only obviously distinct behaviours such as inactive versus active.
The present calibration study enables us to study spatial distributions in relation to the behaviour of free-living crab plovers during their non-breeding season at unseasonable hours and inaccessible sites with exceptional coverage and precision. For instance, we can emphasize when and where crab plovers are inactive, when they are searching for prey and how often they handle prey, day and night (crab plover forage during low tide, day and night), we can study which prey is selected (the distribution of the crab plover prey is spatially segregated (R.A. Bom, unpublished data)), predict the sizes of prey ingested (handling time in crab plovers is log-linear related with the size of the crab that is ingested (R.A. Bom, unpublished data)), estimate the (relative) energy expenditure of different behavioural classes  and, since crab plovers fly between foraging sites (Figure 5) and since accelerometers indirectly measure wing-beat frequency while flying, we could potentially measure the increase of body mass before and after foraging . As crab plovers travel between patches by flight we can also identify patch giving-up decisions . Together with field experiments measuring digestive constraints of crab plovers (R.A. Bom unpublished data), we can analyse if, where and when prey intake of crab plovers is constrained by searching, handling and or digestive breaks. Furthermore, search and handling are the key input behaviours to the quantification of the relationship between predator intake and prey densities, the ‘functional response’ , which is the first step in mechanistically understanding the spatial distribution of (foraging) animals [26, 27].
Techniques to analyse acceleration data are beginning to appear in the ecological literature. A growing number of studies has developed supervised classification algorithms that satisfyingly classify behavioural modes of the studied individuals [4, 8–16], for other individuals of the same species  and even classify behaviour beyond the species level . Outperforming the resolution of more traditional telemetry e.g. [30, 31], especially when accelerometers are combined with GPS sensors, the new methods have great potential for movement ecology. Nevertheless, acceleration-based behavioural classifications have not been successful to classify all behavioural categories accurately (e.g. [8, 15], our study). In our case, the low classification performance for some behaviours was probably due to a low sample size, but also due to the short-lasting nature of the behaviour (this is true for both attack and peck) and of the acceleration-signal being very similar to other behaviours. Thus, future studies are challenged to come up with techniques that can identify such hard-to-distinguish behaviours. These techniques may involve optimization of either of the essential steps in the presented workflow (Figure 1). Our contribution to optimize acceleration-based behavioural classification was to include a variable-time segmentation of the acceleration data. The inclusion of the variable-time segmentation enabled us develop a model that could classify several behavioural modes in crab plovers at satisfying levels. By combining the behaviour classifications with simultaneously measured location data, we were able to make ‘movement ethograms’ on a near-continuous basis with coverage and precision that are unprecedented in the field of movement ecology.
Supporting data are available upon request to corresponding author.
All the work was done under the permission of the Ministry of Environment and Climate Affairs, Sultanate of Oman. We are very grateful to its Director-General, Mr Ali al-Kiyumi, for making all the necessary arrangements during our work in Oman. This work could not have been done without the help of Symen Deuzeman and all other people that took part in the fieldwork. We thank two anonymous reviewers for their comments, Allert Bijleveld for valuable discussions, Merijn de Bakker for good help while annotating the videos and Dick Visser for preparing the figures. Our bird behavioural studies are supported by the UvA-BiTS virtual lab on the Dutch national e-infrastructure, built with support of LifeWatch, the Netherlands eScience Center, SURFsara and SURFfoundation. RAB and JAvG are financially supported by NWO (ALW Open Programme grant 821.01.001 awarded to JAvG).
- Nathan R, Getz WM, Revilla E, Holyoak M, Kadmon R, Saltz D, Smouse PE: Movement ecology special feature: a movement ecology paradigm for unifying organismal movement research. Proc Natl Acad Sci USA 2008, 105:19052–19059.View ArticleGoogle Scholar
- Ropert-Coudert Y, Wilson RP: Trends and perspectives in animal-attached remote sensing. Front Ecol Environ 2005, 3:437–444.View ArticleGoogle Scholar
- Rutz C, Hays GC: New frontiers in biologging science. Biol Lett 2009, 5:289–292.View ArticleGoogle Scholar
- Nathan R, Spiegel O, Fortmann-Roe S, Harel R, Wikelski M, Getz WM: Using tri-axial acceleration data to identify behavioral modes of free-ranging animals: general concepts and tools illustrated for griffon vultures. J Exp Biol 2012, 215:986–996.View ArticleGoogle Scholar
- Bouten W, Baaij EW, Shamoun-Baranes J, Camphuysen CJ: A flexible GPS tracking system for studying bird behaviour at multiple scales. J Ornithol 2013, 154:571–580.View ArticleGoogle Scholar
- Shepard ELC, Wilson RP, Quintana F, Laich AG, Liebsch N, Albareda DA, Halsey LG, Gleiss A, Morgan DT, Myers AE, Newman C, Macdonald DW: Identification of animal movement patterns using tri-axial accelerometry. Endang Species Res 2008, 10:47–60.View ArticleGoogle Scholar
- Sakamoto KQ, Sato K, Ishizuka M, Watanuki Y, Takahashi A, Daunt F, Wanless S: Can ethograms be automatically generated using body acceleration data from free-ranging birds? PLoS One 2009, 4:e5379.View ArticleGoogle Scholar
- Shamoun-Baranes J, Bom R, van Loon EE, Ens BJ, Oosterbeek K, Bouten W: From sensor data to animal behaviour: an oystercatcher example. PLoS One 2012, 7:e37997.View ArticleGoogle Scholar
- Ravi N, Dandekar N, Mysore P, Littman ML: Activity recognition from accelerometer data. Proceedings of the Seventeenth Conference on Innovative Applications of Artificial Intelligence 2005, 1541–1546.Google Scholar
- Watanabe S, Izawa M, Kato A, Ropert-Coudert Y, Naito Y: A new technique for monitoring the detailed behaviour of terrestrial animals: a case study with the domestic cat. Appl Anim Behav Sci 2005, 94:117–131.View ArticleGoogle Scholar
- Lagarde F, Guillon M, Dubroca L, Bonnet X, Ben Kaddour K, Slimani T, El mouden EH: Slowness and acceleration: a new method to quantify the activity budget of chelonians. Anim Behav 2008, 75:319–329.View ArticleGoogle Scholar
- Martiskainen P, Järvinen M, Skön J-P, Tiirikainen J, Kolehmainen M, Mononen J: Cow behaviour pattern recognition using a three-dimensional accelerometer and support vector machines. Appl Anim Behav Sci 2009, 119:32–38.View ArticleGoogle Scholar
- Robert B, White BJ, Renter DG, Larson RL: Evaluation of three-dimensional accelerometers to monitor and classify behavior patterns in cattle. Comput Electron Agric 2009, 67:80–84.View ArticleGoogle Scholar
- Staudenmayer J, Pober D, Crouter S, Bassett D, Freedson P: An artificial neural network to estimate physical activity energy expenditure and identify physical activity type from an accelerometer. J Appl Physiol 2009, 107:1300–1307.View ArticleGoogle Scholar
- Nishizawa H, Noda T, Yasuda T, Okuyama J, Arai N, Kobayashi M: Decision tree classification of behaviors in the nesting process of green turtles ( Chelonia mydas ) from tri-axial acceleration data. J Ethol 2013, 31:315–322.View ArticleGoogle Scholar
- Ross GJ: cpm: sequential parametric and nonparametric change detection. R package version 1.1. 2013. http://CRAN.R-project.org/package=cpm Google Scholar
- R Development Core Team: R: A Language and Environment for Statistical Computing. Vienna: R Foundation for Statistical Computing; 2012.Google Scholar
- Komsta L, Novomestky F: Moments: moments, cumulants, skewness, kurtosis and related tests. R package version 0.13. 2012.Google Scholar
- Torgo L: Data mining with R: learning with case studies. Chapman & Hall/CRC; 2010.View ArticleGoogle Scholar
- Liaw A, Wiener M: Classification and regression by randomForest. R News 2002, 2:18–22.Google Scholar
- Grünewälder S, Broekhuis F, Macdonald DW, Wilson AM, McNutt JW, Shawe-Taylor J, Hailes S: Movement activity based classification of animal behaviour with an application to data from cheetah ( Acinonyx jubatus ). PLoS One 2012, 7:e49120.View ArticleGoogle Scholar
- Halsey LG, Shepard ELC, Quintana F, Gomez Laich A, Green JA, Wilson RP: The relationship between oxygen consumption and body acceleration in a range of species. Comp Biochem Physiol A Mol Integr Physiol 2009, 152:197–202.View ArticleGoogle Scholar
- Sato K, Daunt F, Watanuki Y, Takahashi A, Wanless S: A new method to quantify prey acquisition in diving seabirds using wing stroke frequency. J Exp Biol 2008, 211:58–65.View ArticleGoogle Scholar
- Brown JS: Patch use as an indicator of habitat preference, predation risk, and competition. Behav Ecol Sociobiol 1988, 22:37–47.View ArticleGoogle Scholar
- Holling CS: Some characteristics of simple types of predation and parasitism. Canadian Entomolt 1959, 91:385–398.View ArticleGoogle Scholar
- van der Meer J, Ens BJ: Models of interference and their consequences for the spatial distribution of ideal and free predators. J Anim Ecol 1997, 66:846–858.View ArticleGoogle Scholar
- van Gils JA, Piersma T: Digestively constrained predators evade the cost of interference competition. J Anim Ecol 2004, 73:386–398.View ArticleGoogle Scholar
- Moreau M, Siebert S, Buerkert A, Schlecht E: Use of a tri-axial accelerometer for automated recording and classification of goats’ grazing behaviour. Appl Anim Behav Sci 2009, 119:158–170.View ArticleGoogle Scholar
- Campbell HA, Gao L, Bidder OR, Hunter J, Franklin CE: Creating a behavioural classification module for acceleration data: using a captive surrogate for difficult to observe species. J Exp Biol 2013, 216:4501–4506.View ArticleGoogle Scholar
- Dwyer RG, Bearhop S, Campbell HA, Bryant DM, Roulin A: Shedding light on light: benefits of anthropogenic illumination to a nocturnally foraging shorebird. J Anim Ecol 2012, 82:478–485.View ArticleGoogle Scholar
- van Gils JA, Spaans B, Dekinga A, Piersma T: Foraging in a tidally structured environment by red knots ( Calidris canutus ): ideal, but not free. Ecology 2006, 87:1189–1202.View ArticleGoogle Scholar
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly credited. The Creative Commons Public Domain Dedication waiver (http://creativecommons.org/publicdomain/zero/1.0/) applies to the data made available in this article, unless otherwise stated.