{'fraction_non_alphanumeric': 0.03718829139193721, 'fraction_numerical': 0.018000958225913168, 'mean_word_length': 5.070073397036421, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Cognition contra camouflage: How the brain mediates predator-driven crypsis evolution

While crypsis is a prominent antipredator adaptation, the role of the brain in predator-driven evolution remains controversial. Resolving this controversy requires contextualizing the brain with established antipredator traits and predation pressure. We hypothesize that the reduced predation risk through crypsis relaxes predation-driven selection on the brain and provide comparative evidence across 102 Chinese frog species for our hypothesis. Specifically, our phylogenetic path analysis reveals an indirect relationship between predation risk and crypsis that is mediated by brain size. This result suggests that at a low predation risk, frogs can afford to be conspicuous and use their large brain for cognitive predator evasion. This strategy may become less efficient or energetically costlier under higher predation pressure, favoring smaller brains and instead increasing crypsis.


INTRODUCTION
The arms race between prey and their predators has driven the evolution of numerous antipredator strategies throughout the animal kingdom, including body armor, flight behavior, unpalatability or poisonousness, mimicry, or crypsis (1,2). Many animals have evolved multiple defense strategies, such as morphological and behavioral traits, and the environmental context might dictate the relative efficacy of these traits and their response to selection. Hence, antipredator traits are often negatively associated. For example, the ability or need to escape might decline with enhanced investment in protective weaponry (3). Similar arguments could be made for other forms of physical or chemical protection versus predator evasion. However, simultaneous selection on multiple beneficial traits may also generate positive associations between them, possibly at the cost of other, nondefense-related traits (4). To understand predationdriven evolution, it is thus critical to study correlations between multiple traits and put them in the context of extrinsic factors such as the predation pressure itself (5,6).
Compared to the well-studied morphological and behavioral adaptations to predation, a less explored potential antipredator strategy is the evolution of a larger brain and better cognitive abilities. There is recent, and at least indirect, evidence for potential protective benefits of a larger brain. For instance, within food webs, prey species often have larger brains than their predators (7). Similarly, relatively larger brains lower mortality rates across avian and mammalian species (8,9), and most mammalian predators have been shown to prefer prey with smaller brains over prey with larger brains (10,11). Last, guppies (Poecilia reticulata) with a relatively larger brain survive better under predation pressure (12). Hence, to the extent that brain size reflects cognitive abilities (13)(14)(15)(16), predation pressure seems to select for better cognitive abilities and therefore larger brains. At least in some circumstances, as when the brain's high metabolic costs (17) start to outweigh its cognitive benefits (18), selection is likely to shift toward other antipredator strategies. One such strategy is crypsis, a widespread and well-established antipredator adaptation, with animals avoiding detection via camouflage, nocturnality, or hidden lifestyle (1). We hypothesize that if cognitive abilities help evade predators but lead to considerable costs related to brain size, well-camouflaged animals should be able to save those costs because of their lower detectability. Here, we present evidence for such an inverse relationship between the level of crypsis and relative brain size across Chinese frogs.

RESULTS AND DISCUSSION
First, we assessed for 49 anuran species (fig. S1) from southwestern China the degree of crypsis as apparent to the human eye. We photographed four male frogs per species in their natural environment and then asked 10 different human observers to score the similarity/ difference between environment and body color on the basis of those photos on a scale of 0 to 100. In a phylogenetic regression analysis (see the Supplementary Materials for details) controlling for snoutvent length (SVL) as a proxy of body size, we found these crypsis scores to covary negatively with relative brain size (brain: t 46 = −2.66, P = 0.01; SVL: t 46 = 8.10, P < 0.01; phylogenetic scaling parameter,  = 0.46 <0.01, <0.01 ; Fig. 1A). Having established a negative relationship between relative brain size and crypsis in support of our hypothesis, we broadened our study by (i) using more objective crypsis scores, (ii) increasing the number of species, (iii) including females, and (iv) incorporating additional factors (predation pressure, escape ability) that likely affect this trade-off. In the following, we first explore individual trait relationships and then their interdependence and directionality in path analyses.
We used reflectance measurements and visual modeling across 102 anuran species (fig. S2) to assess their conspicuousness on their specific substrate to different observers, most notably snakes as their main predators (see below). Using a spectrophotometer, we measured the spectral reflectance of the skin of live animals (N = 332 males, 145 females), along with their immediate surrounding substrate (e.g., the leaves, stones, or tree trunks they were sitting on). For each frog, we calculated average reflectance spectra for nine dorsal regions to estimate the degree of crypsis, and for six ventral regions as a control area that may rarely be visible to terrestrial predators. To assess the overall conspicuousness of frogs to potential predators, we calculated both the chromatic and achromatic contrasts created by their body regions against their substrate using the receptor noise-limited model (for more details, see Materials and Methods) (19,20). This model has been successfully applied to predict behavioral responses to visual cues across several taxa (20,21). We modeled contrasts of individual body regions in the trichromatic visual system of lizards and snakes (Supplementary Materials). Although all terrestrial vertebrate classes have been described to prey on anurans, snakes account for almost half of those reports (22) and are also considered the primary predators for most species in our dataset (23). As several snakes are visual hunters with well-developed binocular vision (24), the evolution of crypsis in frogs is likely linked to snake predation. Despite a lack of obvious sexual dichromatism in the species studied and correlated crypsis scores between the sexes (all r ≥ 0.30, P ≤ 0.03), we analyzed males and females separately because female data were limited to only 50 species (fig. S2) and males likely face higher predation pressure than females by exposing themselves more during courtship (25). Confirming our previous results and supporting our main hypothesis, phylogenetic regressions revealed an inverse relationship between the degree of crypsis and relative brain size in both males (crypsis: t 99 = −2.09, P = 0.04; SVL: t 99 = 20.83, P < 0.001;  = 0.29 <0.01, <0.01 ; Fig. 1B, blue) and females (crypsis: t 47 = −2.34, P = 0.02; SVL: t 47 = 16.02, P < 0.001;  = 0.61 0.02, <0.01 ; Fig. 1B, red). Given that birds are likely the second-most important predators of the species included in this study, we repeated our visual modeling and phylogenetic regressions for tetrachromatic birds (both violet and ultraviolet sensitive, respectively). As the results were qualitatively similar (table S1), we focused on the snake visual model when broadening our analyses and including factors that we predicted to mediate the link between crypsis and brain size: predation pressure and evasion ability. Note that many of our focal frog species (N = 89) forage and court mainly during dusk and nighttime. We nevertheless focused on "daytime" crypsis scores (i.e., combining chromatic and achromatic contrasts) to account for the chromatic variation in those species with at least partially diurnal activity. Furthermore, even nocturnal species should benefit from effective crypsis during daytime when several of the snake species we recorded are at least occasionally observed hunting (26). Last, compared to the chromatic contrasts (r ≤ 0.21, P ≥ 0.03), the achromatic contrasts were far more tightly correlated with our overall crypsis scores (r ≥ 0.93, P < 0.001), and limiting our analyses to nocturnal detectability yielded qualitatively similar results. The primary activity period (nocturnal versus nocturnal/diurnal) explained no significant variation in anuran traits or predation pressure, except that the nocturnal species were slightly larger on average than the other species (table S2).
Predation is typically most pronounced during the breeding season when anurans aggregate at ponds (27). Consequently, we determined snake density at breeding sites via nightly line-transect counts as a proxy of predation pressure. As most snakes in our sites are more active during the night, nightly censuses allow for a reliable estimate of snake density (28). They are further likely an adequate indicator of crypsis-relevant daytime predation pressure as many of our snakes can also hunt during the day. While predation events may occur mainly during the night, when cryptic coloration likely is a less effective antipredator strategy, we have repeatedly witnessed daytime predation events over our past years of field work such that these events might be frequent enough to select for higher crypsis in anurans. Evolutionary processes are often driven by relatively small selection differences such that even events that may appear rare can be important evolutionary forces (29).
Consistent with theory and other empirical data (30-32), we found that higher predation pressure was associated with higher dorsal crypsis scores in both males (t 100 = 4.05, P < 0.001,  = 0.21 0.03, <0.01 ; Fig. 1C, blue) and females (t 48 = 3.05, P = 0.004,  < 0.01 0.35, <0.01 ; Fig. 1C, red, and table S3). These relationships, however, were not statistically significant for ventral coloration that is less visible to predators (all P > 0.20; table S4), confirming that dorsal crypsis is likely an evolutionary response to predation in these Chinese anurans. In contrast to the prediction that superior cognitive abilities are beneficial in predator evasion, we found relative brain size to be negatively correlated with predation pressure in males (t 99 = −7.23, P < 0.001; SVL: t 99 = 17.74, P < 0.001;  = 0.55 <0.01, <0.01 ; Fig. 1D, blue). This relationship was not statistically significant across females (t 47 = −1.54, P = 0.13; SVL: t 47 = 14.12, P < 0.001;  = 0.45 0.08, <0.01 ; Fig. 1D, red). An inverse relationship between brain size and predation pressure has been documented in some fishes (33,34), and it has been speculated that the smaller brains in populations with higher predation pressure could result from energy limitations because of impaired foraging opportunities (34,35). In line with this prediction, we found that predation pressure covaried negatively with both male (t 100 = −5. Phylogenetic regressions linking predation pressure, relative brain size, crypsis, and body size across frogs and toads. Partial regressions (controlling for body size) show negative relationships between brain volume and crypsis, whether crypsis was estimated by the human eye (A) or by a snake visual model based on reflectance measurements of dorsal coloration (B). Predation pressure (based on local snake density) covaried positively with dorsal crypsis in both sexes (C) but negatively with relative brain size in males [partial regression controlling for body size (D)], and with body size (snout-vent length) in both sexes (E). All variables are log transformed.
Males are depicted in blue and females in red, and data of both sexes are overlaid solely for spatial reasons; analyses were conducted separately. Fig. 1E, red), a trait known to depend on resource availability in many species. If these energetic considerations indeed apply to our sample of frogs, our findings would not only point toward possible constraints in anuran brain size evolution but also suggest that the energy-saving benefits of smaller brains might outweigh the cognitive benefits of larger brains under high predation pressure.
To better discern whether these interspecific associations reflect correlated evolution between pairs of variables or independent evolutionary processes in the same or opposing direction, we used Pagel's (36) directional test of trait evolution. With likelihood ratio tests and comparisons of the Akaike information criterion (AIC), we compared models with (i) transitions in the state of one variable being contingent on the state of the other, (ii) evolutionary transitions being mutually codependent between the two variables, or (iii) both variables changing states independently of one another. Since this approach uses binary character states, we coded positive brain size residuals [from a phylogenetic generalized least squares (PGLS) regression against SVL] and above-mean values of predation pressure or crypsis as "high" and the remaining values as "low." To test for correlated evolution between predation pressure and anuran traits, we restricted the directional models such that the latter evolved in response to predation pressure, but predation pressure was independent of these other traits (e.g., there was no a priori reason to assume that changes in snake populations would hinge on changes in anuran brain size). Between crypsis and relative brain size, however, we considered all single-and double-dependent models of evolution. These analyses indicated that the transitions in relative brain size were dependent on predation pressure ( 2 2 = 10.20, P = 0.006, AIC = 6.20, AIC weight w AIC = 0.96), with the strongest support for a transition from relatively smaller to relatively larger brains in response to a reduction in predation pressure ( Fig. 2A and table S5). For dorsal crypsis, the dependent model also tended to perform slightly better than the independent model, but not statistically significantly so ( 2 2 = 4.47, P = 0.11, AIC = 1.13, w AIC = 0.64). Despite limited support, the dependent transitions were, if anything, biased toward a reduction in crypsis in response to a relaxed predation pressure and increasing crypsis based on heightened predation pressure ( Fig. 2B and table S5). By contrast, changes in ventral crypsis were clearly not contingent on changes in predation pressure ( 2 2 = 0.39, P = 0.83, AIC = 3.61, w AIC = 0.14). Last, among the four models for the covariance between relative brain size and crypsis, that of independent evolution showed the strongest weight of evidence (w AIC = 0.58; Fig. 2C and table S5), although that with changes in crypsis being dependent on relative brain size was within AIC ≤2 of the top model and so could not be dismissed entirely (AIC = 1.79, w AIC = 0.24). Both remaining models (mutual codependence or changes in relative brain size contingent on crypsis) were not supported (AIC ≥3.31, w AIC ≤ 0.11). The single-dependent model suggested that a decline in brain size was more likely to cause a transition to higher than to lower levels of crypsis, with generally lower and more equal transition rates in response to increasing encephalization.
While uncovering correlations between two traits can inform on possible evolutionary links, understanding predation-driven evolution requires studying correlations between multiple relevant traits and placing them in the context of predation pressure itself. To this end, we used a phylogenetically controlled path analysis (37) to investigate how predation pressure may affect the evolution of body Fig. 2. A directional test of trait evolution investigating pairwise relationships between predation pressure, relative brain size, and crypsis in frogs. Panels show transition rates between binary states of variables. In (A) and (B), we specifically assumed that the changes in predation pressure (i.e., snake densities) should not be contingent on relative brain size (A) or crypsis (B), as indicated by equal transition rates from low to high predation pressure (or vice versa) regardless of the other trait states. However, relative brain size is most likely to increase (A), and crypsis to decrease (B), in response to a reduction in predation pressure, indicating that evolutionary changes in these traits are contingent on predation pressure. (C) Transitions between relative brain size and crypsis. Although the model of independent evolution between these two traits found the strongest support, it was not significantly different from the model with transitions between low and high crypsis depending on relative brain size (but not vice versa; displayed here). Here, a transition from low to high crypsis is most likely to follow a decline in relative brain size, and the reverse following an increase in relative brain size. Arrow widths are proportional to the corresponding transition rate; semitransparent arrows indicate nonstatistically significant transitions (i.e., P > 0.05 in likelihood ratio tests against a transition rate of 0). size, brain size, and crypsis. Since even cryptic species still need to evade predator attacks at close range, we also included hind leg muscle mass in this analysis. Anurans typically evade predators via energetic thrusts with their hind legs to either leap or swim to safety, such that hind leg muscle mass serves as a proxy of escape ability (38). On the basis of 23 prespecified candidate path models ( fig. S3), we conducted a phylogenetic confirmatory path analysis, ranking candidate models by their C-statistic information criterion (CICc) and averaging those with CICc ≤2 from the top model (37). Both brain size and hind leg muscle mass were accounted for allometric effects by including causal links between SVL and these variables in all candidate models. The averaged model (Fig. 3A, table S6, and fig.  S4) showed that under high predation pressure, frogs evolve smaller bodies. This is consistent with the individual trait correlations above and with life history theory (39); it may further suggest that snakes preferentially prey on larger animals (40). Also in line with the previous individual trait correlations was the negative effect of predation pressure on relative brain size. As discussed above, we suggest that this may be an energy-saving adaptation to life in dangerous environments. However, a nonmutually exclusive explanation, ultimately also based on resource availability, could be an indirect link via population density. Many of the frog species used here differ considerably in typical population densities (41). Hence, the local snake densities (our estimate of predation pressure) could simply be a consequence of varying frog densities, with food availability for individual frogs being explained by competition among them. However, this scenario seems less likely because neither the snake densities nor the body sizes of our male frogs were associated with species-specific population densities estimated along the same transects as the snakes (|t 100 | ≤ 0.78, P ≥ 0.44).
Does the apparent selection for smaller brains by predation pressure mean that outsmarting a predator would play no role in predationdriven brain evolution? We think not, as the suggested causal paths indicate a strong and highly significant effect of brain size on crypsis (Fig. 3A). We interpret this as evidence for a functional trade-off between predator evasion strategies. While this negative association was predicted, its directionality in both the test of correlated evolution and the path analysis counters our prediction based on a scenario in which lower detectability via crypsis would reduce the need for cognitive predator evasion. Rather, our data suggest that changes in relative brain size precede those in crypsis, which is also suggested by our directional model of correlated evolution. If so, this would mean that species that are constrained in brain size (e.g., metabolic constraints), and thus in their cognitive capacity, might be under stronger selection for reduced detectability. Combined with the negative effect of predation on relative brain size, these species may have smaller brains because of experiencing a higher predation risk, potentially reducing the efficiency of cognitive strategies while increasing the benefits of low detectability. In turn, larger-brained species may experience relaxed selection for crypsis if their superior cognitive abilities allow them to behaviorally evade their fewer predators (13)(14)(15)(16). This general line of reasoning is corroborated by the strong positive effect of relative brain size on relative hind leg muscle mass. A large brain can allow for more adequate risk assessment (42), which may explain why large-brained animals typically initiate flight at a shorter distance to an attacking predator (43). Fleeing only when a predator is within striking distance gives large-brained prey animals more time to feed and court than those with a smaller brain. In frogs, such a "last-minute" thrust away from a predator is facilitated by strong hind legs. However, relatively stronger hind legs in species with relatively larger brains may also simply be associated with higher levels of activity and locomotion, possibly between different substrates, than in those species that rely primarily on staying undetected. The remaining two significant associations in the average path model result from standard allometry, with larger frogs having larger brains and more muscular hind legs. Body size is typically the strongest predictor of body parts across vertebrates, including the brain (44). Hence, the strong positive effect of body size on both brain size and hindlimb muscle mass was expected.
To validate our conclusions, we repeated this path analysis using ventral instead of dorsal coloration, and then again for females instead of males. The reasoning for the first reanalysis was that ventral coloration should be rarely visible to terrestrial predators and so under weak predator-driven selection for crypsis. This path analysis still yielded a negative effect of predation on relative brain size, but neither relative brain size nor any other variable was associated with ventral crypsis (Fig. 3B, table S7, and fig. S4). Furthermore, as in the previous analysis, a positive association between relative brain size and relative hind leg muscle mass was apparent, albeit reversed, leaving the directionality (but not coevolution itself) somewhat ambiguous. Next, we replicated both path analyses across females (Fig. 3C, table S8, and fig. S4). Using dorsal crypsis, the general structure of the average model paralleled that across males, including at best an indirect effect of predation on crypsis. Unlike the males, however, the wide 95% confidence intervals (CIs) for the brain size effects on both dorsal crypsis and hindlimb muscle mass included 0 in females, rendering them somewhat inconclusive despite relatively high coefficients. The substantially smaller sample size (N = 50 versus 102 in males) could be one plausible explanation; however, this explanation seems unsatisfactory given that reducing the male dataset to the same 50 species had no qualitative effect on these links ( fig. S5 and table S9). A more substantial deviation from the model on male dorsal crypsis was the much weaker and nonstatistically significant direct effect of predation on relative brain size. This difference between sexes was also apparent in the individual regression analyses (above). Here again, lacking statistical power seems a less likely explanation, given that the negative effect of predation on relative brain size in males was also highly significant across the 50 species with female data (t 47 = −5.15, P < 0.001; SVL: t 47 = 13.36, P < 0.001;  = 0.53 <0.01, <0.01 ). However, whether this sex difference results from females being less exposed to predators or more energetically constrained in brain evolution (e.g., higher reproductive investments), or devoting more of their cognitive capacity to other functions (e.g., food searching, mate choice), remains to be seen. However, congruent with the male analyses and as predicted, using ventral coloration in females removed any link between crypsis and other variables (table S10 and fig. S4).
All our results combined provide robust evidence for an evolutionary trade-off between an established and a likely antipredator strategy: crypsis and relative brain size. These findings suggest that large-brained animals can "afford" conspicuous coloration, whereas smaller-brained animals that lack sophisticated cognitive antipredator defenses are selected for a cryptic color pattern. Although crypsis itself increased with predation pressure in the individual trait analysis, the context of our path analysis revealed that this effect is indirect via brain size, suggesting a gradual shift from cognitive predator evasion to camouflage with an increasing predation A B C D Fig. 3. Phylogenetic path analyses relating predation pressure, body size, crypsis, relative brain size, and relative hind leg muscle mass in frogs. Panels show average models using dorsal (A) or ventral (B) crypsis in males, or dorsal crypsis in females (C). Predation pressure reflects the density of snakes where each frog species was sampled. Crypsis estimates are based on contrasts between the mean reflectance of multiple dorsal or ventral skin areas of frogs and the substrate where each individual was collected, adjusted for predicted reptilian trichromatic vision (i.e., snake predator). The causal links between SVL and brain size, and between SVL and hind leg muscles, were included in all candidate models to account for allometric effects. Arrow widths are proportional to the corresponding path coefficients, and arrow colors reflect the direction of associations (olive, negative; blue, positive). Semitransparent arrows indicate nonstatistically significant effects (i.e., 95% CI including 0; fig. S3). pressure. These links add previously undescribed and important dimensions to our understanding of the costs and benefits of large brains, the evolution of crypsis, and how changes in the predation pressure shape the coevolution of complementary antipredator strategies.

Sample collection
We collected males (N = 1 to 6; mean: 3.3 per species) of 102 anuran species and females (N = 1 to 5; mean: 2.9 per species) of 50 of these species by hand at night using a flashlight during the breeding season from 2017 to 2020 in China. All individuals per species originated from a single population and were killed by single or double pithing (45,46) and preserved in 4% phosphate-buffered formalin for tissue fixation. After 2 to 8 weeks of preservation, we measured body size (SVL) to the nearest 0.01 mm with calipers.

Brain size measurements
To measure total brain size, we dissected the brain of each individual and captured digital images of its dorsal, ventral, left, and right sides at ×400 magnification using a Motic Images 3.1 digital camera mounted on a Moticam 2006 light microscope. For dorsal and ventral photographs, we confirmed that the view was horizontal and the brain was symmetrically positioned such that one hemisphere did not appear larger than the other. A single person, blind to species identity, then measured the length (L), width (W), and height (H) of the five brain regions olfactory nerves, olfactory bulbs, telencephalon, optic tectum, and cerebellum, and of the total right half of the brain, using tpsDig v.1.40 (47). We then calculated the volume of each region and of the right brain half on the basis of an ellipsoid model [volume = (L × W × H)/(6 × 1.43) following (38)], doubled for total volume. This equation for brain volume was originally derived by measurements of water displacement (38). We averaged brain volumes by sex within each species.

Predation pressure
We determined snake density at breeding sites as a proxy of the degree of predation pressure, focusing on one breeding population per species during the breeding season (April to July) between 2017 and 2020. In brief, during three consecutive nights around full moon, we walked 5-m-wide line transects of an average length of 1.3 km (range: 0.4 to 4.6 km) with a 12-V flashlight for each anuran population and recorded the number of snakes encountered. A pilot study with nightly searches for a month in one population for each of 10 frog species revealed that three consecutive nights around full moon were sufficiently representative. The mean snake densities were strongly correlated (r = 0.96, t 8 = 9.76, P < 0.001) between the two approaches. We thus used three consecutive nights to estimate the predation pressure for all other anuran species. Among the snakes, we observed primarily Protobothrops jerdonii, Elaphe taeniurus, Ptyas major, Naja atra, Trimeresurus stejnegeri, Bungarus multicinctus, and Dinodon rufozonatum. As an indicator of predation pressure, we calculated the mean number of individual snakes per square kilometer of transect area. For the same transects, we further counted any frogs for an estimate of population density per species. That population densities of anurans vary substantially more between than within species has been shown previously (41). On the basis of 10 species with at least three populations examined in our dataset, we here also confirmed greater variation in associated snake densities between than within our focal anuran species [repeatability = 0.93 (95% CI, 0.81 to 0.97), using the rptR package (48)]. We therefore focused on the same population as frogs were measured for each of the remaining anuran species, prioritizing the number of independent species over the number of populations within them.

Escape ability
Hindlimb muscle mass is an indicator of escaping ability (38) as the robust hindlimbs confer a locomotor advantage in swimming or hopping to escape quickly from predators. To quantify muscle mass, we extracted the four hindlimb muscles (sartorius, plantaris longus, triceps femoris, and gastrocnemius) from each leg of all individuals. We then dried these muscles using a thermostat drier of 60°C for 48 hours before quantifying their dry weight to the nearest 0.1 mg using an electronic balance (49).

Crypsis estimates
We used two approaches to determine the degree of crypsis of frogs in their environment.

Human eye approach
In a pilot study from 2015 to 2017, we obtained information on the degree of crypsis as apparent to the human eye for 49 anurans species (N = 307 individuals). To this end, we photographed frogs in their natural environment with a Nikon 5700 Coolpix camera and standardized their size to one-sixth of the total image area. We used a standard color chart to standardize the camera measurements for comparability of all values across species. We then asked 10 different observers (blind to the aim of the study) to evaluate the difference between body color and environment on a scale from 0 to 100, with higher scores indicating higher similarity between body color and environment (i.e., crypsis). The repeatability between human scorers was high (R = 0.96). When relating these crypsis scores to relative brain size data (collected in 2015 to 2017 as described above) in a phylogenetic regression (see below), we found a significant negative correlation (see Fig. 1). This prompted us to use more objective methods of scoring crypsis in a larger number of species.

Reflectance measurements and visual modeling
For the main study, we conducted field work between April 2018 and July 2020 in 102 species of frogs in southwestern China. We took reflectance measurements to assess the conspicuousness of the frogs on their specific substrate for conspecific and several heterospecific observers. On two or three different days per species during the time of highest activity (20:00 to 01:00 hours), we measured the spectral reflectance of the skin of a total 332 male and 145 female frogs, respectively, and of the specific substrate (e.g., leaves, trunks) where each individual was located. We quantified reflectance spectra of skin and substrate at 2-mm distance using an Ocean Optics HR2000+ Spectrometer fitted with an Ocean Optics bifurcal optic fiber (QP400-7-UV-VIS) with a fixed outer sleeve (to control for the 2-mm distance) and a deuterium-tungsten lamp (HL-2000-CAL). To account for lamp drift, we calibrated the measurements with a white standard (WS-1) every other frog. We measured illumination of the habitat (irradiance) using an optic fiber (QP400-2-VIS-NIR) with an Ocean Optics cosine adaptor-head (CC-3UV), accounting for lamp drift between individuals using Spectralon white standard measurements. We calculated average reflectance spectra for dorsal and ventral regions of each frog. For dorsal reflectance spectra, we averaged nine reflectance measurements (one of which taken on the head between the eyes, six in the middle of the dorsum, and two behind the dorsum). For ventral coloration, we averaged six reflectance measurements on the belly (one taken on throat region, three in the middle of the belly, and two behind the belly). There is no general sexual dichromatism in the species we used. However, predation pressure likely differs between males and females. As we obtained females for only half of the species because of both practical (females are more difficult to find) and ethical-conservation (females have a higher reproductive potential) reasons, we analyzed males and females separately.
To assess the overall conspicuousness of frogs to potential viewers, we calculated the chromatic and achromatic contrasts created by the body regions of a frog against its substrate in three representative visual systems using the receptor-noise limited model (20). This model has the advantage of including a discrimination threshold based on the observation that an animal's ability to discriminate between stimuli is limited by total receptor noise. In this model, chromatic and achromatic discrimination thresholds are expressed as just noticeable differences (JNDs), whereby 1 JND represents the difference between two stimuli that equal 1 SD of receptor noise (20). The model is limited, however, by not incorporating cognitive mechanisms that may affect color discrimination, such as spatial and temporal summation (50). However, it has been successfully applied to predict behavioral responses to visual cues in several species across several taxa (21). To explore how frogs may appear to their predators, we modeled contrasts of individual body regions in the visual system of three representative predator groups: (i) average snake (trichromat), (ii) average ultraviolet-sensitive avian (tetrachromat), and (iii) average violet-sensitive avian (tetrachromat).
We conducted all models using the package pavo v.2.1.0 (51) in R v.3.6 (R Core Team 2019), processing smoothed curves (span = 0.2) via vismodel (with "avg.uv," "avg.v," "bluetit," and "ctenophorus") and coldist functions. For these animal observers, we calculated achromatic contrast (L) and chromatic contrast (S) for each anuran species on its specific substrate. Brightness contrast yields negative results if frogs are darker than their specific background. Since we were more interested in their conspicuousness (i.e., their contrast to their substrate) than whether they were brighter or darker than their substrate, we used the absolute values of brightness contrasts. Last, we estimated the dorsal and ventral overall conspicuousness of the frogs on their substrates for the visual models of different observers. We calculated the overall conspicuousness (OC) between frogs and their background as the Euclidean distance (OC 2 = L 2 + S 2 ) based on the mean color and brightness contrasts for each species, as proposed by Cummings and Crothers (52), and used its inverse (i.e., 1/OC) as our measure of crypsis.

Phylogenetic reconstruction
To reconstruct the phylogeny, we obtained the sequences of nine nuclear, mitochondrial, and mitochondrial ribosome genes from GenBank (for GenBank accession numbers and sequence coverage, see the Supplementary Materials). The three nuclear genes included the recombinationactivating gene 1 (RAG1), rhodopsin (RHOD), and tyrosinase (TYR). The six mitochondrial genes were cytochrome b (CYTB), cytochrome oxidase subunit I (COI), NADH (reduced form of nicotinamide adenine dinucleotide) dehydrogenase subunits 2 and 4 (ND2 and ND4), and the large and small subunits of the mitochondrial ribosome genes (12S/16S; omitting the adjacent tRNAs as they were difficult to align and represented only a small amount of data). We aligned the sequences using multisequence alignment (MUSCLE) in MEGA v.6.0.6 (53). The best nucleotide substitution model, as determined in jModelTest v.2.1.7 (54) based on the AIC, was general timereversible (GTR) +  + I for all genes except RHOD, for which Hasegawa-Kishino-Yano (HKY) +  + I had stronger support.
Using BEAUTi and BEAST v.1.8.3 (55), we then constructed both the phylogeny with unlinked substitution models, a relaxed uncorrelated log-normal clock, and a Yule speciation process. We omitted time calibration because of lack of fossil dates. Using the BEAST implementation in the CIPRES Science Gateway (http://phylo.org), we ran the Markov Chain Monte Carlo simulation for 100 million generations while sampling every 10,000th tree. The effective sample size values exceeded 200 for all tree statistics in the program Tracer v.1.6.0 (56), indicating satisfying convergence of the Bayesian chain and adequate model mixing. Last, we generated maximum clade credibility trees with mean node heights and a 10% burn-in using TreeAnnotator v.1.8.3 (55), presented in fig. S1.

Ethics
The reported experiments comply with the current laws of China concerning animal experimentation, and permit to collect amphibians from the Ethical Committee for Animal Experiments in China Council on Animal Care was on hand at the time of sampling. The Animal Ethics Committee at China West Normal University approved the euthanasia of animals.

Statistical analyses
We conducted all statistical analyses in R v.4.1.2 (R Core Team 2021) using log-transformed data to improve data distributions.

Phylogenetic regression models
To account for nonindependence in regression models due to common ancestry, we used PGLS models (57,58) as implemented in the R package caper (59). We used a maximum-likelihood approach to estimate the phylogenetic scaling parameter , with values close to 0 indicating phylogenetic independence and values near 1 reflecting high phylogenetic dependence. We tested these models with estimated  values against models with  fixed at either 0 or 1 to determine the degree of deviation of  from these null models based on likelihood ratio tests. We report the P values of these tests as superscripts following the  values.

Models of correlated evolution
To test whether trait covariance was the result of correlated evolution, we performed Pagel's (36) directional test of trait evolution, using the fitPagel function in the phytools package (60), with "fitDiscrete" as the optimization method and allowing all rates to differ (i.e., "ARD" model). Using (the weight of) the AIC and likelihood ratio tests, in which the test statistic is asymptotically  2 distributed with df = 2 or 4 depending on rate parameters between models, we compared substitution models with (i) transitions in one trait being constrained on the other trait (but not vice versa; i.e., six rate parameters estimated), (ii) transitions being mutually constrained on one another (eight rate parameters), or (iii) transitions being constrained to be independent (four rate parameters). Since this approach is based on transitions between binary character states, we coded positive brain size residuals (from a PGLS against SVL) and above-mean values of predation pressure or crypsis as "high" and the remaining values as "low." These directional tests are most powerful if ancestral traits are estimated a priori, as this provides insights into the likely evolutionary pathways between ancestral and derived states. We thus first estimated ancestral trait values using a maximum-likelihood approach using the fastAnc function in phytools (60); nodes near the root of our tree indicated relatively high predation pressure, relatively small brains, and relatively high crypsis scores; and all variables changed directions several times across lineages. These replicated evolutionary changes, albeit still somewhat limited in number, should strengthen inferences about correlated evolution (61). To test for correlated evolution between predation pressure and anuran traits, we restricted the directional models to the latter evolving in response to predation pressure, but not the reverse. Between crypsis and brain size, however, we compared for all single-and double-dependent models of evolution as, in principle, each trait could influence the evolution of the other trait. Last, to determine whether any given transition was likely to occur, we tested its rate against the null hypothesis of no transition. To this end, we performed a likelihood ratio test for each state change (test statistic asymptotically  2 distributed with df = 1), comparing the corresponding dependent model with the same model after setting the target transition to 0.

Phylogenetic path analyses
To disentangle the links of the relative brain volume with predation pressure, crypsis, and hind leg muscle mass, we further performed phylogenetic confirmatory path analyses (37) based on predefined candidate path models. For each candidate model, we defined a set of d-separation statements (62) that linked all involved variables based on a hypothesis expressed in a directed acyclic graph ( fig. S3). We predicted that crypsis could be influenced indirectly by predation pressure via body size (with larger frogs being selected against if easily detectable or generally preferred by predators, or selected for if more difficult to capture), relative brain size (cognitive predator evasion), or hind leg muscle mass (escape ability). Alternatively, crypsis could directly respond to predation pressure and secondarily affect relative brain size and/or hind leg muscle mass. Similarly, relative brain size (either cognitive benefits or metabolic costs) and hind leg muscle mass (escape ability) could both also be directly influenced by predation pressure or indirectly via the other trait and/or via crypsis. Last, we included body size as an independent response to predation pressure, as a mediator between predation pressure and other variables, or only to account for allometric effects with no link to predation. To address the importance of allometry in all candidate models, we always causally linked SVL to both brain size and hind leg muscle mass such that any association of brain size or hind leg muscle mass with other variables was accounted for SVL analogous to a multiple regression with body size as a covariate (63,64). We explored 23 simpler to more complex models, which clearly did not exhaust the possible model space but were predicted to include all most likely scenarios of parallel and sequential dependencies between traits. Using the R package phylopath (64), we examined the conditional independence of each model in a PGLS framework, ranking all candidate models on the basis of their CICc and averaging those with CICc <2 from the top model (37,64).