The von Kries Hypothesis and a Basis for Color Constancy

Color constancy is almost exclusively modeled with diagonal transforms. However, the choice of basis under which diagonal transforms are taken is traditionally ad hoc. Attempts to remedy the situation have been hindered by the fact that no joint characterization of the conditions for {sensors, illuminants, reflectances} to support diagonal color constancy has previously been achieved. In this work, we observe that the von Kries compatibility conditions are impositions only on the sensor measurements, not the physical spectra. This allows us to formulate the von Kries compatibility conditions succinctly as rank constraints on an order 3 measurement tensor. Given this, we propose an algorithm that computes a (locally) optimal choice of color basis for diagonal color constancy and compare the results against other proposed choices.


Introduction
Color constancy refers to the visual system's treatment of color as an intrinsic material property. For a given scene, the human visual system, post adaptation, will settle on the same perceived color for an object despite changes in illumination. Such an ability to discern illumination-invariant material descriptors has clear evolutionary advantages and also largely simplifies (and hence is widely assumed in) a variety of computer vision algorithms.
To achieve color constancy, one must discount the effect of changing illumination through transformations of an observer's trichromatic sensor response values. While many illumination-induced transformations are possible, it is commonly assumed that each of the three sensors reacts (uniformly across the visual field) with a form of independent gain control (i.e., each sensor response value is simply scaled by a multiplicative factor) [4,10]. This is termed von Kries adaptation. Represented in linear algebra, it is equivalent to multiplying each column vector of sensor response values by a shared diagonal matrix, and is therefore also referred to as the diagonal model for color constancy.
Note that while the initial von Kries hypothesis applied only to direct multiplicative adjustments of retinal cone sen-sors, we follow [4] and use the term more loosely to allow for general trichromatic sensors. We also allow for a change of color basis to occur before the per-channel multiplicative adjustment. (Finlayson et al. [4] refer to this as a generalized diagonal model for color constancy, and they term the change of color basis a sharpening transform.) The (generalized) diagonal model is at the core of the majority of color constancy algorithms. Even a number of algorithms not obviously reliant on the diagonal assumption in fact rely on diagonal models following a change of color basis [5,4]; their choice of color basis is simply not explicit. Yet, despite the widespread use of the diagonal model, good choices of color bases under which diagonal transforms can be taken are only partially understood.
The most theoretically-justified approach to choosing a color space is predicated on the assumption that the spaces of illuminant and reflectance spectra are each lowdimensional. As shown by Finlayson et al. [5,4], a two-dimensional linear space of illuminants and a threedimensional linear space of reflectances (or vice versa) is sufficient 1 to guarantee diagonal color constancy. This is an important observation because it provides a principled method for choosing a von-Kries compatible color space for a given set of sensors, illuminants, and reflectances.
While the work of Finlayson et al. [5,4] is a significant first step, both empirical and analytical observations reveal this characterization to be incomplete. Empirical studies suggest that diagonal color constancy is adequate under more general conditions than the 2-3 model implies [7]. (This is good news for vision systems that seek color constancy in the real world. While the space of natural illuminants may be sufficiently small, the space of reflectances is probably not [12].) From an analytical standpoint, the 2-3 model is known to be only sufficient 1 -not necessary-for von Kries adaptation. Indeed, once a specific color basis is chosen, one can expand the set of compatible illuminants well beyond a two-dimensional space by adding those illuminants that integrate to zero against (i.e., are black with respect to) all reflectances in the compatible set [7]. More surprisingly, one can algorithmically grow the compatible illuminant set to include additional non-black illuminants as well [16,7]. This analysis, however, is still incomplete because given color data, the analysis does not reveal a method for computing the color space to begin with.
While these limitations have been well-documented, a more complete characterization of the conditions for von Kries compatibility has yet to be established. As a result, the development of more powerful systems for choosing optimized color bases has been slow. This paper addresses these issues by answering the following questions: 1. What are the necessary and sufficient conditions that sensors, illuminants, and materials must satisfy to be exactly von Kries compatible, and what is the structure of the solution space?
2. Given measured spectra or labeled color observations, how do we determine the color space that "best" supports diagonal color constancy?
We observe that the joint conditions are impositions only on the sensor measurements, not the physical spectra. This allows the von Kries compatibility conditions to be succinctly formulated as rank constraints on an order 3 measurement tensor. Our analysis leads directly to an algorithm that, given labeled color data, computes a locally optimal choice of color basis in which to carry out diagonal color constancy computations. The proposed framework also unifies most existing analyses of von Kries compatibility.

Theory
We define two notions of color constancy. The first definition captures the idea that a single adjustment to the sensors will map all material colors seen under an illuminant E 1 to reference colors under (a possibly chosen standard) illuminant E 2 . The second definition (also known as relational color constancy) captures the idea that surface colors have a fixed relationship between each other no matter what overall illumination lights the scene. As stated, these two definitions are not interchangeable. One being true does not imply the other.
To define the issues formally, we need a bit of notation. Let R be the smallest linear subspace of L 2 functions enclosing the spectral space of materials of interest. Let E be the smallest linear subspace of L 2 functions enclosing the spectral space of illuminants of interest. Let p R,E be the color (in the sensor basis) of material reflectance R(λ) ∈ R under illumination E(λ) ∈ E. In the following, D andD are operators that take color vectors and map them to color vectors. D is required to be independent of the material R; likewise,D is required to be independent of the illuminant E. The * denotes the action of these operators on color vectors. Figure 1. The 3xIxJ measurement tensor. The tensor can be sliced in three ways to produce the matrices Ω (j) , Λ (i) , and Γ (k) .
In the case that D andD are linear (and hence identified with matrices), * is just matrix-vector multiplication. If D is linear, we say that the world supports linear adaptive color constancy. IfD is linear, we say the world supports linear relational color constancy. D being linear does not implȳ D is linear, and vice versa. If both D andD are linear, we say the world supports doubly linear color constancy.
In particular, we shall be interested in the case when D andD are both furthermore diagonal (under some choice of color basis). It is proven in [4] that for a fixed color space, D is diagonal if and only ifD is diagonal. So the two notions of color constancy are equivalent if either D orD is diagonal, and we say the world supports diagonal color constancy (the doubly modifier is unnecessary). The equivalence is nice because we, as biological organisms, can likely learn to achieve definition 1, but seek to achieve definition 2 for inference.
Given a set of illuminants {E i } i=1,...,I , reflectances {R j } j=1,...,J , and sensor color matching functions {ρ k } k=1,2,3 , we define a measurement data tensor (see Figure 1): For fixed values of j, we get 3xI matrices Ω (j) := M kij that map illuminants expressed in the {E i } i=1,...,I basis to color vectors expressed in the sensor basis. Likewise, for fixed values of i, we get 3xJ matrices Λ (i) := M kij that map surface reflectance spectra expressed in the {R j } j=1,...,J basis to color vectors. We can also slice the tensor by constant k to get IxJ matrices Γ (k) := M kij .
Since color perception can depend only on the eye's trichromatic color measurements, worlds (i.e., sets of illuminant and material spectra) giving rise to the same measurement tensor are perceptually equivalent. To understand diagonal color constancy, therefore, it is sufficient to analyze the space of measurement tensors and the constraints that these tensors must satisfy. This analysis of von Kries compatible measurement tensors is covered in section 2.1.
Given a von Kries compatible measurement tensor (e.g., an output from the algorithm in section 3), one may also Figure 2. Core tensor form: a 3x3x3 core tensor is padded with zeros. The core tensor is not unique. be interested in the constraints such a tensor places on the possible spectral worlds. This analysis is covered in section 4.

Measurement Constraints
The discussion in this section will always assume generic configurations (e.g., color measurements span three dimensions, color bases are invertible). Proofs not essential to the main exposition are relegated to Appendix A.

Proposition 1. A measurement tensor supports doubly linear color constancy iff ∃ a change of basis for illuminants and materials that reduces it to the core tensor form of Figure 2.
More specifically (as is apparent from the proof of Proposition 1 in Appendix A.1), if a single change of illuminant basis makes all the Ω (j) slices null past the third column, the measurement tensor supports linear relational color constancy. Likewise, a change of material basis making all the Λ (i) slices null past the third column implies the measurement tensor supports linear adaptive color constancy. Support for one form of linear constancy does not imply support for the other.
The following lemma provides a stepping stone to our main theoretical result and is related to some existing von Kries compatibility results (see section 4).

Lemma 1.
A measurement tensor supports generalized diagonal color constancy iff there exists a change of color basis such that, for all k, Γ (k) is a rank-1 matrix.
This leads to our main theorem characterizing the space of measurement tensors supporting generalized diagonal color constancy.

Theorem 1. A measurement tensor supports generalized diagonal color constancy iff it is a rank 3 tensor. 2
An order 3 tensor (3D data block) T is rank N if N is the smallest integer such that there exist vectors { a n , b n , c n } n=1,...,N allowing decomposition as the sum of outer products (denoted by •): 2 There exist measurement tensors supporting generalized diagonal color constancy with rank less than 3, but such examples are not generic.
Without loss of generality, let { a n } be vectors of length I, corresponding to the illuminant axis of the measurement tensor; let { b n } be vectors of length J, corresponding to the material axis of the tensor; and let { c n } be vectors of length 3, corresponding to the color sensor axis of the tensor. Let the vectors { a n } make up the columns of the matrix A, vectors { b n } make up the columns of the matrix B, and vectors { c n } make up the columns of the matrix C. Then the decomposition above may be restated as a decomposition into the matrices (A, B, C), each with N columns.
Proof. (Theorem 1). First suppose the measurement tensor supports generalized diagonal color constancy. Then by Lemma 1, there exists a color basis under which each Γ (k) is rank-1 (as a matrix). This means each Γ (k) can be written as an outer product, Γ (k) = a k • b k . In this color basis then, the measurement tensor is a rank 3 tensor in which the matrix C (following notation above) is just the identity. We also point out that an invertible change of basis (on any of A, B, C) does not affect the rank of a tensor, so the original tensor (before color basis change) was also rank 3. For the converse case, we now suppose the measurement tensor is rank 3. Since C is (in the generic setting) invertible, multi-linearity gives us: The right hand side of Equation (3) is a rank 3 tensor with each Γ (k) slice a rank-1 matrix. By Lemma 1, the tensor must then support diagonal color constancy.
In the proof above, note that the columns of C exactly represent the desired color basis under which we get perfect diagonal color constancy. This theorem is of algorithmic importance because it ties the von Kries compatibility criteria to quantities (best rank 3 tensor approximations) that are computable via existing multilinear methods.

Color Basis for Color Constancy
Given a measurement tensor M generated from realworld data, we would like to find the optimal basis in which to perform diagonal color constancy computations. To do this, we first find the closest von Kries compatible measurement tensor (with respect to the Frobenius norm). We then return the color basis that yields perfect color constancy under this approximate tensor.
By Theorem 1, finding the closest von Kries compatible measurement tensor is equivalent to finding the best rank 3 approximation. Any rank 3 tensor may be written in the form of equation (2) with N = 3. We solve for M 's best rank 3 approximation (decomposition into A, B, C) via Trilinear Alternating Least Squares (TALS) [8]. For a rank 3 tensor, TALS forces A, B, and C to each have 3 columns. It then iteratively fixes two of the matrices and solves for the third in a least squares sense.
Repeating these computations in lockstep guarantees convergence to a local minimum. A, B, C can be used to reconstruct the closest von Kries compatible tensor and the columns of C exactly represent the desired color basis.
As a side note, the output of this procedure differs from the best rank-(3,3,3) approximation given by HOSVD [11]. HOSVD only gives orthogonal bases as output and the rank-(3,3,3) truncation does not in general yield a closest rank 3 tensor. HOSVD may, however, provide a good initial guess.
The following details on TALS mimic the discussion in [14]. For further information, see [14,8] and the references therein. The Khatri-Rao product of two matrices A and B with N columns each is given by where ⊗ is the Kronecker product. Denote the flattening of the measurement tensor M bỹ M IJ×3 if the elements of M are unrolled such that the rows of matrixM IJ×3 loop over the (i, j)-indices with i = 1, ..., I as the outer loop and j = 1, ..., J as the inner loop. The column index ofM IJ×3 corresponds with the dimension of the measurement tensor that is not unrolled (in this case k = 1, 2, 3). The notation for other flattenings is defined symmetrically. We can then write: By symmetry of equation (5), we can write out the least squares solutions for each of the matrices (with the other two fixed).

Relationship to Previous Characterizations
As mentioned in the introduction, there are two main sets of theoretical results. There are the works of [7,16] that give necessary and sufficient conditions for von Kries compatibility under a predetermined choice of color space, and are able to build infinite dimensional von Kries compatible worlds for this choice. Then there are the works of [5,4] that prescribe a method for choosing the color space, but only for worlds with low dimensional linear spaces of illuminants and materials. We omit direct comparison to the various spectral sharpening techniques [6,3,1] in this section, as these methods propose more intuitive guidelines rather than formal relationships.
Previous analyses treat the von Kries compatibility conditions as constraints on spectra, whereas the analysis here treats them as constraints on color measurements. In this section, we translate between the two perspectives. To go from spectra to measurement tensors is straightforward. To go the other way is a bit more tricky. In particular, given a measurement tensor with rank-1 Γ (k) , there is not a unique world generating this data. Any set of illuminants {E i } i=1,...,I and reflectances {R j } j=1,...,J satisfying Equation (1) (with M and ρ k fixed) will be consistent with the data. Many constructions of worlds are thus possible. But if one first selects particular illuminant or material spectra as mandatory inclusions in the world, then one can state more specific conditions on the remaining spectral choices.
In [5,4], it is shown that if the illuminant space is 3 dimensional and the material space is 2 dimensional (or vice versa), then the resulting world is (generalized) von Kries compatible. As a measurement tensor, this translates into stating that any 3x3x2 measurement tensor is (complex) rank 3. However this "3-2" condition is clearly not necessary as almost every rank 3 tensor is not reducible via change of bases to size 3x3x2. In fact, one can always extend a 3x3x2 tensor to a 3x3x3 core tensor such that the Γ (k) are still rank-1. The illuminant added by this extension is neither black with respect to the materials, nor in the linear span of the first two illuminants.
The necessary and sufficient conditions provided in [16] can be seen as special cases of Lemma 1. The focus on spectra leads to a case-by-case analysis with arbitrary spectral preferences. However, the essential property these conditions point to is that the 2x2 minors of Γ (k) must be zero (i.e., Γ (k) must be rank-1).
One case from [16] is explained in detail in [7]. They fix a color space, a space of material spectra, and a single reference illumination spectrum. They can then solve for the unique space of illumination spectra that includes the reference illuminant and is von Kries compatible (in the fixed color basis) with the given material space.
In our framework, this can be interpreted as follows. The given input gives rise to a single Λ (1) measurement slice. The three rows of this slice can be pulled out and placed in a new measurement tensor of the form shown in Figure 3. This measurement tensor is then padded with an infinite number of zero Λ (i) matrices. The Γ (k) slices of this new tensor are clearly rank-1 matrices, and thus this tensor is von Kries compatible in the given color space. Moreover, any measurement tensor with rank-1 Γ (k) that include the original Λ (1) slice in its span must have Λ (i) slices that are spanned by the Λ (i) slices in Figure 3. With this fixed tensor and the fixed material spectra, one can then solve Equation (1) to obtain the space of compatible illumination spectra. This space can be described by three non-black illuminants and an infinite number of black illuminants (giving zero measurements for the input material space). Since the original Λ (1) measurement slice is in the span of the Λ (i) slices, the original reference illuminant must be in the solution space.

Results
We run our color basis algorithm on the SFU dataset [2] and compare our resulting color basis against previous choices (the cone sensor basis, 4 bases derived from different low dimensional approximations of spectral data, that of Barnard et. al. [1], and the "sensor sharpened" basis [6]). This comparison is done in an experiment described below.
The SFU database provides 8 illuminants simulating daylight, and 1,995 materials including measured spectra of natural objects. Fluorescent spectra were removed from the dataset in hopes of better modeling natural lighting conditions since, in color matching experiments, fluorescent lamps cause "unacceptable mismatches of colored materials that are supposed to match under daylight" [17].
The low dimensional worlds to which we compare are taken to have either 3 dimensional illuminant spaces and 2 dimensional material spaces (a 3-2 world) or vice versa (a 2-3 world); this allows computing color bases via the procedure in [4].
We take two different approaches to approximating spectra with low dimensional vector spaces. In the first approach (described in [4,6]), we run SVD on the illuminant and material spectra separately. We then save the best rank-3 and rank-2 approximations. This is Finlayson's "perfect sharpening" method for databases with multiple lights [6].
As pointed out in [13], if error is to be measured in sensor space, there are alternatives to running PCA on spectra. Given a measurement tensor, the alternative ("tensorbased") approach instead applies SVD on the tensor flatten-ingsM J3×I andM 3I×J to get the principal combination coefficients of the spectral bases (to be solved for) that approximate the sample spectra. Refer to [13] for details.
For the experiments, color matching functions are taken to be CIE 1931 2-deg XYZ with Judd 1951 and Vos 1978 modifications [17]. To resolve mismatches in spectral sampling, we interpolate the data using linear reconstruction.
Cone fundamentals are taken to be the Vos and Walraven (1971) fundamentals [17]. Experiments are run with illuminant spectra normalized with respect to the L 2 norm.
We run the same white-patch normalization experiment as in [4]. As input, we are given a chosen white material W and an illuminant E. For every other material R, we compute a descriptor by dividing each of its 3 observed color coordinates by the 3 color coordinates of W (the resulting 3 ratios are then transformed as a color vector to XYZ coordinates so that consistent comparisons can be made with different choices of color space). In a von Kries world, the descriptor for R would not depend on the illuminant E. To measure the non von Kries-ness of a world, we can look at how much these descriptors vary with the choice of E.
More formally, we define the desriptor as: The function diag creates a matrix whose diagonal elements are the given vector's components. C is a color basis.
For each instance of the experiment, we choose one SFU test illuminant E and compute the errors over all test materials (canonical illuminant E is kept the same for each experimental instance). Each time, the color basis derived from running our method (labeled as "Optimized") performed the best. Figure 4 shows the cumulative histograms for instances in which the stated basis performs the best and worst relative to the next best basis. Curves represent the percentage of material color vectors satisfying the von Kries hypothesis versus the allowable error. Relative performance between two bases is measured as a ratio of the areas under their respective histogram curves. The entire process is then repeated for another canonical E to give a total of 4 graphs.
The basis labeled as "Barnard" requires a choice of canonical illuminant for its specification. Figure 4 shows two sets of graphs. One in which the canonical illuminant for testing matches the "Barnard" canonical, and one set in which the canonical illuminants differ. The second canonical illuminant is chosen to illustrate the best worst-case relative performance of our algorithm. "Barnard" optimizes with respect to a particular canonical illuminant, while our method effectively optimizes over all light pairs. We also tested against Finlayson's "database sharpening" method Figure 4. Percent vectors satisfying von Kries mapping versus percent allowable error. Each curve represents a different choice of color space. For low dimensional worlds, the dimension of the illuminant space precedes the dimension of the material space in the abbreviated notation. Low dimensional approximations were obtained either by running PCA on spectra or by tensor methods described in text. We show the experimental instances in which our derived basis performs the best and worst relative to the next best basis. The left and right halves differ in choice of canonical illuminant for testing. Unlike "Barnard", our method effectively optimizes all pairs of lights.
[6] (using PCA on lights to handle multiple lights). The results were nearly identical to both of the 2-3 methods. The SFU optimized color basis given in normalized XYZ coordinates is: For baseline comparison, the cone basis (Vos and Walraven) [17], given in normalized XYZ coordinates is:

Discussion
We have argued for a new data-driven choice of color basis for diagonal color constancy computations. We show that with respect to some existing metrics, the new choice leads to a better diagonal model.
While a linear change of color basis poses no problem to those concerned simply with algorithmic modeling, those who seek relevance to human biological mechanisms might object (on theoretical grounds) that sensor measurement acquisition may involve nonlinearities that disrupt the brain's ability to linearly transform the color basis downstream. Fortunately, experimental results based on single-cell responses and psychophysical sensitivity suggest that any existing nonlinearities at this level are negligible [15,12].
Future work includes investigating positivity constraints on the transformed sensors [3] and running an updated set of color constancy evaluations as in [9]. Human perceptual experiments also need to be run to test the perceptual efficacy of the proposed bases.

A. Proofs
For simplicity, we only consider generic conditions.

A.1. Proof of Proposition 1
We first show that if a measurement tensor supports doubly linear color constancy, then it can be transformed into the core tensor form of Figure 2 via changes in illuminant and material bases.

Lemma 2.
If ∀j, j , ∃D(R j , R j ) satisfying the definition of linear relational color constancy, then ∃ a single change of basis for the space of illuminants, E, such that ∀j ∈ {1, ..., J} the 3xI matrix Ω (j) is zero past the third column.
Proof. (Lemma 2) By definition of linear relational color constancy, we haveD(R j , R j ) is linear, and ∀E ∈ E, its corresponding coordinate vector (in the basis of illuminant spectra used to create the measurement tensor) ε satisfies Ω (j ) ε =D(R j , R j )Ω (j) ε. Let N j ⊆ E be the subset of E whose coordinate vectors (also in the basis of illuminant spectra used to create the measurement tensor), { n}, constitute the null space of Ω (j) . Since Ω (j) is rank-3, N ⊥ j is 3 dimensional. Given the above, we have that ∀ n Ω (j ) ( ε + n) =D(R j , R j )Ω (j) ( ε + n) (17) So N j ⊆ N j . By symmetry under interchange of j and j , N j ⊆ N j , so N j = N j ∀j, j . Fix a j, and choose a basis with the first three vectors spanning N ⊥ j and orthogonal to N j , and the rest of the basis vectors spanning N j and orthogonal to N ⊥ j . Under this choice, every Ω (j) will have zeros past the third column since the decompositions Ker(Ω (j) ) ⊥ ⊕ Ker(Ω (j) ) are the same for all j.
By symmetry of Lemma 2, we have a similar statement for D(E i , E i ) and a change of basis for R. Hence we can get the core tensor form via change of illuminant and material bases. Figure 5. Following a change of illuminant basis, the 3xI measurement tensor slice Ω (j) is partitioned into a nonzero 3x3 sub-blockΩ (j) and a zero 3x(I − 3) sub-block as shown.
We now prove the converse direction. The ability to achieve the core tensor form of Figure 2 implies there is a single change of illuminant basis transforming the measurement tensor's Ω (j) slices into the block form in Figure  5. Denote the nonzero 3x3 sub-block of Ω (j) asΩ (j) . Now define for every pair j, j the linear operatorΩ (j )Ω −1 (j) . Observe that this operator maps the columns of matrix Ω (j) (color vectors of material R j ) to the corresponding columns of Ω (j ) (color vectors of material R j ). The nonzero columns are mapped appropriately by construction, and the zero columns are mapped to zero by linearity. This means the that for all basis illuminant spectra of E, the operator Ω (j )Ω −1 (j) correctly maps the associated material R j colors to the appropriate material R j colors. Since color measurements are linear in the illuminant, and the colors associated with each basis illuminant spectrum are mapped correctly, we can conclude thatΩ (j )Ω −1 (j) acts asD(R j , R j ) does on all color vectors. This implies: Hence,D is linear. SinceD does not depend on illuminants, it is invariant to any illuminant basis change and so the initial change of illuminant basis did not alter whether the measurement tensor supports linear relational color constancy. Likewise, a change of material basis making all the Λ (i) slices null past the third column implies D is linear, and the tensor supports doubly linear color constancy.