TransWikia.com

Improving misclassification for one class in a multi-class classification task

Data Science Asked on May 27, 2021

Here I am trying to use 3 convolution layer neural network to classify a set of images (train data: (3249) , validation data: (487), test data: (326))

I have one class which is misclassified and I cannot understand what to do next. I have tried to reduce the value of dropout layer, but results got worst.

I know that the next solutions could be useful if I had bad classification for all classes :

  • Get more data

  • Try New model architecture, try something better.

  • Decrease number of features (you may need to do this manually)

  • Introduce regularization such as the L2 regularization

  • Make your network shallower (less layers)

  • Use less number of hidden units

What do you thing could be a good choice if I have only misclassifcation of one class?
Number of total samples per class :

Black rot: 1180

Esca: 1383

healthy: 423

leaf blight: 1076

enter image description here

I had split the two datasets as follow:

x_train, _x, y_train, _y = train_test_split(x,y,test_size=0.2, stratify = y, random_state = 1)
x_valid,x_test, y_valid, y_test = train_test_split(_x,_y,test_size=0.4, stratify = _y, random_state = 1)

One Answer

The main problem is that there are too many Escas in your dataset. If you look at the confusion matrix, the Esca column gets predicted (wrongly and correctly) much more that the others. This is clearly a symptom of a skewed data set.

Try augmenting your images to generate a larger 'super-dataset'. Then sample a 'sub-dataset' from that 'super-dataset', such that it has an equal distribution across all classes. Train on the 'sub-dataset'.

If you can't augment your data to have a better distribution across the 4 classes, here are some ideas:

  1. Modify the loss function to more aggressively penalize Black Rots classified as Escas.
  2. Split into two networks; the first differentiates between Leaf Blight-Healthy-Black Rot/Esca, and the second differentiates between Black Rot-Esca.

Correct answer by shinvu on May 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP