Colour vision models: a practical guide, some simulations, and colourvision R package

Human colour vision differs from the vision of other animals. The most obvious differences are the number and type of photoreceptors in the retina. E.g., while humans are insensitive to ultraviolet (UV) light, most non-mammal vertebrates and insects have a colour vision that spans into the UV. The development of colour vision models allowed appraisals of colour vision independent of the human experience. These models are now widespread in ecology and evolution fields. Here I present a guide to colour vision modelling, run a series of simulations, and provide a R package – colourvision – to facilitate the use of colour vision models. I present the mathematical steps for calculation of the most commonly used colour vision models: Chittka (1992) colour hexagon, Endler & Mielke (2005) model, and Vorobyev & Osorio (1998) linear and log-linear receptor noise limited models (RNL). These models are then tested using identical simulated and real data. These comprise of reflectance spectra generated by a logistic function against an achromatic background, achromatic reflectance against an achromatic background, achromatic reflectance against a chromatic background, and real flower reflectance data against a natural background reflectance. When the specific requirements of each model are met, between model results are, overall, qualitatively and quantitatively similar. However, under many common scenarios of colour measurements, models may generate spurious values and/or considerably different predictions. Models that log-transform data and use relative photoreceptor outputs are prone to generate unrealistic results when the stimulus photon catch is smaller than the background photon catch. Moreover, models may generate unrealistic results when the background is chromatic (e.g. leaf reflectance) and the stimulus is an achromatic low reflectance spectrum. Colour vision models are a valuable tool in several ecology and evolution subfields. Nonetheless, knowledge of model assumptions, careful analysis of model outputs, and basic knowledge of calculation behind each model are crucial for appropriate model application, and generation of meaningful and reproducible results. Other aspects of vision not incorporated into these models should be considered when drawing conclusion from model results.

may be perceived differently not only depending on the observer, but also on the context that this 76 colour patch is exposed (e.g. background colour and environmental light conditions; (Endler 77 1978). 78

79
Colour vision models where firstly developed in an attempt to understand the proximate causes 80 of human colour vision, and emulate some of human visual perceptual phenomena (Kemp et al. 81 2015). More recently, with the advent of affordable spectrometers for reflectance measurements, 82 application of colour vision models became common place in ecology and evolution subfields. 83 Together, some of the most important colour vision papers have been cited over 2800 times 84 (Endler 1990 (919) (Thery & Casas 2002) and aposematism (Siddiqi 90 2004). 91 As any model, colour vision models are based on certain assumptions. Knowledge of model 93 strength and limitations are crucial to assure reproducible and meaningful results from model 94 applications. Thus, the motivation of this paper is twofold: first to facilitate the use of colour 95 vision models by evolutionary biologists and ecologists; secondly, to compare the consistency of 96 between model results and how they behave in common scenarios of colour measurements. I did 97 not aim to give an in depth analysis of the physiology of colour vision, but to provide a practical 98 guide to the use of colour vision models, and demonstrate their limitations and strengths. 99 Guidance on other aspects of colour vision models can be found elsewhere (Kelber et al. 2003; In general, colour vision is achieved by neural opponency mechanisms (Kelber et al. 2003;Kemp 108 et al. 2015), although exceptions to this rule do exist (Thoen et al. 2014). In humans, two colour 109 opponency mechanisms appear to dominate: yellow-blue and red-green opponency channels 110 (Kelber et al. 2003). Although colour vision in most other animals studied so far also seem to be 111 based on opponency mechanisms, the exact opponency channels are usually not known (Kelber 112 et al. 2003; Kemp et al. 2015). Nonetheless, empirical studies suggest that the exact opponency 113 channels do not need to be known for a good prediction of behavioural responses by colour 114 vision models  in the environment, such as leaves, twigs and tree bark. Alternatively, the background reflectance 132 can be an achromatic spectrum of low reflectance value. The illuminant can be a reference 133 spectrum (e.g. CIE standards), or, ideally, measured directly in the field using an irradiance 134 measurement procedure (Endler 1990;1993). Reflectance spectra are usually measured using a 135 spectrometer (see Anderson & Prager 2006 for measurement procedures), but it can also be 136 collected using photographic and hyperspectral cameras (Stevens et al. 2007;Chiao et al. 2011). 137 All data must cover the same wavelength range as the photoreceptor sensitivity curves (300-700 138 nm for most cases).
The rationale behind equation (3), referred as the von Kries transformation, is that 158 photoreceptors are physiologically adapted to the light coming from the background, and that 159 animals exhibit colour constancy (Chittka et al. 2014). So that if the environment is rich in 160 wavelengths at the green region of the light spectrum, photoreceptors sensitive to this wavelength 161 region will be less responsive. 162 163

Colour hexagon model 164
The colour hexagon model (Chittka 1992) was formulated for hymenopteran vision. However, 165 due its general form it can, and has been, applied for other taxa. Photoreceptor output ( ) is 166 This means that photoreceptors output ( ) will vary from 0 to 1, and its value will increase 168 asymptotically to the limit of 1. This is done because the relationship between photoreceptor 169 input-output is non-linear. E-values are then depicted into three vectors evenly distributed (120° 170 between them). The resultant of receptor outputs is projected into a plan (chromaticity diagram) 171 using the following formula: 172 The model is originally the first step for a statistical approach to study bird colouration as whole, 176 not as individual colour patches (Endler & Mielke 2005). The model was adapted from 177 tetrachromatic to trichromatic vision by Gomez (2006). The first step is to log-transform relative 178 photon catches: 179 Then, & is transformed so that photoreceptor outputs + + = 1: Rationale between equations 8-10 is that only the relative differences in photoreceptor outputs 184 are used in a colour opponency mechanism. Photoreceptor outputs are projected into a 185 triangular chromaticity diagram by the following formula (Gomez 2006 188

Receptor noise limited models: linear and log-linear versions 189
The receptor noise limited model was developed to predict thresholds of colour vision. One of 190 the assumption is that thresholds are given by noise arising at the receptor channels (Vorobyev & 191 Osorio 1998

207
where & is the receptor noise of each photoreceptor, from shortest to longest wavelength. To 208 date few species had their receptor noise ( & ) measured directly ). In 209 lack of a direct measurement, & can be estimated by the relative abundance of photoreceptor 210 types in the retina and a measurement of a single photoreceptor noise-to-signal ratio:

Distance between colour loci in chromaticity diagrams 218
Distances in chromaticity diagrams represent chromaticity similarities between two colours. The 219 assumption is that the longest the distance, the more dissimilar two colours are perceived. 220 Chromaticity distance between pair of reflectance spectra ( and ) are found by calculating the 221 Euclidian distance between their colour loci ( , ) in the colour space: 222 By definition, background reflectance lays at the centre of the background ( = 0, = 0). 223 Therefore, the distance of the observed object against the background is given by: 224 In the receptor noise models, Δ between pair of reflectance spectra ( and ) can be calculated 225 directly, without finding colour loci in the colour space : 226 Where Δ & is the difference between photoreceptor i output for the reflectance spectrum and 227 (∆ & = # X − U X ). Using equation (24) will give the same value as calculating Δ using equations 228 (14-19) and then equation (23). In RNL models, Δ = 1 equals one unit of just noticeable 229 difference (JND). That means that, given the experimental conditions (large static object against a 230 grey homogenous background), JND = 1 is the threshold for object detection; i.e. the minimum 231 behaviourally discriminable difference between the object and the background. In the second simulation I added 10 percent point to the stimulus reflectance spectra (Figure 2a). 265 My aim was to analyse how a relatively small change in reflectance curves affect model results. 266 An increase in overall reflectance value can be an artefact of spectrometric measurement error 267 (for guidance on spectrometric reflectance measurements see Anderson & Prager 2006). 268 269 Simulation 03: achromatic reflectance spectra 270 Colour vision models are designed to deal with chromatic spectra (reflectance spectra that 271 produces differences in photoreceptor outputs). However, some animal colours have reflectance 272 spectra with a relatively constant reflectance value from 300 to 700nm, which we perceive as 273 white, grey and black patches (achromatic variation). These type of spectra are sometimes 274 modelled into colour vision models. In this simulation I generated a series of achromatic spectra 275 with constant reflectance values from 300-700nm. I generated 10 reflectance spectra with 276 reflectance values from 5% to 95%, with 10 percentage point intervals (Figure 2b).  (Figure 4b). Photoreceptor output also reach unrealistic negative 329 values, and values above 1 (Figure 4b). This is consequence of equations 7-10: when & is below 330 1, the ln-transformation generates negative values. Consequently, the denominator in equations 331 8-10 may reach values close to zero, which causes photoreceptor outputs to tend to infinity. Log-332 RNL model predicts a sigmoid ΔS curve, increasing from short to long midpoint wavelengths, 333 reaching a maximum ΔS at at 700 nm (Figure 4d). Comparably to the EM model, the log-RNL 334 model generates unrealistic negative photoreceptor excitation values (Figure 4d). Again, this 335 happens because when & is below 1 the log-transformation generates negative values (eq. 14). 336 The linear-RNL version estimates a bell shaped ΔS curve, with a maximum Δ at 470nm 337 midpoint wavelength (Figure 4c). Photoreceptors present a sigmoid excitation curve, with 338 maximum values at short midpoint wavelengths (Figure 4c). In this setup, models are more congruent in their results. Their chromaticity diagram indicates 342 similar relative position of reflectance spectra between models ( Figure 5). All of them estimate a 343 bell shaped Δ curve, with maximum values around 500 nm midpoint wavelength ( Figure 6). CH 344 model predicts a bell shaped ΔS curve with maximum Δ peaking at 510nm (25 nm difference to 345 the original model; Figure 6a). However, in comparison to the basic model there is an overall 346 decrease in Δ (Figure 3a and 6a). This happens because eq. 4 makes E-values non-linear as & 347 increases. Therefore, the relative differences between photoreceptors decreases and, as a 348 consequence, ΔS decreases. Contrary to the basic model, EM model now estimates realistic ΔS 349 and photoreceptor excitation values, with a peak at 540nm (Figure 6b). With a 10 percentage 350 point increase in the reflectance, eq. 3 does not produce values below 1. As a consequence, eqs.  (Figures 4c and 6c). 359 Simulation 03: Achromatic reflectance spectra. 361 With achromatic reflectance spectra all datapoints are in the centre of the colour diagram. 362 Consequently, ΔS for all models and all reflectance values equals zero. This happens because all 363 three photoreceptors respond equally to the achromatic reflectance spectra. Nonetheless, the type 364 of response varies between models. In the CH model, photoreceptor output increases 365 asymptotically as reflectance increases, which is result of eq. 4. In the EM model, photoreceptor 366 Similarly, photoreceptor outputs also increase linearly as as the reflectance value of achromatic 384 spectra increases, but with different slopes for each photoreceptor type (Figure 8c). Contrary to 385 other models, ΔS-values in the log-RNL model do not change with varying reflectance value of 386 achromatic spectra (Figure 8d). Although photoreceptor outputs increase as reflectance value of 387 achromatic spectra increases (Figure 8d), the difference between photoreceptor outputs remains 388 the same. Consequently, ΔS-values do not change. 389 When real flower reflectance spectra are used, models also give different relative perception for 392 the same reflectance spectrum. The results of the CH model and the log-RNL model are similar 393 both qualitatively and quantitatively: colour loci projected into the colour space (Figure 9) show 394 similar relative position of reflectance spectra; and there is a high correlation score between Δ 395 values (Figures 9a and 9d; ρ=0.884; N=858; S=12165000; p<0.001). Even though many EM 396 points lay outside the chromaticity, results suggest a high agreement between CH and EM 397 models (Figure 9a and 9b; ρ=0.889; N=858; S=11718000; p<0.001). There was a moderate 398 agreement between the linear and log version of the RNL model (Figures 9c and 9d;    I.e., humans perceive 150g and 100g weights as more dissimilar than 1150g and 1100g weights. 419 This is illustrated by the photoreceptor outputs in Figure 7. In this simulation the achromatic 420 reflectance spectrum increases from 10% to 90% by 10 percept point steps. In the linear-RNL 421 model, photoreceptor outputs respond linearly to the 10% increase, so that the difference in 422 receptor outputs is the same between the 10% vs 20% reflectance spectra as between the 80% vs 423 90% reflectance spectra. In the log-RNL model, however, the difference between 10% vs. 20% is 424 greater than the difference between 80% vs 90%. 425

426
In addition, low reflectance achromatic spectra (i.e. dark colour patches) may also produce 427 spurious values when the background is chromatic (Figure 8 Honeybees, for instance, use colour vision only when the observed object subtend a visual angle 435 larger than ca. 15° (Giurfa et al. 1996). Moreover, bees appear to completely ignore brightness 436 when using the chromatic channel (Giurfa et al. 1997), so that equation (20)  finches, for instance, the same pair of similar red object have a discriminability threshold of ca. 1 454 JND when the background is red, but much higher when the background is green (Lind 2016). 455 The same study emphasises the difference between detecting one object against the background 456 and discriminating two similar objects: detection thresholds are usually higher than 457 discrimination thresholds (as measured by the RNL model; Lind 2016). Given the variation in 458 thresholds, it is misleading to interpret Δ values as binary variable: i.e. above the threshold, 459 detectable; below threshold, not detectable. Instead, use of Δ values as they are, a continuum, 460 makes the interpretation more realistic. E.g., a stimulus with JND = 2 is likely chromatically 461 similar to the background, and is possibly more often not detected than a stimulus with JND = 5.   values as a function of spectra with achromatic reflectance from 5% to 95% (top row). 695 Photoreceptor output values as a function of the same reflectance spectra (bottom row). Violet, 696 blue and green colours represent short, middle and long λmax photoreceptor types. With the 697 exception of c) Linear-RNL, scales are the same as in Figure 4.