Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2014 Feb 21;9(2):e88609.
doi: 10.1371/journal.pone.0088609. eCollection 2014.

Love thy neighbour: automatic animal behavioural classification of acceleration data using the K-nearest neighbour algorithm

Affiliations

Love thy neighbour: automatic animal behavioural classification of acceleration data using the K-nearest neighbour algorithm

Owen R Bidder et al. PLoS One. .

Abstract

Researchers hoping to elucidate the behaviour of species that aren't readily observed are able to do so using biotelemetry methods. Accelerometers in particular are proving particularly effective and have been used on terrestrial, aquatic and volant species with success. In the past, behavioural modes were detected in accelerometer data through manual inspection, but with developments in technology, modern accelerometers now record at frequencies that make this impractical. In light of this, some researchers have suggested the use of various machine learning approaches as a means to classify accelerometer data automatically. We feel uptake of this approach by the scientific community is inhibited for two reasons; 1) Most machine learning algorithms require selection of summary statistics which obscure the decision mechanisms by which classifications are arrived, and 2) they are difficult to implement without appreciable computational skill. We present a method which allows researchers to classify accelerometer data into behavioural classes automatically using a primitive machine learning algorithm, k-nearest neighbour (KNN). Raw acceleration data may be used in KNN without selection of summary statistics, and it is easily implemented using the freeware program R. The method is evaluated by detecting 5 behavioural modes in 8 species, with examples of quadrupedal, bipedal and volant species. Accuracy and Precision were found to be comparable with other, more complex methods. In order to assist in the application of this method, the script required to run KNN analysis in R is provided. We envisage that the KNN method may be coupled with methods for investigating animal position, such as GPS telemetry or dead-reckoning, in order to implement an integrated approach to movement ecology research.

PubMed Disclaimer

Conflict of interest statement

Competing Interests: The authors have declared that no competing interests exist.

Figures

Figure 1
Figure 1. Simple example illustrating KNN analysis when k = 3.
Here the new data points are classed according to a majority vote of their k nearest neighbours, so q1 is classed as red and q2 as blue. Two variables are used in this example, although the same approach may be used with n dimensional data such as tri-axial accelerometer data.
Figure 2
Figure 2. 3D Scatterplot showing raw tri-axial acceleration data for an Imperial cormorant (Phalacrocorax atriceps), data points are labelled by colour according to their behavioural classification.
Red – Ascent Phase of Dive, Green – Bottom Phase of Dive, Blue – Descent Phase of Dive, Purple – Flight, Black – Walking.

References

    1. Cooke SJ, Hinch SG, Wikelski M, Andrews RD, Kuchel LJ, et al. (2004) Biotelemetry: a mechanistic approach to ecology. Trends in Ecology & Evolution 19: 334–343. - PubMed
    1. Halsey LG, Shepard ELC, Hulston CJ, Venables MC, White CR, et al. (2008) Acceleration versus heart rate for estimating energy expenditure and speed during locomotion in animals: Tests with an easy model species, Homo sapiens . Zoology 111: 231–241. - PubMed
    1. Halsey LG, Shepard ELC, Quintana F, Laich AG, Green JA, et al. (2009) The relationship between oxygen consumption and body acceleration in a range of species. Comparative Biochemistry and Physiology a-Molecular & Integrative Physiology 152: 197–202. - PubMed
    1. Qasem L, Cardew A, Wilson A, Griffiths I, Halsey LG, et al. (2012) Tri-axial dynamic acceleration as a proxy for animal energy expenditure; should we be summing values or calculating the vector? PLoS ONE e31187. doi:10.1371/journal.pone.0031187. - DOI - PMC - PubMed
    1. Gleiss AC, Wilson RP, Shepard ELC (2011) Making overall dynamic body acceleration work: on the theory of acceleration as a proxy for energy expenditure. Methods in Ecology and Evolution 2: 23–33.

Publication types

LinkOut - more resources