Responsive robotic prey reveal how predators adapt to predictability in escape tactics

Significance A widespread strategy used by prey animals, seen in insects, mammals, amphibians, crustaceans, fish, and reptiles, is to vary the direction in which they escape when attacked by a predator. This unpredictability is thought to benefit prey by inhibiting predators from predicting the prey’s escape trajectory, but experimental evidence is lacking. Using fish predators repeatedly tested with interactive, robot-controlled prey escaping in the same (predictable) or in random (unpredictable) directions, we find no clear benefit to prey of escaping unpredictably, driven by behavioral counteradaptation by the predators. The benefit of unpredictable escape behavior may depend on whether predators are able to counteract prey escape tactics by flexibly modifying their behavior, or unpredictability may instead be explained biomechanical or sensory constraints.

programmed to respond when the predator had approached within 27 cm, the actual prey reaction distance varied due to a combination of a short delay between the predator being detected and the initial movement of the prey and differences in predator approach speeds across trials. Reaction distances were therefore calculated as the distance between the predator and prey positions in the video frame immediately before the escape response was initiated.
LOESS procedure used to obtain smoothed speed values. In the period before the prey escape response was triggered, predators tended to accelerate in a straight line towards prey during their approach. As the only information available to the predator during the approach phase about the prey's subsequent escape was from its experience of previous trials, the predator's maximum approach speed in each trial was calculated to measure how prey predictability influenced predator behaviour. To obtain reliable estimates of maximum approach speeds and reduce noise, LOESS (locally weighted regression) with a smoother span of 0.1 was used to smooth raw speed values over time. To avoid generating a smoothed time series which includes negative values, which were sometimes produced when using LOESS to smooth data on the original scale, the raw speed values were log(x+1) transformed prior to smoothing.
Smoothed speeds on the original scale were then obtained by applying the inverse of this transformation, resulting in positive smoothed speed values. The maximum predator approach speed was defined as the highest speed during the period of the approach phase in which the predator headed continuously towards the prey (i.e. the predator's bearing to the prey did not exceed 45°), and did not subsequently deviate from this overall direction by heading away from the target. The period up to 10 seconds before the prey started to escape was considered. Data from trials when predators triggered the prey escape response while approaching at a bearing of greater than 45° to the prey were not included in the analysis, as fish were unlikely to have been as motivated to attack in these trials.
Quantifying predator turning performance during the pursuit phase. To assess the turning performance of the predator, we calculated both maximum turn speed and minimum turn radius, to provide an indication of both how quickly and how sharply the predator turned when pursuing prey (1). Turn speed was defined as the change in the direction of the predator's heading in successive frames, and turn radius was calculated as the straight-line distance between the predator's position in frames and + 2, divided by two times the sine of the change in the predator's heading between successive frames, and + 1 (below, and indicate the x-and y-coordinates of the fish): = √( +2 − ) 2 + ( +2 − ) 2 2 sin( ) Statistical analysis. Linear and generalised linear mixed effects models (LMMs/GLMMs) were used to explore the variables that impacted the approach and pursuit behaviour of the predators, using a model comparison approach. LMMs were fitted with the lme4 package and GLMMS were fitted with the glmmTMB package. To limit the number of candidate models being compared, simpler versions of three-way interaction models (models lacking the three-way interaction but retaining the constituent two-way interactions) were not included in the initial model comparison set (2,3). These were only considered if the initial model comparison revealed that the three-way interaction had an important effect. Within model comparison sets, additional explanatory variables were also added to all models in order to account for potentially confounding effects such as the standard body length of the predator, reaction distance (used to control for differences in the distance to the prey when the prey escape response was triggered) and the predator's maximum approach speed (used to control for the expected effect of approach speed on pursuit speed or acceleration). An additional model featuring only these control variables was also included in each model comparison set to serve as the baseline for comparison with the other models. Where control variables were also of interest, a null model lacking any explanatory variables was also included.
Within each comparison set, all models shared the same random effects structure. To control for similar experiences during the training period, and to account for repeated measures of the same individuals, random intercepts for training group and individual identity were included in all models. Individual-level random slopes for the effect of trial number were also included in models with maximum predator approach speed and the time taken to capture prey as the response (4). The extent of inter-individual differences in the effect of trial number on maximum approach speed was also assessed by comparing the conditional AIC (cAIC) of an LMM with individuallevel random slopes to an otherwise identical model lacking random slopes using the cAIC4 package in R (version: 0.9; 5). To aid model fitting, continuous explanatory variables were scaled prior to being included in the model, by subtracting the mean and dividing by the standard deviation. Model assumptions were checked by examining QQ-plots of the residuals, residuals vs. fitted values and the distribution of the conditional modes of the random intercepts. The DHARMa package (version: 0.2.7) was used to check model assumptions for GLMMs (6).  Data is shown for all 363 trials in which the fish left the refuge, and captured prey following a direct approach (i.e. trials in which the bearing of the predator to the prey was less than 45°, at the time when the prey escape response was triggered). The inset shows a magnified version of the same histogram, ranging from 0 to 60 seconds. In both the main histogram and the inset, the dashed vertical line indicates the 10 second threshold used to remove trials in which fish were insufficiently motivated to pursue the prey.  ) at which the initially stationary robot-controlled prey item was programmed to escape from an approaching predator. Black arrows indicate the heading of the approaching predator and the escaping prey. The prey escape angle (relative to the approaching predator) is shown in blue. The experimental arena and fish holding zone were situated within a large rectangular aluminium tank (width = 127 cm, height = 36 cm, length = 238 cm). Within this external structure, an inner tank was constructed from white PVC walls (height = 35 cm, thickness = 0.8 cm) sealed to a white base made of compressed white foamed PVC (thickness = 0.2 cm) using aquarium sealant. This created a high contrast background enabling the movements of the predator to be tracked. The inner tank was divided into a large rectangular experimental arena, separated from a smaller holding zone by a white plastic divider, positioned at one end of the tank. The holding zone was further sub-divided into four compartments (width = 25.75 cm, length = 41.5 cm each), with two compartments positioned either side of a central refuge (width = 16 cm, length = 55.5 cm), which was covered by rigid plastic mesh. Each compartment contained a cylindrical tube and two artificial plants to provide cover for the fish. Small pebbles (< 0.5mm diameter) were also scattered across the floor of each compartment and the central refuge. Holding compartments were linked to the central refuge via a connecting corridor (width = 14 cm, length = 51.5 cm), which bordered the external wall of the inner tank. The holding compartments were separated from the central refuge and experimental arena by retractable doors (indicated by black dashed lines), enabling fish to be transferred from their holding compartments to the central refuge or released into the experimental arena without being caught in nets, thus minimising handling stress. The experimental arena also contained a water heater attached to the wall furthest from the holding zone, and four artificial plants positioned near the edges. Throughout the experiment, the water depth in the experimental tank was kept at 15 cm, temperature was held constant at 27°C (+/-0.5°C) and a 12h:12h light:dark cycle was maintained. Water was continuously filtered and circulated throughout the entire tank using two Eheim Classic 600 external canister filters, which took in water via inflow pipes positioned in the corners of the arena closest to the heater and discharged water back into the holding zone. (b) Photo of the artificial prey item used in the experiment, shown against a dark background. The artificial prey item was a small amount of food (an approximately 5 mm x 8 mm piece of defrosted fish) attached to a length of transparent monofilament fibre (thickness = 1 mm, length = 4 cm) protruding from a cone-shaped white plastic base (diameter = 2.5 cm, cone height = 1.8 cm). , which was used to control how prey respond to an approaching predator. Prior to an attack, the program continuously analysed video frames captured by the webcam positioned above the arena, monitoring any changes from one frame to the next which could indicate movement of the fish within the arena. As part of this process, each frame was first converted to grayscale and smoothed to filter out noise. Background subtraction was then used to calculate differences in pixel values between the current frame and a representation of the static background (i.e. the unchanging aspects of the experimental arena). The background was estimated using a running average, in which motion during more recent frames was weighted more heavily. Thresholding was then applied to the resulting image to isolate areas of the current frame which differed substantially from the background. Additional size filtering also ensured that any regions of movement below a pre-specified size threshold were disregarded, to make certain that noise was ignored and that the sole region of detected motion corresponded to the predator. The program then used this information to calculate the centroid of the predator in each frame, until the predator approached within a pre-specified radius of the prey's starting position (27 cm in both training and test period trials). Video frame processing was halted at this point, and movement commands were sent to the robot, based on the predator's angle of approach and the programmed prey escape angle, in order to execute the prey's escape response.
Table S1. Analysing the performance of the robotic prey system. The table compares AICc scores for Gamma GLMs (generalised linear models) constructed to explain variation in the angular difference between expected and realised prey escape angles, and for LMMs (linear mixed-effects models) explaining variation in reaction distance. Throughout the experiment, the programmed (i.e. expected) prey escape angle did not always perfectly match the escape angle that was realised: the median angular difference between the expected and realised prey escape angle was 8.5° (inter-quartile range, IQR = 10.7°). The directional error of the robotic prey system did not differ between the predictable and unpredictable treatments and was not correlated with the expected prey escape angle (as demonstrated by the lack of improvement in fit for models featuring these explanatory variables, compared to the null model). Additionally, although the realised predator-prey distance at which the prey initiated its escape response (reaction distance) varied from trial to trial, there was no overall difference in reaction distance between the two treatments.  Table S3. Results of LMMs with the maximum approach speed of the predator during predictable treatment trials as the response variable, based on 179 observations of 12 individual fish. In the predictable treatment, individual predators were always exposed to prey escaping at the same angle. To test whether the positive relationship between the prey's escape angle and the predator's maximum approach speed (in predictable treatment trials; Fig. 1C) did not arise because of differences between individual fish, we examined which variables predicted the predator's approach speed. The model including prey escape angle received most support from the data, compared to models featuring standard body length, the approach speed of the predator in the first trial or the time taken to trigger the prey escape response (an indicator of the predator's motivation within a trial). This suggests that the relationship between maximum approach speed and prey escape angle observed in the predictable treatment (Fig. 1C) was unlikely to have arisen due to inter-individual variation in speed, body size or motivation. A summary of the model receiving most support from the data is provided in Table S2.  Table S4.

Results of LMMs with the maximum speed of the predator over the course of the pursuit as the response variable, based on 117 observations of 19 individual fish in trials
where prey escaped at an acute angle (< 90°). All models included reaction distance as an explanatory variable, to control for the effect of proximity to the prey at the point when the prey started to escape on changes in the predator's speed. Maximum predator approach speed was also included in all models except the baseline (reaction distance only) model, to control for the expected effect of approach speeds on the maximum pursuit speed. After controlling for the predator's approach speed, there was evidence for an effect of the prey's escape angle on the speed of the predator during the pursuit. This is shown by the relative improvement in fit (ΔAICc = 6.20) when comparing the model including fixed effects for both the predator's maximum approach speed and the prey's escape angle to the model including the predator's maximum approach speed (reaction distance was included in all models). A summary of this model, which received most support from the data, is provided in Table S2.  Table S5. Results of LMMs with the minimum speed of the predator during the first half of the pursuit phase as the response variable, based on 117 observations of 19 individual fish in trials where prey escaped at an acute angle (< 90°). This first half of the pursuit was defined as period from when the prey started moving, until the time half-way between this start point and the moment the predator captured the prey. All models included reaction distance as a explanatory variable, to control for the effect of proximity to the prey at the point when the prey started to escape on changes in the predator's speed. Maximum predator approach speed was also included in all models except the baseline (reaction distance only) model, to control for the expected effect of approach speeds on the minimum pursuit speed.  Table S6. Results of LMMs with the maximum acceleration of the predator throughout the pursuit as the response variable, based on 117 observations of 19 individual fish in trials where prey escaped at an acute angle (< 90°). All models included reaction distance as a explanatory variable, to control for the effect of proximity to the prey at the point when the prey started to escape on changes in the predator's speed. Maximum predator approach speed was also included in all models except the baseline (reaction distance only) model, to control for the expected effect of approach speeds on maximum acceleration in the pursuit. There was evidence for an effect of treatment on the maximum acceleration of the predator, as the model including maximum predator approach speed, treatment and reaction distance received greater support from the data than the model featuring only maximum predator approach speed and reaction distance (ΔAICc = 1.65). A summary of this model, and the model including maximum predator approach speed and prey escape angle as explanatory variables, is provided in Table S2.  Table S7. Results of LMMs with the maximum deceleration of the predator over the first half of the pursuit as the response variable, based on 117 observations of 19 individual fish in trials where prey escaped at an acute angle (< 90°). This first half of the pursuit was defined as period from when the prey started moving, until the time half-way between this start point and the moment the predator captured the prey. All models included reaction distance as an explanatory variable, to control for the effect of proximity to the prey at the point when the prey started to escape on changes in the predator's speed. Maximum predator approach speed was also included in all models except the baseline (reaction distance only) model, to control for the expected effect of approach speeds on the maximum deceleration in the pursuit. Compared to a baseline model including maximum predator approach speed and reaction distance as explanatory variables, only the model featuring trial number, maximum predator approach speed and reaction distance represented a substantial improvement (a summary of this model is provided in Table S2). As the trials progressed, the fish decelerated more. The relatively large difference in AICc scores between the model including maximum predator approach speed and the baseline model indicated that the predator's maximum approach speed was strongly negatively correlated with its maximum deceleration during the pursuit phase, consistent with greater deceleration by rapidly approaching fish.  Table S8. Results of Gamma GLMMs with the maximum turning speed of the predator during the pursuit phase as the response variable, based on 116 observations of 19 individual fish in trials where prey escaped at an acute angle (< 90°). Only the model including trial number represented a substantial improvement over the null model, and as trials progressed, fish reached higher maximum turning speeds. The analysis was based on 116 observations, not 117, as the maximum turning speed could not be calculated in one of the trials where the predator always moved a distance of less than 0.5 cm between successive video frames (heading angles were only calculated when the predator had moved a distance greater than 0.5 cm between frames).