Understanding a multiclass classifier using a confusion matrix

I have a multi-label classification problem with 12 classes. I use slimof Tensorflowto train models using pre-calculated models ImageNet. Here are the percentages of each class in training and validation

            Training     Validation
  class0      44.4          25
  class1      55.6          50
  class2      50            25
  class3      55.6          50
  class4      44.4          50
  class5      50            75
  class6      50            75
  class7      55.6          50
  class8      88.9          50
  class9     88.9           50
  class10     50            25
  class11     72.2          25

The problem is that the model did not converge and under the curve ROC( Az) in the test set was bad, something like:

               Az 
  class0      0.99
  class1      0.44
  class2      0.96  
  class3      0.9
  class4      0.99
  class5      0.01
  class6      0.52
  class7      0.65
  class8      0.97
  class9     0.82
  class10     0.09
  class11     0.5
  Average     0.65

, , . , , . , . , , . , sigmoid, , ( sigmoid tensorflow) , , . , . , , , . .

enter image description here

:

  • 0 4 , , . , .
  • 2, 6 7 . , .
  • 3, 8 9 . , . 11.
  • 5 , , . .
  • 3 10: , 2 .

- . , , , , . , , ? , , ? / ? .

.

EDIT:

, (, 0,1) ( 0, 1) p(0,1): 1 , 0, 1 , , . p(1, 0), , 0, , 1 , 0 . p(0, 0) , 0. p(0,4) , N/A , , 0, 4 .

2 :

  • 169320
  • 37440

, ( , , ), - , : enter image description here

: , . , :

class 0 shape is completely different than the other objects.
class 1 resembles strongly to class 4.
class 2 shape resembles to class 1 & 4 but it always accompanied by an object different than the others objects in the scene. As a whole, it is different than the other objects.
class 3 shape is completely different than the other objects.
class 4 resembles strongly to class 1
class 5 have common shape with classes 6 & 7 (we can say that they are all from the same category of objects)
class 6 resembles strongly to class 7
class 7 resembles strongly to class 6
class 8 shape is completely different than the other objects.
class 9 resembles strongly to class 10
class 10 resembles strongly to class 9
class 11 shape is completely different than the other objects.

: , :

Avg. num labels per image =  6.892700212615167
On average, images with label  0  also have  6.365296803652968  other labels.
On average, images with label  1  also have  6.601033718926901  other labels.
On average, images with label  2  also have  6.758548914659531  other labels.
On average, images with label  3  also have  6.131520940484937  other labels.
On average, images with label  4  also have  6.219187208527648  other labels.
On average, images with label  5  also have  6.536933407946279  other labels.
On average, images with label  6  also have  6.533908387864367  other labels.
On average, images with label  7  also have  6.485973817793214  other labels.
On average, images with label  8  also have  6.1241642788920725  other labels.
On average, images with label  9  also have  5.94092288040875  other labels.
On average, images with label  10  also have  6.983303518187239  other labels.
On average, images with label  11  also have  6.1974066621953945  other labels.

:

Avg. num labels per image =  6.001282051282051
On average, images with label  0  also have  6.0  other labels.
On average, images with label  1  also have  3.987080103359173  other labels.
On average, images with label  2  also have  6.0  other labels.
On average, images with label  3  also have  5.507731958762887  other labels.
On average, images with label  4  also have  5.506459948320414  other labels.
On average, images with label  5  also have  5.00169779286927  other labels.
On average, images with label  6  also have  5.6729452054794525  other labels.
On average, images with label  7  also have  6.0  other labels.
On average, images with label  8  also have  6.0  other labels.
On average, images with label  9  also have  5.506459948320414  other labels.
On average, images with label  10  also have  3.0  other labels.
On average, images with label  11  also have  4.666095890410959  other labels.

: , , 10 ( , , 0), . , , , . : ( 10, 9) (, , 1 2% 2). , , , , , .

+4
1

, , , , , . , , , ( L , L), ( , 0.9, , 0.99, ). , , , , .

., : https://arxiv.org/abs/1706.04599


1 1

0: AUC ( ) = 0.99. . 0 , .

1: AUC = 0,44. , 0,5, , , - , .

1 , . , , "" , (55,6%). 50% , , , . 1 - , , , , .

2: AUC = 0,96. .

, , . , . , > 0 0s . , . , , . , .

AUC ; , , . 0,5, , , . ROC , .

3: AUC = 0,9, .

, , AUC , , . , 2 ( , , , , ).

, "" ( 3) "" ( 3), 3, , , .

4: , 0.

5: AUC = 0.01, . . , . , ? , (0 False Positives , , , ).

, 5 . , , .

6: AUC = 0,52, , .

6 , 2. AUC, , , . 5, . , , .

7: AUC = 0,65, . , , 2, , , .

8: AUC = 0.97, , 3.

9: AUC = 0,82, , . , , AUC . , , . , ? .

10: AUC = 0,09, . A 0 ( ?). , 3 9 10 ( primary_incision_knives secondary_incision_knives?). , .

11: AUC = 0,5, , . ( ), , , , .


/?

, , ( ). (i, j) , j. , , . , , , , .

, ( ), , - . , , 10 . 10, , , 10 . , , - :

# Do all of the following once for training data, AND once for validation data    
tot_num_labels = 0
for image in images:
    tot_num_labels += len(image.get_all_labels())
avg_labels_per_image = tot_num_labels / float(num_images)
print("Avg. num labels per image = ", avg_labels_per_image)

for label in range(num_labels):
    tot_shared_labels = 0
    for image in images_with_label(label):
        tot_shared_labels += (len(image.get_all_labels()) - 1)
    avg_shared_labels = tot_shared_labels / float(len(images_with_label(label)))
    print("On average, images with label ", label, " also have ", avg_shared_labels, " other labels.")

, , , , .

, , , . , , .


?

, . , .

, , (, ) . , . , , , . , , .

+2

Source: https://habr.com/ru/post/1693847/


All Articles