Analyzing the Relations of Misclassified Inputs Between Models
Abstract
A common belief in the machine learning community is that many of the misclassified images are “difficult” images ( e.g. , the differentiation between classes is based on small details).
We compare the misclassified images of various deep learning models and check which model misclassifies which image.
We find that the misclassified images of each model are different.
Moreover, despite having similar accuracy on ImageNet, one model can classify correctly more than 15% of the misclassified images of another model.
This can encourage further research to use two or more architectures when performing a prediction, such as ensemble methods.
The code for our analysis can be found at https://github.com/hadarshavit/analysing-relations .
Introduction
Today, in the field of computer vision, neural networks are the most used method for most pattern recognition tasks, such as image classification or semantic segmentation.
The popular ImageNet benchmark is typically used to compare different models.
In the last decade, the best accuracy on this benchmark increased by around 20%, as AlexNet [9] reached an accuracy of 62.5% while the recent ConvNeXt reached 20%.
Many new architectures emerged with various key features, such as residual networks [5], patchify stem [17], and more.
It is known that every architecture produces a different features map [4], even two models from the same family (e.g., transformers) can have a substantially different features map.
In recent years, a few papers have been published trying to understand the differences between classified and misclassified images of deep learning models.
Specifically, Shankar et al.
[12] showed that there are difficult images in the ImageNet benchmark that both human and AI models cannot classify correctly, for example, due to classes with similar attributes like different dog breeds.
In addition, they showed that the computer models had more difficulties in classifying some objects correctly, while humans did not have this problem.
Wen et.
al [18] showed the inter and intra relations between images in a superclass of a few similar classes (such as types of dogs).
In addition, combinations between machine learning models have been studied for a long time in the form of ensemble methods [3, 2].
In this paper, we explore the relations between classified and misclassified images between models.
We do it because the different features map of each model can mean that each model can learn different features, which can allow it to classify different images correctly.
In addition, we do this to understand better the strengths and limitations of ensemble methods, as looking at the theoretical boundaries can give insights into what can work and what cannot.
We find that one model can classify between 15% to 25% of the misclassified images of another model.
In the next sections, we check how two (or more) models can benefit from combining them and check whether some models are stronger in certain classes.
Relation Between Misclassified Images
First, we check how many images that one model classifies incorrectly, another model classifies correctly.
Therefore, we define the Potential Correction Rate of model B over model
A as the ratio of misclassified images of A that B classifies correctly:
[Equation]
Where we denote F A as the set of images that are classified correctly by the first model. T B denotes the images that are classified correctly by the second model.
In addition, we look into the maximum achievable accuracy of combining two models (e.g., the accuracy that can be achieved if for every image, we use the model that classifies it correctly, if such model exists).
We define the Virtual Accuracy of models A and B as the percent of the validation set that either model A or B can classify correctly:
[Equation]
Where we denote T A as the set of images that are classified correctly by the first model, T B denotes the images that are classified correctly by the second model, and V denotes the full validation set.
This definition is similar to the virtual best solver definition from the automated algorithm selection area [8].
We use the timm library [19] for trained weights of various models, as well as the inference script in order to check which images each model classifies correctly from the ImageNet validation dataset.
In our experiment, we use the following models: ConvNeXt-T [11], EfficientNet-B4 [15], ResNet- [5, 20], Swin-T [10], Vit-S [1, 14], DeiT-S [16], DenseNet-121 [7], VGG11 [13].
We choose those models as they are from various families (transformer-based, CNNs) and years.
In Figure 1 we show the potential correction rates of those models.
[Figure]
C o n v N e X t
E ff N e t
R e s N e t
S w i n
V i T
D e i T
D e n s e N e t
V GG
F i r s t M o d e l ( B a s e M o d e l ) 0.
We can see that for all model pairs, the second model can correctly classify a substantial amount of the images misclassified by the first model, even when the base accuracy of the second model is lower.
For example, VGG can classify 15% of the misclassified images of ViT, even though VGG has lower accuracy by 10%.
This is especially important as some ensemble methods, such as weighting use the accuracy of the model for the performing the ensemble [3]. Indeed, models with a higher base accuracy have a generally higher potential correction rate (e.g., they can classify more of the misclassified images of [-82 − 69 100 − 69 = 
-]other models).
However, this is not always the case.
For example, ResNet has lower accuracy than Swin Transformer, but it has a higher correction rates than Swin for many models.
[Figure]
[Figure]
C o n v N e X t
E ff N e t
R e s N e t
S w i n
V i T
D e i T
D e n s e N e t
V GG
F i r s t M o d e l ( B a s e M o d e l ) [Figure] [Figure] [Figure]
[Figure] [Figure] [Figure] [Figure]
[Figure]
[Figure]
[Figure]
[Figure]
[Figure]
The accuracies of single models are the diagonal of the matrix.
All combinations reach higher virtual accuracy.
In addition, we show the virtual accuracy of model pairs.
This number shows how many percents of the validation set one of the models can classify correctly.
The values are presented in Figure 2.
The diagonal of the matrix is the accuracy of every single model.
We can see that those are the lowest values in the matrix.
We can see that combining two models reaches substantially higher (virtual) accuracy by 3-5% of the better model.
Combining three models gives even better virtual accuracy.
For example, by combining ViT, ConvNeXt, and EfficientNet, we get a virtual accuracy of 88.8%.
For detailed accuracies, see appendix A.
Analysis of Images
In this section, we investigate for which classes each model is better than the other models.
In Figure 3 we can see the total number of examples each model corrected per class for all models.
Higher bars mean that the model is stronger in this class relative to other models, as it can classify correctly many instances that other models cannot classify correctly.
In Figure 4, we can see the total number of examples each model got corrected by other models, per class.
A higher bar in this figure means that the model is weaker in this class relative to other models. We can see that each model has different classes that it can correct, as the patterns in each graph are different from each other.
For example, we can see in Figure 3 that ConvNeXt has a denser pattern than ViT for classes 0-500.
This can show that each feature map is different, and some feature maps make predictions of specific classes easier than others.
[Figure]
[Figure] In Table 1 we can see the top 5 classes that each model corrected.
Those are the classes that the model is stronger in classifying them related to others.
Interestingly, we can see that some classes are repeated a few times, like ’missle’.
We check the predictions for this class and find that all models classify correctly less than 50% of the images in this class
[Figure]
[Table]
Conclusions and Future Work
Although the different deep learning models for image classification have similar accuracy on the ImageNet benchmark, each model has its own distinctive set of correctly labeled images.
While some misclassified images are mutual to many models, there is a substantial amount of images that one model can classify correctly while other model(s) cannot.
This can show that there is a group of images that are the “most difficult” to classify, as two or more models fail to classify them correctly.
However, a considerable amount of the misclassified images of a model can be classified correctly by other models.
Especially, we can see that by using two models the virtual accuracy increases by a few percent and by using three models, the accuracy further increases.
This shows us that the belief that all the misclassified images are difficult to classify is not entirely correct.
We can also see that combining models can result in higher virtual accuracy.
Using per-instance algorithm selection [8] techniques can be a further research direction.
It is possible to use this existing work from machine learning with reject option literature [6], as they try to predict when a model cannot classify an input correctly.
Another possible research is to use two or more feature maps to perform predictions, as used in ensemble learning [3].
A Virtual Accuracies of 3 models combinations
In Table
[Table] we present the virtual accuracies of combinations of 3 models [Table] [Table]
[Table]
[Table]
[Table]
convnext swin
[Table]
[Table]
[Table]
[Table]
[Table]
swin
[Table]