Md. Asif Uddin
    I.12.X10

    An anomaly on the surface scores zero

    counterexample▲▲△

    The best width-one linear autoencoder for the four points (1,2)(1,2), (2.2,0.4)(2.2,0.4), (−1,−2)(-1,-2) and (−2.2,−0.4)(-2.2,-0.4) projects onto u1=(0.8,0.6)\vec u_1=(0.8,0.6). Its squared reconstruction error is used as an anomaly score, and any input scoring above 1.51.5 is flagged.

    (a) Find the scores of the four training points.

    (b) Find the scores of (8,6)(8,6) and of (−1.2,1.6)(-1.2,1.6), and the distance from each to its nearest training point.

    (c) Which of the two is flagged?

    (d) What does the score measure, and what would be needed to flag the other one?

    Hint

    Write each new point in the eigenvectors u1=(0.8,0.6)\vec u_1=(0.8,0.6) and u2=(−0.6,0.8)\vec u_2=(-0.6,0.8). The score is the square of the u2\vec u_2 component.

    Solution

    (a) Each training point has a component of ±1\pm1 along u2\vec u_2, so every score is 11. The threshold of 1.51.5 passes all of them.

    (b) The point (8,6)(8,6) is 10 u110\,\vec u_1. It lies on the principal axis and its score is 00. Its nearest training points are (1,2)(1,2) and (2.2,0.4)(2.2,0.4), each at distance 65=8.062258\sqrt{65}=8.062258.

    The point (−1.2,1.6)(-1.2,1.6) is 2 u22\,\vec u_2. Its score is 44. Its nearest training points are (1,2)(1,2) and (−2.2,−0.4)(-2.2,-0.4), each at distance 5=2.236068\sqrt5=2.236068.

    (c) Only (−1.2,1.6)(-1.2,1.6) is flagged. The point (8,6)(8,6) passes with the lowest score of any input seen so far, lower than every training point, though it is more than three times as far from the data as the point that was flagged.

    (d) The score is the squared distance from the reconstruction surface, here a line. It says nothing about where along the line an input falls. The line extends without end, and the data occupy a short stretch of it.

    To flag (8,6)(8,6) one must know which codes are usual. Its code is 1010, where the training codes are ±2\pm2. Reconstruction error does not look at the code, and (I.12.1) defines no distribution over codes against which 1010 could be judged improbable. A threshold on the size of the code would catch this case and would be a second detector, added by hand.

    The failure grows with the quality of the model. A decoder that generalises well reconstructs inputs it was never shown, and each of them scores as normal.

    Draws on