Optimising colour for camouflage and visibility: the effects of the environment and the observer’s visual system

Avoiding detection can provide significant survival advantages for prey, predators, or the military; conversely, maximising visibility would be useful for signalling. One simple determinant of detectability is an animal’s colour relative to its environment. But identifying the optimal colour to minimise (or maximise) detectability in a given natural environment is complex, partly because of the nature of the perceptual space. Here for the first time, using image processing techniques to embed targets into realistic environments, psychophysics to estimate detectability, and deep neural networks to interpolate between sampled colours, we propose a method to identify the optimal colour that either minimises or maximises visibility. We apply our approach in two natural environments (temperate deciduous forest and Mediterranean scrub) and show how a comparatively small number of samples can be used to predict robustly the most and least effective colours for camouflage. To illustrate how our approach can be generalised to other non-human visual systems, we also identify the optimum colours for concealment and visibility when viewed by red-green colour-blind dichromats, typical for non-human mammals. Contrasting the results from these visual systems sheds light on why some predators (e.g. tigers) seem, at least to humans, to have colouring that would appear detrimental to ambush hunting. We found that for simulated dichromatic observers, colour strongly affected detection time for both environments. In contrast, trichromatic observers were far more effective at breaking camouflage and detecting targets and while there were effects of colour, they were comparatively small. Author Summary Being the right colour is important in a natural and built environment, both for hiding (and staying alive) or being seen (and keeping safe). However, empirically establishing what these colours might be for a given environment is non-trivial, depending on factors such as size, viewing distance, lighting and occlusion. Indeed, even with a small number of factors, such as colour and occlusion, this is impractical. Using artificial intelligence techniques, we propose a method that uses a modest number of samples to predict robustly the most and least effective colours for camouflage. Our method generalises for classes of observer other than humans with normal (trichromatic) vision, which we show by identifying the optimum colours for red-green colour-blind observers, typical for non-human mammals, as well as for different environments, using temperate woodland and Mediterranean scrub. Our results reveal that colour strongly affects detection time for red-green colour-blind observers in both environments, but normal trichromatic observers were far more effective at breaking camouflage and detecting targets, with effects of colour being much smaller. Our method will be an invaluable tool, particularly for biologists, for rapidly developing and testing optimal colours for concealment or conspicuity, in multiple environments, for multiple classes of observer.


Introduction
Recently, interest in camouflage among evolutionary biologists has grown considerably [1], and many of the basic principles of how to conceal oneself have become far clearer. The range of research is wide and empirical support has been provided for many of the diverse strategies employed in the animal kingdom. Studies measuring the effectiveness of camouflage tend follow the same basic format: a small number of colours, patterns or colour/pattern combinations are generated that capture the proposed camouflage principles; and then the utility of the camouflage is evaluated, perhaps in the field by measuring predation rates, or in the laboratory measuring detection speed and accuracy, identification ability, or capture rate, using either human or nonhuman subjects. The same basic method is also used in the assessment of military camouflage [e.g. [2][3][4][5]. If the goal is to compare only a few colours/patterns in a given context then this strategy has much to commend it, being both simple to analyse and easy to understand. However, if the question is "what is the optimal camouflage strategy to employ in a given context?", the approach is ineffective: the range of possible patterns is too large.
Optimal camouflage depends on a diverse range of factors: size, viewing distance, height above the ground, lighting, occlusion, the nature and variability of the environment, as well as the characteristics of the visual system of the observer [1,[6][7][8][9][10]. The optimal colours and patterns may also vary depending on the mechanism by which the camouflage acts, whether to hinder detection, identification, selection or capture [1,10]. Consequently, in the animal kingdom, the range of camouflage patterns and strategies is wide; in human applications (e.g. military), the range of potential patterns is even wider because pattern generation is not constrained by biological mechanisms [11]. A reliable, systematic means of finding the optimal colouration and pattern for either minimising (camouflage) or maximising (conspicuity) visibility for a given range of environments would have wide applicability.
Here we concentrate on one simple but important characteristic of camouflage: its colour. Partly this is because colour is obviously an important property in determining the visibility of a target but, more importantly, because the space of all possible colours is far larger than traditionally explored.
If colour could be characterised by a single dimension (say simply its luminance), then identifying the most (or least) concealing colour in a given context would be straightforward. We could systematically vary the colour along this single dimension and use a principled method to assess its visibility: finding maxima (and minima) in one dimensional spaces is simple. In contrast, even though colour is relatively low dimensional (three), an exhaustive evaluation of all colours, even if done at a course scale, scales badly: the number of locations required in colour space increases exponentially with dimensionality. We would like a method that could scale to this number of dimensions, and if this works, hopefully scale it to more.
Equally, investigating only those colours and patterns seen in nature [e.g. 12] omits possibilities that became extinct without leaving a fossil record, or those that evolution has not realised because of phylogenetic or developmental constraints. To address the challenges presented by a large multidimensional parameter space, without needing to impose artificial constraints, we propose a method for identifying optimal colours, patterns or colour/pattern combinations in any given context that uses deep neural networks. Specifically, we use them to interpolate smoothly between the colours that have been (noisily) tested, to other colours that have not.
Neural networks have been used for finding structure in unlabelled data (unsupervised learning) [13]; classification of inputs based on previously labelled data [14]; or regression (predicting real valued measurements) [15]. In some ways this may be considered a "sledge-hammer" approach: usually the simple problems such as interpolating a three-dimensional space would be dealt with a simpler method such as Gaussian process-based smoothing [16]. However, such methods often inherit strong assumptions, such as constant variability/noise for all values of the function. While these assumptions may be reasonable for the simple three-dimensional problems studied here, deep neural networks are a more general solution and can potentially be applied to more complicated spaces. Here we use deep neural networks to implement non-linear regression and use it, after training, to interpolate between measured inputs and predict responses for unseen inputs.
While the data sampling requirements of our method are modest compared with contemporary 'big data' standards, they are nevertheless large enough to preclude field trials. Using computer presentation and human participants, we can change stimuli rapidly and accurately capture the reaction times taken to identify them. However, because many camouflage strategies (such as concealment of shape based on countershading [17]) simply do not make sense in a uniformly illuminated two-dimensional world, and many objects are effectively impossible to conceal unless partly hidden by the foreground, we built our stimuli using multiple layers in order to achieve some level of realism. Our stimuli superimposed three layers: 1) a foreground occlusion layer; 2) a target layer; and 3) a background layer. We then used these stimuli to construct a visual search task that in some sense matches the task of predators and prey, albeit without active movements through the environment. In this way we can control each of the dimensions of interest.
To provide some confidence that the approach generalises, we demonstrate our method using human participants to identify targets in trichromat and (simulated) dichromat colour in two natural environments. Dichromatic colour is straightforward to simulate for trichromats, using image processing; though the downside is the lack of the lifetime's experience of dichromacy that a natural protanope has, something returned to in the discussion. The natural environments we used were temperate deciduous forest and Mediterranean scrub. We show: (i) that our methods allow rapid presentation of coloured objects embedded in realistic environments; (ii) how neural networks can be combined with bootstrap techniques to provide a statistical characterisation of the visibility function (the mapping between the colour of an object and its geometric mean detection time); and (iii) that the optimally concealed and conspicuous targets depend not only on the environment they are embedded in, but also on the nature of the visual system of the observer.

Results
Data for each condition were combined to provide a trichromat dataset and dichromat dataset (each one 500 trials x 10 participants = 5000) for each geographical location. In order to be able to interpolate and predict reaction times for colours that had not been sampled during the experiment, and to take account of inter-subject variability in responses, deep residual neural network models were built using Keras [18] running TensorFlow [19]. To provide for a measure of accuracy in our predictions (an estimate of standard error) we created 100 bootstraps of our network. The bootstrap is particularly useful when the value of interest is, as in this case, a complicated function [20], and by averaging the bootstrapped networks predictions we calculate both a data dependent smoothing of the reaction time function and an estimate of our certainty of its estimate. Configuration and parameters for the network can be found in Fig S1 (supplementary information). Using the bootstrapped models, we submitted 16,777,216 colour samples (i.e. the whole RGB gamut), collecting predicted reaction times for each. From the bootstrap values, we found the minimum and maximum reaction times and their associated easiest and hardest to see colours. Table   1 shows the extreme reaction time values produced by the neural networks. All statistics below were calculated using random permutation tests for the colours with the highest and lowest reaction times for each of the 100 bootstrapped networks, all based on 100,000 resamples. Permutation tests were selected due to the underlying distribution of the neural networks being uncertain.
Targets were detected significantly slower in the dichromat treatment than in the trichromat treatment in both environments (Fig 1: all p < .001 except the comparison between hardest trichromat and hardest dichromat for the forest, p = .002). The difference between the hardest and easiest to find colours, within colour conditions, was also found to be significant for both colour conditions (all p < .001). P-values were adjusted for multiple comparisons with False Discovery Rate [21]. One JND in the present context refers to 2.3 units in LAB space [22,23]. Taking the easiest-to-find colours for the forest environment shows that absolute easiest colour, according to the neural network, is yellow. However, red and pink hues were found to be within one JND (or 9 ms) and can be considered to be similarly easy to find.

Site Condition Colour range (darkest to lightest)
Forest Trichromat Easy For each geographical location and condition the colour strip represents, for illustration, the first twenty colours that were at least 1 JND from each other (i.e. colours within 1 JND are omitted as there would be no perceivable difference between them). Hues have been ordered darkest to lightest and the strips represent time span (top to bottom) of 9ms, 49ms, 3ms, 2ms, 1ms, 11ms, <1ms, 1ms, respectively. Note that one JND in this context refers to 2.3 units [22] in CIEDE2000 LAB space [23].

Discussion
Based on an approach using simple image synthesis, psychophysics, and deep neural networks for interpolation, we identified the optimal colours for camouflage and conspicuity, an approach not previously tried for multidimensional perception-based experiments. Trichromat observers were significantly quicker than simulated dichromatic observers to identify simple coloured targets in both temperate deciduous forest and Mediterranean scrub scenes. Interestingly, in some conditions the distribution with respect to hues appears to be multi-modal; for example, the hardest to find colours for the trichromat scrub condition are either shades of dark olive (resembling shadows) or a lighter tan shade (resembling dry grass). This suggests that, unsurprisingly, there might be multiple solutions to the same problem, which intuitively seem to represent what is seen in natural and human-made camouflage [11].
The result that trichromatic vision is more effective at breaking camouflage seems to run counter to oft-quoted historical accounts of the military value of dichromatic observers and contemporary theories for the maintenance of visual pigment polymorphisms in many New World monkey species [24,25]. However, the most recent work in this area suggests that evidence supporting an advantage for dichromats in camouflage breaking is, at best, equivocal [26]. This view seems to be confirmed by a brief survey of the literature. In one paper, Morgan, Adam and Mollon [27] review literature from as early as 1940 [28], which claims that dichromatic benefit would accrue in only limited situations, describing the early literature as largely descriptive and offering no empirical support. Morgan, Adam & Mollon [27] go on to describe their own empirical work with human observers, reporting dichromatic advantage, but their experiments were limited to a precisely controlled geometric display. Another study tested white-faced capuchins [29], arguing that some benefit accrues for dichromats, however, it is difficult to untangle the confounding effects of different light levels and relative abundance of target insects. Lovell et al. [30] investigated both trichromat and dichromat visual systems with respect to changes of illuminant in natural scenes, concluding that a foraging advantage accrues to trichromatic mammals because their visual system is less confounded by abrupt and unpredictable changes in illumination [p2069]; that is, it is less affected by shadows and changes in illumination. This is consistent with the present results. An advantage for dichromats under particular conditions, but overall advantage for trichromats, seems to reflect the broad findings of this literature; indeed, it is the overall conclusion of Troscianko et al. [26]. They found that trichromats perform better, but under particular conditions dichromats have an advantage. Our own results arguably offer confirming evidence that, on average, across the whole colour gamut, trichromats perform better than dichromats, in two dissimilar environments. The intuitive statement below seems to sum up much of the empirical work that has been carried out: glass, it would be most unlikely that the colour-blind person would ever be able to score off him." [28] Comparing trichromat and dichromat vision does not say anything about why, for example, a tiger is orange, rather than some shade of green; the latter should be more appropriate camouflage for an ambush hunter. Some insight can be gained from examination of the dichromat plots in  Based on our results and given that most mammals have dichromatic colour vision that is unable to reliably differentiate brown and green, it seems that there is little benefit to actually become green if the receiver is dichromat. Hence predators (e.g. tigers), whose main prey is other mammals (e.g. ungulates), experience little evolutionary pressure to evolve green colouration. Moreover, producing a green coat would require a significant change to mammalian biochemistry since mammals rely on the large polymers, eumelanin and phaeomelanin, to produce black and yellow-red colours, which are the basis of the limited palette we see [31]. Indeed, the only mammal with a green coat is considered to be the sloth whose colour is actually due to a green alga (Trichophilus welckeri) that grows in its fur [32].
What constitutes the best colour for camouflage therefore depends very much on the receiver; we try to illustrate this in Fig 5 using the colours identified using our method. Most ungulates, are dichromats [33,34] and, for them, most of their predators, like tigers, are effectively green. We note that the colour of a tiger viewed by a dichromatic receiver (left panel of Fig 4) and the hardest-tofind dichromatic colour in the forest from our experiment (third panel of Fig 5) are very similar. This is in contrast to the trichromatic tiger (right panel Fig 4) and the trichromatic colour from our experiment (first panel of Fig 5), where the colour difference is far greater. This supports the idea that tigers are camouflaged against dichromatic receivers such as Sambar deer (tigers' main prey) [35][36][37].
Based on our results, for species seeking concealment from dichromats there appears to be little pressure to actually become green. In contrast, when hiding from trichromats, simple colouration is not that effective. The open question is therefore not why tigers are not green, but why their major prey are not trichromats. Images for (1) were acquired using a large blue screen (1.8m x 2.8m blue cotton muslin photography background cloth mounted on a lightweight frame) that could be easily manoeuvred across the scene captured for (3). The blue-screen images were used with a chromakey technique to create occlusion of the search object during stimulus construction. Again, these images were captured using the tripod mounted Nikon D90 digital SLR.
The captured occlusion layer images were pre-processed in order to obtain the location of the blue screen as a mask. This provided for permissible locations of the centre of the search object that we wanted participants to find (see below), and identified all of those pixels that were needed to form the occlusion. This pre-processing allowed a location for the search object to be rapidly chosen and A bespoke program, written using Matlab [38] and the Psychtoolbox-3 extensions [39,40], was used to construct and present the stimuli, and to collect experimental data.

Stimulus construction (presentation)
During each trial, stimuli were constructed by randomly choosing a background image, together with its associated occlusion image, from a pool of 32 images and their permissible locations for the stimulus, for each geographical location. The occlusion image was pre-processed from the blue screen image and a matrix produced (the same size as the background image) containing a logical 'true' for every permissible centre for the search object. The combination of backgrounds (32 per location) and potential positions for the search image (mean 284,650 per image) provided a very large number of possible scenes. The target was a sphere, 128 pixels in diameter, constructed dynamically using a sample colour with realistic illumination/countershading to achieve a spherical look (an example of a coloured sphere is shown in the central panel of Fig 6). While we acknowledge that there are few perfectly round/spherical things in nature, we chose a sphere because it was easy to create and shade to look realistic. Maintaining a constant size and shape also had the benefit that any effects that might be attributable to changing shape could be discounted.
Based on the mask, a pixel position was randomly chosen as the centre point for the sphere and the sphere superimposed on the background. Also using the mask, the pixels occluding the sphere were then superimposed onto the sphere. Examples of the completed stimuli are shown in lower panels of Bottom right: a dichromat stimulus example using the temperate woodland background images.

Procedure
Images were projected on to a 1900x1070mm screen (Euroscreen, Halmstad, Sweden) from 3100mm using a calibrated 1920x1080 pixel HD (contrast ratio 300,000:1) LCD projector (PT-AE7000U; Panasonic Corp., Kadoma, Japan). Participants sat behind a table 2m from the display screen with a keyboard in front of them. The experimental stimulus subtended a visual angle of 60 o by 33.75 o and the target sphere 4 o . Participants were randomly assigned to one of two colour space conditions which was presented in the first block (either trichromat or dichromat, the other condition being presented later on a separate occasion). A central fixation cross on a mid-grey background was displayed for 2 s prior to stimulus onset. Participants had up to 10 s to find and indicate on which side of the screen the stimulus sphere was presented. The inter-trial interval was 2 s. Failure to respond caused the trail to be recorded as a failure and the experiment to move on the next stimulus. Reaction times and errors were recorded. Each block consisted of 1000 trials (plus eight practice trials). Trials were based on 500 forest and 500 scrub backgrounds presented in a random order. We used simple uniform random sampling to select sphere colours using a 24-bit RGB gamut. Occlusion levels were chosen randomly between 25 and 50%.