Testosterone amplifies the negative valence of an agonistic gestural display by exploiting receiver perceptual bias

Many animals communicate by performing elaborate displays that are incredibly extravagant and wildly bizarre. So, how do these displays evolve? One idea is that innate sensory biases arbitrarily favour the emergence of certain display traits over others, leading to the design of an unusual display. Here, we study how physiological factors associated with signal production influence this process, a topic that has received almost no attention. We focus on a tropical frog, whose males compete for access to females by performing an elaborate waving display. Our results show that sex hormones like testosterone regulate specific display gestures that exploit a highly conserved perceptual system, evolved originally to detect ‘dangerous' stimuli in the environment. Accordingly, testosterone makes certain gestures likely to appear more perilous to rivals during combat. This suggests that hormone action can interact with effects of sensory bias to create an evolutionary optimum that guides how display exaggeration unfolds.


Introduction
Animals often court mates and compete with rivals by producing elaborate displays that showcase colourful ornaments, spectacular sounds and extraordinary body movements. Biologists have long marvelled at such behaviour, often studying it to uncover the core principles that describe how selection generates phenotypic innovations and diversity. Some of the most provocative work on this topic centres on the notion of receiver perceptual bias and its putative role in shaping the design of elaborate socio-sexual displays [1,2]. Auditory systems provide an intuitive hypothetical example of how perceptual bias might work in this capacity. If a species's auditory system is tuned to detect certain frequencies of sound better than others, then the species should be more likely to evolve acoustic signals that emphasize these 'preferred' frequencies [3]. In some cases, perceptual biases emerge adaptively in response to natural selection for sensory processes that are unrelated to sexual communication, such as those that are used to find food or avoid predators. These biases can powerfully select for display features that stimulate existing perceptual channels and exploit the neural processes underlying signal recognition and classification, a model of trait evolution known as 'sensory exploitation' [4]. Despite the clear importance of perceptual bias models to our understanding of signal design, several key questions remain unclear. One might expect, for example, that perceptual biases influence display design by working with mechanisms of signal production, given that physiology can play an outsized role in guiding and/or restricting the adaptation and diversification of elaborate displays [5][6][7]. However, studies rarely (if ever) address this possibility.
Here, we study this issue by investigating relationships between perceptual biases that probably influence display design and hormone systems that regulate display production. The putative connection between these two phenomena is intuitive. Hormones are well-known regulators of elaborate display behaviour across vertebrates [8]. They act throughout the brain and body to coordinate motivational and performance-related aspects of display, ensuring that individuals communicate in not only the right time and place, but also the right way [9,10]. It is therefore possible that pre-existing perceptual biases select for systems of hormonal regulation that mediate display production to enhance the exploitation of receiver sensory and/or cognitive biases. If so, then this physiological push toward innate sensory and/or cognitive biases might create a potent evolutionary optimum that is defined by both predispositions to perceive certain types of display behaviour and physiological mechanisms that underlie its production.
We therefore examine how androgenic hormones like testosterone (T) regulate the performance of elaborate gestural displays, and whether such regulation occurs in the direction of perceptual bias. T regulates many facets of male sociosexual behaviour, including displays that help males negotiate competition and courtship [8]. Several studies show that these effects are often rooted in motor control, whereby T coordinates how neural and muscular systems generate movement patterns that deviate from a species' 'normal' performance landscape [11,12]. Our work suggests that these effects create a foundation for sexual selection to drive the adaptive evolution of reflexes, gestures and/or vocalizations that otherwise make up a reproductive display [13]. With the context of perceptual bias in mind, one might expect that sensory and/or cognitive predispositions influence how T induces these effects on behavioural output. If so, then T's impact on behaviour should recursively fuel the ability of perceptual bias to shape display design.
Bornean rock frogs (Staurois parvus) provide an opportunity to test this idea. To breed, males aggregate in large groups near the base of small waterfalls in the Bornean rainforest. The abiotic noise from water splashing on the rocks is loud, and thus males actively compete among each other for access to mates by calling and by performing an elaborate gesture called the foot-flag (figure 1a; electronic supplementary material, movie S1). To perform the behaviour, males fully extend their hindlimb above their head and then slowly arch the limb downward to the substrate along the dorsal-ventral axis. During this latter movement, males spread open their foot to show conspicuous white webbing. The behaviour ends when males retract their leg back to the body (table 1). Field studies suggest that this unusual display has little function outside of male-male competition [14][15][16], with no clear evidence that it is involved in male-female communication, for example. Accordingly, it is thought that footflagging evolved after vocalizations in frogs like S. parvus that engage in intense intrasexual competition in extremely noisy environments [16,17]. Others have added further to this idea by speculating that the foot-flag's design is fundamentally influenced by innate perceptual biases of the anuran visual system [16,18]. Of particular importance are highly conserved 'feature analysers' that help individuals detect, recognize and classify objects in the environment based on their shape and movement [19][20][21][22]. If, for example, an object moves parallel to its own long axis (figure 1b) in front of a frog, then the frog's brain classifies that object as a potential prey item and approaches it [23]. Such objects are often referred to as 'worm' stimuli. By contrast, if an object moves perpendicular to its long axis (figure 1b) in front of a frog, then the frog's brain classifies that object as a potential threat [24,25]. Such objects are often called 'antiworm' stimuli, and they typically result in freezing and/or avoidance behaviour [24]. Thus, feature analysers work primarily by perceiving the direction an object moves relative to its shape [23,24]. In a foot-flag   (table 1). In coloured boxes above ii, iii and iv, we show how foot-flagging exploits feature analyser systems. Blue box (bottom) denotes different effective stimuli that underlie how conserved anuran feature analysers detect prey and environmental threats [19][20][21][22]. Orange box (middle) describes the conserved behavioural responses elicited by effective stimuli [15], while green box (top) describes how these behavioural responses are exploited for socio-sexual communication through foot-flagging ( proposed by [16,18] display, the signaller moves a long, skinny rectangular object (its leg) either parallel to its long axis or perpendicular to its long axis (figure 1b); thus, it is proposed that foot-flagging displays might exploit a receiver's feature analyser system [16,18]. Indeed, when a male initiates his display by extending his leg outward, the frog moves his hindlimb parallel to the limb's long axis in a manner that closely mimics a 'worm' stimulus. Moreover, when the male arches his leg downward to the substrate, he moves the appendage perpendicular to its long axis in a manner that mimics an 'antiworm' stimulus. Behavioural studies suggest that male receivers perceive the foot-flag itself as a threat, which in turn elicits a behavioural response that is similar to what we see in frogs presented with 'antiworm' stimuli (e.g. freezing, avoidance, behavioural suppression) [15], (N.K.A. & D.P. 2021, personal observations). By contrast, when a male receiver hears a call from another male, the receiver shows the opposite effect (e.g. arousal and behavioural activity) [26]. Anuran feature analysers therefore likely bias the recognition of select footflag motions as more threatening or dangerous stimuli, an effect that surely helps foster the evolution of this behaviour as a component of an agonistic display [15].
Here, we examine whether T action modulates footflagging performance by enhancing movements that exploit the perceptual biases of the male receivers' feature analysers. We know that exogenously administered T can increase the frequency of foot-flag behaviour, without affecting other components of the display, like calling [27,28]. Moreover, the thigh muscles that actuate the foot-flag are highly sensitive to androgenic hormone, compared to non-foot-flagging relatives [5,27]. Thus, we investigate how T regulates the footflag's kinematic programme, such as the display's shape as it is traced in the air above the frog and the foot's speed as it makes this trace. We then computationally model the anuran feature analyser system to assess whether T's effect on the foot-flag is sufficient to underlie signal discrimination by male receivers. Because the foot-flag is known to strongly mediate male-male competition for access to mates, we predict that T amplifies movements that resemble 'antiworm' stimuli. Such an effect would likely increase the negative valence of the display by prompting the classification of its movements as threatening. Likewise, we predict that T would have little to no effect on the leg movements that are similar to 'worm' stimuli. This is because 'worm' cues elicit approach behaviour, which may be less advantageous to the signaller in the context of male-male competition. Finally, we predict that T alters the movement programme of the footflag in a manner that facilitates receiver discrimination. If T injection amplifies leg movements that boost the foot-flag's negative valence, then receivers should be able to tell the difference between these displays and those that are produced without the influence of high T.

(a) Testosterone and foot-flag shape
We first aimed to establish how T influences foot-flag kinematics by collecting high-speed videos of displaying males during staged competitive bouts (electronic supplementary material, movies S2 and S3). Each focal individual received an injection of either T or saline (controls). To analyse the behaviour, we ran an elliptical Fourier analysis (EFA) on the two-dimensional spatial coordinates (x, y values) of each focal male's foot as it was moved through the air above the back. We then computed (i) an average display shape for each treatment group and (ii) a principal component analysis (PCA) on the matrix of EFA coefficients. This latter step allowed us to create variables of discrete shape information from the different principal components (PCs), an especially powerful approach to visualizing and assessing how T can (or cannot) impact the movement patterns of the foot-flag.
Overall, we found a significant effect of T on display shape (figure 2a). This result is clearest when we consider the interaction among all PC shape variables, with T mediating the production of a rounder foot-flag that shows increased perpendicular movement (Wilks λ = 0.119; F 1,13 = 5.57; p = 0.025; figure 2a). Subsequent comparisons of individual PCs between treatment groups showed a similar effect. T, for instance, was associated with significantly greater PC1 values (t 12.93 = −3.589; p = 0.003), which accounts for 48.4% of our data's shape variance. PC1 is explained by display circularity and perpendicular movement produced along with the frog's dorsal-ventral axis (figure 2b). Importantly, this particular phase of the foot-flag closely resembles 'antiworm' movements (when an object moves perpendicular to its long axis) that stimulate the feature analysers responsible for recognizing and classifying environmental threats. Meanwhile, all other PCs were statistically indistinguishable between treatment groups (electronic supplementary material, table S1). These data are therefore consistent with the idea that T has less effect on movements that might resemble 'worm' stimuli. In this way, T appears to selectively influence foot-flag components that likely stimulate 'antiworm' feature analysers, but not 'worm' feature analysers. (iii) arch The knee is fully extended, and the leg begins to move downwards and backwards in an arc motion. Webbings are visible and displayed in different directions.
(iv) pull-in The arch is fully completed, and the knee begins to retract inwards.
(v) lower The knee and leg are fully pulled-in, tight to the body, and the leg and foot begin to lower towards the ground.
royalsocietypublishing.org/journal/rspb Proc. R. Soc. B 288: 20211848 To further corroborate these findings, we compared the path length of the hindlimb (mm of leg movement) during 'antiworm-like' and 'worm-like' components of the foot-flag (figure 2c-e; electronic supplementary material, table S2). We found that T significantly increased the path length of foot movement during the display's arch component (figure 2d; t = −2.904; d.f. = 12.80; p = 0.013), which corresponds to 'antiworm' movement. By contrast, T had no effect on the path length of foot movement during the display's extended-knee component (t = −1.579; d.f. = 11.26; p = 0.142; figure 2c) or pull-in component (t = −0.892; d.f. = 11.10; p = 0.391; figure 2e). Both of these variables differ among individuals during competitive encounters in the wild [29], and thus males should be able to regulate the 'worm-like' movements of their display. Our analyses therefore show that T amplifies perpendicular movement of the leg during the display, in which 'antiworm' feature analysers are likely triggered. But there is no significant effect on movements that resemble 'worm' stimuli.

(b) Testosterone and foot-flag speed
The speed at which an object moves is another stimulus property that can strongly activate feature analysers in the anuran visual system, particularly if the object is moving in a stepwise manner [30]. By conducting an analysis like the one above, we tested how T influences the velocity and/or acceleration of a displaying foot. We used two-dimensional spatial coordinates to calculate the duration, velocity and acceleration of foot movement during each foot-flag component (electronic supplementary material, table S3). Using a PCA, we then reduced these data into variables (PCs) of movement information for further analysis.
When considering the interaction of all foot movement variables, we found that T significantly alters the overall speed of the foot's trajectory (Wilks λ = 0.201; F 1,7 = 3.97; p = 0.045). Only PC5, however, individually differed between treatment groups (t = 3.345; d.f. = 10.89; p = 0.007; electronic supplementary material, figure S1 and table S1). This variable accounts for 4.40% of the speed variance, with higher values reflecting slower arch velocities and accelerations as well as shorter pull-in durations. As such, we found that T reduced PC5 values, meaning that the hormone acted to increase foot velocity and acceleration during the arch component and lengthen the pull-in duration. All other PCs were statistically indistinguishable between groups (electronic supplementary material, table S1). Altogether, these results ii. iii.
iv. suggest that T alters the speed profile of the foot, particularly during the arch component of the foot-flag. Given that the anuran visual system is well known to be highly tuned to object velocity [31], our data again imply that hormones are altering aspects of the foot-flag which stimulate feature analysers in the frog brain.
(c) Computational validation of the capacity for signal discrimination Finally, to assess the functional relevance of our findings, we tested whether T's impact on foot-flag geometry and speed profile provides receivers with enough information to discriminate among high and low T males. We approached this issue computationally, using linear discriminant analyses (LDA) to model feature-related algorithms that help receivers detect and classify visual stimuli, mirroring other animal communication studies [32,33]. Such algorithms are especially enlightening to studies like ours because they model object discrimination in a way that is very similar to that of the anuran feature analysers [24]. Our first discriminant algorithm was derived solely from display shape, and it was fully capable of identifying footflags from either T or control groups (t = −11.51; d.f. = 13.00; p < 0.001; figure 3a). We implemented a leave-one-out crossvalidation to verify our model's ability to accurately discriminate foot-flags from the treatment groups. Accordingly, our LDA was 87% accurate and showed substantial agreement (κ = 0.732), which indicates significant non-random categorization by our algorithm. Our second discriminant algorithm was derived from foot speed data from the different footflag components. This algorithm was also able to successfully classify foot-flags according to treatment group (t = −11.77; d.f. = 12.67; p < 0.001; figure 3b). Our subsequent leave-oneout cross-validation showed that our LDA was 87% accurate, with a moderate agreement in its reassignments (κ = 0.737).
Thus, T appears to affect foot-flag movements in a manner that is sufficient to support receiver signal discrimination. Our findings therefore support the notion that steroidmediated exploitation of receiver perceptual biases likely works in a functionally meaningful way and thus can plausibly evolve in response to selection.
Another benefit to this computational approach is that we can compare the κ values from our leave-one-out crossvalidations to assess the relative effect that each variable set (shape information versus speed information) has on signal discriminations. Because our model associated with shape information produced a greater κ value (0.732) compared to our model associated with speed information (0.737), we can conclude that both models work with similar accuracy.

Discussion
Male Bornean rock frogs congregate in competitive breeding aggregations near noisy, fast-flowing streams to compete with other males by performing foot-flag displays. Our results show that T-a potent androgenic sex steroid-regulates this behaviour by altering its aerial geometry and speed. In doing so, T amplifies leg movements that probably stimulate an innate feature analyser in receivers, which evolved by natural selection to facilitate detection and classification of threatening environmental stimuli. T does not appear to alter movements in the display that would stimulate an alternate set of feature analysers, which probably help individuals recognize food items. These data therefore imply that T action selectively mediates how male frogs perform foot-flag displays in a manner that enhances the exploitation of specific pre-existing perceptual biases. As a result, T probably augments the negative valence of this display by increasing its capacity to threaten competitors during bouts of competition [34]. It is also important to note that previous studies in this system find that T only alters foot-flagging behaviour and has no effect on vocalizations during the multimodal display [27].
We also demonstrate that T-mediated changes to footflag geometry and speed are sufficient to support display discrimination. For context, T treatment increases the verticality of the foot-flag shape by approximately equal to 10 mm (figure 2), which is comparable to height of an adult male frog sitting upright on a rock near the waterfall. We therefore expect that individuals have the visual acuity to distinguish *k = 0.732; p < 0.001 *k = 0.737; p < 0.001  royalsocietypublishing.org/journal/rspb Proc. R. Soc. B 288: 20211848 this difference in display behaviour. We tested this idea computationally by creating two different discriminatory algorithms-one based on geometry alone and the other based on speed alone-that function like anuran feature analysers. Both shape and speed variables provide enough information for receivers to categorize an individual's foot-flag reliably and accurately according to its hormone treatment. This finding suggests that male receiver can probably detect T-induced changes to the foot-flag, lending credence to our interpretation described above.
(a) An evolutionary optimum arises through the combinatorial effects of androgens and sensory bias Our results shed an intriguing new light on the putative role of perceptual bias on display design. Most research in this area focuses solely on receivers and thus pays little attention to how signallers finely adjust their display behaviour to better exploit the intrinsic biases that a receiver might have [1,2]. Our data suggest that such fine adjustment does in fact occur through the actions of T and its ability to modulate hindlimb motor control. From a conceptual standpoint, these results paint a picture in which perceptual bias probably triggers selection on androgenic regulator systems, shaping them to mediate behaviour in a very specific way. As such, perceptual bias does not likely influence display evolution by itself, but rather works in tandem with the mechanisms that underlie display production. We therefore hypothesize that the interaction between these two factors helps to create an evolutionary optimum that guides the complex process of display design. In other words, combinatorial effects of receiver sensory bias and hormonal amplification of perpendicular leg movement likely favours the exaggeration of gestures that resemble up-and-down limb waving along with the dorsalventral axis of the frog's body. Yet, equally important is that this same combinatorial effect probably exerts far less selective pressure for other exaggerated movements, such as limb extension and/or retraction. Certainly, the latter should be possible, given that there is ample individual variation in the knee extension and leg pull-in phases of the behaviour [29]. If the combination of perceptual bias and hormonal control of display behaviour does in fact create a landscape that favours the evolution of foot-flagging, then we expect that this effect applies to nearly all frogs. The main reason is that feature analysers used to detect prey and identify environmental threats are highly conserved across the anuran lineage [35], meaning that each species probably shows at least some degree of perceptual bias when it comes to an ability to appraise how visual stimuli move in space. Certainly, visual displays are common among frogs and toads, whether they involve limb waving, toe tapping or arm shaking [16]. It might be interesting to determine how many of these displays conform to design expectations set by the rule of feature analyser functionality. At the same time, there seems to be a strong propensity in the animal kingdom for androgenic hormones to kick-start the evolution of movement programmes. Endocrinologists have long shown that T coordinates different copulatory reflexes and postures, as well as many courtship and agonistic display routines [13]. Work in birds and lizards even suggests that selection for more complex gestural display routines occurs through the concomitant evolution of androgenic modulation of select descending and ascending motor pathways [36,37]. Thus, anurans might be set along a course where both perceptual bias and hormonal predisposition for behavioural regulation foster the repeated evolution of footflagging and other elaborate social gestures.
With these considerations in mind, we ask more specifically how the process of foot-flag evolution begins. The display is thought to arise as a ritualized leg-kick, a behaviour that originally evolved to mediate male-male combat during aggressive encounters in breeding aggregations [14]. Many foot-flagging frogs still violently kick their rivals when they get too close [14,38] and thus one benefit to ritualizing this behaviour into an elaborate display is that doing so likely reduces costs of injury associated with direct combat [14,16]. As described above, androgens may therefore mediate this ritualization process and help create the evolutionary optimum that directs the trajectory of display design.
(b) Androgenic regulation of the foot-flag The ideas described above are predicated on the notion that androgenic regulation of the foot-flag is adaptive. We suspect this is the case. Foot-flagging behaviour helps male frogs negotiate agonistic encounters with other males for access to mates [14][15][16]; thus, males are presumably more successful in agonistic contests if they can produce a display that causes their opponent to freeze [15]. By specifically amplifying components of the footflag that feature analysers recognize and classify as a threat, T probably gives a male a competitive edge in this regard. In other words, T may help males perform a foot-flag that will 'freeze' male rivals, thereby increasing the odds that the signaller can first approach females that appear at the breeding site. Sexual selection by male-male competition should therefore favour the evolution of mechanisms that promote T-mediated regulation of the foot-flag's danger aesthetic.
Along with these same lines, T's effect on foot speed is also likely to be adaptive. Object velocity can boost the degree to which variables such as object shape and direction of movement stimulate a frog's feature analysers, especially if speed changes as an object moves through space in a stepwise manner [30]. This is exactly what we see: T first increases foot speed during the perpendicular 'antiworm' movements, but T then slows foot speed as the leg is pulled back to the body. This means that T alters the speed programme of the foot-flag, as opposed to simply increasing or decreasing the display's speed altogether. As such, we hypothesize that this effect similarly enhances the capacity of specific patterns of leg movement to be recognized and classified as a threat by a receiver.
Worth mentioning is that our interpretation largely assumes that foot-flags are not used as courtship signals. There is no evidence for such a function, as field studies clearly show that foot-flagging mediates male-male competition [14,16]. Still, we cannot entirely rule out the possibility that foot-flagging is somehow associated with male-female advertisement. If it were, then one might expect the threating nature of foot-flagging to be disadvantageous for males, because it would probably cause females to freeze (which seems antithetical to the role of a courtship display). This effect could create tension between intra-and inter-sexual selection, and how hormonal modulation of foot-flagging would evolve in such a context is unclear. One possibility is that mechanisms would arise to help T differentially mediate foot-flags associated with male-male competition and courtship [39]. Alternatively, it is possible males would take advantage of a situation in which foot-flagging triggers females to freeze, as it would create an royalsocietypublishing.org/journal/rspb Proc. R. Soc. B 288: 20211848 opportunity for males to quickly approach a female and initiate amplexus. Male signals and/or behaviours sometimes work in this way [40,41], though this idea remains speculative.
Additionally, our interpretations might appear to assume that T levels in competing frogs are static, and thus relative levels of 'antiworm' movements incorporated into a display are predetermined by the amount of T in an individual's bloodstream. However, this assumption need not be the case. Selection can act on males' ability to dynamically modulate T in response to the current social context [39], favouring contextually appropriate responses rather than constitutively higher or lower responses per se [42,43]. This is especially true for agonistic behaviour, in that periods of intense male-male competition and/or bouts of aggression can induce T pulses that shape current and future competitive behaviour [39]. If male Bornean rock frogs similarly mount a T response in the face of more intense socio-sexual competition at breeding sites near the waterfall, it may help these individuals 'dial up' the threatening nature of their foot-flag by amplifying 'antiworm' movements. At the same time, we know that T increases the frequency of foot-flagging behaviour [27] but has no effect on calling behaviour or other measures of activity and arousal [27,28]. Thus, T action may work as a physiological rheostat to dynamically fine-tune how males perform select components of their larger multimodal display routine in response to shifts in social landscape [44,45].

Conclusion
In sum, our study suggests that the androgenic steroid T mediates the production of foot-flagging behaviour in Bornean rock frogs by amplifying components of the display that exploit receiver perceptual bias. In particular, T increases vertical leg movements that closely resemble 'antiworm' stimuli, which should trigger innate feature analysers that evolved to detect and classify potentially threatening objects in the environment. T's effect on behaviour is sufficient for receiver discrimination and thus provides an opportunity for selection ( probably intrasexual selection) to act. This is the first study, to our knowledge, to show how perceptual bias might influence display design through interactions with the physiological mechanisms that underlie behavioural output.

Methods (a) Animals
Adult male Bornean rock frogs (Staurois parvus) were obtained from a captive colony at the Vienna Zoo (Vienna, Austria). The population consists of more than 300 individuals housed in a large terrarium (150 × 120 × 100 cm), which closely resembles the species's native conditions in Borneo ( presence of a large, fast-flowing waterfall; dense vegetation; temperature: approx. equal to 25°C (range: 22-27°C); relative humidity: approx. equal to 90-95%; and day length: 12 L : 12 D). All frogs were reproductively active, and thus produced abundant vocalizations and foot-flagging displays in aggregations around the waterfall [46].
Prior to testing (see below), we removed 46 male frogs from the breeding terrarium and placed them into one of two medium-sized terraria (50 × 60 × 70 cm). These smaller terraria were kept at the same environmental conditions as the large breeding terrarium.

(b) Behavioural testing
We designed a study to test how T regulates properties of leg movement-or kinematics-that underlie foot-flagging display to exploit the frogs' innate feature analysers. Accordingly, we focused on (i) signal's shape, or the two-dimensional geometry produced by the foot's trajectory during a single display, and (ii) parameters that characterize how the foot moves to generate this shape, such as duration, velocity and acceleration of foot movement. As such, we randomly selected a single male from one of the two medium-sized terraria and measured its body mass, snout-vent-length (SVL) and eye width. We then gave the individual a 25 µl intraperitoneal injection of either (i) T-propionate diluted in normal saline (treatment group, n = 24) or (ii) normal saline (control group, n = 22). This T dose equates to roughly 10 µg frog −1 , and it is known to stimulate the production of foot-flagging without compromising an individual's health and/or affecting its general locomotor activity [27]. After the injection, we placed the individual in a transparent fauna box (30 × 18 × 15 cm) along with a randomly chosen juvenile male. The latter frog helped elicit footflags from the focal (injected) male (note that S. parvus juveniles are bright green and smaller than adults, making these individuals easy to distinguish from the focal adult male during all behavioural observations). We placed the box in the breeding terrarium near the waterfall to foster visual and acoustic communication between our focal frog and other actively displaying males in the population. We gave focal frogs 2 h to habituate and then recorded their foot-flagging behaviour for a 5 h period. Upon completion of the behavioural observation session, we released the frogs into a separate terrarium (50 × 60 × 70 cm) to monitor health and prevent repeated testing of the same individual.
We collected video recordings of foot-flagging with a Sony RX 10 II slow motion camera at 250 fps. We used only those recordings in which the male was facing directly toward or away from the camera (n = 15), which was determined by ensuring a perpendicular angle of the frog's SVL relative to camera's perspective. By ensuring that we captured foot-flags from this viewpoint, we could standardize measures of foot-movement trajectories in space and time along with both the xand y-axes for T-treated and control individuals. In the x-y plane, the footflag display can be separated into five distinct components (table 1). This categorization allowed us to have a standard comparison of foot-flags among individuals.

(c) Quantification of foot-flag geometry
We tracked foot trajectories using Kinovea software (https:// www.kinovea.org), extracting the x and y coordinates of the middle toe as it traces the 'loop' that otherwise makes up the foot-flag (figure 1a; see electronic supplementary material, methods, and movies S2 and S3). We then analysed these data with the Momocs package [47] in R studio (www.rstudio.com). Our workflow involved first running an EFA on the x and y coordinates of the foot trajectory to quantify the display's shape (i.e. geometry). An EFA is a standard heuristic for such measurements and is widely used to quantify object geometry in ecological and evolutionary studies [29,48]. Further description of an EFA can be read in the electronic supplementary material.
We next performed a PCA on the matrix of coefficients from the EFA to quantify shape variation in the foot-flag itself. This approach reduced the array of EFA data into 15 PCs, with the first eight PCs accounting for 98% of variation in the display's two-dimensional geometry. Using a multivariate analysis of variance (MANOVA) on these first eight PCs, we tested for differences in the amount of separation in PC space between foot-flag geometry of T-treated and control individuals. For subsequent analyses, we considered each PC as its own set of royalsocietypublishing.org/journal/rspb Proc. R. Soc. B 288: 20211848 geometrical information that is defined by the overlap of the extreme foot-flag shapes along either end of the PC axis. As such, we ran a set of Welch's two-sample t-tests on each PC score to examine what sets of geometrical information (PCs) differed between T-treated and control males. To better examine the particular shape differences in foot-flag displays, we also ran a set of Welch's two-sample t-tests on the x and y displacement of the different foot-flag components and overall path length.
Next, we performed a LDA to model the innate object feature analysers of frogs. Anuran feature analysers work by discriminating objects by their shape and movement. Our first LDA worked similarly to object detection by shape since it reduced our PCs into two axes and identified the linear combination of geometrical features that best distinguish foot-flags between T-treated and control males. A Welch's two-sample t-test on the LD scores from the LDA, uncovered the degree to which the foot-flags from T-treated males are separated from control males. The LDA also shows the per cent contribution for each PC in distinguishing foot-flags. These values elucidated which sets of shape information were key in defining foot-flags from T-treated versus control males.
Finally, we implemented a standard 'leave-one-out' crossvalidation model, which randomly removed one foot-flag shape from the dataset and created an LDA with the remaining foot-flags. The model then recursively input the 'left out' footflag shape into the LDA and used the derived algorithm to assign the removed shape to either the T-treated or control category. The model ran through all possible combinations of foot-flag shapes and thus provided a per cent assignment accuracy of the derived LDA. Additionally, it calculated a κ statistic to assess the agreement (i.e. how confident the model assigns groups) of our LDA with assigning the correct categories to foot-flag shapes. We used the following interpretation of the κ statistic: 0.01-0.20 = slight agreement, 0.21-0.40 = fair agreement, 0.41-0.60 = moderate agreement, 0.61-0.80 = substantial agreement and 0.81-0.99 = almost perfect agreement [49].

(d) Movement parameter analyses
Finally, we compared movement parameters of the foot-flag between T-treated and control males. To begin, using the xand y-coordinates of the trajectories, we calculated the duration, velocity and acceleration of the different components of the foot-flag (table 1 and figure 1b). We then performed a PCA on these data, which reduced our large dataset to 15 PCs. The first seven PCs accounted for 97% of the variation in movement parameters. Using a MANOVA, we compared the values of these PCs between T-treated and control males. Additionally, we ran a set of Welch's two-sample t-tests on each PC score.
Using a similar workflow as the one described above, we performed a second LDA on our movement parameter data to model object discrimination via movement information, like that of anuran feature analysers. Through a 'leave-one-out' cross-validation, we assessed the accuracy and agreement of our LDA at categorizing foot-flags from either T-treated or control males (same procedure as above). Finally, we compared the κ statistics of our shape and movement LDAs to assess which algorithm was most successful at discriminating hormone treatment in frogs.