- Methodology article
- Open Access
Optimizing acceleration-based ethograms: the use of variable-time versus fixed-time segmentation
Movement Ecology volume 2, Article number: 6 (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.
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 .
Two types of classification approaches can be used to identify behavioural modes in acceleration data. Unsupervised classification algorithms are needed when information on the behaviour is not known at the start of the modelling  and after the exercise is done, behaviour is classified based on expert knowledge. Supervised classification algorithms can be built on a labelled dataset  and the behaviour classification is a direct outcome of the model. A protocol for obtaining acceleration-based behavioural classification with supervised machine learning algorithms has been outlined previously [4, 8] (summarized with adjustments in Figure 1). The approach has a data collection, a data processing, a modelling, and a model application part. The data collection part consists of acquiring acceleration data and gaining information on the behaviour of the animal on which the accelerometer is mounted. The data processing part consists of dividing the acceleration data into segments, and of assigning a behaviour class to each segment. The modelling part consists of calculating and selecting summary statistics that describe the data and of building the classification model. Finally, in the model application part the model is used to classify behaviour for all the collected data.
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.
In this paper we develop a supervised classification model built on both variable-time and fixed-time segment lengths using acceleration data of free-ranging crab plovers Dromas ardeola (Figure 2) moving around and foraging during low tide on the tropical intertidal mudflats of Barr al Hikman in the Sultanate of Oman, and compare the resulting classification performances of both approaches.
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
We designed an ethogram of eight behaviours (Table 1) and assigned behaviours to acceleration data that could be synchronised with the collected video material using the UvA-BiTS annotation tool (http://staff.science.uva.nl/~bredeweg/pdf/BSc/20102011/DeBakker). The tool will soon be available as a web service (http://www.UvA-BiTS.nl/virtual-lab). We could synchronise 919 bouts of acceleration data of 10 s each with video recordings and in a total of 2,668 instances a class of behaviour was assigned (Table 1).
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
Each segment was assigned to a behavioural class (Table 1) that, according to the video annotation, made up most of that segment. Figure 3 shows an example of 10 seconds of acceleration data with variable-time segments (ARL0 = 50,000) and fixed-time segments (fixed at 1 second), with both the assigned and classified behaviour.
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).
Useful classification was achieved by both approaches, but the variable-time segmentation approach considerably outperformed the fixed-time approach for several classes of behaviour (Table 2). The best classification performance for the variable-time segmentation was established when parameter ARL0 was set to its maximum value of 50,000. For most behaviours, the best classification performance for the fixed-time approach was obtained when segments were fixed to 1 second. Thus, comparing the variable-time and fixed-time segmentation approach for the settings for which the classification performance was highest (Figure 4), inactive behaviours (95% vs. 92%), flying (89% vs. 91%) a walking (88% vs. 87%), handling (84% vs. 77%), searching (78% vs. 67%) and body care (68% vs. 72%) were reasonably classified with both approaches, and peck (15% vs. 4%) and attack (2% vs. 1%) were never very accurately classified. Compared with the fixed-time segmentation approach, the variable-time segmentation approach yielded a significant higher classification performance for inactive behaviours (Z = 3.12, p < 0.01), handling (Z = 1.50, p < 0.01) and searching (Z = 2.00, p < 0.01).
Figure 5 shows the ‘movement ethogram’ of crab plover #674 during a single tide on 20 November 2012. This example starts around 04 o’clock when the crab plover is inactive at its shoreline roost. With the ebbing tide, the bird goes to the mudflat where it moves between and within distinct areas, which we here call patches. Between patches the bird travels by flight. Within patches the crab plover mainly walks and is inactive and occasionally is searching for, or handling a prey. The example ends in the early afternoon when the water has reached the beach and the crab plover starts to be more inactive. The time budget in Figure 6 suggests that off the mudflats crab plovers are mainly inactive and sometimes walk.
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.
Availability of supporting data
Supporting data are available upon request to corresponding author.
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.
Ropert-Coudert Y, Wilson RP: Trends and perspectives in animal-attached remote sensing. Front Ecol Environ 2005, 3:437–444.
Rutz C, Hays GC: New frontiers in biologging science. Biol Lett 2009, 5:289–292.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Ross GJ: cpm: sequential parametric and nonparametric change detection. R package version 1.1. 2013. http://CRAN.R-project.org/package=cpm
R Development Core Team: R: A Language and Environment for Statistical Computing. Vienna: R Foundation for Statistical Computing; 2012.
Komsta L, Novomestky F: Moments: moments, cumulants, skewness, kurtosis and related tests. R package version 0.13. 2012.
Torgo L: Data mining with R: learning with case studies. Chapman & Hall/CRC; 2010.
Liaw A, Wiener M: Classification and regression by randomForest. R News 2002, 2:18–22.
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.
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.
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.
Brown JS: Patch use as an indicator of habitat preference, predation risk, and competition. Behav Ecol Sociobiol 1988, 22:37–47.
Holling CS: Some characteristics of simple types of predation and parasitism. Canadian Entomolt 1959, 91:385–398.
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.
van Gils JA, Piersma T: Digestively constrained predators evade the cost of interference competition. J Anim Ecol 2004, 73:386–398.
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.
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.
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.
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.
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).
The authors declare that they have no competing interests.
RAB, WB and JAvG conceived and designed the fieldwork. RAB and JAvG conducted the fieldwork except for the catching of crab plovers and attaching of the trackers, which was done by KO. RAB, WB and JAvG analyzed the data. RAB, TP, WB and JAvG wrote the paper. All authors read and approved the final manuscript.
About this article
Cite this article
Bom, R.A., Bouten, W., Piersma, T. et al. Optimizing acceleration-based ethograms: the use of variable-time versus fixed-time segmentation. Mov Ecol 2, 6 (2014). https://doi.org/10.1186/2051-3933-2-6
- Behaviour classification
- Change-point model
- Crab plover
- Dromas ardeola
- Movement ethogram
- Random forest
- Supervised classification
- Tri-axial acceleration
- Video annotation