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

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

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)

• It would be good to get an idea of class distribution across the whole dataset, model architecture (and see a model variance / bias analysis [scikit-learn.org/stable/modules/generated/…) before making such a recommendation. If you could edit your post to at least include this information, that would be great. Aug 11 '20 at 10:53
• Your dataset is quite small. Did you use stratified splits to get your train/val/test sets? Do you have enough samples in the class which was misslcassified? Aug 11 '20 at 11:48
• yes I used 0.2 to test and 0.4 from testing dataset to train Aug 11 '20 at 12:23
• I could not acces the link mentioned below Aug 11 '20 at 12:29
• I noticed somthing that when I compile the model two times successively I got better results: it is normal? 0.959 (training), 0.952 (validation) and 0.969 (testing) Aug 11 '20 at 13:36

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.
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.
• Well, you have to essentially create a custom loss function. But you can probably base it off of categorical_crossentropy Aug 11 '20 at 15:15