Definition
It is a technique use to model labels for multi-class problems. Each label (), is represented as a vector with dimensions where is the number of possible classes.
All the values in the vector consists of zeros except the element for the correct class, which is defined as .
For an input belonging to class , the label vector is defined as:
where the th element is .
This of label vector can also be interpreted as a probability vector. An example of this is the DeepFace system, which uses a “one-of-4030” encoding for its 4,030 face classes.
Example
Classification of images into one of three categories: Cat, Dog, or **Bird ** i.e (K=3) classes. According to the 1-of-K encoding scheme, the label for each image will be a 3-dimensional vector.
Label Modeled for an image from each class:
- If an input image is a Cat (Class 1), its label vector would be:
- If an input image is a Dog (Class 2), its label vector would be:
- If an input image is a Bird (Class 3), its label vector would be:
Each vector has a '' in the position corresponding to its class and ''s in all other positions.