Md. Asif Uddin
    Problem I.12.B03

    How much noise, how much shrinkage

    limit▲▲△

    Exact values where possible; six decimal places otherwise.

    STATEMENT

    Find the linear map that best removes noise of variance σ2\sigma^2 from four points, with and without a bottleneck, and follow it as the noise goes to zero and to infinity.

    GIVEN

    The four points of I.12.B01, with eigenvalues λ=(4,1)\lambda=(4,1) and eigenvectors u1=(0.8,0.6)\vec u_1=(0.8,0.6), u2=(−0.6,0.8)\vec u_2=(-0.6,0.8). The input is corrupted as x~=x+ε\tilde{\vec x}=\vec x+\vec\varepsilon, where ε\vec\varepsilon is independent of x\vec x with mean zero and covariance σ2I\sigma^2\mat I. The loss is E∥Mx~−x∥2\E\|\mat M\tilde{\vec x}-\vec x\|^2.

    FIND

    (a) The optimal gain on each principal direction and the loss it leaves. (b) The optimal map and its loss at σ2=1\sigma^2=1. (c) The same when M\mat M must have rank one. (d) The limits σ2→0\sigma^2\to0 and σ2→∞\sigma^2\to\infty, with values at σ2=0.01\sigma^2=0.01 and 100100. (e) A check of (I.12.8) for Gaussian data.

    STRATEGY

    Use the decomposition in (I.12.7). The optimal map shares the eigenvectors of S\mat S, so the problem separates into one scalar problem per direction.

    SOLUTION

    (a) By (I.12.7) the loss is the clean reconstruction loss of M\mat M plus σ2∥M∥F2\sigma^2\|\mat M\|_F^2, and its minimiser S(S+σ2I)−1\mat S(\mat S+\sigma^2\mat I)^{-1} has the eigenvectors of S\mat S. Write M=∑igiuiuiT\mat M=\sum_ig_i\vec u_i\vec u_i^{\mathsf T}. The loss becomes ∑i[(1−gi)2λi+σ2gi2]\sum_i\big[(1-g_i)^2\lambda_i+\sigma^2g_i^2\big]. Each term is a parabola in its own gig_i, with derivative −2(1−gi)λi+2σ2gi-2(1-g_i)\lambda_i+2\sigma^2g_i:

    gi=λiλi+σ2,lossi=λi σ2λi+σ2.\begin{aligned} g_i&=\frac{\lambda_i}{\lambda_i+\sigma^2},\\ \text{loss}_i&=\frac{\lambda_i\,\sigma^2}{\lambda_i+\sigma^2}. \end{aligned}

    A direction is kept at exactly one half when the noise variance equals its own.

    (b) At σ2=1\sigma^2=1 the gains are 4/54/5 and 1/21/2. The two projections are

    u1u1T=[0.640.480.480.36],u2u2T=[0.36−0.48−0.480.64],\begin{aligned} \vec u_1\vec u_1^{\mathsf T}&=\begin{bmatrix}0.64&0.48\\0.48&0.36\end{bmatrix},\\[2pt] \vec u_2\vec u_2^{\mathsf T}&=\begin{bmatrix}0.36&-0.48\\-0.48&0.64\end{bmatrix}, \end{aligned}

    so

    M⋆=0.8 u1u1T+0.5 u2u2T=[0.6920.1440.1440.608].\begin{aligned} \mat M^\star&=0.8\,\vec u_1\vec u_1^{\mathsf T}+0.5\,\vec u_2\vec u_2^{\mathsf T}\\[2pt] &=\begin{bmatrix}0.692&0.144\\0.144&0.608\end{bmatrix}. \end{aligned}

    The loss is 4/5+1/2=1.34/5+1/2=1.3.

    (c) A rank-one map keeps one direction. Keeping direction ii costs λiσ2/(λi+σ2)\lambda_i\sigma^2/(\lambda_i+\sigma^2) there and the full λj\lambda_j on the other. Keeping u1\vec u_1 costs 0.8+1=1.80.8+1=1.8; keeping u2\vec u_2 costs 0.5+4=4.50.5+4=4.5. So the best rank-one map is 0.8 u1u1T0.8\,\vec u_1\vec u_1^{\mathsf T}, with loss 1.81.8.

    The bottleneck chooses the direction, as in I.12.T1. The noise then shrinks what is kept.

    (d) As σ2→0\sigma^2\to0 each gain tends to 11, the map tends to the identity and the loss to 00. Without noise, nothing stops the copy. As σ2→∞\sigma^2\to\infty each gain behaves like λi/σ2\lambda_i/\sigma^2 and tends to 00; the map outputs the mean, and the loss tends to tr⁡S=5\operatorname{tr}\mat S=5.

    σ2\sigma^20.010.0111100100
    g1g_10.9975060.9975060.80.80.0384620.038462
    g2g_20.9900990.9900990.50.50.0099010.009901
    loss0.0198760.0198761.31.34.8362534.836253

    (e) If x\vec x is Gaussian with mean zero and covariance S\mat S, then x~\tilde{\vec x} is Gaussian with covariance S+σ2I\mat S+\sigma^2\mat I and score −(S+σ2I)−1x~-(\mat S+\sigma^2\mat I)^{-1}\tilde{\vec x}. Then (I.12.8) gives

    x~−σ2(S+σ2I)−1x~    =S(S+σ2I)−1x~,\begin{aligned} &\tilde{\vec x}-\sigma^2(\mat S+\sigma^2\mat I)^{-1}\tilde{\vec x}\\ &\;\;=\mat S(\mat S+\sigma^2\mat I)^{-1}\tilde{\vec x}, \end{aligned}

    which is the map of (a). For Gaussian data the best denoiser is linear, and the two results are one.

    Answer

    Gains λi/(λi+σ2)\lambda_i/(\lambda_i+\sigma^2) with loss ∑iλiσ2/(λi+σ2)\sum_i\lambda_i\sigma^2/(\lambda_i+\sigma^2). At σ2=1\sigma^2=1: M⋆=[0.6920.1440.1440.608]\mat M^\star=\begin{bmatrix}0.692&0.144\\0.144&0.608\end{bmatrix} with loss 1.31.3, or 0.8 u1u1T0.8\,\vec u_1\vec u_1^{\mathsf T} with loss 1.81.8 at rank one. The map tends to the identity as σ2→0\sigma^2\to0 and to zero as σ2→∞\sigma^2\to\infty.

    Check — sanity

    At σ2=1\sigma^2=1, copying the corrupted input costs σ2∥I∥F2=2\sigma^2\|\mat I\|_F^2=2 and outputting the mean costs tr⁡S=5\operatorname{tr}\mat S=5. The optimum, 1.31.3, is below both. Every gain lies strictly between 00 and 11.

    Where this breaks

    Noise with a general covariance N\mat N gives S(S+N)−1\mat S(\mat S+\mat N)^{-1}, which shares eigenvectors with S\mat S only if the two matrices commute. And for data that are not Gaussian the best denoiser is not linear at all: I.12.X08 finds a tanh⁡\tanh.

    Variation

    At σ2=4\sigma^2=4 the gains are (0.5,  0.2)(0.5,\;0.2) and the loss is 2+0.8=2.82+0.8=2.8. The script also confirms the decomposition of (I.12.7) exactly, by averaging over the four points and four noise vectors (±σ2,0)(\pm\sigma\sqrt2,0), (0,±σ2)(0,\pm\sigma\sqrt2), whose covariance is σ2I\sigma^2\mat I.

    Draws on