{'fraction_non_alphanumeric': 0.04258043861053305, 'fraction_numerical': 0.005442612453977909, 'mean_word_length': 4.3265132139812446, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Mathematical derivation for Vora-Value based filter design method: Gradient and Hessian

In this paper, we present the detailed mathematical derivation of the gradient and Hessian matrix for the Vora-Value based colorimetric filter optimization. We make a full recapitulation of the steps involved in differentiating the objective function and reveal the positive-definite Hessian matrix when a positive regularizer is applied. This paper serves as a supplementary material for our paper in the colorimetric filter design theory.


Preliminary
Let Q = [r, g, b] and X = [x, y, z] denote respectively the spectral sensitivities of the camera and the CIE XYZ color matching functions (CMFs) of the human visual sensors. The columns of matrices Q and X represent the spectral sensitivity for each sensor channel and the rows represent the sensor responses at a sampled wavelength. Both matrices are in the size of n × 3, where n is the number of sampling wavelengths across the visible spectrum.

Notation
We will use the following notation for the gradient and Hessian matrix (with respect to the n-dimensional filter vector f = [f 1 , f 2 , · · · , f n ] T ): or equivalently, using the indices, we can respectively express as (∇ν) i = ∂ν . From the definitions, we know that ∇ν and ∇ 2 ν are respectively in the size of n × 1 and n × n.

Vora-Value
Given a camera sensor set Q and the trichromatic human visual sensors X, the Vora-Value is defined [2] as where the superscripts T and −1 denote respectively the matrix transpose and inverse and tr() returns the sum of the elements along the diagonal of a matrix. The Vora-Value is often used to measure how similarly a camera samples the spectral signals compared to the human visual system. It returns a number in the range [0,1] where 1 means the camera is fully colorimetric such that RGBs are precisely a linear transform from XYZ tristimulus values. A higher Vora-Value indicates a better fit between two sensor systems.

Projector Matrix
The projector of a matrix -such as Q -is defined as When we return to Eq. (2), it can also be written in a more compact representation as where P{Q} and P{X} denote the projection matrices respectively of the camera spectral sensitivities Q and the human visual responses X.

Orthonormal Basis
In a n-dimensional vector space, n linearly independent vectors forms a set. We call such a set as basis set. Every vector in the n-dimensional vector space can be expressed as a linear combination of the basis vectors. There are infinite bases for a vector space and, by definition, they are all linear transform apart. Let where T is the (full rank) linear mapping matrix which makes V orthonormal. An orthonormal matrix has columns that are unit vectors and also perpendicular to each other. Mathematically, we write V T V = I 3 (I 3 is the 3 × 3 identity matrix). The orthonormal matrix V can be obtained by many methods, e.g. the Gram-Schmidt process [3]. By simple substitution into the matrix projector in Eq. (3), we can express projector matrices in a simpler algebraic form: and then substituting into Eq. (2), we can simplify the Vora-Value as

Filter-modified Vora-Value
Previously, we proposed to design a color filter which, when placed in front of a camera, can make the new effective camera more colorimetric [4]. When a color filter is placed in front of a camera, it alters the spectral sensitivities. The effect of placing a color filter to a camera can be modeled as the multiplication of the filter spectral transmittance to the camera spectral sensitivities. Given f an n-dimensional filter vector (with f i > 0) and camera spectral sensitivity matrix Q, the new effective sensitivity responses after filtering can be represented as diag(f)Q. To ease the notation, we use F = diag(f) and rewrite as FQ.
Thus the filter-modified Vora-Value for the effective 'filter+camera' system (using the orthonormal basis of the XYZ CMFs) can be written as ν(FQ, X) = 1 3

Derivation of Gradient
In this section, we will derive the gradient, in terms of the filter vector, of the filter-modified Vora-Value as given in Eq. (8).
Proof. The following rules of matrix calculus are used to obtain the required differentials: Using the above rules, we have Using the acyclic property of trace that tr(ABC) = tr(BCA) = tr(CAB), we can move the dF in each of the term to the end of the formulation. We also use the projector representation of P{X} = VV T to make it more compact as The matrix F is diagonal by definition, we can make the derivative as We use F −1 P{FQ} = Q(Q T F 2 Q) −1 Q T F to ease the notation ( the diagonality of F guarantees it to be invertible). Our gradient function can be expressed as Given F −1 P{FQ} P{X} is symmetric, we have This equation can be further merged into where I is the identity matrix. Now, let us rewrite the derivative in terms of the underlying filter vector f. First, remember that F = diag(f). Let us denote the inverse operator -the one that extracts the diagonal from a square matrix and places the result in a vector -as ediag ('e' signifies to 'extract' the diagonal elements). Clearly, ediag(diag(f)) = f. Here, diag() is a forward operation turning a vector into a diagonal matrix and ediag is the companion reverse operator extracting the diagonal. Now we can derive the gradient, in terms of the underlying filter vector, as where the gradient with respect to the filter vector, ∇ν(f), is a n × 1 vector.
It is evident that the gradient has a very interesting structure: it is the diagonal of the product of three projection matrices multiplied by the inverse of the filter (at hand). We will come back to this interesting feature later.

Smoothness Constrained Filter
When the filter is composed by a linear combination of a set of basis functions, f = Bc where columns of B are basis vectors and c denotes the coefficients [5]. By using the chain rule, we can calculate the gradient with respect to the coefficient vector c as: or, equivalently in its explicit form as ∇ν(c) = 2 3 B T ediag F −1 P{FQ} P{X}(I − P{FQ}) .

Filter Design with Regularization
In Eq. (19), we reformulate the filter design optimization that we aim to minimize (instead of to maximize as for the Vora-Value optimization):