What do we mean by 'principal angle between subspaces'?
Let's consider the case where you have two photos, one base photo and one other photo which is a scaled version of the base photo. Consider then that you could create a 'mapping' from the base photo to the scaled photo as defined by a set of vector changes for each pixel in the base photo.
That is to say, if you had a pixel at point (0,0) in the base photo it would be in position (0,0) on the scaled photo. If you had a pixel at point (0,1) on the base photo, it would be at point (0,s) on the scaled photo, where s is the scale factor between them. The same would be true for (1,0) mapping to (s,0) and (1,1) mapping to (s,s).
We can understand each of these pixels as a subspace on the vector space of &quot;all possible pixels&quot; (possibly with an included vector for the 'value' of each pixel as a third+ dimension, based on how it's represented). Note though, that they are different subspaces. There are vectors that exist in the scaled picture for scale factors greater than 1 which are not in the original picture. For scale values less than one, there are vectors which are in the original picture which are not in the scaled picture. For scale vector equal to one, it's basically the identity and they're the same picture.
What's more, we can do the same for rotation. If you have base photo and rotated photo, then there is a mapping from one pixel on the base photo to one pixel on the rotated photo, I'll leave the math up to you. The same is further true for translating, skewing, and even changing the colors of the image. Each one denotes a type of mapping that you could make from one subspace to another.
So what does this mean? Well, one thing that you could do is take two images, one &quot;base&quot; photo and two &quot;scaled&quot; photos and determine &quot;how different are these two photos from the base photo&quot;? That is, if the first scaled photo has a scaling factor of 10 and the second has a scaling factor of 100, then you could say that the larger scaled-photo is &quot;further away&quot; from the base photo. That is, we can compare the two mappings together to determine which mapping is closer to the original.
What's more, these mapping functions are often composable and commutative. That is if you do a &quot;scale-then-rotate&quot;, that is very similar if not exactly identical to doing &quot;rotate-then-scale&quot;. Let's take a look at why this is. Let's consider that we take a unit vector from either one. We then apply &quot;scale&quot; which scales both the x and y components, and then rotate this unit vector about some axis (let's assume the origin, though maybe there's a translation that happens as well). You will then yield a new vector which represents all of these applied changes. What's more, we can do this to both of the &quot;scale-then-rotate&quot; function and the &quot;rotate-then-scale&quot; function.
Now we have two vectors, and we want to determine if they are the same. Well, one way to do that is to calculate the angle between two vectors. If the angle is 0, then we can say that the vectors are the same (with the assumption that they are also of the same magnitude). In this case, both would yield the same vector, the angle between them is 0, so we can say they are the same.
So then how do we get back to the question of &quot;how different are these two objects&quot;? Well, one way that we could do it is to attempt to answer the question &quot;What set of composed functions maps from one object onto the other one?&quot;. If we can create a new &quot;vector&quot; which is the representation of the full set of changes from one picture to the other, we can then attempt to determine how different these two objects are, as represented in the dimensional spaces of their image.
But the question that you may then ask is &quot;why is this useful&quot;? Well, imagine that you are a neural network. You've been given a picture and tasked with answering the question &quot;Is this a cat?&quot;. How would you go about answering this? Well, one thing as a neural net that you've learned is &quot;cats have ears&quot;. You have a canonical representation of a &quot;cat ear&quot; encoded in the weights of your neural network, so you go about looking at different subsets of the picture to say &quot;is this a cat ear&quot;? You can do this, for example, by taking a cropped section of the picture, determining the angle and dimensions apart that cropped section is from your canonical &quot;cat ear&quot; is, and if the angle between your canonical &quot;cat ear&quot; and your sample is below some amount, you can say with confidence that what you have found is a &quot;cat ear&quot;. A couple cat ears, eyes, a nose, some fur, and a tail (though maybe the tail is occluded), and you can be confident that you have found a &quot;cat&quot;.
(Note: This is an oversimplification and this is usually done in deep networks by breaking pictures out into a continually composing series of features, for instance first &quot;lines&quot; vs &quot;curves&quot; vs &quot;textures&quot;, which then yield &quot;circles&quot; vs &quot;rectangles&quot; vs &quot;cross-hashes&quot;, which then yield &quot;eyes&quot; vs &quot;fur&quot; vs &quot;skin&quot;, etc. Each different layer could be implemented with its own comparison in this same method though!)