---
title: Whitening-Coloring Transform for Style Transfer
url: https://www.emergentmind.com/topics/whitening-coloring-transform-wct
type: topic
---

# Whitening-Coloring Transform for Style Transfer

Searching arXiv for core and related WCT papers to ground the article in the cited literature.
Whitening-Coloring Transform (WCT) is a feature-space transformation for universal style transfer in which deep content features are first decorrelated and then re-correlated to match the covariance structure of style features. In its canonical form, WCT operates on CNN activations extracted from a fixed pretrained VGG network and transfers arbitrary unseen styles without style-specific retraining: whitening removes the original second-order statistics of the content representation, while coloring imposes those of the style representation. The method was introduced as the analytic core of a reconstruction-based universal style transfer pipeline [1705.08086], and was later reinterpreted as one particular solution of a broader covariance-matching and optimal-transport formulation [1906.00668].

## 1. Statistical definition and core equations

In the standard formulation, content and style feature maps at a chosen CNN layer are vectorized as
\[
f_c \in \mathbb{R}^{C \times H_c W_c}, \qquad f_s \in \mathbb{R}^{C \times H_s W_s},
\]
or, in the Gaussian interpretation, as samples from multivariate distributions
\[
u \sim \mathcal{N}(\mu_c,\Sigma_c), \qquad v \sim \mathcal{N}(\mu_s,\Sigma_s).
\]
WCT is a linear transform that maps centered content features to the style distribution by whitening with the inverse square root of the content covariance and coloring with the square root of the style covariance. In matrix form, the transform is
\[
t(u) = T(u-\mu_c) + \mu_s,
\]
with the covariance-matching constraint
\[
T\Sigma_c T^T = \Sigma_s.
\]
The canonical WCT choice is
\[
T = \Sigma_s^{1/2}\Sigma_c^{-1/2},
\]
which first removes content feature correlations and then imposes style correlations [1906.00668].

In the eigendecomposition form used in universal style transfer, if
\[
f_c f_c^\top = E_c D_c E_c^\top,\qquad f_s f_s^\top = E_s D_s E_s^\top,
\]
then whitening and coloring are written as
\[
\hat{f}_c = E_c D_c^{-\frac12} E_c^\top f_c,
\qquad
\hat{f}_{cs} = E_s D_s^{\frac12} E_s^\top \hat{f}_c,
\]
followed by restoration of the style mean. The resulting transformed features satisfy
\[
\hat{f}_{cs}\hat{f}_{cs}^\top = f_s f_s^\top,
\]
so WCT matches the full covariance matrix, not merely diagonal variances. This is the explicit covariance-matching analogue of Gram-matrix style transfer, since the Gram matrix \(FF^\top\) encodes channel correlations in feature space [1705.08086].

## 2. Canonical universal style transfer pipeline

The original WCT system combines a fixed encoder, learned decoders, and an analytic feature transform. A pretrained VGG-19 network serves as encoder; a symmetric reconstruction network is trained to invert features back to RGB images; and WCT is inserted between them as a closed-form style operator. The decoder is trained with
\[
L = \|I_{o}-I_{i}\|^{2}_{2} + \lambda\|\Phi(I_{o}) - \Phi(I_{i})\|^{2}_{2},
\]
where \(\Phi\) is the fixed VGG encoder. After training, the encoder and decoders are frozen, and style transfer is performed entirely by feature extraction, covariance computation, WCT, and decoding [1705.08086].

The original system trains five decoders, one for each VGG layer \(\mathrm{Relu}_{X\_1}\) with \(X=1,\dots,5\). This enables both single-level stylization and a multi-level coarse-to-fine procedure. In the multi-level version, WCT is applied sequentially from \(\mathrm{Relu}_{5\_1}\) down to \(\mathrm{Relu}_{1\_1}\): higher layers introduce coarse semantic style patterns, and lower layers refine colors and fine textures. The reported motivation is that reversing this order destroys low-level information once higher-level transformations are applied, whereas coarse-to-fine stylization better preserves visual quality and style statistics across levels [1705.08086].

A style-strength control parameter is introduced by interpolating between transformed and original content features:
\[
f' = \alpha \hat{f}_{cs} + (1-\alpha) f_c.
\]
The same analytic mechanism is also used for texture synthesis by replacing content with random noise, and for texture interpolation via feature blending:
\[
\hat{f}_{cs} = \beta \hat{f}_{cs_1} + (1-\beta)\hat{f}_{cs_2}.
\]
These extensions follow directly from WCT’s interpretation as an explicit manipulation of feature statistics rather than a learned style-specific mapping [1705.08086].

## 3. Expressivity, relation to AdaIN, and non-uniqueness

A central distinction in the literature is between WCT and Adaptive Instance Normalization (AdaIN). AdaIN aligns per-channel mean and variance and therefore uses only diagonal covariance information; in matrix terms,
\[
T = D_s ./ D_c,
\]
with \(D_c\) and \(D_s\) the diagonal matrices of \(\Sigma_c\) and \(\Sigma_s\). WCT, by contrast, matches the entire covariance matrix, including inter-channel correlations. The stated argument is that CNN channels are correlated, so a full covariance-aware transform is more expressive and generally more stylized than a diagonal one [1906.00668]. The same contrast reappears in later image translation and GAN literature, where WCT is treated as a strict generalization of channel-wise normalization because it models cross-channel interactions rather than independent scale-and-shift parameters [1812.09912; 2208.00921].

Theoretical analysis also shows that covariance matching alone is underconstrained. If
\[
T\Sigma_c T^T = \Sigma_s,
\]
then
\[
T = \Sigma_s^{1/2}Q\Sigma_c^{-1/2}
\]
is also a valid solution for any unit orthogonal matrix \(Q\). WCT is therefore only one member of an infinite family of covariance-matching transforms. This result formalizes a common but often implicit point: matching style statistics does not define a unique stylized feature, and different orthogonal choices can yield different visual outputs even when the covariance constraint is exactly satisfied [1906.00668].

Within the optimal-transport view, WCT satisfies the style-distribution constraint but does not explicitly optimize content preservation. The proposed objective is
\[
T = \arg\min_T E(\|t(u)-u\|_2^2)
\quad \text{s.t.} \quad
t(u)=T(u-\mu_c)+\mu_s,\;\; T\Sigma_cT^T=\Sigma_s,
\]
which selects, among all admissible covariance-matching transforms, the one closest in expected squared distance to the original content feature. The resulting closed-form Optimal Style Transfer (OST) solution is
\[
T = \Sigma_c^{-1/2} \left(\Sigma_c^{1/2}\Sigma_s\Sigma_c^{1/2}\right)^{1/2} \Sigma_c^{-1/2}.
\]
In this interpretation, WCT is “covariance matching,” whereas OST is “covariance matching plus optimal preservation of content.” The same analysis emphasizes that WCT can preserve some structure due to whitening, but that artifacts or structural distortions remain because no explicit content-preserving criterion is enforced [1906.00668].

## 4. Variants within style transfer: diversity and photorealism

The non-uniqueness of covariance or Gram matching motivated diversified arbitrary style transfer based on deep feature perturbation (DFP). In that formulation, the standard WCT coloring stage
\[
\hat{F}_{cs} = E_sD_s^{\frac12}E_s^T\hat{F}_c
\]
is modified by inserting an orthogonal random matrix \({\bf Z}\):
\[
\hat{F}_{csn} = E_sD_s^{\frac12}{\bf Z}E_s^T\hat{F}_c.
\]
Because \({\bf Z}{\bf Z}^T=I\), the Gram matrix is preserved exactly:
\[
\hat{F}_{csn}\hat{F}_{csn}^T = E_sD_sE_s^T = F_sF_s^T.
\]
The reported interpretation is that DFP traverses the style-specific feature space of all feature maps sharing the same Gram matrix, thereby producing diverse stylizations without retraining [1909.08223].

DFP is integrated into multi-level WCT-style pipelines as perturbed WCT (PWCT). Diversity is controlled by mixing the perturbed and unperturbed outputs,
\[
\hat{F}'_{csn} = \lambda \hat{F}_{csn} + (1-\lambda)\hat{F}_{cs},
\]
and then blending with content via the usual \(\alpha\) parameter. The paper reports that deterministic WCT-based baselines have zero diversity under the paper’s diversity metrics, whereas Li et al. + DFP reaches Pixel distance \(0.162\) and LPIPS \(0.431\), Sheng et al. + DFP \(0.102 / 0.264\), and Li et al. + DFP \(0.091 / 0.203\). It also reports that arbitrary random matrices severely degrade quality, indicating that orthogonality, rather than the specific sampling distribution, is the property preserving style statistics [1909.08223].

A distinct line of work targets photorealistic transfer. WCT\(^2\) retains the whitening-coloring mechanism
\[
f_{cs} = E_s D_s^{\frac12} E_s^\top E_c D_c^{-\frac12} E_c^\top f_c,
\]
but replaces lossy max-pooling and unpooling with Haar wavelet pooling and wavelet unpooling, which satisfy exact reconstruction conditions. The stated motivation is that ordinary WCT and PhotoWCT can distort object boundaries and amplify reconstruction errors when stylization is applied recursively across scales. WCT\(^2\) instead performs progressive stylization within a single forward pass at layers such as `conv1_1`, `conv2_1`, `conv3_1`, and `conv4_1`, while preserving high-frequency structure through wavelet subbands \(LL\), \(LH\), \(HL\), and \(HH\) [1903.09760].

The reported consequences are architectural and empirical. WCT\(^2\) is described as the first and the only end-to-end model in that discussion that can stylize a \(1024\times1024\) image in \(4.7\) seconds without post-processing, uses about \(51\%\) of the GPU memory of PhotoWCT, and yields a stable video stylization without temporal constraints. Human evaluation preferred it in \(69.33\%\) for fewest artifacts, \(56.77\%\) for best stylization, and \(62.21\%\) overall preference [1903.09760].

## 5. Extensions to image translation, GANs, and normalization

WCT has been adapted to exemplar-based image-to-image translation through Group-wise Deep Whitening-and-Coloring Transformation (GDWCT). The motivation is that plain WCT uses explicit eigendecomposition, which is computationally intensive and difficult to differentiate through. GDWCT therefore replaces exact whitening with a learned approximation in which the encoder is regularized so that its output covariance approaches identity,
\[
\mathcal{R}_w = \mathbb{E}[\lVert \Sigma_c - I \rVert_{1,1}],
\]
making mean subtraction a surrogate whitening step. Coloring is likewise approximated by a learned matrix \(UDU^T\), with orthogonality encouraged by
\[
\mathcal{R}_c = \mathbb{E}_s[\lVert U^T U - I \rVert_{1,1}].
\]
The transform is made group-wise by splitting channels into \(G\) groups, which reduces parameter count from about
\[
C^2 \to \frac{C^2}{G}.
\]
The reported interpretation is that GDWCT is a trainable, group-wise, end-to-end approximation of WCT suitable for image translation [1812.09912].

In GAN generators, AdaWCT generalizes AdaIN by replacing per-channel normalization and affine modulation with a whitening matrix \(\mathbf{W}\) and a learned coloring matrix \(\boldsymbol{\Gamma}\):
\[
\tilde{\mathbf X}_\mathrm{AdaWCT} =
\boldsymbol{\Gamma}\mathbf{W}(\mathbf{X}-\hat{\mu}(\mathbf{X})\mathbf{1}^\intercal)
+\boldsymbol{\mu}\mathbf{1}^\intercal.
\]
To avoid unstable exact SVD, the whitening matrix is approximated with the Newton-Schulz iterative method after shrinkage and normalization. Group-wise whitening and coloring are implemented with block-diagonal matrices; \(G=1\) degenerates to AdaIN, and \(G=C\) gives full WCT. In StarGANv2 on AFHQ, reported averages over all domains are: reference-guided AdaIN \(19.78\) FID and \(0.431\) LPIPS versus AdaWCT \(16.20\) and \(0.434\); latent-guided AdaIN \(16.18\) and \(0.450\) versus AdaWCT \(13.07\) and \(0.476\). The same study reports the best FID at group size \(G=64\) and states that this is the first use of WCT for style injection in GANs [2208.00921].

A related but distinct adaptation is Whitening and Coloring batch transform for GANs. There, whitening is applied to batch features using a matrix \(W_B\) satisfying
\[
W_B^\top W_B = \Sigma_B^{-1},
\]
followed by a learned coloring transform
\[
Coloring(\hat{\mathbf{x}}_i) = \Gamma \hat{\mathbf{x}}_i + \boldsymbol{\beta}.
\]
Conditional versions use class-specific coloring filters \(\Gamma_y\) and \(\boldsymbol{\beta}_y\), optionally with a shared class-agnostic branch. The paper frames this as a GAN-oriented instantiation of the same whiten-then-color principle: whitening improves optimization conditioning, while coloring restores representational flexibility and encodes conditioning information more expressively than conditional Batch Normalization [1806.00420].

## 6. Domain-specific adaptations, limitations, and recurring misconceptions

A recent domain-specific extension is UStyle, which reformulates WCT for underwater imagery through depth-aware whitening and coloring transform (DA-WCT). Standard WCT is characterized there as a global covariance-alignment operator,
\[
F_{cs} = U_s + C_s^{1/2} C_c^{-1/2} (F_c - H_c),
\]
or equivalently
\[
\hat F_c = C_c^{-1/2}(F_c - H_c), \qquad
F_{cs} = C_s^{1/2}\hat F_c + H_s.
\]
The stated problem is that underwater “style” is tied to waterbody optics, depth-dependent attenuation, and backscatter; direct global WCT can therefore cause global averaging, oversaturation, or loss of object detail. DA-WCT first extracts a style waterbody component \(B_s\) using a physics-based procedure based on the style depth map and the \(5\%\) farthest pixels, then fuses stylized and original features with a depth-dependent gate
\[
w(x) = \sigma\!\left(-k\cdot(D_c(x)-T)\right),
\qquad
F_{\text{depth}}(x) = w(x)\cdot F_{cs}(x) + \bigl(1-w(x)\bigr)\cdot F_c(x),
\]
followed by a global style-strength parameter
\[
F_{cs} = \alpha F_{\text{depth}} + (1-\alpha)F_c.
\]
The paper reports that, in every ablation configuration, DA-WCT outperforms plain WCT on PSNR, SSIM, and RMSE; for example, in the full model, \(B \rightarrow G\) improves from PSNR \(28.36\) to \(28.73\), SSIM \(0.9590\) to \(0.9613\), and RMSE \(9.77\) to \(9.39\), while \(DG \rightarrow DB\) improves from PSNR \(28.43\) to \(29.14\), SSIM \(0.9069\) to \(0.9126\), and RMSE \(9.15\) to \(8.96\) [2503.11893].

Several limitations recur across the WCT literature. Exact WCT requires eigendecomposition or SVD of covariance matrices, with computational complexity described as roughly \(O(n^3)\) for an \(n\times n\) covariance matrix, and its backpropagation is repeatedly characterized as non-trivial or unstable [1812.09912]. Full coloring matrices also incur parameter cost: in AdaWCT, for \(C=256\) and a 512-dimensional style vector, the projection network would require at least
\[
256\times256\times512 \approx 33\text{M}
\]
parameters per style injection block, motivating group-wise approximations [2208.00921]. Within style transfer proper, a frequent misconception is that exact covariance matching is sufficient for good stylization. The optimal-transport analysis argues against this: covariance matching is underconstrained, WCT is not unique up to orthogonal rotations, and explicit content preservation changes the solution class [1906.00668]. Another recurring misconception is that WCT and AdaIN differ only in implementation detail; the literature consistently treats them as different statistical models, with AdaIN matching only channel-wise moments and WCT matching full inter-channel covariance [1906.00668; 2208.00921].

Source: https://www.emergentmind.com/topics/whitening-coloring-transform-wct