A simple linear classifier has the following equation:

f(xrandom,W,b)=Wxrandom+bWRK×DxrandomRDbRK

In image classification, a single image is represented by xrandom in computer memory. xrandom is an array of D numbers, each of which represents a pixel. You can think of W as K classifiers.

an image = an array of pixel valuesxrandom W=[WdogWcatWturtleWtiger]}K classifiers or "templates"

Notice each of the K classifiers are an array of D numbers as well. You can think of each classifier as the “ideal” or “template” image for the class of image it represents. For example, one of the classifiers might represent a dog. If you use it to classify a random image, xrandomRD, it’ll produce a “dog score”. The “dog score” could be the probability the random image, xrandom, is an image of a dog. Or it could just be a numerical value that you use to compare against scores when multiplying xrandom by other templates.

Wdogxrandom=score of how similar the random image is to a dog's image

However you interpret the score, when you multiply W and xrandom, essentially you’re producing K scores, one for each classifier in W. You’re getting scores for dog, cat, truck, lion, and whatever other classes are in W. On a more fine-grained level, you’re taking the dot product between each classifier of W and xrandom. If you recall from linear algebra, taking the dot product between two vectors, v1 and v2, can be thought of as taking the projection of v1 on v2 or vice versa. And you can think of computing projection as computing the similarity between the two vectors. In other words, given a random image xrandom and a template image for a dog, Wdog, how similar is xrandom to Wdog?

Wxrandom+b=[dog scorecat scoreturtle scoretiger score]}K scores

Now compute similarity scores between xrandom and every other template image in W. Finally, after computing K similarity scores, you’ll have K scores. Depending on what your score represents, choose the score that tells you which template your random image, xrandom, most represents.

For example, max(dog score, cat score, turtle score, …, tiger score) = dog score. Therefore, the random image, xrandom, is most likely to be an image of a dog.