A generalized equation for the calculation of receptor noise limited colour distances in n-chromatic visual systems

Researchers must assess similarities and differences in colour from an animal's eye view when investigating hypotheses in ecology, evolution and behaviour. Nervous systems generate colour perceptions by comparing the responses of different spectral classes of photoreceptor through colour opponent mechanisms, and the performance of these mechanisms is limited by photoreceptor noise. Accordingly, the receptor noise limited (RNL) colour distance model of Vorobyev and Osorio (Vorobyev & Osorio 1998 Proc. R. Soc. Lond. B 265, 351–358 (doi:10.1098/rspb.1998.0302)) generates predictions about the discriminability of colours that agree with behavioural data, and consequently it has found wide application in studies of animal colour vision. Vorobyev and Osorio (1998) provide equations to calculate RNL colour distances for animals with di-, tri- and tetrachromatic vision, which is adequate for many species. However, researchers may sometimes wish to compute RNL colour distances for potentially more complex colour visual systems. Thus, we derive a simple, single formula for the computation of RNL distance between two measurements of colour, equivalent to the published di-, tri- and tetrachromatic equations of Vorobyev and Osorio (1998), and valid for colour visual systems with any number of types of noisy photoreceptors. This formula will allow the easy application of this important colour visual model across the fields of ecology, evolution and behaviour.


RDS, 0000-0002-8248-0532
Researchers must assess similarities and differences in colour from an animal's eye view when investigating hypotheses in ecology, evolution and behaviour. Nervous systems generate colour perceptions by comparing the responses of different spectral classes of photoreceptor through colour opponent mechanisms, and the performance of these mechanisms is limited by photoreceptor noise. Accordingly, the receptor noise limited (RNL) colour distance model of Vorobyev and Osorio  Proc. R. Soc. Lond. B 265, 351-358 (doi:10.1098/rspb.1998.0302)) generates predictions about the discriminability of colours that agree with behavioural data, and consequently it has found wide application in studies of animal colour vision.  provide equations to calculate RNL colour distances for animals with di-, tri-and tetrachromatic vision, which is adequate for many species. However, researchers may sometimes wish to compute RNL colour distances for potentially more complex colour visual systems. Thus, we derive a simple, single formula for the computation of RNL distance between two measurements of colour, equivalent to the published di-, tri-and tetrachromatic equations of , and valid for colour visual systems with any number of types of noisy photoreceptors. This formula will allow the easy application of this important colour visual model across the fields of ecology, evolution and behaviour.
2017 The Authors. Published by the Royal Society under the terms of the Creative Commons Attribution License http://creativecommons.org/licenses/by/4.0/, which permits unrestricted use, provided the original author and source are credited.

Background
Colour sensations are constructed by nervous systems via comparisons of the responses of different spectral classes of photoreceptor [1]. Across taxa there is considerable variation in the number of spectral classes of photoreceptor in the retina, and in the wavelengths of light to which these different spectral classes respond most strongly [1][2][3]. Consequently, animal colour sensations can differ substantially to our own, yet it is essential in many fields of enquiry to evaluate similarities and differences in colour from an animal's eye view.
The responses of an animal's photoreceptors to a particular stimulus can be computed, given the reflectance spectrum of that stimulus and its background, the spectral sensitivity functions of the animal's photoreceptors, and the spectrum of illuminant light [1,4,5]. The calculated responses of the relevant classes of photoreceptor can then be used to determine the position of the stimulus within that animal's colour space [1,[6][7][8][9]. Often of interest is the question of whether particular colour loci can be discriminated from one another, and key to this issue is the idea that the performance of colour opponent mechanisms is limited by photoreceptor noise [4,10,11]. The receptor noise limited (RNL) model allows the discriminability of colours to be assessed in a way that accounts for photoreceptor noise [4,10,11] and consequently is among the most influential and well-used tools in studies involving animal colour vision.
The original publication of the RNL model provides equations allowing colour distances to be determined for di-, tri-and tetrachromatic visual systems [4]. Most animals with the capability of colour vision do indeed appear to be functionally di-, tri-or tetrachromatic, and theoretical analyses also suggest that such visual systems are adequate for extracting the information available in natural spectra. However, many organisms have photoreceptor machinery that could mediate more complex colour vision, even if the mechanisms employed for a particular behavioural task can be shown to be di-, tri-or tetrachromatic. For example in butterflies, screening pigments produce a wide variety of spectral types of receptor that varies among families, species and even sexes, with the extreme so far discovered being 15 spectral types of photoreceptor in Graphium sarpedon [12,13]. In spite of the potential for greater complexity, foraging in Papilio xuthus relies on a tetrachromatic mechanism [14], and oviposition behaviours in Papilio aegeus, Pieris brassicae, and Pieris rapae are adequately explained by trior tetrachromatic mechanisms [15,16]. Dragonflies have an extraordinary diversity of opsin genes whose expression varies with life stage and eye region, with more than 10 visual opsins expressed in the adult eye of some species [17], and their involvement in colour-driven behaviour is currently unknown; and the 12 spectral receptor classes serving colour vision in mantis shrimp operate as an unusual scanning colour recognition system unlike any other known colour visual mechanism [18]. For such organisms, the experimenter may wish to test the plausibility of any possible n-chromatic visual mechanism if the photoreceptors involved in a particular behavioural act are unknown or in doubt (c.f. [14,19]).
In other study species, visual mechanisms have the potential to be more complex than has been assumed, necessitating analysis of n-chromatic visual mechanisms. For example, in true flies five spectral classes of receptor are present through the majority of the retina [20,21]. Although it has often been assumed that colour discrimination relies only on the four classes of long visual fibre [21,22], evidence from Drosophila shows that the short visual fibres, previously assumed to serve achromatic functions only, contribute to colour discrimination [23]. Among the Tabanidae and Dolichopodidae, differently coloured lenses in different regions of the compound eye shift the sensitivities of photoreceptors within their ommatidia [24][25][26][27], raising the possibility that still more functional classes of receptor may exist. Outside of the insects, the double cones of fishes, reptiles, and birds are also assumed to serve achromatic tasks only, but there is evidence from blackbar triggerfish that they can contribute to colour discrimination in that species [28]. Thus, there may be a need for experimenters on such systems to consider n-chromatic visual mechanisms during their investigations.
In order to apply the RNL model to colour visual systems hypothesized to involve greater than four photoreceptors, experimenters have had to derive the relevant RNL model equations (such as those provided for pentachromatic and hexachromatic colour visual systems by [19]). Thus, to simplify the application of the RNL model to colour visual systems of any dimensionality, we derive a single equation that can be used to compute RNL colour distances for n-chromatic visual systems.

Basic assumptions
We begin with the fact that for any animal with the capability, colour stimuli are described by photoreceptor responses. The quantum catch of a photoreceptor, q, is computed where q i is the quantum catch of receptor i, S i (λ) is its spectral sensitivity function and I s (λ) is the spectrum of light entering the eye from a stimulus of interest, s. λ is the wavelength and r i is the range sensitivity factor, through which photoreceptor responses are adjusted to the spectrum of light entering the eye from the visual background, I b : The process of phototransduction leads to a non-linear relationship between quantum catch, q i , and photoreceptor response, f i [1,5,9]. The RNL model can be applied to linearly or non-linearly transformed photoreceptor responses and the two are equivalent for stimuli that are close to a reference [4,10,11].
We will assume that there are N receptors and that the output of receptor i has random noise with variance e 2 i [4]. We follow the notation of Vorobyev et al. [11] and the usual assumptions [4] that: 1. for a visual system with N receptor channels, colour is encoded by N − 1 opponent mechanisms and the achromatic signal is discarded; 2. opponent mechanisms give zero signal for stimuli that differ from background in intensity only; and 3. thresholds are set by receptor noise, and not by opponent mechanisms.
The response of the N receptors to a stimulus can be represented by a column vector f where Similarly, the output of the (N − 1) opponent mechanisms can be represented by a column vector x with (N − 1) components. It is also assumed [4,10,11] that x depends linearly on f . Hence the relationship between the two vectors can be written mathematically as where F is an (N − 1) × N matrix with constant components. As pointed out by Vorobyev & Osorio [4], assumption 2 imposes a constraint on the form of the matrix F. They show (their equation A8) that the sum of the components in each row of F must be zero. They consequently choose F to be the matrix which defines each x i by Equation (2.4) implies that the outputs of the opponent mechanisms depend only on the differences between the outputs of the photoreceptors. It can be shown generally that any matrix F satisfying equation A8 in [4], and thus assumption 2, must have this property. What equation (2.4) does not do, is uniquely define the opponent mechanism outputs. Any linear combination of the differences ( f i − f j ) is a possible choice of an opponent mechanism output satisfying assumption 2 and that choice will not affect the colour distance S defined by Vorobyev & Osorio [4]. It is in this limited sense that the statement in assumption 3, that thresholds are not set by opponent mechanisms, is valid.

The Mahalanobis distance
We need to have a measure of the difference between the responses to two different stimuli. Let two responses be f and g with corresponding vectors x and y after the opponent mechanisms. Let f = ( f − g) and x = (x − y). Vorobyev & Osorio [4] suggested that in the N − 1 dimension space of x vectors, the distance between the two stimuli could be defined by S where the square of S is given by Here R −1 is the inverse of R, the variance-covariance matrix of the variables x i. The distance defined in equation (3.1) is known to statisticians as the Mahalanobis distance [29] after the Indian statistician who first used it. Note that although S is referred to as a distance, it is actually a pure number as it is the ratio of the 'distance' between the two stimuli to the generalized standard deviation of the distribution. It gives the equivalent, in any number of dimensions, of the onedimensional statement that two data points are S standard deviations apart. Since it is a number, it has the property of 'scale invariance' which means that each x i can be rescaled without changing S. It is also invariant under rotations of the axes in the space of the vectors x. This gives us the freedom to choose the opponent mechanisms' outputs in the manner mentioned in the previous section.
It should be noted that in the calculation of the variance-covariance matrix R, knowledge of the values of the means of the f i or x i are not required. While it is frequently stated that the variances of a distribution are independent of the position of the mean, in the RNL model this is a direct consequence of the implicit assumption that the variance of the noise, e 2 i , is independent of the quantum catch of receptor i. Hence the variances of the noise are independent of the means of the receptor outputs f i and the variances and covariances of the x i are independent of their means also.
Following a suggestion from a referee (whom we thank) we define, along with Vorobyev & Osorio [4], δx i and δf i by 2 and, since the f i are independent, their covariances, δf i δf j with i = j, are all zero.
Thus the diagonal terms of the matrix are and the only non-zero, off-diagonal terms are In all the above expressions, the brackets · · · indicate averaging over the weighted values of the variable inside the brackets or both the variables if there are two.
To simplify the mathematical expressions below, from this point on we will write v i for e 2 i . We will return to the usual notation in the final expression.
The matrix R is a symmetric, tridiagonal matrix: The components of inverses of tridiagonal matrices are known to satisfy simple relationships [30]. The components of the inverse of the above matrix are given by and In these expressions the θ i and ∅ i are functions of the v i that satisfy known recurrence relations. The θ i satisfy the recurrence relation for i = 2, . . . N − 1 with initial values θ 0 = 1 and Similarly the ∅ i satisfy  gives eventually (3.10) or (3.11) Using θ 0 = 1 and It is clear that θ i is the sum of all possible products of v 1 , v 2 , . . . v i+1 with just one v missing. It can be written concisely as (3.14) A similar reduction can be made for ∅ i . The variances involved are v i to v N giving When these expressions are entered into equations (3.5) and (3.6) the products of the v i cancel, giving and In terms of these components, since

Simplification
Vorobyev & Osorio [4] demonstrated for trichromatic and tetrachromatic vision that much simpler expressions could be obtained if ( S) 2 is expressed in terms of all the ½N(N − 1) squared differences ( f i − f j ) 2 . We will assume this is possible for any N and we will show that the result is a very simple formula. Let while the coefficient of , (4.4) which agrees with the coefficient of Consequently, we have that the square of the Mahalanobis distance between f and g for N receptors with (N − 1) opponent mechanisms is simply (4.5) We have replaced v i by e 2 i in this result. This equation agrees with the results published by Vorobyev & Osorio [4] for dichromatic, trichromatic and tetrachromatic vision. To demonstrate this we will consider the trichromatic case as an example.
When N = 3 equation (4.5) is Apart from reordering this is the same formula as given in [4].

Conclusion
Equation (4.5) gives ( S) 2 for any number of receptor types. It can be simply stated as ( f i − f j ) 2 /e 2 i e 2 j summed over all pairs of receptors divided by 1/e 2 i summed over all receptors. This equation allows the calculation of RNL colour distances for n-chromatic visual systems, facilitating the easy application of this model to investigate colour discrimination in organisms with complex visual systems and unknown chromatic mechanisms (c.f. [14,19]).
A key premise of the RNL model is that the discriminability of colour stimuli is set by receptor noise and not opponent mechanisms (assumption 3), and as such the way in which receptor responses are combined within opponent mechanisms (the matrix F in equation (2.3)) does not determine the discriminability of colour signals (e.g. [11]). However, we point out that the form of equation (4.5) depends critically on equation (2.4), which itself is determined by assumption 2. Hence in the RNL model, opponent mechanisms are not completely unspecified because their choice is restricted by assumption 2.
Data accessibility. This article has no additional data. Authors' contributions. R.C.C. and J.S.B. conceived the idea for the paper. R.C.C. conducted the mathematical work; J.S.B. and R.D.S. provided biological interpretation. R.C.C. and R.D.S. drafted the article, and all authors contributed to critical revisions. All authors have agreed to the final version.