An “orientation sphere” visualization for examining animal head movements

Abstract Animal behavior is elicited, in part, in response to external conditions, but understanding how animals perceive the environment and make the decisions that bring about these behavioral responses is challenging. Animal heads often move during specific behaviors and, additionally, typically have sensory systems (notably vision, smell, and hearing) sampling in defined arcs (normally to the front of their heads). As such, head‐mounted electronic sensors consisting of accelerometers and magnetometers, which can be used to determine the movement and directionality of animal heads (where head “movement” is defined here as changes in heading [azimuth] and/or pitch [elevation angle]), can potentially provide information both on behaviors in general and also clarify which parts of the environment the animals might be prioritizing (“environmental framing”). We propose a new approach to visualize the data of such head‐mounted tags that combines the instantaneous outputs of head heading and pitch in a single intuitive spherical plot. This sphere has magnetic heading denoted by “longitude” position and head pitch by “latitude” on this “orientation sphere” (O‐sphere). We construct the O‐sphere for the head rotations of a number of vertebrates with contrasting body shape and ecology (oryx, sheep, tortoises, and turtles), illustrating various behaviors, including foraging, walking, and environmental scanning. We also propose correcting head orientations for body orientations to highlight specific heading‐independent head rotation, and propose the derivation of O‐sphere‐metrics, such as angular speed across the sphere. This should help identify the functions of various head behaviors. Visualizations of the O‐sphere provide an intuitive representation of animal behavior manifest via head orientation and rotation. This has ramifications for quantifying and understanding behaviors ranging from navigation through vigilance to feeding and, when used in tandem with body movement, should provide an important link between perception of the environment and response to it in free‐ranging animals.


| INTRODUC TI ON
Animal behavior may be viewed as a response to both internal state and environmental conditions, ultimately leading to enhanced lifetime reproductive success (cf. Nathan et al., 2008). Studies of behavior are many (Huntingford, 2012;Sih et al., 2015), and there are also extensive studies on how animals behave and move according to environmental circumstances (Lea, 2015;Snell-Rood, 2013;Steinmeyer, Schielzeth, Mueller, & Kempenaers, 2010). However, the process by which information is perceived from the environment by an animal is less clear. Despite the rich and varied literature on animal sensory systems (Ali, 2013;Dusenbery, 1992;Fay & Tavolga, 2012;Martin, 2017), there is little research on exactly how free-living animals orientate their sensory systems, located primarily on the head, toward areas in the environment of interest and, as a consequence, understanding the cues used by animals in navigation continues to be challenging (Doherty & Driscoll, 2018). However, the increasing use of head-and eye-tracking technology in captivity using head-mounted equipment (e.g., Williams, Mills, & Guo, 2011) means that developments in technology should now enable us to examine the head movements of wild animals. Indeed, despite reservations that such systems are likely to be suitable for wild animals moving uninhibited in their natural environment (Duchowski, 2017), Kano, Walker, Sasaki, and Biro (2018) have already demonstrated the use of a head-tracking system on free-flying homing pigeons, while Kane and Zamani (2014) used head-mounted cameras to investigate how trained falcons hunt prey using visual motion cues.
It therefore seems clear that similar systems will be used on wild animals soon (Kano, 2019). This will be made more likely by the increasing number of studies using head-mounted technology of any type on wild animals, including head-mounted accelerometers and magnetometers to quantify foraging success (e.g., Kokubun, Kim, Shin, Naito, & Takahashi, 2011;Watanabe & Takahashi, 2013;Ydesen et al., 2014). Attempts to quantify how animals might perceive their environment seems to have begun with human-based approaches, most notably eye-tracking technology (Duchowski, 2007; cf. Williams et al., 2011). The sophistication of such methods is, however, particularly challenging for wild animals, so simpler systems based on head, rather than eye, orientation Wilson, Norman, et al., 2015) have proven useful on captive, but free-flying, birds (Kane & Zamani, 2014;Kano et al., 2018). Indeed, these systems have revealed important details about how homing pigeons allocate their attention to the environment.
Although this technology does not specifically allow researchers to pinpoint exactly where the eyes might be looking, because eyes can move relative to the head within their sockets, it does show how the subject "frames" the environment (Wilson, Norman, et al., 2015).
The extent to which the environment is framed should encompass everything perceived by the visual system, although certain parts will receive more attention (due, e.g., to fovea). The orientation of the head thus determines which part of the environment is framed and therefore which part provides information from a visual perspective (Wilson, Norman, et al., 2015). The environmental framing approach has particular value for wild animals because many species use multiple, complex sensory systems with a weighting that does not necessarily reflect the high visual bias apparent in humans. In this regard, many vertebrates have sensory systems mounted on the head with a preponderance orientated frontally. However, this is less important that appreciating the arcs over which vertebrate sensory systems operate, which may equally be laterally (cf. Martin, 2017) and workers need to be cognisant of this in their interpretation of head orientation. As such though, determination of head orientation using the "environmental framing" concept should prove particularly valuable to the study of awareness in free-ranging animals. Beyond this, because head movement is symptomatic of behaviors not involved with perception of the environment, such as grazing in ungulates (Ensing et al., 2014) or displays in birds (Tinbergen & Moynihan, 1952), quantification of head movement can help define behaviors that might otherwise be difficult to observe or even resolve using body-mounted tags alone (Wilson et al., 2017).
A particular difficulty in the use of head orientation-determining systems (HODS), however, is that the data that are collected represent the orientation of the head in more than one dimension.
Specifically, the data are made up of head heading (or azimuth) in one plane and head pitch (also called elevation or dip angle) in another, perpendicular to this. Head roll (bank angle) is a third plane, although it generally changes gaze orientation minimally and is less likely to be more important than heading and pitch in environmental framing (but see Kano et al., 2018). We propose that these metrics can be conveniently examined in a single spherical visualization that important link between perception of the environment and response to it in freeranging animals.

K E Y W O R D S
animal behaviour, environment framing, head movement, head pitch, head yaw, orientation sphere we term the "orientation sphere" (O-sphere) (cf. similar representations for visual field data (Martin, 2017)). Here, if we imagine that the spherical plot is represented by the Earth, the head heading is represented by the longitude while the head pitch is represented by the latitude. Thus, any head orientation is represented on the sphere by a single point that can be defined in terms of latitude and longitude (head pitch and head heading) and changes in head orientation will be represented by a trajectory across the sphere. In this single visualization, movement of the head can be inspected in a way that explicitly links both pitch and heading together better than as independent visualizations. This same visualization can also be used to show the orientations of animal bodies, which can be used as a stand-alone method to aid in identification of behavior or to allow correction for the body so that head orientation can be examined relative to the body.
We present the methodology behind the building and interpretation of the O-sphere and propose metrics that can be derived from these data to quantify the head movements in animals, thereby helping identify head-focussed behaviors and quantify behaviors involved in environmental framing. As part of this, we present a modified methodology, developed from a recently published methodology, to identify turns in movement paths (Potts et al., 2018). We illustrate our concepts using data from headand body-mounted systems deployed on domestic sheep (Ovis aries), Arabian oryx (Oryx leucoryx), loggerhead turtles (Caretta caretta) undergoing rehabilitation, and wild Aldabra giant tortoises (Aldabrachelys gigantean).

| The head orientation-determining system
The head orientation-determining system (HODS) is based on the "Daily Diary" (DD) tag presented by Wilson, Shepard, and Liebsch (2008), consisting primarily of a logging unit linked to a tri-axial (orthogonal axes) accelerometer and, similarly, tri-axial magnetometer (although a more sophisticated version incorporating gyros for very fast-moving animals (Johnson & Tyack, 2003) can also be used.
These tags are typically used to record at frequencies of 10 Hz or greater. We assume that the tag is placed on the head so that the three acceleration axes represent the longitudinal (surge) axis, the dorso-ventral (heave) axis, and the lateral (sway) axis of the head (see below). Depending on the axis/axes about which the tag is rotated, rotation of the tag (head) produces a change in the pitch (also called elevation or dip) angle and/or a change in the roll (also called lateral inclination) angle.
In the absence of roll, tag pitch angle (and by extraction, head pitch-see below) can be determined by taking a running mean of the longitudinal (surge) acceleration using a window of around 2 s  and then taking the sine of the smoothed g-values (1 g = 9.81 m.s -2 ). Note that the relationship between the g-value of acceleration and tag angle follows a sine wave. Therefore, the most accurate determinations of tag pitch angle for values around the horizontal (−45° to 45°) are derived by using the longitudinal acceleration axis (because this is when the rate of change of g-value is greatest with respect to angular change). When the tag rolls however, calculation of its pitch is given by where surge, heave, and sway are the acceleration values for those axes. There are packages in R, including those of animalTrack (Farrell, Fuiman, & Farrell, 2013), and software including DDMT (Wildbyte Technologies, http://wildb ytete chnol ogies.com/softw are.html) that calculate both pitch and roll. Note that DDMT smooths the acceleration channels to determine pitch and roll parameters for levelling the magnetometer data (see below). This allows the algorithm to remove any transients that might be present and, at the same time, better represents more static values with the acceleration vector magnitude sqrt (Acc surge 2 + Acc sway 2 + Acc heave 2 ) being closer to 1 g when measuring the device orientation compared to gravity. We note though, when animals are turning so rapidly that they are subject to substantial centripetal acceleration, that the acceleration vector magnitude may deviate appreciably from 1 g making calculations of pitch and roll invalid, with knock-on consequences for derivation of heading (see below).
Tag heading is more complex. Its calculation uses all tri-axial data from the magnetometers and the accelerometers within the HODS.
The heading, pitch, and roll calculation is based on the well-known "tilt-compensated compass" algorithm. After correcting the magnetometry data for any hard/soft iron offsets and distortions, the accelerometer-derived pitch axis and the roll axis are used to level the magnetometer data to the ground plane. Heading can then be calculated by using the magnetometer axes in the ground plane. Extensive detail on the process is provided by numerous authors including Bidder et al., (2015) and Koo, Sung, and Lee, (2009), and there is an R package (TrackReconstruction; Battaile, 2015) that undertakes this and a detailed code provided by Liu, Battaile, Trites, and Zidek (2015). The full process of disentangling heading from pitch and roll replies on spherical trigonometry and is detailed, for example, in Benhamou (2018).

| Mounting the head orientationdetermining system
Ideally, the HODS should be set at the exact center of rotation of the mobile (head or body; see later) so that rotations do not produce translation. However, this is obviously impractical so workers should at least mount the unit on the head in a roughly central position, but so that the three orthogonal axes for both tri-axial magnetometers and tri-axial accelerometers align with the main orientation of the skull. Thus, one axis aligns with the longitudinal axis of the head, one with the dorso-ventral axis of the head, and one with the lateral axis.
For this, the tag can be placed on the top or the back of the head (e.g., Pitch = atan surge heave 2 + sway 2 0.5 Figure 1). In our work, we used glue to mount the HODS to the dorsal surface of the head of the oryx, sheep, and turtle and Velcro for the tortoise and used either glue or a collar to attach tags to animals' bodies (Supporting information S1). Glue only allows HODS to be retained until animal fur is molted and thus, in the event that tagged animals were not recaptured, would only maintain devices on animal heads for a maximum period of one year although this would normally not exceed a few weeks.

| Construction of the O-sphere
The heading data are represented by a circular plot spanning 0-360° and this is enhanced by a further circular plot running perpendicularly to show the head pitch (in degrees) corresponding to each head heading (Supporting information S2) ( Figure 2). Since animals rarely have head pitches that are less than −90° (where e.g., the head looks back along and underneath the body) and exceed 90° (where the head is inverted to look along the top of the body), the O-sphere plot is an intuitive 3-dimensional plot that highlights head orientation with respect to heading and pitch.
In addition, because the data on the O-sphere can be subject to occlusion and over-plotting, extended time periods can be represented on the O-sphere using a "Dubai" plot (Wilson et al., 2016).

| Identifying turning points in head orientation
Within environmental framing, the orientation of the head directs sensory systems to derive input from a particular part of the environment and two head behaviors have been recognized as important in this for humans; "scanning," and "object fixation" (Wilson, Norman, et al., 2015). Scanning involves head rotation in the pitch and/or yaw axes while fixation results in no head movement for a defined period (Blascheck et al., 2014), during which information is gained from an object or area of interest: The points at which scanning changes direction or becomes a fixation can be considered to be turning points on the O-sphere.
In order to identify head-based scanning and turning points (rather than overall [head and body] movements), both body and head orientation should be derived using compass tilt-compensated systems (based on mathematical expressions relating yaw and pitch to the orthodromic arc size (Benhamou, 2018)

| Head orientation with a static animal body
The O-sphere visualizations provided an intuitive representation of head orientation, which is especially apparent when the animal is static but the head active.

| Head orientation with a dynamic animal body
Movement of the head is not the only mechanism by which an animal can orientate its sensory system to frame the environment because the body also plays a role. In our example animals, the O-spheres of the heads of moving animals typically had greater variability than those of stationary animals, and this is shown by comparison of feeding between the Aldabra tortoise and the loggerhead turtle ( Figures 3 and 4). Both species had highly active heads, but the dynamism of the turtle head O-sphere was partially due to the movement of the body as well as that of the head, with the ultimate head orientation effectively depending on the body orientation and the head orientation with respect to the body. Accordingly, in the turtle example, the orientation of the head clearly showed greater range of pitch than the body (Figure 4).

| Turn points in the head movement
We noted that head O-spheres manifest three primary "behaviors." The first of these was "fixations" (Blascheck et  tile range (IQR) 6.1) for feeding tortoises and 4.6°/s (IQR 11.9) for feeding turtles). Finally, "scans" occurred, where the head moved continuously, and relatively slowly (e.g., median angular velocities were ca. 5.2°/s (IQR 7.1) for walking sheep) across the sphere.
These movements typically occurred either horizontally or vertically and could, for example, oscillate from one side to the other.
The change-point approach described above readily highlighted patterns of head movement, both for animal activity in general ( Figure 6, cf. Figure 5) and for specific stylized movements such as head movement during walking (see later).
The interplay of the body-with respect to the head directionality in O-sphere plots is useful in cases where heading is specifically relevant (grazing being one- Figure 3) but superfluous and liable to hide patterns in others. This is because variation in animal orientation with respect to North may superimpose patterns indicative of behavior as the animal rotates. To remove this influence, where recorded, the body heading (derived using the tilt-compensated compass) can be simply subtracted from the head heading to give head yaw on the "body relative O-sphere." This negates animal body directionality and makes particular patterns from stylized behaviors, such as walking, more apparent (Figure 7).

| D ISCUSS I ON
Head pitch and heading (including changes in these two parameters) highlights many behaviors clearly and we suggest that the O-sphere helps in visualization and interpretation, most particularly because it integrates heading/yaw with pitch. For the convenience F I G U R E 3 Body and head orientation of an Aldabra tortoise over 20 min derived using carapace-and head-mounted tags (corrected for a "pitch-up" angled carapace-mounted tag to read 0° when the animal was level but showing slight "pitch-down" attitude due to the animal feeding on an incline). (a) shows a time series of tri-axial accelerometer (Acc) and magnetometer (Mag) data while (b) shows the same data resolved into pitch and yaw and plotted onto O-spheres. (c) shows planar plots of the O-sphere to allocate pitch and heading more easily as separate entities. To aid visualization, points are colored by pitch, with warmer colors increasingly deviating from the horizontal at 0°. Note that the body moves little while the head covers a pitch range in excess of 90°, predominantly directed down, and a heading difference of about 160° of this work, behaviors may be grouped into; (i) "general behaviors," which range from extended static positions during e.g. sleep (with O-sphere Dubai plots manifesting single, high bar histograms; cf. Figure 5) to repetitive movement across the O-sphere e.g. as occurs in feeding (apparent in our tortoise study, Figure 3e) or during stylized displays (e.g., Hester, Gordon, Baillie, & Tappin, 1999;Périquet et al., 2010), which may be particularly conventionalized in birds (Frith, 1992) and (ii) behavior associated with environmental framing, manifesting scanning and fixations (cf. Figure 5). As with stylized displays, such environmental framing is liable to be shortterm, resulting in transitions across the O-sphere interspaced with fixations ( Figure 5) (Wilson, Norman, et al., 2015). These can be seen and inspected on the O-sphere but, most importantly, the O-sphere specifically provides a platform from which metrics of particular behaviors can be defined. These include, but are not limited to, rates of change of pitch/heading across the O-sphere (cf. Figure 7), the F I G U R E 4 O-sphere visualizations of a foraging loggerhead turtle over 20 min during a series of feeding experiments in circular tanks (ranging from 2 to 6 m in diameter with a water depth of 0.95 m). (a) shows all data for both the body (tag attached to the carapace) and the head with (b) showing planer views of the same data to highlight pitch and heading variation. (c) shows the detail for each of four events where the animal was consuming green crabs (Carcinus maenas) located at random locations and presented at 5-min intervals. To aid visualization, line is colored by pitch, with warmer colors increasingly deviating from the horizontal at 0°. Note how body pitch is constrained compared to the head that was particularly pitched down to access the crab on the tank bottom F I G U R E 5 Two O-spheres depicting the same ca. 3 min of Arabian oryx head behavior. The left-hand sphere clearly shows that the animal rotated through 360° (circles of points running between N-W-E in the diagram) but that more time was spent facing particular headings. The right-hand sphere shows the same data in a "Dubai" plot, which resolves superimposed data into histograms that make clear the orientations where the head position was fixed for extended periods  (Figures 5 and 7), the temporal sequence of trajectories across the O-sphere (Figure 7), the co-ordinates of turn points (Figure 6), and the length of stationary periods on the O-sphere ( Figure 5). Such an approach provides important discriminatory metrics to machine-learning methods (e.g., Random Forests (Breiman, 2001)), but also to Boolean methods for identifying behaviors  and should increase the number of behaviors that can be reliably isolated using data from animal-attached tags. Of particular value is the ability to define stylized head movements precisely. These include for example, feeding (Hester et al., 1999), vigilance (Périquet et al., 2010), acquisition of social information (Colagross & Cockburn, 1993) and navigation (Caduff & Timpf, 2008). At the same time, examination of the O-sphere should allow workers to have more intuitive contact with the data than might occur with machine-learning alone.

| Varying the length of time of the O-sphere representation
The value of the O-sphere as a visualization tool depends critically on the length of time covered in any particular visualization.
Shorter periods clearly show transient head behavior well, but this becomes less apparent with increasing time intervals. The specific lengths of time to achieve particular objectives will also depend on the study animal (tortoises obviously move their heads slower than mammals). Since the length of fixations on the O-sphere is likely to indicate whether animals are inspecting sites of interest within the environment (cf. Wilson, Norman, et al., 2015), resting or for example, ruminating (something that is considered particularly problematic to identify using tag technology (di Virgilio, Morales, Lambertucci, ), we suggest that workers separate "active" from "inactive" periods (Watanabe, Izawa, Kato, Ropert-Coudert, & Naito, 2005). This can be done effectively if an additional body-mounted tag records acceleration (e.g., Wilson et al., 2008) so that for example, dynamic body acceleration (e.g., Qasem et al., 2012) can code for activity (Brown, Kays, Wikelski, Wilson, & Klimley, 2013).

| Body versus head movement for the O-sphere
Any activity that changes the orientation of the body will tend to change that of the head although the head is usually stabilized to an appreciable degree (Pozzo, Berthoz, & Lefort, 1990). Importantly though, simple examination of head orientation using the O-sphere will tend to have greater lability and translation of points across the O-sphere due to the signal being a composite of the head and the body (cf. Figures 3 and 4-but see stabilization of the head in birds (Frost, 2009) and Kano et al., 2018). In addition, moving animals normally have particular reason to inspect the environment more thoroughly than stationary ones (which may mean more shortterm fixations and higher transition rates). This behavior helps them move safely through the environment, both with respect to the bio-  Figure 6a). Finally, the angular speed in the yaw axis is color-coded with colder colors showing slower speeds (each sphere color codes within maximum limits for the period shown

| The O-sphere and environmental context
Perhaps the most powerful use of the O-sphere becomes apparent when it is placed into environmental context. In a general sense, feeding behavior in some species relates to the head dealing with food lower than the body (Figures 3 and 4), but modern animalattached technology can use GPS systems or GPS-enabled deadreckoning systems to give remarkable detail on an animal's position in geo-referenced space (Bidder et al., 2015;Tomkiewicz, Fuller, Kie, & Bates, 2010). At a coarse level, this approach can provide O-sphere metrics that can then be allocated to environment types (cf. Figure 6), but at a more refined level it may be possible to de-  (Schneider, Call, & Liebal, 2010), could be allocated to the specific geographical areas where the behavior was displayed.
There are undoubted difficulties with interpretation of HODS data, and the O-sphere is just one convenient and promising approach. However, the potential in such systems for informing us about the features of the environment that might be affecting animal behavior makes the subject area exciting. A particular example might be allocating fixations to specific points within the environment and then determining how the finely resolved animal track (e.g., Bidder et al., 2015), or other behavior, has changed (or not), as a result of the information gathered during such fixations.
Indeed, the ability to trace the specific element of the environment that has driven the manifestation of a particular behavior is the next exciting step in linking behavior and energy expenditure to circumstance.

| CON CLUS IONS
Head-mounted tags from which head pitch and heading can be deduced, produce much complex information which codes for the way the animal frames the environment and behaves. The O-sphere is an intuitive plot that distils out, and links, head heading and pitch in one 3D plot, which can be extended to 4 dimensions if time is introduced as a radial axis, and 5 dimensions if the trajectory across the O-sphere is color-coded for angular speed. This enables researchers to have, at once, an impression of changes in behavior while providing metrics that can be used in conventional methods for identifying them. The specific strength of O-spheres in highlighting environmental framing behaviors as well as other behavior types means that we may be nearing a time when we can specifically link environmental context to behavioral response.

ACK N OWLED G M ENTS
This study was financially supported by the Deanship of Scientific Analysis of the data. All authors contributed critically to the development of, and writing, the manuscript.

DATA AVA I L A B I L I T Y S TAT E M E N T
All data will be archived in Figshare under DOI; 10.6084/ m9.figshare.11903178.