TrisZaska's Machine Learning Blog

Multi-layer Neural Network for binary/multi classification

1. Introduction
2. History and Overview about Artificial Neural Network
3. Single neural network
4. Multi-layer neural network
5. Install and using Multi-layer Neural Network to classify MNIST data
6. Summary
7. References

Binary/Multi classification

This is an optional topic we'll discuss the problem of Neural Network for multi-classification. In the section 4.4.2, we actually install Neural Network for binary classification, the output layer has one neuron with just two values are 0 and 1. Since it's relevant when we just need to classify whether it's Setosa flower (0) or Versicolor flower (1), but what if we want to add another flower to classify so-called Virginica (2), what will we do?
So, the technique could deal with multi-classification (greater than or equal to 3 labels) so-called One-vs-All method which can help us and of course it's very easy simple technique, let's illustrate an example,
Says, blue ball is represented for Setosa, the green ball is represented for Versicolor, the red ball is Virginica. The idea is when we classify one class, we just ignore all of the remain classes, the image below is what we will do,
Alright, we just do it graphically, when we actually implement it by codes, we'll use one-hot representation to describe the simple idea here. If you don't know what is one-hot representation, just check this on the Wikipedia page. Briefly, it's just a group of bit with bit 1 represent the class we care and bit 0 represent the remain classes.
So, three types of flowers can be represented as,
\( \text{Setosa} = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}, \text{Versicolor} = \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix}, \text{Virginica} = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}\)

No comments :

Post a Comment

Leave a Comment...