Multi class Perceptron problem
What do you do when you have to process more than two classes using the perceptron or a similar basic classifier unit? There's several approaches available to solve it, one of the most common is called the One vs All strategy.
|
The one vs all strategy consists on using several perceptron layers to discriminate the desired traits, so that selecting one automatically eliminates the rest. In this exercise we make use of the irisSmall.arff dataset which is widely used by researchers worldwide due to being an example of three linearly separable objects that has been provided and fully tested.
|
Iris dataset
This dataset consists of three different classes of flowers;
@RELATION irisSmall
@ATTRIBUTE sepallength REAL
@ATTRIBUTE sepalwidth REAL
@ATTRIBUTE petallength REAL
@ATTRIBUTE petalwidth REAL
@ATTRIBUTE class {Iris-setosa,Iris-versicolor,Iris-virginica}
@DATA
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
7.0,3.2,4.7,1.4,Iris-versicolor
6.4,3.2,4.5,1.5,Iris-versicolor
6.9,3.1,4.9,1.5,Iris-versicolor
6.3,3.3,6.0,2.5,Iris-virginica
5.8,2.7,5.1,1.9,Iris-virginica
7.1,3.0,5.9,2.1,Iris-virginica
- Iris-Setosa
- Iris-versicolor
- Iris-virginica
- sepallength
- sepalwidth
- petallength
- petalwidth
@RELATION irisSmall
@ATTRIBUTE sepallength REAL
@ATTRIBUTE sepalwidth REAL
@ATTRIBUTE petallength REAL
@ATTRIBUTE petalwidth REAL
@ATTRIBUTE class {Iris-setosa,Iris-versicolor,Iris-virginica}
@DATA
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
7.0,3.2,4.7,1.4,Iris-versicolor
6.4,3.2,4.5,1.5,Iris-versicolor
6.9,3.1,4.9,1.5,Iris-versicolor
6.3,3.3,6.0,2.5,Iris-virginica
5.8,2.7,5.1,1.9,Iris-virginica
7.1,3.0,5.9,2.1,Iris-virginica
Neural network topology
In order to solve this problem we decided to make a huge assumption. The data provided will only concern those three flowers, that means, no weeds, no other flowers other than iris-setosa, iris-versicolor and iris-virginica. The topology of the network makes use of the hardlim function to evaluate and with this we only require to feed the four attributes to the first input networks.
The second network that discriminates the third class only receives the outputs of the first two networks as input. Figure 1 shows the network topology.
The second network that discriminates the third class only receives the outputs of the first two networks as input. Figure 1 shows the network topology.
In this case we feed the real values to the input networks and readjust the weights and bias values until we find the numbers required for the network to classify between the iris-setosa vs the rest & iris-virginica vs the rest.
Then we feed those output values which are now binary numbers to the third neuron to identify if its iris-versicolor or the others.
Then we feed those output values which are now binary numbers to the third neuron to identify if its iris-versicolor or the others.