1

In a Deep Learning lession, the author explains that 2 black / white images can NOT be compared by looking at their pixel value differences because some values would be negative, and they would cancel each other out.

For example:

pixel (0,0) of image A is 250
pixel (0,0) of image B is 256
= -6

pixel (1,1) of image A is 146 pixel (1,1) of image B is 140 = +6

= -6 + 6 = 0

I am not sure if what he says is correct. To me, this would still be a valid way to compare them.

However, the author then goes on to say that we need all (pixel difference) value to be positive.

We can get rid of this problems by 2 ways:

  • Make all differences absolute (so that - becomes +)

or

  • Take the mean of the square of differences (which makes everything positive) and then take the square root (which undoes the squaring). This is called the root mean squared error (RMSE) or L2 norm.

I tried to follow along, but I don't see how the square of differences would make everything positive.

Using example values above:

-6² = -12
+6² = 12

This still sums up to 0 for me.

What does the author do differently than I am?

Thank you!

tmighty
  • 393

1 Answers1

0

$$(-6)^2=36$$

$$6^2=36$$

Root means squared error would be $\sqrt{\frac{36+36}2}=\sqrt{36}=6>0.$

It will be positive as long as the two images are not identical.

Siong Thye Goh
  • 149,520
  • 20
  • 88
  • 149