Skip to main content

How to study a predator that only eats a few meals a year: high-frequency accelerometry to quantify feeding behaviours of rattlesnakes (Crotalus spp.)



Many snakes are low-energy predators that use crypsis to ambush their prey. Most of these species feed very infrequently, are sensitive to the presence of larger vertebrates, such as humans, and spend large portions of their lifetime hidden. This makes direct observation of feeding behaviour challenging, and previous methodologies developed for documenting predation behaviours of free-ranging snakes have critical limitations. Animal-borne accelerometers have been increasingly used by ecologists to quantify activity and moment-to-moment behaviour of free ranging animals, but their application in snakes has been limited to documenting basic behavioural states (e.g., active vs. non-active). High-frequency accelerometry can provide new insight into the behaviour of this important group of predators, and here we propose a new method to quantify key aspects of the feeding behaviour of three species of viperid snakes (Crotalus spp.) and assess the transferability of classification models across those species.


We used open-source software to create species-specific models that classified locomotion, stillness, predatory striking, and prey swallowing with high precision, accuracy, and recall. In addition, we identified a low cost, reliable, non-invasive attachment method for accelerometry devices to be placed anteriorly on snakes, as is likely necessary for accurately classifying distinct behaviours in these species. However, species-specific models had low transferability in our cross-species comparison.


Overall, our study demonstrates the strong potential for using accelerometry to document critical feeding behaviours in snakes that are difficult to observe directly. Furthermore, we provide an ‘end-to-end’ template for identifying important behaviours involved in the foraging ecology of viperids using high-frequency accelerometry. We highlight a method of attachment of accelerometers, a technique to simulate feeding events in captivity, and a model selection procedure using biologically relevant window sizes in an open-access software for analyzing acceleration data (AcceleRater). Although we were unable to obtain a generalized model across species, if more data are incorporated from snakes across different body sizes and different contexts (i.e., moving through natural habitat), general models could potentially be developed that have higher transferability.


A basic understanding of the natural history and ecological role of a species often involves monitoring and measuring the behaviours of individuals and establishing an activity budget [1, 2]. Activity budgets and behavioural profiles are particularly critical for understanding how individuals may respond to a changing environment, such as human-induced rapid shifts in temperature [3, 4] and habitat quality [5, 6]. Traditionally, quantifying activity budgets requires numerous hours of direct observation of individuals through methods such as scan sampling or focal sampling [7]. These direct observation methods have been applied to both free-ranging and captive animals across a wide variety of taxa [e.g., 8, 9, 10, 11, 12, 13, 14, 15]. However, a number of constraints make direct observation infeasible for many species. Examples include species that are difficult to observe in their habitat (e.g., dense forest, underground, turbid water, etc.), are only active at night, travel long distances in a short period of time, or are solitary predators, where simultaneous observation across a sample of individuals is impractical. In addition, human presence can drastically alter animal behaviour [16], and individuals may, therefore, not exhibit species-typical behaviour in the presence of human observers.

Recent innovations in animal-borne biologging technologies have provided novel approaches that help circumvent the problems associated with using direct observation to quantify behaviour [17]. The attachment of devices that continuously log acceleration values has been particularly useful for quantifying metrics of movement and behavioral states, as many behaviors result in unique acceleration profiles that can be identified with high accuracy and precision through machine learning methods [19]. The miniaturization and affordability of animal-borne accelerometers has made this approach a key tool for characterizing behaviour of free-ranging animals. Ecologists initially began attaching accelerometers to marine mammals because of the challenges of direct observations on these organisms [18, 19]. Subsequently, terrestrial and freshwater ecologists have adopted this novel method and have been able to use animal-borne accelerometers to quantify activity budgets [e.g., 20, 21], frequencies of key behaviours [e.g., 22, 23], and energy expenditure [e.g., 21, 24]. Accelerometers are now being paired with other biologging devices such as acoustic recorders [25, 26] and global positioning systems [27] to provide even further insight into the activity budgets and behaviour of free-ranging animals and how they may differ across environmentally relevant conditions (e.g., photoperiod, moon phase, seasonality, etc.).

Although accelerometry is becoming an integral and important tool to further understand behaviour, taxonomic representation in these studies is uneven. The majority of research has focused on larger-bodied mammals, birds, and marine taxa [19]. Because logistical details of how to best attach and configure devices are likely to differ greatly across groups, the widespread adoption of animal-borne accelerometry across different groups of organisms is facilitated by studies that document best practices and provide details on overcoming methodological hurdles. For example, we know comparatively little concerning the detailed behavioural ecology of most snake species, despite the fact that this globally distributed group are often abundant predators that play vital roles in ecological communities. Some snake species also have major impacts on both human health and medicine (snakebite envenoming has been recognized by the World Health Organization as a Neglected Tropical Disease), and others have invaded native ecosystems with devastating effects on local fauna [28,29,30]. Viperid snakes in particular represent an ideal group for investigating animal behaviour using accelerometry. Detailed studies of the behavioural ecology (specifically foraging ecology) of this group are difficult, because these snakes are cryptic, rarely encountered, sensitive to human presence, and spend long periods of time hidden from view. Although some methodological approaches have been developed to study specific aspects of their foraging ecology (e.g., dietary analysis, fixed videography coupled with radio telemetry), none of these methods [31,32,33,34,35] allow for the quantification of key aspects of hunting behaviour and outcomes of predatory encounters.

Quantifying behavioural data via attaching animal-borne accelerometers to free-ranging individuals is the next step in advancing our knowledge of foraging ecology in viperids. Most species within this group are characterized as ambush (i.e., sit-and-wait) predators and progress through a series of distinctive behavioural stages when capturing prey. A typical feeding event involves: (1) an initial search for an ambush site, (2) a prolonged wait while remaining cryptic, (3) the targeting, striking, and envenomation of any suitable prey that comes within range, (4) the release of envenomated prey to avoid retaliatory attacks, (5) strike-induced chemosensory searching to locate the carcass of envenomated prey, and (6) swallowing and digesting the prey item [reviewed 36]. Many of the behaviours exhibited by viperids during a feeding event are distinct, and could result in unique acceleration signatures that would enable us to quantify the frequency and outcome of predation events across a large sample of free-ranging snakes. Such data would represent the first comprehensive analysis of feeding behaviour within an ecologically critical and globally distributed group of predators. Previous work pioneering the use of low-frequency accelerometers implanted into the body cavities of Western Diamond-backed Rattlesnakes (Crotalus atrox), Burmese Pythons (Python bivittatus), and Timber Rattlesnakes (Crotalus horridus) illustrates the general utility of this approach [37, 58, 64] and underscores the need to develop new attachment and analysis techniques to quantify detailed behavioural profiles for these predators.

The computational burden imposed by high-resolution accelerometer data remains one of the most significant hurdles to effective use, particularly in validation studies on novel focal taxa [38,39,40]. Acceleration signatures for unique behaviours can be impacted by multiple factors, such as body size and the duration of the behaviour. Thus, it may not be appropriate to use behavioural classification models developed for one species (or even one population) on another similar species. However, it is plausible that a model developed on one species could have high transferability to another similar species if that species is comparable in body size and if they perform analogous behaviours. Accordingly, accelerometer studies must provide detailed step-wise procedures and, when possible, evaluate the potential for transferability of specific methods across similar focal taxa to streamline future applications. If using a single classification model across multiple species is possible, it should be prioritized, as it could simplify classification and increase the adoption of accelerometers to quantify behaviour of the taxa involved [41, 42]. Viperids are an ideal taxon for applying a single classification model across multiple species, as many are similar in body size and go through the same distinct behavioural stages to capture prey. Thus, we hypothesized that computational models would show high transferability across congeneric viperid species (i.e., high recall, precision, and accuracy), and that future studies could forgo the labor-intensive task of simulating feeding events in captivity to develop adequate classification models.

In this study, we used animal-borne accelerometry to develop behavioural classification models for key feeding behaviours of three species of viperids (Timber Rattlesnakes (Crotalus horridus), Western Rattlesnakes (C. oreganus), and Prairie Rattlesnakes (C. viridis) and assessed the transferability of these models across different species. First, we developed a simple and cost-effective methodology to attach accelerometry devices anteriorly to a venomous snake. Our next objective was to develop and validate machine learning models that would allow us to accurately classify key feeding behaviours in all three species. Finally, we assessed the transferability of species-specific classification models via a cross-species comparison to evaluate the feasibility of building general classification models that would apply across a range of closely related species with similar behavioural profiles.


Captive validation

All rattlesnake species were collected from the wild using visual encounter surveys at different locations (C. horridus (n = 17) from Georgia; C. oreganus (n = 14) from Southern California; and C. viridis (n = 7) from Western Texas and Southwestern New Mexico) and transported to either Georgia College and State University (C. horridus) or San Diego State University (C. oreganus and C. viridis).

For each trial, an accelerometer (AXY-5, Technosmart Europe Srl., Rome, Italy) recording tri-axial acceleration values at 25 Hz was attached to the dorsum of individual rattlesnakes (C. horridus, C. oreganus, or C. viridis). Accelerometers were placed anteriorly on each individual at a distance of 25% of the snout vent length of the snake, so that the relative body placement was consistent across individuals. This allowed the three acceleration channels of the device to be placed so they represented the animal’s dorso-ventral axis (heave), the anterior–posterior axis (surge), and the lateral axis (sway). The devices were adhered to the snake via a transparent bandage material (3 M™ Tegaderm™; see Fig. 1) that covered the accelerometry device, but only adhered to a few of the scale rows lateral to the dorsal vertebrae. This was important to ensure that sufficient dermal elasticity was retained as prey items were ingested [59]. To stage a feeding trial, each study animal was placed into a custom arena (2 × 2 m) made of corrugated plastic or glass and video recorded with a stationary camera (PatrolMaster 1296P UHD Body Camera; Amcrest UltraHD Video Security System) recording at 60 frames per second placed above the arena. Immediately after a rattlesnake was placed into an arena, a defensive assay was performed, where personnel agitated the individual with a plush toy attached to a long pole to prompt defensive strike behaviours. After the defensive assay, snakes were allowed to acclimate to the arena for approximately 12 h before a feeding assay was conducted. For the feeding assay, rattlesnakes were video recorded as they were fed a mouse that was allowed to move freely into the arena (Mus musculus, their typical food in captivity). It was necessary to use live mice to replicate the feeding behaviors of free-ranging snakes as closely as possible, as past studies have shown that rattlesnakes respond differently to live vs. euthanized prey items [65].

Fig. 1
figure 1

A lateral (A) and dorsal (B) view of an accelerometer placed posteriorly from the snout at a distance of 25% of the snout-vent length of the snake and adhered via a transparent bandage material (3 M™ Tegaderm™)

Following exploratory analyses of videos, we chose to group behaviours into four classes that appeared to result in distinct acceleration signatures and corresponded to critical phases of the feeding cycle: still, locomotion, strike, and swallow (Table 1; Fig. 2). Behavioural scores were time-matched to accelerometer readings (to within 1 s) to generate annotated acceleration data sets by recording a video of the exact time (using the Exact Time™ application by ©Neurovat, 2023) as the accelerometry device began logging data (Technosmart devices emit a visible signal when powering on). We then also recorded the Exact Time™ (©Neurovat, 2023) at the outset of all videos recording animals wearing accelerometry devices.

Table 1 Description and function of four rattlesnake behaviours used for accelerometry classification
Fig. 2
figure 2

Acceleration signatures of the sway (dark blue), heave (gray), and surge (light blue) axes for the behaviours still, locomotion, and strike at a 2 s time burst, and for the behaviours still, locomotion, and swallow over a period of 5 min

Behavioural classification algorithms

We used the open-access software AcceleRater to train classification algorithms based on our captive training data sets [38]. Because of the extreme differences in the durations of the strike and swallow behaviors (e.g., a typical strike is less than 1 s, while a swallowing event can last over 5 m) leading to complications with window size selection, we analyzed the data separately to identify striking and swallowing behaviors. Thus, we attempted to independently obtain the best model for (1) ‘strike’-focused models, with strike, still, and locomotion as behavior classes; and (2) ‘swallow’-focused models, with swallow, still, and locomotion as behavior classes. In addition, because class imbalance can lead to inference issues when using machine-learning methods [60], all data sets were manually balanced, so that each behavioural class had an equal number of samples relative to the behaviour that had the fewest samples from our captive trials (in all cases, this was either the behaviour swallow or strike). We then ran a linear support vector machine (SVM) [61], a decision tree [62], and a random forest [63] algorithm that either included all summary statistics available in AcceleRater (mean, standard deviation, skewness, kurtosis, maximum, minimum, vector norm, covariance, Pearson correlation, dynamic body acceleration, overall dynamic body acceleration (ODBA), mean-diff, std-diff, wave amplitude, line crossings, 25 percentile, 50 percentile, 75 percentile) or just the summary statistics of mean, standard deviation, and ODBA at window sizes of 3, 6, 12, 24, and 40 s for ‘swallow’ models, and window sizes of 0.4, 0.8, 1.2, and 1.6 s for ‘strike’ models. For each unique model and window size, we trained the model via a (50/50) train-test split, where a random 50% of the data were used to train each model and the remaining 50% of the data set was used to test the model.

We used the same methods as Clermont et al. [43] to identify which algorithm optimally classified behaviours. For each algorithm, a confusion matrix was built in AcceleRater that counted true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN). Accuracy, precision, and recall for each behavioural class were calculated using these counts and are defined as follows (redrawn from Clermont et al. [43]). Accuracy is the proportion of correct classifications either into or out of a given behaviour category:

$${\text{Accuracy}} = \frac{{{\text{TP}} + {\text{TN}}}}{{{\text{TP}} + {\text{TN}} + {\text{FP}} + {\text{FN}}}}$$

Precision is the proportion of classifications into a given behaviour category that were correct:

$${\text{Precision}} = \frac{{{\text{TP}}}}{{{\text{TP}} + {\text{FP}}}}$$

Recall is the proportion of instances of a behaviour classification into the correct category:

$${\text{Recall}} = \frac{{{\text{TP}}}}{{{\text{TP}} + {\text{FN}}}}$$

Higher precision denotes fewer false positives and higher recall denotes fewer false negatives.

Cross-species comparison: statistical analyses

To assess the transferability of algorithms trained on one rattlesnake species when tested on a different rattlesnake species exhibiting the same behaviour, we used the top performing models from each species to annotate and label already known behaviours. If there was more than one top model, we used the model that most consistently performed well across each species. Thus, we were able to test how well the best performing ‘strike’ and ‘swallow’ models were able to correctly classify the same behaviours of other species using a factorial experimental design, where we tested (1) C. horridus on C. oreganus and C. viridis; (2) C. oreganus on C. horridus and C. viridis; and (3) C. viridis on C. horridus and C. oreganus. Subsequently, for each test, we calculated overall accuracy (or percent correctness) and the precision, recall, and F1-score of each behavioural class. The F1-score was calculated as follows:

$$F1\,{\text{score}} = \frac{{2 \times {\text{Precision}} \times {\text{Recall}}}}{{{\text{Precision}} + {\text{recall}}}}.$$


Behavioural classification using accelerometry data

The window sizes and classification algorithms that predicted the top model(s) for both ‘strike’ and ‘swallow’ models varied across species (Tables 2, 3; Additional file 1). For C. horridus the top performing algorithm for ‘swallow’ models was a random forest that included all summary statistics at a window size of 3 s (all three behaviours with accuracies > 81%) and there were multiple top performing algorithms for ‘strike’ models, where all three behaviours had an accuracy, precision, and recall of 100% (Tables 2, 3). For C. oreganus, the top performing algorithm for ‘swallow’ models was a random forest that included all summary statistics at a window size of 6 s (all three behaviours with accuracies > 90%) and the top performing algorithm for ‘strike’ model was a random forest that included all summary statistics at a window size of 0.4 s (all three behaviours with accuracies > 98%; Tables 2, 3). For C. viridis, the top performing algorithm for ‘swallow’ models was a random forest that included all summary statistics at a window size of 3 s (all three behaviours with accuracies > 88%) and there were two top performing algorithms for ‘strike’ models, where all three behaviours had an accuracy, precision, and recall of 100% (Tables 2, 3). Thus, for each species we were able to develop models that performed well and correctly classified our behaviours of interest.

Table 2 Accuracy, precision, and recall for the top algorithm, window size, and summary statistics for Crotalus horridus, C. oreganus, and C. viridis. Behaviours included in these models were swallow, locomotion, and still
Table 3 Accuracy, precision, and recall for the top algorithm, window size, and summary statistics for Crotalus horridus, C. oreganus, and C. viridis

Cross-species validation

The overall accuracy, and the precision, recall, and F1-scores of each behavioural class varied across species tests for ‘swallow’ and ‘strike’ models (Tables 4, 5). The top cross-species ‘swallow’ model (random forest model developed using C. viridis data and tested on C. oreganus) had an overall accuracy of only 58%. Across all ‘swallow’ models, locomotion behaviour was classified correctly most frequently, but was still often confused with swallow (Table 4; Additional file 2) The top cross-species ‘strike’ model (random forest model created using C. viridis data and tested on C. oreganus) had an overall accuracy of 73%. In general, cross-species ‘strike’ models were able to classify strikes correctly, but performed poorly at discerning still and locomotion from strike (Table 5; Additional file 2).

Table 4 Overall accuracy (i.e., percent correctness) of each test and precision, recall, and F1-scores for each behavioural classification when applying top swallow algorithm for each species of Crotalus to the two other species
Table 5 Overall accuracy (i.e., percent correctness) of each test and the precision, recall, and F1-scores for each behavioural classification when applying top strike algorithm for each species of Crotalus to the two other species


Our results indicate that high-frequency acceleration data logged from an anteriorly adhered device has definite potential for quantifying key feeding behaviours in taxa of predators that have proven difficult to study using direct behavioural observation. Using accelerometry data to characterize species-typical hunting behaviours in viperid snakes, we were able to create species-specific models that classified the behaviours strike, swallow, locomotion, and remaining still with high precision, accuracy, and recall. The high success rates of our preliminary models show that using this technique could have strong ecological relevance in future studies and open up new opportunities for quantifying behaviour across viperids and other snakes. In addition, we identified a low cost, reliable, non-invasive attachment method for accelerometry devices to be placed anteriorly on snakes, as is likely necessary for accurately classifying distinct behaviours in these species. However, species-specific models had low transferability in our cross-species comparison. Thus, it may be necessary to develop and validate classification models within the same species to avoid any species-specific differences in behaviour or body size variance that could affect acceleration data. Our study also took place in a captive environment, and additional field validation sampling may be necessary to build models applicable to free-ranging snakes.

Species-specific models

For all three species (C. horridus, C. oreganus, and C. viridis), we created a model selection framework to determine the top performing models that could classify swallow and strike behaviours, alongside both still and locomotion. We used what we deemed as biologically relevant window sizes for each separate ‘swallow’ and ‘strike’ model to determine the top performing model. Furthermore, we tested three different supervised machine-learning algorithms across varying biologically relevant window sizes, providing a general framework within AcceleRater to find a top performing model. For our results, the best performing algorithms were almost all random forests, which was unsurprising, as it is typically the approach with the highest success rate in other studies using supervised machine-learning algorithms to classify animal behaviour [27, 43,44,45]. However, some studies are beginning to explore unsupervised machine-learning algorithms (e.g., ‘deep learning’; [39, 46,47,48]) which could benefit the classification of animal behavior using acceleration data in the future. Nonetheless, our top performing ‘strike’ and ‘swallow’ models had high accuracy, precision, and recall within all three species.

For all three species, the behaviour class strike had very high accuracy (> 97%), precision (all models = 100%), and recall (> 93%). This was expected, as rattlesnake strikes are extremely fast and have a short duration, thus it was predictable that a machine-learning algorithm could develop a model able to classify the behaviour strike from still and locomotion. Furthermore, the behaviour class swallow also had high accuracy (> 88%), precision (> 87%), and recall (> 74%) across all three species. This behaviour, which represents the movement of the body when a prey item passes down the esophagus towards the stomach of the animal and underneath the dorsally attached accelerometer, represents a key step in studying feeding ecology in free-ranging snakes. Past studies of viperid feeding ecology have quantified feeding behaviors in free-ranging snakes using a combination of radio tracking and fixed videography to assemble large data sets on ambush behaviour, quantification of site residence times, prey encounter rates, and strike success rates [31,32,33,34,35]. However, because viperid snakes almost always release struck prey after envenomation, videography studies have not been able to estimate the actual frequency of successful feeding events, given that the swallowing of prey or failure to locate prey items almost always occurs once the animals have left the video frame. Our study indicates that validated machine-learning models applied to accelerometry data sets from free-ranging snakes should be able to accurately estimate the true number of prey items ingested by snakes. We suspect that swallowing is amenable to accurate classification, because it involves a pattern of upward movement on the accelerometer that is likely rare and should most often occur in temporal proximity to a strike. Nevertheless, additional validation may be necessary before applying our models to free-ranging snakes, as we only tested individuals feeding on a narrow size range of prey. Although the mice we used in our study are representative of the ‘typical’ prey size taken by these individuals in nature, free-ranging viperids swallow a range of carcass sizes [49,50,51] and a more accurate validation set might need to include an equivalent range of prey size.

The behaviour classes locomotion and still were included in each ‘strike’ and ‘swallow’ model. In all cases, our top performing models classified both behavioural classes locomotion and still with high accuracy, precision, and recall (Tables 2, 3). Thus, our accurate classification of behaviours involved in feeding events across these three viperid species is similar to the performance reached with other predator species [25, 27, 43, 52].

Accelerometer attachment

In addition to developing models to predict behaviours involved with foraging ecology in viperids, we describe a non-invasive procedure for attaching accelerometers anteriorly to viperids and potentially other small vertebrates as well (e.g., other snakes, lizards, etc.). Many feeding behaviour movements involve only the head and upper body, so attaching the accelerometer close to the head is probably necessary for the success of this technique. For example, feeding strikes may involve a rapid forward surge of the head and neck region, with the lower body remaining more or less still [53], and prey passing through the gullet are then held in the stomach for a prolonged digestion period, making it unlikely that lower regions of the body exhibit unique acceleration patterns for either striking or swallowing behaviours.

We investigated several ways to attach accelerometers, but found that attaching the accelerometer via a transparent bandage material (3 M™ Tegaderm™) on the dorsum with the leading edge at 25% SVL was the simplest and most effective technique. Although being close to the head is desirable for accelerometer attachment, the degree to which devices can be attached anteriorly is also limited by the size of the device relative to the snake. Snakes ingest comparatively large prey items relative to their head and body size, and the elastic skin of their anterior body must be able to expand during ingestion. A device attached to the dorsum with adhesive tape should only adhere to the few scale rows lateral to the vertebrae, lest it interfere with the snake’s ability to ingest large prey. All three of our species tested were broadly similar in body size, with adults ~ 600–1100 mm in SVL, and we found that attaching devices at 25% SVL did not interfere with normal movement or feeding behaviours. However, we suspect this attachment methodology may need to be modified for smaller-bodied snakes.

Although we recognize the use of an adhesive bandage is a short-term attachment method (snakes generally shed the device during each ecdysis cycle), high-frequency accelerometry on relatively small-bodied vertebrates is inherently limited in duration. Devices small enough for external attachment (our customized AXY-5; Technosmart Europe Srl., Rome, Italy) were configured as flat rectangular packages (32 L × 10 W × 8 H mm) and could collect ~ 30 days of data at a sampling frequency of 25 Hz. Preliminary field tests of our technique attaching devices to free-ranging C. viridis have found that devices generally remain attached for the entire 30-day battery life of the device, although detachments are frequent enough that we adhere a 0.5 g micro-VHF transmitter to the accelerometer, so that we can recover any devices that detach (RJH, JLH, and RWC, pers. observation). We also caution that the success of this technique may be somewhat species-specific; in the current study, we qualitatively noted significant variation in adherence of devices among species, with C. viridis and C. oreganus retaining devices for long periods of time, whereas devices attached to C. horridus detached much more readily during both captive and field tests (DLD, AFT, and MLT, pers. observation).

Cross-species comparison

Although accelerometry models are typically developed and tested within a species, several other research groups have also noted the potential utility of cross-species modeling [42, 54,55,56,57]. Previous studies have shown both high and low transferability of models across similar species, but when more complicated behaviours are included, the models typically have low transferability. For example, Dickinson et al. [57] examined model transferability of a captive phylogenetically similar species and captive conspecifics (surrogate species) in Caprids for calibrating behavioural classification of 11 different behaviours and found low model transferability (< 55%). However, the possibility of cross-species models is still important to assess, because the use of a previously developed and validated model could save researchers extensive time and effort in creating a unique validation data set when a suitable one already exists. For instance, Auge et al. [42] found high model transferability across two species of freshwater turtles, where accelerometry was coupled with water sensing technology to classify activity states. Therefore, a general model could be useful in many different scenarios, including instances when behavioural categories are broad (e.g., moving vs. still), free-ranging animals are difficult to record, or the target species is especially cryptic and difficult to find.

Despite highly accurate species-specific models, we found low transferability of all of our top performing models across species. Overall accuracy ranged from 42–58% to 36–73% for ‘swallow’ and ‘strike’ models, respectively. Across all ‘swallow’ models, we found that locomotion was classified correctly most frequently, but still was often confused with swallow (Table 4; Additional file 2). This may be because the behavioural class swallow is similar to still, where the accelerometer remains motionless until the prey item passes down the esophagus and underneath the accelerometer, presumably forcing the accelerometer upwards. Broadly, cross-species ‘strike’ models were able to classify strikes correctly, but performed poorly at discerning still and locomotion from strikes (Table 5; Additional file 2). Although it is unclear why the transferability of ‘strike’ models was low, it is possible that there was too much variation in body size across the three species, or that snake strikes are more variable in duration and acceleration than is apparent from direct observation. However, it is important to note that the C. viridis ‘strike’ model had a reasonably accurate transferability of 67% and 73% overall accuracy on C. horridus and C. oreganus, respectively. Consequently, a data set that includes a larger sample of individuals across more variable body sizes may increase overall transferability among species. Although we are still uncertain why models were not generalizable across species, we think it is unlikely that different rattlesnake species differ fundamentally from one another in the kinematics of their various feeding behaviors, and that generalizable models may be achieved by building larger validation data sets that incorporate a broader range of snake sizes and movement contexts (i.e., including movements of free-ranging individuals through natural habitats, rather than relying solely upon captive individuals). Such data sets should be able to train models that can recognize the broader range of variation present in behavioral classifications. We also suggest that future approaches should experiment with machine-learning algorithms that use more complex and involved training methods (such as over-sampling, under-sampling, moving/sliding window sizes, etc.).


Overall, our study demonstrates the strong potential for using accelerometry to document critical feeding behaviours in snakes that are difficult to observe directly. Many snakes are extreme low-energy specialists, and may only feed once every few months—a pattern that has generally stymied attempts to fully document predation behaviours for most species. Furthermore, we provide an ‘end-to-end’ template for identifying important behaviours involved in the foraging ecology of viperids using tri-axial accelerometry. We highlight a method of attachment of accelerometers, a technique to simulate feeding events in captivity, and a model selection procedure using biologically relevant window sizes in an open-access software for analyzing acceleration data. Although we were unable to obtain a generalized model across congeneric species, we believe this goal is still feasible if more data are incorporated from a broader range of movement and feeding contexts, including snakes with more varied body sizes moving in more naturalistic settings. This goal is important for driving more widespread adoption of accelerometry tools within particular taxonomic groups, as researchers starting with a general viperid feeding model could spend much less effort in validation, and more effort in characterizing movement and behavior under varied ecological contexts that would lead to rich comparative data sets.

Availability of data and materials

The full data sets used and/or analyzed during the current study are available from the corresponding author.



Overall dynamic body acceleration


True positive


True negative


False positive


False negative


  1. Tinbergen N. On aims and methods of ethology. Z Tierpsychol. 1963;20:410–33.

    Article  Google Scholar 

  2. Lehner PN. Handbook of ethological methods. Cambridge: Cambridge University Press; 1998.

    Google Scholar 

  3. Rieger I, Weihe WH. Weather dependent behaviour of captive striped hyaenas (Hyaena hyaena). Int J Biometeorol. 1975;1975(19):122–6.

    Article  Google Scholar 

  4. Hanya G. Seasonal variations in the activity budget of Japanese macaques in the coniferous forest of Yakushima: effects of food and temperature. Am J Primatol. 2004;63:165–77.

    Article  PubMed  Google Scholar 

  5. Collins WB, Urness PJ, Austin DD. Elk diets and activities on different lodgepole pine habitat segments. J Wildl Manag. 1978;1978:799–810.

    Article  Google Scholar 

  6. Wauters L, Swinnen C, Dhondt AA. Activity budget and foraging behaviour of red squirrels (Sciurus vulgaris) in coniferous and deciduous habitats. J Zool. 1992;227:71–86.

    Article  Google Scholar 

  7. Bateson M, Martin P. Measuring behaviour: an introductory guide. Cambridge: Cambridge University Press; 2021.

    Book  Google Scholar 

  8. Abrol DP. Time and energy budgets of alfalfa pollinating bees Megachile nana bingh and Megachile flavipes Spinola (Hymenoptera: Megachilidae). Pap Anim Sci. 1986;95:579–86.

    Google Scholar 

  9. Anthony ELP, Stack MH, Kunz TH. Night roosting and the nocturnal time budget of the little brown bat, Myotis lucifugus: effects of reproductive status, prey density, and environmental conditions. Oceologica. 1981;51:151–6.

    Article  CAS  Google Scholar 

  10. Baumgardner DJ, Ward SE, Dewsbury DA. Diurnal patterning of eight activities in 14 species of muroid rodents. Anim Learn Behav. 1980;8:322–30.

    Article  Google Scholar 

  11. Mann J. Behavioural sampling methods for cetaceans: a review and critique. Mar Mamm Sci. 1999;15:102–22.

    Article  Google Scholar 

  12. Nursall JR. The activity budget and use of territory by a tropical blenniid fish. Zool J Linn Soc. 1981;72:69–92.

    Article  Google Scholar 

  13. Puttick GM. Foraging behaviour and activity budgets of Curlew Sandpipers. Ardea. 1979;1979(67):1–122.

    Google Scholar 

  14. Seyfarth RM, Cheney DL, Marler P. Vervet monkey alarm calls: semantic communication in a free-ranging primate. Anim Behav. 1980;28:1070–94.

    Article  Google Scholar 

  15. Turner DC. An analysis of time-budgeting by Roe Deer (Capreol Us Capreol Us) in an agricultural area. Behav. 1979;1979(71):246–89.

    Article  Google Scholar 

  16. Burghardt GM, Bartmess-LeVasseur JN, Browning SA, Morrison KE, Stec CL, Zachau CE, Freeberg TM. Perspectives—minimizing observer bias in behavioural studies: a review and recommendations. Ethol. 2012;118:511–7.

    Article  Google Scholar 

  17. Whitford M, Klimley AP. An overview of behavioural, physiological, and environmental sensors used in animal biotelemetry and biologging studies. Anim Biotelemet. 2019;7:1–24.

  18. Yoda K, Sato K, Niizuma Y, Kurita M, Bost C, Le Maho Y, Naito Y. Precise monitoring of porpoising behaviour of Adélie penguins determined using acceleration data loggers. J Exp Biol. 1999;202:3121–6.

    Article  CAS  PubMed  Google Scholar 

  19. Brown DD, Kays R, Wikelski M, Wilson R, Klimley AP. Observing the unwatchable through acceleration logging of animal behaviour. Anim Biotelemet. 2013; 1:1–16.

  20. Williams CT, Wilsterman K, Zhang V, Moore J, Barnes BM, Buck CL. The secret life of ground squirrels: accelerometry reveals sex-dependent plasticity in above-ground activity. R Soc Open Sci. 2016;3:160404.

    Article  PubMed  PubMed Central  Google Scholar 

  21. Menzies AK, Studd EK, Seguin JL, Derbyshire RE, Murray DL, Boutin S, Humphries MM. Activity, heart rate, and energy expenditure of a cold-climate mesocarnivore, the Canada lynx (Lynx canadensis). Can J Zool. 2022;100:261–72.

    Article  Google Scholar 

  22. Hammond TT, Springthorpe D, Walsh RE, Berg-Kirkpatrick T. Using accelerometers to remotely and automatically characterize behaviour in small animals. J Exp Biol. 2016;219:1618–24.

    PubMed  Google Scholar 

  23. Studd EK, Landry-Cuerrier M, Menzies AK, Boutin S, McAdam AG, Lane JE, Humphries MM. Behavioural classification of low-frequency acceleration and temperature data from a free-ranging small mammal. Ecol Evol. 2019;9:619–30.

    Article  PubMed  Google Scholar 

  24. Gleiss AC, Wilson RP, Shepard EL. Making overall dynamic body acceleration work: on the theory of acceleration as a proxy for energy expenditure. Methods Ecol Evol. 2011;2:23–33.

    Article  Google Scholar 

  25. Studd EK, Derbyshire RE, Menzies AK, Simms JF, Humphries MM, Murray DL, Boutin S. The Purr-fect Catch: Using accelerometers and audio recorders to document kill rates and hunting behaviour of a small prey specialist. Methods Ecol Evol. 2021;12:1277–87.

    Article  Google Scholar 

  26. Studd EK, Boudreau MR, Majchrzak YN, Menzies AK, Peers MJ, Seguin JL, Lavergne SG, Boonstra R, Murray DL, Boutin S, Humphries MM. Use of acceleration and acoustics to classify behaviour, generate time budgets, and evaluate responses to moonlight in free-ranging snowshoe hares. Front Ecol Evol. 2019;7:154.

    Article  Google Scholar 

  27. Wang Y, Nickel B, Rutishauser M, Bryce CM, Williams TM, Elkaim G, Wilmers CC. Movement, resting, and attack behaviours of wild pumas are revealed by tri-axial accelerometer measurements. Mov Ecol. 2015;3:1–12.

    Article  CAS  Google Scholar 

  28. Rodda GH, Savidge JA. Biology and impacts of Pacific island invasive species. 2. Boiga irregularis, the brown tree snake (Reptilia: colubridae) 1. Pac Sci. 2007;61:307–24.

  29. Monzón-Argüello C, Patiño-Martínez C, Christiansen F, Gallo-Barneto R, Cabrera-Pérez MÁ, Peña-Estévez MÁ, López-Jurado LF, Lee PL. Snakes on an island: independent introductions have different potentials for invasion. Conserv Genet. 2015;16:1225–41.

    Article  Google Scholar 

  30. Dorcas ME, Willson JD, Reed RN, Snow RW, Rochford MR, Miller MA, Meshaka WE Jr, Andreadis PT, Mazzotti FJ, Romagosa CM, Hart KM. Severe mammal declines coincide with proliferation of invasive Burmese pythons in Everglades National Park. Proc Natl Acad Sci. 2012;109:2418–22.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  31. Clark RW. Post-strike behaviour of timber rattlesnakes (Crotalus horridus) during natural predation events. Ethol. 2006;112:1089–94.

    Article  Google Scholar 

  32. Barbour MA, Clark RW. Ground squirrel tail-flag displays alter both predatory strike and ambush site selection behaviours of rattlesnakes. Proc R Soc B. 2012;279:3827–33.

    Article  PubMed  PubMed Central  Google Scholar 

  33. Clark RW, Tangco S, Barbour MA. Field video recordings reveal factors influencing predatory strike success of free-ranging rattlesnakes (Crotalus spp.). Anim Behav. 2012;84:183–90.

  34. Clark RW, Dorr SW, Whitford MD, Freymiller GA, Putman BJ. Activity cycles and foraging behaviours of free-ranging sidewinder rattlesnakes (Crotalus cerastes): the ontogeny of hunting in a precocial vertebrate. Zool. 2016;119:196–206.

    Article  Google Scholar 

  35. Putman BJ, Barbour MA, Clark RW. The foraging behaviour of free-ranging rattlesnakes (Crotalus oreganus) in California ground squirrel (Otospermophilus beecheyi) colonies. Herpetologica. 2016;2016(72):55–63.

    Article  Google Scholar 

  36. Hanscom RJ, Higham TE, Ryan D, Clark RW. Ambush hunting in snakes: behaviour, function, and diversity. In: Penning D, editor. Snakes: morphology, function, and ecology. Hauppauge, New York: Nova Science Publishers; 2023 (in press).

  37. DeSantis DL, Mata-Silva V, Johnson JD, Wagler AE. Integrative framework for long-term activity monitoring of small and secretive animals: validation with a Cryptic Pitviper. Front Ecol Evol. 2020;8:169.

    Article  Google Scholar 

  38. Resheff YS, Rotics S, Harel R, Spiegel O, Nathan R. AcceleRater: a web application for supervised learning of behavioural modes from acceleration measurements. Mov Ecol. 2014;2:1–7.

    Article  Google Scholar 

  39. Chimienti M, Cornulier T, Owen E, Bolton M, Davies IM, Travis JM, Scott BE. The use of an unsupervised learning approach for characterizing latent behaviours in accelerometer data. Ecol Evol. 2016;6:727–41.

    Article  PubMed  PubMed Central  Google Scholar 

  40. Ladds MA, Thompson AP, Kadar JP, Slip JD, Hocking PD, Harcourt GR. Super machine learning: improving accuracy and reducing variance of behaviour classification from accelerometry. Anim Biotelemet. 2017;5:1–9.

  41. Collins PM, Green JA, Warwick-Evans V, Dodd S, Shaw PJ, Arnould JP, Halsey LG. Interpreting behaviours from accelerometry: a method combining simplicity and objectivity. Ecol Evol. 2015;5:4642–54.

    Article  PubMed  PubMed Central  Google Scholar 

  42. Auge AC, Blouin-Demers G, Murray DL. Developing a classification system to assign activity states to two species of freshwater turtles. PLoS ONE. 2022;17:e0277491.

  43. Clermont J, Woodward-Gagné S, Berteaux D. Digging into the behaviour of an active hunting predator: arctic fox prey caching events revealed by accelerometry. Mov Ecol. 2021;9:1–12.

    Article  Google Scholar 

  44. Lush L, Ellwood S, Markham A, Ward AI, Wheeler P. Use of tri-axial accelerometers to assess terrestrial mammal behaviour in the wild. J Zool. 2016;298:257–65.

    Article  Google Scholar 

  45. Fehlmann G, O’Riain MJ, Hopkins PW, O’Sullivan J, Holton MD, Shepard EL, King AJ. Identification of behaviours from accelerometer data in a wild social primate. Anim Biotelemet. 2017;5:1–11.

  46. Norris CE. Testing the efficacy of unsupervised machine learning techniques to infer shark behaviour from accelerometry data. Doctoral dissertation: Murdoch University; 2019.

  47. Wang G. Machine learning for inferring animal behaviour from location and movement data. Ecol Inform. 2019;49:69–76.

    Article  Google Scholar 

  48. Chambers RD, Yoder NC, Carson AB, Junge C, Allen DE, Prescott LM, Bradley S, Wymore G, Lloyd K, Lyle S. Deep learning classification of canine behaviour using a single collar-mounted accelerometer: Real-world validation. Animals. 2021;11:1549.

    Article  PubMed  PubMed Central  Google Scholar 

  49. Clark RW. Diet of the timber rattlesnake, Crotalus horridus. J Herpetol. 2002;36:494–9.

    Article  Google Scholar 

  50. Rothe-Groleau C, Fawcett JD. Diet of a population of prairie rattlesnakes (Crotalus viridis) in Kansas. J N Am Herpetol; 2022;1.

  51. MacArtney JM. Diet of the northern pacific rattlesnake, Crotalus viridis oreganus, in British Columbia. Herpetologica. 1989;1989:299–304.

  52. Painter MS, Blanco JA, Malkemper EP, Anderson C, Sweeney DC, Hewgley CW, Červený J, Hart V, Topinka V, Belotti E, Burda H. Use of bio-loggers to characterize red fox behaviour with implications for studies of magnetic alignment responses in free-roaming animals. Anim Biotelemet. 2016;4:1–19.

  53. Kardong KV, Bels VL. Rattlesnake strike behaviour: kinematics. J Exp Biol. 1998;201:837–50.

    Article  PubMed  Google Scholar 

  54. Campbell HA, Gao L, Bidder OR, 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;216:4501–6.

    PubMed  Google Scholar 

  55. Pagano AM, Rode KD, Cutting A, Owen MA, Jensen S, Ware JV, Robbins CT, Durner GM, Atwood TC, Obbard ME, Middel KR. Using tri-axial accelerometers to identify wild polar bear behaviours. Endanger Species Res. 2017;32:19–33.

    Article  Google Scholar 

  56. Patterson A, Gilchrist HG, Chivers L, Hatch S, Elliott K. A comparison of techniques for classifying behaviour from accelerometers for two species of seabird. Ecol Evol. 2019;9:3030–45.

    Article  PubMed  PubMed Central  Google Scholar 

  57. Dickinson ER, Twining JP, Wilson R, Stephens PA, Westander J, Marks N, Scantlebury DM. Limitations of using surrogates for behaviour classification of accelerometer data: refining methods using random forest models in Caprids. Mov Ecol. 2021;9:1–14.

    Article  Google Scholar 

  58. Whitney NM, White CF, Smith BJ, Cherkiss MS, Mazzotti FJ, Hart KM. Accelerometry to study fine-scale activity of invasive Burmese pythons (Python bivittatus) in the wild. Anim Biotelem. 2021;9:1–3.

    Article  Google Scholar 

  59. Cundall DA, Greene HW. Feeding in snakes. In Schwenk K, edior. Feeding: form, function, and evolution in tetrapod vertebrates. London: Academic Press, 2000.

  60. Krawczyk B. Learning from imbalanced data: open challenges and future directions. Prog Artif. 2016;5:221–32.

    Article  Google Scholar 

  61. Suthaharan S, Suthaharan S. Support vector machine. Machine learning models and algorithms for big data classification: thinking with examples for effective learning. Integr Ser Inf Syst 2016;207–35.

  62. Charbuty B, Abdulazeez A. Classification based on decision tree algorithm for machine learning. J Appl Sci Technol Trends. 2021;2:20–8.

    Article  Google Scholar 

  63. Segal MR. Machine learning benchmarks and random forest regression. New York: Center for Bioinformatics and Molecular Biostatistics; 2004.

  64. Tipton AF, Vázquez Diosdado JA, DeSantis DL. Scale-dependent effects of roadways on the movement behavior of a large-bodied pit viper (Crotalus horridus). Front Ecol Evol. 2023;11:68.

    Article  Google Scholar 

  65. Whitford MD, Freymiller GA, Higham TE, Clark RW. The effects of temperature on the kinematics of rattlesnake predatory strikes in both captive and field environments. IOB. 2020;2(1):obaa025.

    CAS  Google Scholar 

Download references


We thank Matthew Bazzi, Carlo Dizon, Taylor Kallmann, Joshua Mayo, Mariana Padilla, Rachel Restrepo, Lea Sanders, Vanessa Tyler, and Talon Weck for assistance in lab trials and video scoring. We thank Carlo Catoni and Technosmart for invaluable assistance with designing and troubleshooting accelerometers used in this study. We thank Dr. Dylan Maag for aid with collecting a subset of our Crotalus viridis specimens. Finally, we thank one anonymous reviewer, Dr. Emily Taylor, and Dr. Brian Todd for taking the necessary time and effort to review the manuscript. We sincerely appreciate all of your valuable comments and suggestions, which helped us in improving the quality of the manuscript.


Funding was provided by the National Science Foundation (IOS 1856404) and Georgia College and State University internal sources (Department of Biological and Environmental Sciences, College of Arts and Sciences).

Author information

Authors and Affiliations



RJH, DLD, and RWC conceived and designed the study. RJH, DLD, JLH, AFT, MT and RWC collected the data. RJH, TM, and JS analyzed the data. RJH wrote the original draft of the manuscript. RWC, DLD, RJH, TEH, and JS provided supervision and mentorship. All authors critically contributed to the drafts and gave final approval for publication. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Ryan J. Hanscom.

Ethics declarations

Ethics approval and consent to participate

All procedures on vertebrates involved in this study were approved by the San Diego State University Institutional Animal Care and Use Committee (22-07-008C) and the Georgia College and State University Institutional Animal Care and Use Committee (2020-D).

Consent for publication

Not applicable.

Competing interests

The authors declare that they have no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary Information

Additional file 1. 

Model results for species-specific algoritims at varying window sizes.

Additional file 2. 

Cross-species model performance statistics.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated in a credit line to the data.

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Hanscom, R.J., DeSantis, D.L., Hill, J.L. et al. How to study a predator that only eats a few meals a year: high-frequency accelerometry to quantify feeding behaviours of rattlesnakes (Crotalus spp.). Anim Biotelemetry 11, 20 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI:


  • Accelerometry
  • Animal behaviour
  • Foraging ecology
  • Crotalus oreganus
  • Crotalus horridus
  • Crotalus viridis
  • Feeding