- Short communication
- Open Access
Tri-axial accelerometers quantify behaviour in the Eurasian badger (Meles meles): towards an automated interpretation of field data
Animal Biotelemetry volume 2, Article number: 5 (2014)
The popularity of tri-axial accelerometer data loggers to quantify animal activity through the analysis of signature traces is increasing. However, there is no consensus on how to process the large data sets that these devices generate when recording at the necessary high sample rates. In addition, there have been few attempts to validate accelerometer traces with specific behaviours in non-domesticated terrestrial mammals.
We fitted a collar with a tri-axial accelerometer to a tame captive Eurasian badger (Meles meles). The animal was allowed to move freely in an outside enclosure and artificial sett whilst movements were recorded using a video camera. Data were analysed using custom-written software in terms of magnitude of movement, posture and periodicity using spectral analysis, a principal component analysis, the k-nearest neighbour algorithm and a decision tree to facilitate the automated classification of behaviours.
We have demonstrated that various discrete behaviours (walking, trotting, snuffling and resting) can be differentiated using tri-axial accelerometer data. Classification accuracy ranged between 77.4% and 100% depending on the behaviour and classification method employed.
These results are an important step in defining how accelerometer data code for the behaviour of free-ranging mammals. The classification methods outlined here have the potential to be used in the construction of a behavioural database and to generate behaviour-time budgets of hitherto unparalleled detail for wild animals. This would be invaluable for studies of nocturnal, subterranean or difficult-to-observe species that are particularly sensitive to human intrusion.
Background and aims
Accelerometer data loggers are being used increasingly to study animal behaviour and derive indirect proxies of energy expenditure in the wild [1–6]. A key challenge is deciding how to assign specific behaviours to large sets of acceleration data recorded at high frequencies (typically 10 to 50 Hz). To date, no common solution to this problem has been agreed thus multiple processing approaches have been adopted, ranging from black box machine learning techniques [7, 8], to more visual, and often manually applied, hierarchical key-based methods . Classification usually requires a ground-truthing stage during which the animal is monitored (although unsupervised attempts have also been made ).
Here we combined a number of previously tested methods with novel analytical techniques to develop an extensible classifier with high potential utility across species. We used: (a) the k-nearest neighbour (k-NN) algorithm and (b) a sliding window combined with an intuitively constructed decision tree to facilitate the automated classification of behaviours. The sliding window and decision tree approach also allowed for the simultaneous visualisation of behaviours from continuous streams of accelerometer data. The Eurasian badger (Meles meles) was selected as a study species as it is widely dispersed across much of Europe and Asia , attracts much attention as a reservoir of disease (particularly tuberculosis (TB) ) and serves as a model quadruped for mammalian studies in general .
Materials and methods
Accelerometer and collar
A tri-axial (orthogonal) accelerometer (X8M-3; Gulf Coast Data Concepts, LLC, Waveland, MS, USA; recording range: ±8 g; resolution: 0.001 g) was encased in epoxy resin (Evo-Stik, Bostik Limited, Stafford, UK) and configured to record at a sample rate of 25 Hz. The device was attached to an adjustable nylon clip-on dog collar (Ancol Pet Products Limited, Walsall, UK; circumference: 20 to 30 cm) with a layer of waterproof self-amalgamating tape (ultratape™; Bruce Douglas Marketing, Dundee, UK), which was additionally fastened with three cable ties and then covered with tesa®; tape (No. 4651; tesa AG, Hamburg, Germany). To ensure that the collar remained in position on the ventral side of the neck, it was fitted with an additional weight consisting of four metal nuts. The total mass in air of the fitted collar was 146 g. The y-axis of the accelerometer was positioned to correspond with ‘surge’ motion (front-back acceleration), the x-axis with ‘sway’ (left-right acceleration) and the z-axis with ‘heave’ (up-down acceleration) (Figure 1).
Subject and enclosure
The study took place in January 2013 at a wildlife rehabilitation centre (Secret World Wildlife Rescue) in Somerset, UK (latitude: 51.205803, longitude: −2.963007), under licence from Natural England. The subject was an adult male badger (body mass: 12 kg). As the animal was tame, the collar was attached without the need for anaesthesia and it could be observed from close range (<2 m). The badger was then allowed to roam freely within a fenced 20×20 m2 outdoor enclosure consisting of flat grassland. Observations were also made within an indoor artificial sett through an observation window.
In total, four discrete behaviours were studied, three of which were recorded in the outdoor enclosure: ‘walking’ (head up and travelling forwards), ‘trotting’ (fast leg movements with rump swaying from side to side) and ‘snuffling’, the primary mode of foraging (i.e. standing, head lowered with nose to the ground). A third locomotory gait that has been documented in badgers, ‘galloping’ , was not observed. A continuous sequence of movements was recorded on a video camera (Samsung Galaxy Tab 10.1; Samsung Electronics Co, Ltd, Suwon, South Korea) for a total of 35 min. At no point did the collar rotate. Therefore, specific behaviours were recorded consistently in the three axes. The final behaviour, ‘resting’ (lying down), was recorded whilst the animal was in the artificial sett over a two-day period, during which a total of 10 min were filmed. Video footage was time-stamped to ensure synchronisation with the accelerometer.
The collar was removed from the animal and the accelerometer data downloaded. All analyses were performed using R version 3.0.2 . To ground truth data, results were annotated manually with behavioural labels by examining video footage frame-by-frame (30 FPS). In total, 25 2-s samples (which was sufficient time to capture repetitive cycles of movement) of each of the four behaviours were selected at random using a custom R function and the corresponding accelerometer data were isolated (Additional file 1a and b). From each segment, we extracted features that have proved useful in the determination of behaviours in other species [16, 17], as described below.
Static and dynamic acceleration
Acceleration can be described using a number of components . ’Static’ acceleration is defined as the acceleration due to the Earth’s gravitational field and provides information on posture. ’Dynamic’ acceleration results from movement of the accelerometer and is superimposed on the static acceleration to give the raw data. Static acceleration was approximated by taking a 2-s running mean of the raw acceleration data (Additional file 2a). The dynamic acceleration was derived by subtracting the static acceleration from the raw acceleration (Additional file 2b). As an indicator of posture, the mean static acceleration was calculated for each axis. The mean absolute dynamic acceleration was calculated to gauge the magnitude of acceleration resulting from movement in each axis.
Spectral analysis was used to determine the periodicity of the various behaviours. The dynamic acceleration data for each of the three axes were transformed from the time to the frequency domain by computing the discrete Fourier transform. This enabled the acceleration data to be categorised in terms of the frequency (Hz) and amplitude of the signal components. Raw acceleration data were first centred around zero to remove the constant component (i.e. static acceleration). A Hanning window (50 points long) was applied to reduce spectral leakage. The fast Fourier transform algorithm was then used to compute the frequency spectra from which the maximum amplitude (normalised by a factor of 1/N where N is the number of points), standard deviation of the amplitude and absolute period of movement (peak frequency, precision: 0.5 Hz) were calculated (Additional file 1c).
To establish whether the four target behaviours could be distinguished we used the supervised non-parametric k-NN machine learning algorithm, in which an object is classified based on a majority vote of its k-nearest (in Euclidean distance) neighbours. Principal component analysis was used to reduce the dimensionality of the 100 isolated behavioural sequences. Principal components with eigenvalues greater than 1.0 were retained adhering to the Kaiser criterion . The retained principal component scores were used in lieu of the 15 original variables as the training data set of the k-NN classifier (k = 3) with leave-one-out cross-validation. Subsequently, a decision tree (Figure 2) was constructed (e.g. [9, 17]) based on the descriptive statistics derived for each of the behaviours (Additional file 3). These rules were implemented in custom-written software designed to scan and identify animal behaviours from streams of accelerometer data. Features were extracted within a 2-s overlapping sliding window (e.g. ) and threshold values were refined through iterative testing on the randomly selected sequences (Figure 3). This software was used to process the 45-min continuous sequence of data from both the outdoor enclosure and within the artificial sett (see Additional file 4 for video output).
Descriptive statistics and decision tree
Low absolute dynamic acceleration was indicative of resting behaviour (surge: g, s=0.002; sway: g, s=0.001; heave: g, s=0.001). Trotting had a distinctively high degree of periodicity (maximum amplitude: g, s=0.235) and high absolute dynamic acceleration in the heave axis ( = 0.792 g, s=0.153). Relatively high static surge acceleration ( g, s=0.141) was the most distinguishing feature of snuffling behaviour. Walking exhibited low to intermediate periodicity (maximum amplitude: g, s=0.186) and intermediate levels of absolute dynamic acceleration in the heave axis ( g, s=0.112). See Additional files 1, 2 and 3 for more details. The root node of the decision tree (Figure 2) first evaluated the magnitude of absolute dynamic acceleration in the three axes. If these values were less than or equal to the threshold (0.03 g), the behaviour was classified as resting. The next internal node examined the static surge acceleration to consider the position of the badger’s head in relation to the ground. If the static surge threshold (0.345 g) was met or exceeded, the behaviour was classified as snuffling. If the value was less than the snuffling threshold, a subsequent internal node examined the degree of periodicity in the heave axis, terminating as either trotting (if the maximum amplitude was greater than or equal to 0.664 g) or walking (less than 0.664 g).
The first three components from the principal component analysis rendered eigenvalues that were greater than 1.0 and these were retained. These components accounted for 80.2% of the total variance. Overall the accuracy of the k-NN algorithm was 92% (Cohen’s kappa = 0.89, average proportion of votes = 0.93). Resting behaviour was the most readily identifiable with an accuracy of 100% (average proportion of votes = 1.0), followed by trotting (96%, average proportion of votes = 0.91), snuffling (88%, average proportion of votes = 0.95), and lastly, walking (84%, average proportion of votes = 0.87) (Table 1). A total of 21 min from the continuous sequence were manually annotated as belonging to one of the four behaviours of interest (excluding training data). For this time, the overall decision tree percentage match was 87.1% and 83.2% when weighted equally between the behaviours. As with the k-NN results, resting had the highest classification accuracy (99.4%), followed by trotting (78.7%), snuffling (77.5%) and walking (77.4%) (Table 2).
The ability to identify behaviours retrospectively from animal-borne data loggers is an important goal in field ecology [21, 22]. Our use of the k-NN algorithm and an automated decision tree applied to accelerometer data show how this can be achieved with a model mammalian quadruped, the Eurasian badger. Using features that relate clearly to animal movement and posture, both methods demonstrated variable (depending on behaviour), but high, classification accuracy. The k-NN results indicate that the behaviours could be distinguished from isolated sequences of accelerometer data and, as such, lend themselves to the creation of a database of behavioural information to help classify future traces. Using a sliding window and decision tree classification approach, we showed that behaviours could also be accurately identified under more natural conditions from continuous streams of accelerometer data containing multiple transitions between behaviours.
In terms of the misclassification rate, variable walking speed and hence periodicity may explain some of the observed confusion between walking and trotting. While moving forwards, the animal occasionally lowered its head making the distinction between walking and snuffling less clear. Optimisation of window length and the extraction of additional features could further improve classification accuracy . It is also worth noting the extensibility of the feature extraction methods detailed here as they may be used in conjunction with a variety of other classification algorithms (such as those explored by Nathan et al. ).
In future studies, these methods will enable the automated generation of detailed behaviour-time budgets from large quantities of accelerometer data collected on wild animals. Whilst the figures presented here may serve as an initial benchmark for badgers, further work should focus on the characterisation of a wider repertoire of behaviours occurring over a range of terrain, as both substrate and gradient can affect the mechanical work requirements of terrestrial locomotion, which may be reflected in body acceleration [24, 25]. Cross-validation between animals of the same species could also be performed to confirm the implication that accelerometer data from one individual can accurately predict the behaviour of another. Promisingly, other recent validation studies suggest this may be the case both at intra-specific  and, to varying degrees of success depending on morphology, inter-specific levels . Specifically for badgers, accelerometers could be used to examine the differential occurrence of behaviours between TB infected and uninfected individuals, with the potential to expand on recent studies [27–29]. Such a high resolution of behavioural information could prove invaluable in future badger biosecurity work.
Availability of supporting data
The analysis software is under continued development and will be made available at: https://github.com/dmcclune/accelerometeR.
gravitational acceleration (1 g = 9.80665 m/s2)
Yoda K, Sato K, Niizuma Y, Kurita M, Bost C-A, Le Maho Y, Naito Y: Precise monitoring of porpoising behaviour of Adélie penguins determined using acceleration data loggers. J Exp Biol 1999, 3126: 3121–3126.
Wilson RP, Shepard ELC, Liebsch N: Prying into the intimate details of animal lives: use of a daily diary on animals. Endangered Species Res 2008,4(January):123–137. doi:10.3354/esr00064
Whitney NM, Pratt TC, Pratt H L Jr: Identifying shark mating behaviour using three-dimensional acceleration loggers. Endangered Species Res 2010, 10: 71–82. doi:10.3354/esr00247
Wilson RP, White CR, Quintana F, Halsey LG, Liebsch N, Martin GR, Butler PJ: Moving towards acceleration for estimates of activity-specific metabolic rate in free-living animals: the case of the cormorant. J Anim Ecol 2006,75(5):1081–1090. doi:10.1111/j.1365–2656.2006.01127.x 10.1111/j.1365-2656.2006.01127.x
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(2):197–202. doi:10.1016/j.cbpa.2008.09.021 10.1016/j.cbpa.2008.09.021
Lyons GN, Halsey LG, Pope EC, Eddington JD, Houghton JDR: Energy expenditure during activity in the American lobster Homarus americanus : correlations with body acceleration. Comp Biochem Physiol A Mol Integr Physiol 2013,166(2):278–284. doi:10.1016/j.cbpa.2013.06.024 10.1016/j.cbpa.2013.06.024
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(11):49120. doi:10.1371/journal.pone.0049120 10.1371/journal.pone.0049120
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(Pt 6):986–996. doi:10.1242/jeb.058602
Gómez Laich A, Wilson RP, Quintana F, Shepard ELC: Identification of imperial cormorant Phalacrocorax atriceps , behaviour using accelerometers. Endangered Species Res 2009, 10: 29–37. doi:10.3354/esr00091
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(4):5379. doi:10.1371/journal.pone.0005379 10.1371/journal.pone.0005379
Marmi J, Macdonald DW, Calafell F, Zholnerovskaya E, Domingo-Roura X, López-Giráldez F: Mitochondrial DNA reveals a strong phylogeographic structure in the badger across Eurasia. Mol Ecol 2006,15(4):1007–1020. doi:10.1111/j.1365–294X.2006.02747.x 10.1111/j.1365-294X.2006.02747.x
Delahay RJ, De Leeuw ANS, Barlow AM, Clifton-Hadley RS, Cheeseman CL: The status of Mycobacterium bovis infection in UK wild mammals: a review. Vet J 2002,164(2):90–105. doi:10.1053/tvjl.2001.0667 10.1053/tvjl.2001.0667
Stopka P, Johnson DDP: Badger ( Meles meles ) as a model species for the development of ecological and behavioural research. Lynx 2000, 31: 125–131.
Roper TJ: Badger. London: Collins; 2010.
R Core Team: R: A Language and Environment for Statistical Computing. Vienna: R Foundation for Statistical Computing; 2013. http://www.R-project.org/
Shepard ELC, Wilson RP, Quintana F, Gómez Laich A, Liebsch N, Albareda DA, Halsey LG, Gleiss A, Morgan TM, Myers AE, Newman C, McDonald DW: Identification of animal movement patterns using tri-axial accelerometry. Endangered Species Res 2008, 10: 47–60. doi:10.3354/esr00084
Soltis J, Douglas-Hamilton I, Vollrath F, King LE, Savage A, Wilson R P: Accelerometers in collars identify behavioral states in captive African elephants Loxodonta africana . Endangered Species Res 2012,18(3):255–263. doi:10.3354/esr00452 10.3354/esr00452
Shepard ELC, Wilson RP, Halsey LG, Quintana F, Gómez Laich A, Gleiss AC, Liebsch N, Myers AE, Norman B: Derivation of body motion via appropriate smoothing of acceleration data. Aquat Biol 2008,4(January):235–241. doi:10.3354/ab00104
Kaiser HF: The application of electronic computers to factor analysis. Educ Psychol Meas 1960, 20: 141–151. 10.1177/001316446002000116
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(1):319–329. doi:10.1016/j.anbehav.2007.01.010 10.1016/j.anbehav.2007.01.010
Ropert-Coudert Y, Wilson RP: Trends and perspectives in animal-attached remote sensing. Front Ecol Environ 2005,3(8):437–444. doi:10.1890/1540–9295(2005)003[0437:TAPIAR]2.0.CO;2 10.1890/1540-9295(2005)003[0437:TAPIAR]2.0.CO;2
Cooke SJ: Biotelemetry and biologging in endangered species research and animal conservation: relevance to regional, national, and IUCN Red List threat assessments. Endangered Species Res 2008,4(January):165–185. doi:10.3354/esr00063
Huynh T, Schiele B: Analyzing features for activity recognition. In Proceedings of the 2005 Joint Conference on Smart Objects and Ambient Intelligence Innovative Context-aware Services: Usages and Technologies. New York: ACM; 2005:159–163. doi:10.1145/1107548.1107591
Gleiss AC, Wilson RP, Shepard ELC: Making overall dynamic body acceleration work: on the theory of acceleration as a proxy for energy expenditure. Methods Ecol Evol 2010,2(1):23–33. doi:10.1111/j.2041–210X.2010.00057.x
Bidder OR, Qasem LA, Wilson RP: On higher ground: how well can dynamic body acceleration determine speed in variable terrain? PloS ONE 2012,7(11):50556. doi:10.1371/journal.pone.0050556 10.1371/journal.pone.0050556
Campbell H, Gao L, Bidder O, Hunter J, Franklin C: Creating a behavioural classification module for acceleration data: using a captive surrogate for difficult to observe species. J Exp Biol 2013, 089805. doi:10.1242/jeb.089805
Garnett BT, Delahay RJ, Roper TJ: Ranging behaviour of European badgers ( Meles meles ) in relation to bovine tuberculosis ( Mycobacterium bovis ) infection. Appl Anim Behav Sci 2005,94(3–4):331–340. doi:10.1016/j.applanim.2005.02.013
Weber N, Bearhop S, Dall SRX, Delahay RJ, McDonald RA, Carter SP: Denning behaviour of the European badger ( Meles meles ) correlates with bovine tuberculosis infection status. Behav Ecol Sociobiol 2012,67(3):471–479. doi:10.1007/s00265–012–1467–4
Weber N, Carter SP, Dall SRX, Delahay RJ, McDonald JL, Bearhop S, McDonald RA: Badger social networks correlate with tuberculosis infection. Curr Biol 2013,23(20):915–916. doi:10.1016/j.cub.2013.09.011 10.1016/j.cub.2013.09.011
VideoLAN: VLC media player. http://www.videolan.org/vlc/
We are grateful to Secret World Wildlife Rescue for permission to conduct this research with Eros the badger. DWM was supported by a PhD studentship from the Department of Employment and Learning (Northern Ireland).
RPW is on the editorial board of Animal Biotelemetry. The authors declare that they have no other competing interests.
DWM, MS, NJM and NEM performed the experiments. DWM wrote the software and analysed the data. DWM, MS, NJM, RPW, JDRH, WIM, NEM and EG wrote the paper. All authors read and approved the final manuscript.
Electronic supplementary material
Additional file 1: Example raw acceleration and frequency spectra of four behaviours (walking, trotting, snuffling and resting) for the Eurasian badger ( Meles meles ). (a) Raw acceleration in the surge, sway and heave axes for a range of behaviours over a 2-min period. Dashed lines indicate a sub-slice containing the behaviour of interest. (b) Magnified regions displaying a detailed 50-point view (2 s) of raw acceleration data for each behaviour for the three axes. (c) The dynamic acceleration data (raw acceleration values centred around zero to remove the constant component, i.e. static acceleration) for each behaviour transformed from the time to the frequency domain by discrete Fourier transform and plotted as frequency spectra. The heave axis during trotting exhibited the highest periodicity of acceleration with a prominent peak at 4 Hz (1 cycle every 0.25 s) in this sub-slice. (PNG 128 KB)
Additional file 2: Example static and dynamic acceleration of four behaviours (walking, trotting, snuffling and resting) for the Eurasian badger ( Meles meles ). (a) Static acceleration in the surge, sway and heave axes for each behaviour over a 2-s period. When the animal was upright during walking, trotting or snuffling, the static acceleration registered on the heave axis. Note that during snuffling, relatively high static acceleration values registered on the surge axis as the badger had its head pointed downwards, nose to the ground. For resting, the heave static acceleration was close to 1 g, indicating that the animal was lying on its back. (b) Dynamic acceleration during the same period for the surge, sway and heave axes. (PNG 94 KB)
Additional file 3: Descriptive statistics for walking, trotting, snuffling and resting for the Eurasian badger ( Meles meles ). Values shown are mean ± standard deviation derived from 100 isolated behavioural sequences. For surge, sway and heave, amplitude σ is the population standard deviation. (PDF 43 KB)
About this article
Cite this article
McClune, D.W., Marks, N.J., Wilson, R.P. et al. Tri-axial accelerometers quantify behaviour in the Eurasian badger (Meles meles): towards an automated interpretation of field data. Anim Biotelemetry 2, 5 (2014). https://doi.org/10.1186/2050-3385-2-5
- Meles meles
- Pattern recognition