A computational neuroscience framework for quantifying warning signals

Animal warning signals show remarkable diversity, yet subjectively appear to share certain visual features that make defended prey stand out and look different from more cryptic palatable species. For example, many (but far from all) warning signals involve high contrast elements, such as stripes and spots, and often involve the colours yellow and red. How exactly do aposematic species differ from non‐aposematic ones in the eyes (and brains) of their predators? Here, we develop a novel computational modelling approach, to quantify prey warning signals and establish what visual features they share. First, we develop a model visual system, made of artificial neurons with realistic receptive fields, to provide a quantitative estimate of the neural activity in the first stages of the visual system of a predator in response to a pattern. The system can be tailored to specific species. Second, we build a novel model that defines a ‘neural signature’, comprising quantitative metrics that measure the strength of stimulation of the population of neurons in response to patterns. This framework allows us to test how individual patterns stimulate the model predator visual system. For the predator–prey system of birds foraging on lepidopteran prey, we compared the strength of stimulation of a modelled avian visual system in response to a novel database of hyperspectral images of aposematic and undefended butterflies and moths. Warning signals generate significantly stronger activity in the model visual system, setting them apart from the patterns of undefended species. The activity was also very different from that seen in response to natural scenes. Therefore, to their predators, lepidopteran warning patterns are distinct from their non‐defended counterparts and stand out against a range of natural backgrounds. For the first time, we present an objective and quantitative definition of warning signals based on how the pattern generates population activity in a neural model of the brain of the receiver. This opens new perspectives for understanding and testing how warning signals have evolved, and, more generally, how sensory systems constrain signal design.

1. Animal warning signals show remarkable diversity, yet subjectively appear to share certain visual features that make defended prey stand out and look different from more cryptic palatable species.For example, many (but far from all) warning signals involve high contrast elements, such as stripes and spots, and often involve the colours yellow and red.How exactly do aposematic species differ from non-aposematic ones in the eyes (and brains) of their predators?
2. Here, we develop a novel computational modelling approach, to quantify prey warning signals and establish what visual features they share.First, we develop a model visual system, made of artificial neurons with realistic receptive fields, to provide a quantitative estimate of the neural activity in the first stages of the visual system of a predator in response to a pattern.The system can be tailored to specific species.Second, we build a novel model that defines a 'neural signature', comprising quantitative metrics that measure the strength of stimulation of the population of neurons in response to patterns.This framework allows us to test how individual patterns stimulate the model predator visual system.
3. For the predator-prey system of birds foraging on lepidopteran prey, we compared the strength of stimulation of a modelled avian visual system in response to a novel database of hyperspectral images of aposematic and undefended butterflies and moths.Warning signals generate significantly stronger activity in the model visual system, setting them apart from the patterns of undefended species.The activity was also very different from that seen in response to natural scenes.Therefore, to their predators, lepidopteran warning patterns are distinct from their non-defended counterparts and stand out against a range of natural backgrounds.4. For the first time, we present an objective and quantitative definition of warning signals based on how the pattern generates population activity in a neural model of the brain of the receiver.This opens new perspectives for understanding and

| INTRODUC TI ON
Aposematic prey have striking colour patterns that warn potential predators that they are unpleasant or unprofitable to eat (Cott, 1940;Mappes et al., 2005;Poulton, 1890;Rowe & Halpin, 2013;Wallace, 1867).Although diverse in nature (Briolat et al., 2019), some common visual characteristics, such as being yellow or red, or having 'high contrast internal boundaries' or 'repetitive elements', are commonly observed in the patterns of aposematic prey and are often considered to be key features that help to deter predators (Guilford & Dawkins, 1993;Mappes et al., 2005;Poulton, 1890;Stevens & Ruxton, 2012).Despite aposematism being a textbook example of adaptation and a key testbed for evolutionary theory (Cuthill et al., 2017;Mappes et al., 2005;Stevens & Ruxton, 2012), we lack an objective quantification of the common visual characteristic of these signals and rely on subjective descriptions of what typifies them.
Existing visual models developed to understand aposematic patterns focus on quantifying how conspicuous a pattern is against the background on which it is found.For example, studies typically use either mathematical properties of the pattern and the background, or model how neurons in visual areas encode these two elements (Barnett, Cuthill, et al., 2018;Barnett, Michalis, et al., 2018;Pike, 2018).While providing valuable insights into how aposematic prey appear against their backgrounds and particularly how conspicuous they might be to a foraging predator, these approaches have not tackled the question of whether aposematic patterns share common properties, or asked what those might be.Here, we take a different approach and apply computational models to compare the patterns of aposematic prey with those of palatable species.We significantly expand on previous spatiochromatic models by developing a two-part modelling framework, based on (1) the responses of classes of artificial neurons that process luminance, pattern and colour information (as others have done, e.g.Pike, 2018), and (2) the response of a novel population model emulating the neural network underlying predator vision.The latter step is important as it allows us to consider each pattern as a coherent whole, rather than breaking it down into notional constituent parts.We apply this computational approach to a novel database of lepidopteran colour patterns where the palatability of each species is known.We show that the diverse warning signals of aposematic prey produce specific neural signatures in the modelled visual systems of their predators that are stronger and distinct from the patterns of more palatable species.We also show that these responses are distinct from the model responses to natural backgrounds.
Our novel framework can quantify and define warning signals based on how the signals themselves are likely to stimulate early sensory systems independent of the backgrounds on which they are found.Our model also offers a predictive tool to test whether any specific prey is likely to be aposematic, based on its pattern, and suggests that it could be the strong neural responses elicited across a population of neurons that underpin predator responses to aposematic prey.

| Model part 1: Computational modelling of visual processing in the predator brain
We focussed on how the colour patterns of Lepidoptera stimulate the visual systems of birds.Birds predating Lepidoptera is a well-established and widely used model system for the study of defensive strategies, particularly aposematism and crypsis (e.g.Cuthill et al., 2005;Kapan, 2001;Ronka et al., 2020), Importantly, the palatability of Lepidoptera to their predators can be extracted from the literature (e.g.Chai, 1986;Pinheiro, 1996), and the visual system of the predator is also relatively well understood (Lind & Kelber, 2011;Olsson et al., 2015Olsson et al., , 2016;;Osorio et al., 1999).We defined a model to emulate avian vision, based on what we know about their photoreceptors and the first stages of their visual pathway (note, the same approach could be translated to other species of predator using available knowledge of their visual system, or even to other sensory modalities).Here, we used the best characterised model of avian vision, that of the domestic fowl (Gallus gallus domesticus) (Olsson et al., 2015(Olsson et al., , 2016;;Osorio et al., 1999;Wilby et al., 2015).
Since colour and luminance are processed in distinct pathways, we separately estimated the response to the patterns of double cones, thought to underlie luminance perception in birds (Bhagavatula et al., 2009;Lind et al., 2014;Osorio et al., 1999) (Model Part 1a, Figure 1c); and responses that underlie colour perception: the four classes of single cone photoreceptors, respectively, sensitive to ultraviolet (U), short (S), medium (M) and long (L) wavelength (Cuthill, 2006;Hart, 2001) (Model Part 1b, Figure 1f).For the achromatic pathway, scans were converted to an avian analogue of luminance using the absorption curve of double cones found in domestic fowl (Gallus gallus testing how warning signals have evolved, and, more generally, how sensory systems constrain signal design.

K E Y W O R D S
animal pattern, aposematism, avian vision, camouflage, computational neuroscience, defensive coloration, image statistics, Lepidoptera domesticus).For the colour pathway, scans were converted to colour response using cone absorption curves of the domestic fowl.

| Model part 1a: Luminance pathway
We used current knowledge of the neurobiological architecture that underlies luminance perception in birds.A key concept in biological vision is that of the receptive field.This is defined as a region of space where a sensory stimulus evokes a physiological response.In many taxa, including mammals and birds, pattern vision is achieved through the visual field being sampled by neurons with receptive fields that respond to particular scales of pattern and particular orientations (DeAngelis & Anzai, 2004;Engelage & Bischof, 1996;Hubel & Wiesel, 1962).We emulated that here.The luminance model consisted of units that encode luminance edges at specific topographical locations, for different orientations and spatial scales (coarse to fine), through oriented receptive fields of different orientations and size (see Supplementary Methods 2; Figure S1; Figure 1c (left)).Our model was based on neurons found in the initial processing stages of the visual system of mammals starting with the retina (Devalois et al., 1982;Hubel & Wiesel, 1962), which are also thought to be analogous to neurons found in the avian visual system (Engelage & Bischof, 1996;Li et al., 2007;Pinto & Baron, 2009).
This stage of the model comprised a population of units regularly distributed on a spatial ('retinotopic') grid and sensitive to edges with a given orientation and spatial scale (4 orientations and 2 scales shown in Figure 1c, see Supplementary Methods 2 for specific implementation details).The response of the model was computed by considering processing of the luminance images by this population of artificial neurons, followed by a process of nonlinear normalisation of each unit response by the response of neighbouring units.This assumes that the linear responses of each model neuron are modulated by the responses of surrounding neurons following a standard nonlinear centre-surround operation (Stoddard & Osorio, 2019).This operation, called 'divisive normalisation', is found extensively across sensory systems and increases the sensitivity to salient features (Carandini & Heeger, 2012;Itti & Koch, 2001) (Figure 1c).The output of the luminance model was a vector representing activity at each location for each orientation and spatial scale, in response to each pattern.This is visualised in Figure 1d as histograms of activity for each orientation, where each block represents a particular scale.As an example, the yellow-boxed region in information (Goldsmith & Butler, 2005;Osorio et al., 1999).We considered a regularly distributed grid of opponent neurons with a standard colour normalisation (Osorio et al., 1999, Figure 1f).We converted the responses of the simple cones into opponent channel information by considering the L-M ('red-green'), (L+M)-S ('yellowblue') and U-S ('ultraviolet-blue') channels.These three channels capture the chromatic information available (Osorio et al., 1999).
Since the detailed form of the receptive fields underlying colour opponency in birds is not yet identified (Kelber, 2019), we used information from other taxa for which the receptive fields are known (Johnson et al., 2008).We specifically selected the L-M channel for our colour analysis, as variation across the L-M and the (L+M)-S channels was highly correlated for the samples in our database and the response of the U-S channel was similar for the patterns of aposematic and non-aposematic prey (see Supplementary Methods 1) (Figure 1f).This means that the main differences between aposematic and non-aposematic patterns in terms of colour were along what are commonly known as the red-green and yellow-blue axes in colour space, not the ultraviolet-blue axis.
To allow the full range of visible wavelengths to be considered, we exposed the model to a set of hyperspectral images of Lepidoptera (spectral range 350-800 nm, see Section 2.3 below).
The output of the colour model was a vector of encoding activity in response to each pattern (as per Figure 1d, representing response at each location for each orientation and spatial scale).In the example shown in Figure 1d, the AP pattern delivers a more varying response (top) than the non-AP pattern (bottom).

| Model part 1: Output across luminance and colour pathways
The output of Part 1 of our model provided two vectors of population activity for each image.These capture activity at each location, orientation and spatial frequency, emulating how luminance and colour are neurobiologically encoded during the initial processing stages of the visual system (Figure 1d,g).A strength of our approach is that straightforward changes to Part 1 of the model allow adaptation to any chosen predator species for which we know the basics of early luminance and colour processing, for example, for bird species with different sensitivities for the L or M cones.Model Part 2 did not retain information on the (L+M)-S and U-S channels (see below) as most of the chromatic information from our Lepidoptera database is at longer wavelengths.Those channels are maintained in Model Part 1 as they are likely to be important when applying the framework in other contexts such as sexual selection.In this case, it would be straightforward to alter the input to the U-S channel for a bird species with a cone type with sensitivity further into the ultraviolet (U type) and matched changes in S cone sensitivity, such as a passerine (Cuthill, 2006;Odeen & Hastad, 2013).The goal of this paper is primarily to showcase the method rather than investigate differences due to predator visual systems; hence, we show modelling based on the domestic fowl only.

| Model part 2: Metrics of modelled neural activity
The novel part of our modelling approach was to consider the effect of a prey pattern on the whole population of artificial neurons.
To obtain a measure of how the population of artificial neurons are stimulated by a single pattern, we defined metrics that summarise the activity of the whole population.Specifically, we defined three summary statistics to characterise modelled brain activity, which we refer to as a 'neural signature' (for the full range of statistics considered, see Supplementary Methods 1).For luminance, we computed the 'luminance contrast' of the patterns using the standard deviation of the luminance population activity, a metric that is a robust correlate of brain activity (Kay et al., 2013;Watson et al., 1983).
Natural scenes have a consistent distribution of contrast across orientations, and deviation with respect to this distribution is important in scene perception and in object categorisation (Girshick et al., 2011;Torralba & Oliva, 2003).With that in mind, we defined a new metric, 'orientation distribution deviation' (ODD), that provides a measure of how the distribution of signal across orientations deviates from that statistically found in natural scenes (an illustration of the two metrics calculated for an AP sample and a non-AP sample is shown in Figure 1e).Our ODD measure considers how the evenness of the distribution of edge orientations at each location on a pattern compares to the typical evenness of the distribution found in natural images.Our baseline was an estimate of the evenness of the distribution of orientations in natural scenes.This estimate was obtained by calculating probability distributions from the histograms of oriented edge energy across orientations for image patches from a large set (more than 1000) of natural images (van Hateren & van der Schaaf, 1998) and at each location on these images, and then computing their 'evenness' as the Shannon entropy of the resulting probability distributions (Cover & Thomas, 2006).The baseline Shannon entropy was computed as the grand average of all the evenness values (2.5 for the model with eight orientations).The ODD is then calculated for each pattern as the standard deviation of the vector of the differences between the Shannon entropy for that pattern at each location and the estimate for natural scenes in general (see Supplementary Methods 3 for details).For example, a stripey pattern will have high ODD because it will contain a peak in the probability distribution for the orientation of the stripes and will have much lower probability at all other orientations.
For colour, we computed the 'colour contrast', defined as the standard deviation of the L-M channel, akin to the computation of 'luminance contrast' (an illustration for the AP and non-AP samples is shown in Figure 1h) (Chaparro et al., 1993).
Overall, these analyses delivered three numbers for each pattern, forming a neural signature that can be plotted in a threedimensional (3D) 'pattern space' (Stoddard & Osorio, 2019) (Figure 1i shows an illustrative example for the AP and non-AP samples shown in Figure 1a).Thus, the mathematically defined 'neural signature' can be thought of as a location in a 3D space that defines the whole animal pattern.For all metrics, we combined dorsal and ventral patterns because we wanted to consider each pattern as a coherent whole (see Supplementary Methods 3 for details).
Compared with other mathematical measures of contrast based on adjacent pixel values, for example root-mean-square (RMS) or Michelson contrast (Aronsson & Gamberale-Stille, 2009;Halpin et al., 2020;Prudic et al., 2007), our neural signature captures the spatial structure and arrangement of patterns.To illustrate this, we manipulated the spatial structure of a lepidopteran prey.We randomly scrambled an increasing number of pixels from a pattern, starting with zero percent scrambling (original pattern) to 100% scrambling (all the pixels randomly moved, Figure 2a).This increasingly removed the spatial content of each pattern while retaining luminance and colour content at the pixel level.The luminance contrast and ODD of our model activity progressively decreased (Figure 2b, luminance contrast signature shown in green, ODD in blue).Figure 2c shows that measures of contrast such as the RMS or the Michelson contrast are insensitive to the amount of random scrambling, since they are solely based on pixel information and do not use information about the relative location of the pixels.Therefore, considering models that use receptive-field like structures (Part 1) is essential for effectively discriminating between patterns (see Figure S1 for more details).

| A database of lepidopteran patterns
To apply the proposed framework, we built a novel database of lepidopteran patterns of aposematic (AP) and non-aposematic (non-AP) species.To build our database, we first searched Google Scholar from 1980 onwards using the term 'aposem*'.From the studies returned, we identified aposematic lepidopteran species and selected them for our study where evidence was consistent with them being defended (e.g.being rejected by predators, or containing known toxins).We then searched for 'palatable' spe- details).Samples of each species were located in museum collections (the Natural History Museum (BMNH), London, UK; the Manchester Museum (MMUE), Manchester, UK; and the American National Museum (AMNH), New York, USA), and their dorsal and ventral sides were photographed using a hyperspectral camera (Figure 1a,b).In total, we photographed the dorsal and ventral sides of 331 specimens (AP, N = 244, average number of specimens per species 5.1, std 2.9; non-AP, N = 87, average 6, std 2.8) from the selected species, giving a total of 676 hyperspectral images.Full details on how the list of species was developed and hyperspectral image acquisition are available in Supplementary Information and Supplementary Methods 1.A sample of the database is shown in Figure 3.The database is freely accessible at https:// arts.st-andre ws.ac.uk/ lepid optera/ index.html.

| Statistical analysis
To test our main hypothesis of the discriminability of AP and non-AP patterns in our modelled neural stimulation space, we ran linear mixed models with pattern category (AP/non-AP) as the independent variable.As predicting pattern membership has potential applications, we also provide the output of logistic regressions, with odds ratios to measure effect size.For this predictive exercise, it should be noted, however, that there are other drivers of colour pattern (e.g.sexual selection), and palatability is still important for confirming anti-predator strategy.

| Combination of luminance metrics and colour
Combining colour and luminance metrics better discriminates between aposematic and non-aposematic patterns than either dimension alone.Figure 5c shows scatterplot of the three metrics, with background colour corresponding to predicted pattern category (orange, AP species; pale blue, non-AP species) according to the binary classification provided by a logistic regression of pattern category on luminance contrast, ODD and colour contrast for the full three-dimensional pattern space.The predictive power of this statistical model, combining colour contrast with the two luminance summary statistics, was higher than that of a simpler model including only the two luminance summary statistics (χ 2 = 5.66, df = 1, p = 0.0174, ΔAIC = 73.0-76.4= −3.4) or the colour summary statistics only (χ 2 = 36.48,df = 1, p = 1.20 × 10 −8 , ΔAIC = 73-105.5= −32.5).We also visualised luminance contrast, ODD and colour contrast in a three-dimensional pattern space (Figure 5c).The space can be separated into two regions (shown by pale blue and orange shading in Figure 5c), with aposematic patterns typically associated with higher values for the three summary statistics compared to non-aposematic patterns.The separation correctly classified 87.2% of the species (evaluated using 10-fold cross-validation, see Supplementary Methods 4).

| Analyses within Lepidoptera families
If these neural signatures characterise warning signals, we expect to see them replicated at different taxonomic scales.To explore this, we repeated the comparisons of the three metrics above using the five families in our that data set that include both aposematic and nonaposematic species (Erebidae, Geometridae, Nymphalidae, Pieridae and Pyralidae).We used a bootstrapping method to draw pairs randomly (with replacement) to repeatedly resample the maximum number  ).Consistent with our overall findings, we found that luminance contrast, ODD and colour contrast were generally higher for aposematic than non-aposematic species in the five families (Figure 6, all p < 10 −6 except for ODD in Pieridae, see Supplementary Result 3).
F I G U R E 4 (a) Graphs show luminance contrast, Orientation Distribution Deviation (ODD) and the best linear combination between luminance contrast and ODD statistics of the model population activity in response to AP (orange, N = 96) and non-AP (blue, N = 29) patterns.Values correspond to the species average across all specimens and both sides (dorsal and ventral).Boxplots show median, the 25th and 75th percentiles (lower and upper hinges), the lowest measured values within Q1 (first quantile) and 1.5 × Q1 (lower whisker) and the highest observed value within Q3 (third quantile) and 1.5 × Q3 (upper whisker).(b) Scatterplot of luminance contrast and ODD as a twodimensional pattern space.Background colour is predicted pattern category (pale orange, AP species; pale blue, non-AP) from a logistic regression (see Section 2).Each species can be identified in Supplementary Result 2, Figure S4.F I G U R E 6 (a) Comparison of the luminance contrast; (b) Orientation Distribution Deviation (ODD); and (c) colour contrast summary statistics between AP species (orange dots) and non-AP species (blue dots) within the same family for all families in the database that contained both AP and non-AP species (family, total number of species = number of non-AP species + number of AP species: Erebidae, 13 = 1 + 12; Geometridae, 17 = 9 + 8; Nymphalidae, 61 = 12 + 49; Pieridae, 8 = 4 + 4; Pyralidae, 2 = 1 + 1).All conventions as in Figure 4.

| Aposematic species stand out in typical natural scenes
Aposematic signals are thought to have been selected to not only enhance predators' abilities to discriminate between palatable and defended prey, but to also increase prey conspicuousness in natural environments and enhance predator avoidance (Stevens & Ruxton, 2012).To test this, we first presented patches of natural scenes to our model to extract their luminance and colour neural signatures.We then compared the differences in frequency distributions of our three summary statistics between natural backgrounds and those for aposematic and non-aposematic prey (Figure 7).patterns appear to share distinct 'neural signatures' that could make them stand out from palatable prey and a wide variety of natural backgrounds, and potentially make them easier to learn and avoid.
Our results provide objective evidence for the (previously subjective) observation that lepidopteran warning signals share the features of high contrast, bold (often long wavelength) colours, and distinctive patterning that differentiates them from both backgrounds and nonaposematic prey.They additionally reveal that there are many ways to be aposematic: patterns and colours that appear very different to the experimenter can be similarly potent aposematic patterns to a model visual system.Importantly, the model framework can be applied to a range of signalling systems in order to generate testable predictions about how selection has shaped signals to be particularly effective against their intended receivers.
In recent years, several modelling approaches to understand animal defensive coloration have integrated biologically realistic elements of predator vision (Pike, 2018;Stevens & Cuthill, 2006;Stoddard et al., 2014;Troscianko et al., 2017;van den Berg et al., 2020).Some work has quantified coloration patterns on a continuum between crypsis and conspicuousness using the response of units sensitive to luminance edges with receptive fields similar to those in our model.For example, modelling with such units has been used to measure how an animal pattern disrupts its outline on a given background, to quantify disruptive colouration (Stevens & Cuthill, 2006;Troscianko et al., 2017).Conspicuousness with respect to a background can be quantified following a generic model of visual attention (Itti & Koch, 2000) by comparing the distribution of responses of similar units between target animal and background (Barnett et al., 2017(Barnett et al., , 2021;;Michalis et al., 2017;Pike, 2018).Our work is different in emphasis as it aims to understand the design of warning signals per se, by characterising how these signals specifically stimulate a detailed model of the visual brain of the receiver, with no reference to a specific background.This allows us to define a 'pattern space' (Stoddard & Osorio, 2019), based on visual processing of evolved colour patterns as a whole rather than a sum of separate components, so that patterns can be compared with one another, across species, as well as against natural backgrounds.
Our approach and findings emphasise that there may be no simple 'recipe' for building a pattern that is strongly aposematic, but instead suggests a general principle: that an aposematic pattern has a specifically strong effect on visual brain areas in predators.In other words, aposematic signals do not have to rely on the presence of specific physical colours or specific physical pattern elements (Aronsson & Gamberale-Stille, 2009;Guilford, 1990;Stevens & Ruxton, 2012), but on the effect, pattern elements have on the brain of the receiver.This can explain the diversity of warning signals (Stevens & Ruxton, 2012), as it means that there are many ways to produce a strong aposematic signal, and suggests that a range of patterns that look very different to us may affect predators in very similar ways (see Figure 4 insets showing two differently patterned species, with similar neural signatures).It also means that there is a risk that some aposematic patterns have been overlooked by researchers, and our work may facilitate the discovery and study of aposematic species with patterns that fall outside what the literature has considered the norm.It also challenges the assumption that warning signals without typical features described in the literature are somehow 'weak' and less effective (Wuster et al., 2004), and instead helps to generate testable predictions about which patterns will be the strongest and most effective (Halpin et al., 2020).
Our results suggest that warning patterns exploit sensory mechanisms through eliciting stronger neural signals in predators' brains.
While our results are based on a single predator-prey system, the ways in which visual processing is conserved across taxa would suggest that our finding can be extended to warning signals more generally.Our modelling was based solely on processes that occur before any cognitive processing of the visual information occurs, and for all three metrics we considered, there was greater activity in the modelled brain for the aposematic patterns than the nonaposematic patterns.This suggests a hitherto non-contemplated reason for why warning signals have an effect on predators that provides a clear prediction for future testing: Sensory processing alone could explain why warning signals are easier to learn and remember (Santangelo, 2015).
When comparing animal patterns against a wide range of generic natural backgrounds, we found that the frequency distributions of our three metrics were rather similar for backgrounds and non-aposematic prey (Figure 7); yet there were strikingly different between backgrounds and aposematic prey.This offers a statistical explanation for which patterns might offer camouflage or conspicuousness.Importantly, Figure 7 shows strong evidence that it may be possible for aposematic patterns to systematically differ from most natural backgrounds.Natural scenes, despite their apparent diversity, share consistent regularities, for example, in how contrast varies across spatial scales (Field, 1987).Strong theoretical and empirical evidence shows that visual systems adapt over evolutionary time to these statistical regularities (Atick & Redlich, 1992;Baker & Graf, 2009;Barlow, 1961;Field, 1987;Parraga et al., 2000).Recent evidence suggests that these regularities may play a role in sexually selected traits (Hulse et al., 2020;Renoult et al., 2016).If a pattern departs from the statistical structure of natural scenes by deviating from the way contrast varies across scales, as arrangements of spots and stripes do (Penacchio, Otazu, et al., 2023;Penacchio & Wilkins, 2015), it will differ from most natural backgrounds.
This work also has wider implications for the understanding of visual signalling.Although focussed on how Lepidopteran patterns stimulate a model avian visual system, our approach is based on wellknown components of visual systems that are likely to be conserved across a range of species (Kelber et al., 2003;Osorio & Cuthill, 2015), meaning that it could potentially be used to study the patterns of animals across different contexts with a wide variety of receivers.
While our model could be refined as we learn more about avian brains, especially the machinery of avian colour vision including its spatial organisation (Kelber, 2019), the key point is that we have added a novel development to literature on sensory drive, sensory exploitation and receiver psychology (Endler & Basolo, 1998;Guilford & Dawkins, 1993) by offering an objective and quantitative definition of warning signals grounded in how patterns trigger activity in a model of predators' brain.

Figure
Figure 1d delivers higher response at vertical orientation for AP than non-AP patterns (see yellow-boxed areas, orange = AP, blue = non-AP).
cies from the same families for a representative sample of palatable non-aposematic species (any Batesian mimics of aposematic species identified in the literature search were excluded).Again, we checked the literature for evidence of palatability for each species used.The representative set consists of 125 species of Lepidoptera across 12 families for our analysis (96 aposematic and 29 non-aposematic species, see Supplementary Material for F I G U R E 2 (a) (Top row) Random scrambling of an example image (Arctia caja, dorsum), from 0% (top left, original image) to 100% (top right, random permutation of all pixels in the pattern) and (bottom row) luminance model total activity (i.e.summed over all orientations and scales) in response to the patterns at the top.(b) Luminance neural signatures against amount of scrambling.(c) Pixel-based metrics of contrast against amount of scrambling (root-mean-square and Michelson contrast lines are overlain).
Therefore, taken together, our framework based on avian visual processing provides a clear separation between warning signals and patterns of undefended species.Note that the separation is based on objective differences in a neural stimulation space and does not correspond to 'how similar' the patterns may appear to us.Insets in Figure 5c give an example.The dorsal (D, left side) and ventral (V, right side) colouration of two AP species with adjacent neural signatures is shown (Diaethria clymena, left, and Danaus plexippus, right).These patterns look very different, but have similar neural signatures.

F
I G U R E 5 (a) Colour contrast and (b) best linear combination between luminance contrast, Orientation Distribution Deviation (ODD) and colour contrast for AP (orange) and non-AP (blue) patterns.(c) Scatterplot of luminance contrast, ODD and colour contrast as a threedimensional pattern space.Background colour is predicted pattern category (pale orange, AP species; pale blue, non-AP) from a logistic regression (see Section 2).Background colour is predicted pattern category (orange, AP species; pale blue, non-AP species) from a logistic regression.Insets: the dorsal (D, left side) and ventral (V, right side) colouration of two AP species with adjacent neural signatures (Diaethria clymena, left, and Danaus plexippus, right).Image credit: D. clymena dorsal and ventral adapted from Geoff Gallice (CC-BY-2.0);D. plexippus adapted from Didier Descouens (CC BY-SA 3.0).
Figure 7d corresponds to a single patch in the van Hateren database of calibrated natural images (van Hateren & van der Schaaf, 1998) (seeSection 2).These data suggest that aposematic patterns do not simply have colours and patterns that are different from those found in natural scenes but have been selected to deliver a stronger neural signature, and thus be more conspicuous in the natural world.