Psychophysics of Artificial Neural Networks Questions Classical Hue
  Cancellation Experiments
We show that classical hue cancellation experiments lead to human-like
opponent curves even if the task is done by trivial (identity) artificial
networks. Specifically, human-like opponent spectral sensitivities always
emerge in artificial networks as long as (i) the retina converts the input
radiation into any tristimulus-like representation, and (ii) the post-retinal
network solves the standard hue cancellation task, e.g. the network looks for
the weights of the cancelling lights so that every monochromatic stimulus plus
the weighted cancelling lights match a grey reference in the (arbitrary) color
representation used by the network. In fact, the specific cancellation lights
(and not the network architecture) are key to obtain human-like curves: results
show that the classical choice of the lights is the one that leads to the best
(more human-like) result, and any other choices lead to progressively different
spectral sensitivities. We show this in two ways: through artificial
psychophysics using a range of networks with different architectures and a
range of cancellation lights, and through a change-of-basis theoretical analogy
of the experiments. This suggests that the opponent curves of the classical
experiment are just a by-product of the front-end photoreceptors and of a very
specific experimental choice but they do not inform about the downstream color
representation. In fact, the architecture of the post-retinal network (signal
recombination or internal color space) seems irrelevant for the emergence of
the curves in the classical experiment. This result in artificial networks
questions the conventional interpretation of the classical result in humans by
Jameson and Hurvich.
Jorge Vila-Tomás, Pablo Hernández-Cámara, Jesús Malo
# Psychophysics of Artificial Neural Networks

###### Abstract

We show that classical hue cancellation experiments lead to human-like opponent curves even if the task is done by trivial (_identity_) artificial networks. Specifically, human-like opponent spectral sensitivities always emerge in artificial networks as long as (i) the _retina_ converts the input radiation into any tristimulus-like representation, and (ii) the post-retinal _network_ solves the standard hue cancellation task, e.g. the network looks for the weights of the cancelling lights so that every monochromatic stimulus plus the weighted cancelling lights match a grey reference in the (arbitrary) color representation used by the network. In fact, the specific cancellation lights (and not the network architecture) are key to obtain human-like curves: results show that the classical choice of the lights is the one that leads to the best (more human-like) result, and any other choices lead to progressively different special sensitivities. We show this in two ways: through _artificial psychophysics_ using a range of networks with different architectures and a range of cancellation lights, and through a _change-of-basis theoretical analogy_ of the experiments. This suggests that the opponent curves of the classical experiment are just a by-product of the front-end photoreceptors and of a very specific experimental choice but they do not inform about the downstream color representation. In fact, the architecture of the post-retinal network (signal recombination or internal color space) seems irrelevant for the emergence of the curves in the classical experiment. This result in artificial networks questions the conventional interpretation of the classical result in humans by Jameson and Hurvich.

Artificial Psychophysics. Spectral Sensitivity of Artificial Networks. Visual Neuroscience. Hue Cancellation Experiments. Opponent Color Coding.

## 1 Introduction

The classical hue cancellation experiments [1, 2] are usually considered as the first psychophysical quantification of Hering's intuition on opponent color coding in the human brain [3, 4, 5]. As an example, an influential textbook on visual neuroscience [6] introduces hue cancellation as follows: _"Several experimental observations, beginning in the mid-1950s, catapulted opponent-colors theory from a special-purpose model, known only to color specialists, to a central idea in Vision Science. The first was a behavioral experiment that defined a procedure for measuring opponent-colors, the hue cancellation experiment. By providing a method of quantifying the opponent-colors insight, Hurvich and Jameson made the idea accessible to other scientists, opening a major line of inquiry."_

The scientific question to be solved by the _hue cancellation experiment_ is about the post-retinal neural architecture, or recombination of color signals after photodetection. This is illustrated by Fig. 1.a, based on the original diagram in [2]. The authors confront the Young-Helmholtz trichromatic theories of color vision with the qualitative opponent theory of Hering. They propose an architecture to get the Achromatic, Tritanopic (red-green) and Deuteranopic (yellow-blue) sensors (ATD) from the front-end photoreceptors tuned to Long, Medium, and Short (LMS) wavelengths, and hue cancellation would be the tool to quantify the spectral sensitivity of the ATD mechanisms in the proposed architecture.
In this work we present a counter-example based on artificial networks (on automatic differentiation) that suggests that the results of conventional hue cancellation experiments do not provide conclusive information on the inner color representation of the system that mediates the task (the post-retinal network, black box in Fig.1.b). Therefore, strictly speaking, the curves from the classical hue cancellation experiments would not be measuring the sensitivity of those ATD mechanisms.

In particular, we show that _identity networks_ develop opponent red-green and yellow-blue color valence functions which are quite similar to the human curves independently of the color representation (LMS, RGB or ATD). What we refer to as _identity network_ is a trivial architecture whose (3-dimensional) output is exactly the same as its (3-dimensional) input in each spatial location. This trivial network, which already operates in a tristimulus-related representation, (say certain standard LMS cone space [7], or even in an arbitrary, device dependent, digital count RGB space [8, 9]) may apply no opponent color coding whatsoever and still gets the human-like curves (in contrast to the specific architecture assumed in Fig. 1.a). Therefore, the opponent curves that emerge do not strictly inform of the inner (eventually opponent) color representation of the post-retinal neural network. Instead, they are a by-product of the (retinal) tristimulus representation of the input radiation and of the choices in the conventional experimental setting (e.g. the wavelengths of the spectral cancellation lights). To explore in more detail this result, we perform multiple hue cancellation experiments with cancellation lights different to the classical ones and we obtain a clear dependence with the choice of the spectral cancellation lights, achieving the best human-like behaviour only in the case of the classical cancellation lights. This result is confirmed by an analysis of the hue cancellation experiment using a change-of-basis analogy.

Figure 1: **(a)** Elements of the competing theories of Young-Helmholtz vs Hering, and **(b)** Learning process to get the weights that cancel the hue of certain monochromatic stimulus of wavelength \(\lambda\). Following the original diagram in [2], **Figure 1.a** displays the sensors of the Young-Helmholtz theory, with all-positive sensitivities tuned to _Long_, _Medium_, and _Short_ (LMS) wavelengths, and a possible architecture of a network that would lead to the sensors of the Hering theory: two chromatic sensors with opponent sensitivities, the _Tritanopic_ sensor (T) tuned to red-green and the _Deuteraopic_ sensor (D) tuned to yellow-blue, together with an Archromatic sensor (A) with a wide all-positive sensitivity. **Figure 1.b** illustrates the hue cancellation experiment: the (natural or artificial) observer _looks for_ the weights of the spectral cancelling lights so that a mixture of these cancellation stimuli with the original monochromatic input matches a grey reference (a stimulus with no hue). In this setting, hue cancellation reduces to distance minimization between the responses \(R^{\prime}\) to the white and to the considered \(\lambda\) plus the weighted cancelling lights.

**The question** is whether this search of the weights reveals something about the computation or architecture of the _brain-network_ module in Fig. 1.b that transforms \(R\) into \(R^{\prime}\), or about the nature of the inner color representation \(R^{\prime}\).
Methods: hue cancellation experiments in artificial networks

### General setting

In this work the artificial hue cancellation experiment is a matching problem in the color representation used by the artificial network. Take the setting represented in Fig 1.b: for any arbitrary spectral input of wavelength \(\lambda\), \(E_{\lambda}\), and a grey reference, \(W\), the network takes the input retinal representation of stimulus and reference, \(R(E_{\lambda})\) and \(R(W)\), and transforms them into the inner representation \(R^{\prime}(E_{\lambda})\) and \(R^{\prime}(W)\). We make no assumption of the nature of this representation \(R^{\prime}\). In Fig 1.b \(R^{\prime}\) is represented by red, green and blue layers just for visualization, this does not mean we assume them to be LMS-like. In the initial situation, when no cancelling lights are added, the distance \(|R^{\prime}(W)-R^{\prime}(E_{\lambda})|\) will have a large value. The goal in this matching problem is looking for the optimal weights \(w_{\lambda_{c}}^{\star}(\lambda)\) of the cancelling lights that minimize the distance between the reference and the monochromatic stimulus plus the weighted cancelling lights:

\[w_{\lambda_{c}}^{\star}(\lambda)=\operatorname*{arg\,min}_{w_{\lambda_{c}}( \lambda)}\left|R^{\prime}(W)-R^{\prime}\left(E_{\lambda}\oplus\sum_{\lambda_{ c}}w_{\lambda_{c}}(\lambda)\,E_{\lambda_{c}}\right)\right| \tag{1}\]

where the subtraction in the distance is regular subtraction between vectors, but \(\oplus\) stands for additive superposition of radiations. Physical superposition is always positive so, in this case, as conventionally done in color matching experiments [10], we assume that _negative_ weights in the superposition to \(E_{\lambda}\) physically mean the corresponding amount of _positive_ superposition to \(W\). In short, the cancellation experiment should tell us about the change of color representations, from the input space \(R\) to the output \(R^{\prime}\). In principle, the goal function in Eq. 1 can be applied to regular tristimulus vectors (where vector summation has perceptual meaning) but also to arbitary, engineering-oriented device-dependent color representations such as digital counts in RGB.

The matching problem described above is just a difference minimization problem which is well suited for learning based on automatic differentiation. In this _artificial psychophysics_ setting, the network architecture of the black-box in Fig. 1.b is fixed but the energy of the cancelling lights (the weights \(w_{\lambda_{c}}\)) is modified in each iteration to minimize the distance in Eq. 1.

Appendix A elaborates on how to approximate monochromatic stimuli for artificial networks intended to work with restricted stimuli such as regular digital images. Appendix B elaborates on how the four individual weighting functions we get from the artificial nets, \(w_{\lambda_{c}}^{\star}(\lambda)\), are combined into the final valence functions (that happen to be red-green and yellow-blue in the case of the conventional \(\lambda_{c}\)'s).

### Hue cancellation with artificial networks beyond the classical setting

This artificial simulation of the hue cancellation experiment can be applied with any architecture in the fixed network (black box in Fig. 1.b) and with any choice of \(\lambda_{c}\)'s for the cancelling lights.

If human-like opponent channels emerge from the simulations even if the network does not have a biologically plausible architecture and independently of the post retinal space, this means that the result of the classical experiment cannot be interpreted as an indication of the existence of post-retinal mechanisms performing the computation suggested in Fig. 1.a.

Refutation of the conventional interpretation of the classical experiment is stronger if the emergence of opponent curves mainly happens with a particular choice of \(\lambda_{c}\)'s. This would mean that instead of having the result because of interesting properties of the post-retinal mechanisms, it comes from a fortunate selection of the experimental setting. For this reason it is interesting to simulate hue cancellation for a range of alternative \(\lambda_{c}\)'s different from the classical experiment.

### Differences with the experimental setting for humans

In the original experiments with humans, the cancelling lights had the same energy and their wavelengths were slightly different for the two observers J/H: \(467/475\) nm (blue), \(490/500\) nm (green), \(588/580\) (yellow), and \(700/700\) nm (red). In all our simulations the cancelling lights always had the same initial energy and we used an equienergetic stimulus as grey reference. In simulating the classical setting, our wavelengths were the ones for observer H (\(475\), \(500\), \(580\) and \(700\) nm). In our experiments we use (without loss of generality) quasi-monochromatic lights so that they can be properly represented in digital values to be processed by conventional artificial networks. These stimuli are defined by a narrow Gaussian spectral radiance added on top of a low-radiance equienergetic background. Appendix A shows examples of these stimuli.
In solving the distance minimization problem, the iterative variation of the weights was applied to the height of the narrow Gaussian of the quasi-monochromatic cancelling lights. These differences (cancelling wavelengths similar to the ones in the classical experiment and narrow-spectrum quasi-monochromatic stimuli) do not imply fundamental differences with the classical setting.

Human observers in the classical experiment do not change all 4 weights at the same time, but (just for the observers convenience) they just move one at a time (judging how the complementary hue disappears) and repeat the experiment 4 times. This is not a fundamental difference because (at the expense of longer time per wavelength) after the "first cancellation" the observer could also cancel the remaining hue and then match the response to a grey. Additionally, in any part of the spectrum, is the experimenter in the classical experiment who lets the observer to use "the appropriate" cancellation light. This is not a fundamental difference either because if they could look for the cancellation lights in pairs, simultaneous modification of the opponent cancellation lights would null each other and the effect would be as using a single one.

In the setting that we propose to simulate hue cancellation in artificial systems, the only difference with regard to the experiments in humans is that humans may not need an achromatic reference since they already have the concept of what an achromatic stimulus is, and hence they modify the weights of the cancellation lights to match this mental concept. In the case of artificial systems, obtaining the concept of achromatic reference for hue cancellation is not a problem either. It could be computed from natural images using the classical _grey world assumption_[11], or simply take a flat spectrum reference as we did here.

### The trivial identity network

The counter-example presented in this note is based on a trivial network architecture. Its output is the same as the input: for a color \(C\), represented at the input by the array \(R(C)\), the response \(R^{\prime}(C)\) is just:

\[R^{\prime}(R(C))=I\cdot R(C)=R(C) \tag{2}\]

This, clearly non-human, trivial architecture preserves whatever previous color representation coming from the sensors. This trivial network is a good counter-example for the eventual human-like results because in the brain, the color representation in the retina certainly changes downstream [12, 13].

## 3 Experiments and Results

As stated in the _Methods_ section, the conventional interpretation of the classical hue cancellation experiment can be questioned if one finds a counter example showing that human-like opponent valence curves may emerge for the classical choice of \(\lambda_{c}\)'s regardless of the post-retinal network architecture and color representation. Moreover, refutation would be stronger if one finds that the human-like results are mainly obtained for the classical choice of \(\lambda_{c}\)'s while other choices lead to progressively different curves regardless of the input color representation space.

According to this, we perform two sets of experiments: (1) we look for counter examples with the classical hue cancellation lights using trivial identity networks working with different color representations (LMS, ATD and digital RGB). (2) we consider a range of experiments with alternative cancellation lights different from the classical choice using the same trivial identity networks operating either in LMS, ATD or digital RGB.

### Counter examples in the classical setting

In order to check the emergence of human-like curves in hue cancellation even with the trivial identity network, we perform three experiments assuming different _input_ representations \(R\):

* **Experiment 1:** Identity network working in an arbitrary non-human color representation: a device-dependent digital RGB.
* **Experiment 2:** Identity network working in a standard LMS cone space, as for instance [7].
* **Experiment 3:** Identity network working in a standard opponent space as for instance, the Jameson and Hurvich model [1, 14].

Note that the above three identity networks would correspond to color representations with quite different qualitative features: (a) if the input is digital RGB, the problem is solved by a system with wide-band overlapping all-positive spectral sensitivities (different from LMS) and compressive nonlinear response in the retina, (b) if the input are standard LMS tristimulus one has a purely linear LMS color code with all-positive sensitivities in the retina, and (c) if the input
representation \(R\) is an opponent system with an achromatic channel and two chromatic channels, the network is fed with a fundamentally different color coding.

Figure 2 shows the results of these three hue cancellation experiments together with the experimental results for humans reported in [1].

Appendix C shows that (1) the final matches make sense (found at the yellow-blue and red-green curves) and are close to perfect (almost zero difference after the addition of \(w^{\star}_{\lambda_{c}}(\lambda)E_{\lambda_{c}}\)), and (2) the difference minimization process with the different networks is remarkably similar.

The results show that all identity networks, regardless of the space where they operate, lead to similar hue cancellation curves, and these are remarkably similar to the human curves.

### Alternative \(\lambda_{c}\)'s: control experiments and theoretical analysis

The previous artificial experiments question the traditional interpretation of hue cancellation with the classical \(\lambda_{c}\)'s because not only opponent systems but also trichromatic systems lead to similar opponent results. As anticipated above, the fortunate selection of the cancellation \(\lambda_{c}\)'s is _somehow_ biasing the matching towards the opponent curves.

In order to confirm that this is the case, we propose additional control experiments with artificial networks (experiments 4, 5 and 6), and we introduce a _change-of-basis analogy_ of the hue cancellation to understand the results. We show the predictions of this _change-of-basis analogy_ in the experiment 7:

* **Experiment 4:** Numerical results of hue cancellation for a range of \(\lambda_{c}\)'s away from the classical choice using the identity network working in a device-dependent digital RGB space.
* **Experiment 5:** Numerical results of hue cancellation for a range of \(\lambda_{c}\)'s away from the classical choice using the identity network working in a standard LMS space [7].
* **Experiment 6:** Numerical results of hue cancellation for a range of \(\lambda_{c}\)'s away from the classical choice using the identity network working in a standard ATD space [1, 14].

Figure 2: Opponent curves for the trivial identity network operating in different color representation spaces.
* **Experiment 7:** Exhaustive exploration of (analytical) changes of basis that are similar to hue cancellation experiments for \(\lambda_{c}\)'s very different from the classical choice.

First, lets introduce the idea of the _change-of-basis analogy_ of the hue cancellation experiments, and then we present the results of experiments 4-6 together with the theory-based simulation (experiment 7).

Consider the case in which the cancellation lights are complementary in pairs. For instance, in Fig. 3, see the pair [\(\lambda_{1}\), \(\lambda_{3}\)] and the pair formed by \(\lambda_{2}\) and the magenta referred to as \(\lambda_{4}\). In that situation, the determination of \(w^{\star}_{\lambda_{c}}\) is equivalent to a change to a color basis where two of the primaries go in the directions of the pair of complementary wavelengths (e.g. the red and green vectors in Fig. 3). By choosing a third linearly-independent vector (e.g. in the direction of an achromatic color as the vector in blue perpendicular to the triangle of the chromatic diagram) one has a _new basis_ of the color space perfectly defined by the _new_ primaries, \(P^{\star}_{i}\), with \(i=1,2,3\). These _new_ primaries are defined by their tristimulus vectors, \(R(P^{\star}_{i})\), in the basis of _old_ primaries, \(P_{i}\), with \(i=1,2,3\). They have chromatic coordinates \(r(P^{\star}_{i})\), and, as in every array of chromatic coordinates and tristimulus vectors, they are proportional: \(R(P^{\star}_{i})=\gamma_{i}r(P^{\star}_{i})\).

In this situation, taking \(P_{i}\) as the input color representation (as in Fig. 1.b), hue cancellation with the four lights is analogous to a _change-of-basis_ from \(P_{i}\) to \(P^{\star}_{i}\). Therefore, looking for \(w^{\star}_{\lambda_{1}}(\lambda)\) and \(w^{\star}_{\lambda_{2}}(\lambda)\) is analogous to the computation of the tristimulus values of the monochromatic components of the equienergetic white \(R^{\star}_{1}(E_{\lambda})\) and \(R^{\star}_{2}(E_{\lambda})\). Under this _change-of-basis analogy_, the valence functions can be computed analytically from the color matching functions (the vectors \(R(E_{\lambda})\), \(\forall\,\lambda\)), and the matrix \(M_{PP^{\star}}\) that changes the vectors from the basis \(P_{i}\) to the basis \(P^{\star}_{i}\):

\[R^{\star}(E_{\lambda})=M_{PP^{\star}}\cdot R(E_{\lambda}) \tag{3}\]

where, as in any standard change of basis [10], the matrix is:

\[M_{PP^{\star}}=\left(\begin{array}{ccc}R_{1}(P^{\star}_{1})&R_{1}(P^{\star}_ {2})&R_{1}(P^{\star}_{3})\\ R_{2}(P^{\star}_{1})&R_{2}(P^{\star}_{2})&R_{2}(P^{\star}_{3})\\ R_{3}(P^{\star}_{1})&R_{3}(P^{\star}_{2})&R_{3}(P^{\star}_{3})\end{array} \right)^{-1}=\left(\begin{array}{ccc}\gamma_{1}^{-1}&0&0\\ 0&\gamma_{2}^{-1}&0\\ 0&0&\gamma_{3}^{-1}\end{array}\right)\cdot\left(\begin{array}{ccc}r_{1}(P^{ \star}_{1})&r_{1}(P^{\star}_{2})&r_{1}(P^{\star}_{3})\\ r_{2}(P^{\star}_{1})&r_{2}(P^{\star}_{2})&r_{2}(P^{\star}_{3})\\ r_{3}(P^{\star}_{1})&r_{3}(P^{\star}_{2})&r_{3}(P^{\star}_{3})\end{array} \right)^{-1}\]

In this _change-of-basis analogy_ the hue cancellation valence functions are obtained from the color matching functions in the input representation transformed by the matrix in Eq. 3. Note that the weights \(\gamma_{i}\) associated to the (arbitrary)

Figure 3: The _change-of-basis analogy_: Hue cancellation experiment as combination of vectors of a new basis. Note that the primaries \(P^{\star}_{i}\) (based on the cancelling lights) are not related to the unknown primaries of the unknown representation \(R^{\prime}\). The primaries \(P^{\star}_{i}\) (either in option 1 or 2) are just an _artifice_ to compute analytically the weights \(w^{\star}_{i}(\lambda)\) from the tristimulus values \(R^{\star}_{1}(E_{\lambda})\) and \(R^{\star}_{2}(E_{\lambda})\). Given two arbitrary \(\lambda_{1}\) and \(\Delta\lambda\), the difference between _option 1_ and _option 2_ is that in the second the primaries \(P^{\star}_{1}\) and \(P^{\star}_{2}\) are taken to be orthogonal to the one that goes in the direction of the White, \(P^{\star}_{3}\propto W\), so that they convey _less_ information about brightness.
length of the vectors, \(R(P_{i}^{\star})\), will scale each output \(R_{i}^{\star}(E_{\lambda})\). Therefore, despite the shape of the curves is fixed by the matrix of chromatic coordinates of the new basis, the global scale of the predicted functions can be varied via the length of the primaries. As a result, in the simulations using this analogy, given certain cancellation \(\lambda_{c}\)'s, the length of the basis vectors will be adjusted to obtain the best possible match between the predicted function and the classical curves of Jameson and Hurvich.

As explained in Appendix B, in the settings where the cancelling lights are not strictly complementary (as in the classical setting by Jameson and Hurvich) the curves can be obtained from alternative instrumental lights which are complementary. Then, the contribution of these instrumental lights always can be assigned back to the considered cancelling lights. Therefore, (1) the classical setting can be understood using this _change-of-basis analogy_, and (2) this analogy can be used to explore multiple combinations of axes \((\lambda_{1},\lambda_{3})\) and \((\lambda_{2}=\lambda_{1}+\Delta\lambda,\lambda_{4})\). These configurations can include the original experiment and also other, progressively different, alternatives.

In the experiments 4-6 we execute artificial hue cancellation experiments with identity networks using complementary cancelling lights selected according to the _change-of-basis analogy_ described above. We explore a range of \(\lambda_{1}\) over the visible spectrum, and for each \(\lambda_{1}\), we select \(\lambda_{2}=\lambda_{1}+\Delta\lambda\) with a range of \(\Delta\lambda\) so that \(\lambda_{2}\) is still visible. Then, the 3rd and 4th cancellation lights are the complementary lights of \(\lambda_{1}\) and \(\lambda_{2}\). Sometimes the complementary cancellation lights are purple-magenta, as in the arbitrary example of Fig. 3, but that is not a conceptual problem to apply the change-of-basis analogy. We take the wavelengths in these control experiments along a uniform grid over the spectral space. The analytical solution of the change-of-basis analogy (Fig. 3 and Eq. 3) can, of course, be used in this range of \(\lambda_{c}\)'s. Moreover, its analytical nature implies that one can efficiently sample the spectral space at higher rates. On top of the coarse regular grid shown below, we also perform the artificial hue cancellation at the configurations where the theory predicts better agreement with the opponent curves, which incidentally coincide with the wavelengths chosen in the classic experiment.

For every considered configuration of cancellation lights we compute the cancellation (or valence) curves and we compute the departure from this result and the human curves of Jameson and Hurvich. Fig. 4 shows the error of these predicted valence curves obtained either through the identity networks operating in different color spaces (experiments 4-6), or through the analytical change-of-basis analogy (experiment 7).

The results of experiments 4-7 stress the role of the choice of the cancellation lights in these experiments. Note that _all the error surfaces_ have the same specific structure:

* The theoretical surfaces of experiment 7 (which could be densely sampled since they are faster to compute) show two clear minima consistent with the setting selected in the classical experiment. The diagram shows that these two minima are actually equivalent. Moreover, they display a clear pattern of secondary minima. The pattern is more distinct in the setting where the _chromatic_ primaries \(P_{1}^{\star}\) and \(P_{2}^{\star}\) are chosen to be orthogonal to the White.
* The errors checked at the grid in the artificial hue cancellation experiments 4-6 are consistent with the theoretical surfaces despite the sampling grid is coarser. The reason for a coarser grid is merely computational1. In some cases the deepest minimum is not in the classical point, but the difference is always very small, i.e. in the classical setting the artificial curves are also very similar to the human curves. Footnote 1: Each location involves the estimation of the two valence curves at 50 \(\lambda\)’s. Therefore, it involves 50 hue cancellation experiments, i.e. 50 minimizations, one per \(\lambda\) in the visible range
* The artificial experiments lead to more marked differences between the agreement in the singular locations of small error (blueish points) and the rest. Note that the errors in the artificial experiments seem to increase faster as one goes away from the regions of small error.

These results (which are consistent regardless of the use of trichomatic representations or opponent representations) suggest that the emergence of the classical curves is more linked to the selection of the cancellation lights than on the inner color representation \(R^{\prime}\).

## 4 Discussion

### Summary of results

When using trivial (identity) artificial networks in the classical hue cancellation setting, opponent red-green and yellow-blue valence functions emerge regardless of the actual color representation used by the networks (as long as it is a tristimulus representation or even tristimulus-like digital-RGB representations that include mild nonlinearities).
This suggests that these opponent curves do not inform us about the inner workings of the considered system, but about the properties of color mixtures in the tristimulus representations. Given the fact that the mixture of opponent spectral cancellation lights is in the line between them in the chromatic diagram, changing the energy of these cancellation stimuli will always lead to displacements along these lines and hence, proper match with the grey reference (or proper hue cancellation) using the correct proportion of cancellation lights: humans and also trivial machines forced to use spectral (or quasi-spectral) cancellation lights would arrive to the same conclusion.

The reasoning is not as (analytically) obvious in nonlinear representations (as the digital-RGB) but results show that it follows the same trends, thus stressing the generality of the result.

The actual variation of the mixture when modifying the weights in the hue cancellation process only depends on the properties of the additive color mixture, and the path in the diagram is determined by the (classical) choice of the spectral cancellation lights, and not by the inner color representations. Results suggest that a fortunate selection of the cancellation \(\lambda_{c}\)'s is _somehow_ biasing the matching towards the correct opponent curves. If a range of alternative cancellation lights are considered, the results are progressively different from the classical opponent functions.

With the classical \(\lambda_{c}\)'s, the different color representations only imply different metric spaces to compute the error in the match, but in absence of neural noise (or in moderate neural noise), this would mean minor variations in the result of the minimization, and hence one cannot rule out trichromatic LMS-like representations.

Figure 4: Results of the control experiments (regular grid) together with the results in the original configuration (see the two dots off the regular grid). **Top row** shows the errors of the experiments 4-6 with a blue-yellow colorbar scale where blue means low error (good reproduction of the human opponent curves) and yellow means high departure from the human result. The color code of the departure represents the Mean Squared Error between the human and the artificial curves. **Bottom row (right):** these surfaces represent the same kind of errors, with the same color code for the two options of the change-of-basis analogy. The circles in red and magenta indicate the minima of the theoretical surfaces. **Bottom row (left):** the chromatic diagram shows that the two minima found by the theoretical simulations actually correspond to the same choice of cancellation lights, and coincide with the classical setting (see appendix B for more information on the auxiliary magenta).
### Previous criticisms to hue cancellation experiments

Certainly there are have been a number of well founded criticisms to the classical hue cancellation results. For instance, [6] makes this point: to what extent can we generalize from the valence measurements using monochromatic lights to other lights?. If the human behavior for polychromatic light does not follow from the behavior for monochromatic lights, then the data represents only an interesting (but non-generalizable) collection of observations. In general, the linearity assumption is only an approximation [15, 16, 17, 18]. As a result, we need a more complete (nonlinear) model before we can apply the hue cancellation data to predict the opponent-colors appearance of polichromatic lights. Other criticisms refer to overestimation of valence in certain spectral regions in hue cancellation versus other psychophysical methods [17, 19, 20].

However, the problem implied by the systematic emergence of the opponent curves from the identity networks is different. It is not restricted to the linearity assumption. In fact, the systems with nets operating in the LMS or ATD spaces are linear by definition. The emergence of the same result in two different (linear) trivial cases implies that the curves do not give a conclusive message about the inner working of the system.

### Emergence of human-like opponent curves in artificial systems

Emergence of human-like behavior in artificial systems has been an inspiration for functional (or principled) explanations in theoretical neuroscience [21, 22, 23].

In particular, due in part to the current success of artificial networks in vision tasks [24], there is a growing interest to compare their behavior with humans [25, 26, 27] or with human-like models of traditional visual neuroscience [28, 29, 30, 31, 32].

In this context, we set a low-level conventional psychophysics program to check the basic behavior of artificial networks in light of known basic human behavior [33, 34]. In this context, to our surprise, our first experiments with artificial networks (with markedly non-human color representation) actually displayed human-like behavior in hue cancellation [35].

That was the origin of this research because the emergence of human-like curves in hue cancellation in networks where opponency had not been built in (nor assumed in the training tasks) could have two implications:

* **Hypothesis A:** On the positive side, it could imply that the considered tasks used to train the nets actually lead to human behavior in scenarios different from the training. These evidences are interesting in the debate about the kind of tasks that may lead to human behavior. Note that certain tasks (e.g. assessing image quality or enhancing the retinal image), may lead to positive or negative results in reproducing human behavior depending on the architecture of the net. Consider examples in [28, 36] for the emergence of contrast nonlinearities, examples in [30, 32] for the emergence of the Contrast Sensitivity Functions, or examples in [37, 38] for the visibility of distortions.
* **Hypothesis B:** On the negative side, it could also be that the experimental setting somehow forces the result. In this case the opponent curves would not tell much about the inner color representation of the system, but about the selected _opponent_ spectral cancelling lights and about the properties of additive mixtures in tristimulus spaces. These elements (alien to the specific color coding in the network) could also explain the human-like opponent curves.

According to the results reported here, the second hypothesis seems the one that may be true.

### Implications in Visual Neuroscience

Direct physiological recording of the opponent spectral sensitivity of cells [39, 40] is (of course) the strongest indication of opponent color coding in the brain. However, following our results with trivial networks, the consistent emergence of the opponent curves in hue cancellation experiments suggests that other psychophysical techniques [41] may be more appropriate than hue cancellation to reveal the opponent mechanisms. Similarly, our results suggest that indirect statistical arguments actually give stronger evidences in favour of opponent color coding than hue cancellation experiments. Statistical arguments are not limited to classical linear decorrelation [42, 43], but also include more recent, nonlinear measures of dependence [44, 45, 46, 47].

## Appendix A: Quasi-monochromatic spectrum and cancellation lights

Monochromatic lights live on the spectral locus of the color diagram. However, it is not possible to represent perfect monochromatic lights in digital values, so we used a quasi-monochromatic approximation to perform the experiments.
To do that, we generate the quasi-monochromatic radiation as a narrow Gaussian spectral radiance of a determined height and width over a low-radiance equienergetic background. Fig. 5 left shows the quasi-monochromatic spectrum generated for different lambdas. For the experiments we use a Gaussian height of \(1.5\times 10^{-3}W\cdot m^{-2}\cdot st^{-1}\cdot nm^{-1}\) over an equienergetic background of \(0.5\times 10^{-4}W\cdot m^{-2}\cdot st^{-1}\cdot nm^{-1}\) and a Gaussian width of \(10nm\).

Fig. 5 right shows where the classical monochromatic lights live on the CIE 1931 color space (B, G, Y and R points) and the quasi-monochromatic reference wavelengths used in the experiments (inner blue points, which are inside the inner triangle that represent the color space that is possible to represent in digital values). The diagram also shows the equivalent opponent magenta marked by the red point in the B-R line that we used to combine the weights (see appendix B for more details).

## Appendix B: valence functions from optimal \(w^{\star}_{\lambda,\epsilon}(\lambda)\)

The result of our experimental settings with identity nets (as in the classical experiment) are four weights, \(w^{\star}_{\lambda,\epsilon}(\lambda)\), obtained after solving Eq. 1. However, as in the classical experiment, we need to combine the four weights to obtain two curves, the _red-green_ and the _yellow-blue_ when the classical cancellation lights are used. The way to combine the weights depends on the cancellation lights.

### B.1 When the cancellation lights _are_ complementary

Some cancellation stimuli can have _complementary wavelengths_: for instance, in the conventional setting, \(\lambda_{475}\) and \(\lambda_{580}\) are approximately _complementary_ because their mixture can lead to a grey (approximately equal to the equienergetic white). The mixture of these two lights leading to the white can be obtained by solving the following equation:

\[R(W)=\kappa_{1}\cdot R(E_{475})+\kappa_{2}\cdot R(E_{580}) \tag{4}\]

Where \(R(W)\) and \(R(E_{\lambda})\) represent the tristimulus vectors of the white and the cancellation lights respectively, and \(\kappa_{i}\) are the corresponding weights so that the sum of the two lights give monochromatic white. Then, the corresponding cancellation weights (i.e. \(w^{\star}_{475}\) and \(w^{\star}_{580}\)) are straightforward to mix because a positive increase in one of them can be compensated (in terms of hue) by a corresponding positive increase in the other with the corresponding \(\kappa_{i}\) factors. With such same-sign increases, the mixture will remain at the same point in the chromatic diagram and hence the hue is not modified. As a result, these same-sign increments cancel. Similarly, weights of different sign in complementary \(\lambda_{c}\)'s contribute to the change of hue in the same way (moving the mixture in the same direction). Therefore, such opposite-sign increases should not cancel, but should be added in absolute value. In these opposite-sign cases, the resulting sign depends on the criterion taken to define the chromatic channel: for instance, if we decide to build a _yellow-blue_ channel (meaning positive values for long wavelengths and negative values for short wavelengths), the sum

Figure 5: Monochromatic cancellation lights and quasi-monochromatic approximation of the spectral locus. The auxiliary colors in _yellow_ and _magenta_ represent alternative methods to get the valence cancellation curves (see Appendix B) in case the complementary of some of the selected cancellation wavelengths is not a monochromatic stimulus (i.e. it is in the purple region) as is the case in the classical setting depicted here.
of modulus should be given a positive value when \(w^{\star}_{475}<0\) and \(w^{\star}_{580}>0\). In short, the yellow-blue valence function, \(V_{\text{YB}}\), is:

\[V_{\text{YB}}=\pm\kappa_{1}\cdot|w^{\star}_{475}|\pm\kappa_{2}\cdot|w^{\star}_{5 80}| \tag{5}\]

where, the sign criterion we have just discussed above leads to these four cases:

\[\left\{\begin{array}{l}\text{if}\;\;w^{\star}_{475}\geq 0,w^{\star}_{580} \geq 0\implies V_{\text{YB}}=sign(w^{\star}_{475}-w^{\star}_{580})\left|\kappa_{1} \cdot w^{\star}_{475}-\kappa_{2}\cdot w^{\star}_{580}\right|,\\ \text{if}\;\;w^{\star}_{475}<0,w^{\star}_{580}<0\implies V_{\text{YB}}=sign(w^{ \star}_{580}-w^{\star}_{475})\left|\kappa_{1}\cdot w^{\star}_{475}-\kappa_{2} \cdot w^{\star}_{580}\right|,\\ \text{if}\;\;w^{\star}_{475}\geq 0,w^{\star}_{580}<0\implies V_{\text{YB}}=-\left(\kappa_{1}\cdot|w^{ \star}_{475}|+\kappa_{1}\cdot|w^{\star}_{580}\right|),\\ \text{if}\;\;w^{\star}_{475}<0,w^{\star}_{580}\geq 0\implies V_{\text{YB}}=\kappa_{1}\cdot|w^{\star}_{475}|+\kappa_{1} \cdot|w^{\star}_{580}|\end{array}\right. \tag{6}\]

The prescription is equivalent for any arbitrary pair of complementary cancellation \(\lambda_{c}\).

### When the cancellation lights are not complementary

In the case of the red-green channel, the complementary direction of the \(\lambda_{500}\) is not in the direction of the \(\lambda_{700}\). The actual complementary color is in the purple region. In that case, summation of \(w^{\star}_{500}\) and \(w^{\star}_{700}\) is not as straightforward because grey is not a sum of these cancellation lights.

Method 1: cancelling the reddish-greenish appearance (matching an auxiliary yellow instead of the white)

The authors of the classical experiment, [1] considered \(\lambda_{700}\) and \(\lambda_{500}\) as complementary because they weren't cancelling at white, but they were looking to cancel the reddish or greenish hue. This is equivalent to (4) but changing \(W\) by an _auxiliary yellow_, \(\mathcal{Y}\), at the intersection of the YB line with the line that connects the green \(\lambda=500nm\) with the red \(\lambda=700nm\). See this line and the auxiliary yellow in the diagram of Fig. 5, which can be obtained from this mixture:

\[R(\mathcal{Y})=\kappa_{3}\cdot R(E_{500})+\kappa_{4}\cdot R(E_{700}) \tag{7}\]

Where we set the (arbitrary) luminance of this auxiliary Yellow as the sum of the luminance of \(E_{500}\) and \(E_{700}\), and \(\kappa_{i}\) are the corresponding weights so that the sum of the two corresponding lights give a color which is neither red nor green. After that, we combine the obtained weights following the same sign criterion as in (6).

#### Method 2: matching the white through an auxiliary magenta

There is yet another way to solve the problem: in order to be able to cancel \(\lambda_{500}\) to the white, we need to find its complementary, and we can also impose that it lies in the \(BR\) line (magenta point in the diagram of Fig. 5) so that we can relate it with the other \(\lambda_{c}\)'s in use. We calculate this auxiliary _magenta_, as \(R(\mathcal{M})=\alpha_{M1}\cdot R(E_{475})+\alpha_{M2}\cdot R(E_{700})\), and we impose that it has the same energy as the other cancelling lights. We can consider, without loss of generality, that this magenta is complementary of \(\lambda_{500}\) so that, when they are mixed with the appropriate weights, they generate the White. This magenta is only an artifice to get the red-green curve from the obtained \(w^{\star}_{i}\); it has not been used in the optimization process. Its equivalent cancellation curve can be obtained via \(w^{\star}_{M}=\alpha_{M1}\cdot w^{\star}_{475}+\alpha_{M2}\cdot w^{\star}_{700}\). Then, we can impose the White sum condition as before to get the corresponding weights \(\kappa_{i}\):

\[R(W)=\kappa_{M1}\cdot R(E_{500})+\kappa_{M2}\cdot R(\mathcal{M}) \tag{8}\]

Now we can obtain the red-green valence curve, \(V_{\text{RG}}\), as a sum of \(w^{\star}_{500}\) and \(w^{\star}_{M}\) as follows (taking into account the same sign criteria stated in Eq. 6):

\[V_{\text{RG}} =\pm\kappa_{M1}\cdot|w^{\star}_{500}|\pm\kappa_{M2}\cdot|w^{ \star}_{M}|=\pm\kappa_{M1}\cdot|w^{\star}_{500}|\pm\kappa_{M2}\cdot(\alpha_{M1 }\cdot|w^{\star}_{475}|+\alpha_{M2}\cdot|w^{\star}_{700}|)=\] \[=\pm\kappa_{M1}\cdot|w^{\star}_{500}|\pm\kappa_{M2}\cdot\alpha_{M 1}\cdot|w^{\star}_{475}|\pm\kappa_{M2}\cdot\alpha_{M2}\cdot|w^{\star}_{700}| \tag{9}\]

By doing this calculation, we are using \(w^{\star}_{475}\) to get the two curves, which is something that our algorithm has not taken into account. To avoid using the energy of \(\lambda=475\) nm twice, we must remove from \(V_{\text{RG}}\) the amount of \(w^{\star}_{475}\) that we used in \(V_{\text{YB}}\). Doing so, Eq. 9 becomes:

\[V_{\text{RG}}=\pm\kappa_{M1}\cdot|w^{\star}_{500}|\pm(\kappa_{M2}\cdot\alpha_{ M1}-\kappa_{1})\cdot|w^{\star}_{475}|\pm\kappa_{M2}\cdot\alpha_{M2}\cdot|w^{ \star}_{700}| \tag{10}\]
Fig. 6 right shows the \(\lambda_{475}\) (blue), \(\lambda_{580}\) (yellow), \(\lambda_{500}\) (green) and auxiliary-magenta curves that are summed to give the yellow-blue and red-green curves.

The procedure described here can be applied to other choices of cancelling \(\lambda_{c}\)'s. When exploring the whole range of possible cancelling \(\lambda_{c}\) to simulate the hue cancellation experiment in situations beyond the conventional choice of cancelling lights, we always compute first the _complementary_ curves (one or two) when possible and then, when necessary, compute the complementary of \(\lambda_{c}\) with the red or blue extremes to get the last curve. Note that we always use \(\lambda_{700}\) when only one component lies in the purple line, but we use both \(\lambda_{400}\) and \(\lambda_{700}\) when there are two.

Finally, a note on the scaling of the valence curves. The shape of the curves and their relative scale determine how the matchings are made for each \(\lambda\). According to the change-of-basis analogy in Eq. 3, the scale of the curves is associated to the _arbitrary_ length of the associated primaries \(P_{i}^{\star}\). Therefore, once the minimization is finished, we keep the spectral shape constant and we look for the optimal lengths of \(P_{i}^{\star}\) to obtain the best match to the human-opponent curves.

## Appendix C: Visualization of hue cancellation matches with classical \(\lambda_{c}\)'s

It is important to check if the algorithm we used to minimize the distance has converged. In Fig. 7 we represent the hue cancellation solutions after solving Eq. 1 for experiments 1-3. Blue points represent the initial quasi-monochromatic stimuli, before the addition of the cancelling lights (i.e, \(w_{i}^{\star}=0\)). Black and red points represent the colors of the spectral and reference modified with the addition of the optimal \(E_{\lambda_{c}}\) founded by Eq. 1. We find that independently of the color representation, identity network gets the match at the directions determined by the selected \(\lambda_{c}\)'s in a very consistent way. Interestingly, the _red-green_ axis consistent with the magenta complementary of \(\lambda_{c}=500\) nm was not imposed in any way because the minimization was done by modifying the energy of \(\lambda_{c}=700\) nm. Of course (as in any learning process prone to errors due to early stopping), the networks do not find the absolute minimum (in a perfect match the difference between the red and the black stimuli should be zero). However, the final differences (black lines) are substantially smaller than the initial differences (blue lines).

Figure 6: Optimal weights, \(w_{i}^{\star}(\lambda)\), of the classical cancellation lights for the trivial identity network operating in different photoreceptor color spaces. Here we show the magenta curve (built from the blue curve and the red curve) that can be directly subtracted from the green curve to obtain \(V_{\text{RG}}\)
## Acknowledgments

The authors thank interesting discussions on the preliminary results [35] that lead to this research with A. Parraga, A. Akbarinia, J. Vazquez-Corral, X. Otazu, M. Bertalmio, F. Wichmann, and particularly, V. Laparra. This work was supported in part by MICIIN/FEDER/UE under Grant PID2020-118071GB-I00 and PDC2021-121522-C21, in part by Spanish MIU under Grant FPU21/02256 and in part by Generalitat Valenciana under Projects GV/2021/074, CIPROM/2021/056 and CIAPOT/2021/9. Some computer resources were provided by Artemisa, funded by the European Union ERDF and Comunitat Valenciana as well as the technical support provided by the Instituto de Fisica Corpuscular, IFIC (CSIC-UV).
