3
$\begingroup$

Problem:

Given a neural network for image classification, the objective is to develop an algorithm which decides which images are 'problematic' and the model is probably going to classify them incorrectly.

Discussion:

So far, I've thought of two possible approaches:

  • Feed the given image to the model and then analyse its softmax ouput with various metrics (difference between first and second class confidence, entropy, gini index etc).
  • Perform some kind of image processing (feature extraction) on the given image, to obtain some features that indicate whether the image is not going to be correctly classified.

Questions:

Can you provide me with more suggestions about the second approach? What type of feature extraction would you think will help distinguish those images?

Any other ideas that are not mentioned here are welcome.

$\endgroup$
5
  • $\begingroup$ uhh...by testing all of the classes (from a separate validation set) to the model and studying the confusion matrix? If you don't have a separately provided validation set, then splitting the train set works too? $\endgroup$
    – neel g
    May 18, 2021 at 22:48
  • $\begingroup$ @neelg to check if some classes are being consistently mistaken by the model? And what if the model performs exactly the same for each class? $\endgroup$
    – Paris
    May 19, 2021 at 7:23
  • $\begingroup$ That's exactly what a confusion matrix tells you. It would give you a breakdown of what classes the models confuse and what classes are the most toughest for it. $\endgroup$
    – neel g
    May 19, 2021 at 18:54
  • $\begingroup$ @neelg okay, I'll give it a shot, though I believe the 'balanced accuracy' metric (average accuracy among all classes) equals the standard accuracy for that model. $\endgroup$
    – Paris
    May 19, 2021 at 19:46
  • $\begingroup$ @neelg Your intuition was right to some extent. The confusion matrix showed that the model has a hard time classifying some cat/dog breeds which look very much alike and classes that overlap (e.g. bathtub vs tub, monitor vs desktop etc). For the first case the only idea I can come up is to build another neural network that recognizes cats/dogs to find those images that the model will probably predict incorrectly. Have you got any other ideas? $\endgroup$
    – Paris
    May 22, 2021 at 15:22

3 Answers 3

2
+100
$\begingroup$

You might want to frame your problem as an uncertainty estimation problem.

The idea is that you want to evaluate how comfortable your model will be when making a prediction. If your model is not very comfortable with a prediction (even if gets classified as predic_proba = 0.99), then the uncertainty prediction should be high.

What @BrianSpiering is proposing is a way to calculate uncertainty with neural networks. This method is known as Monte Carlo Drop Out as a Bayesian estimation.

The idea is to apply drop out regularization when doing predictions and doing several times. This way your model predicts a probability distribution in which you can calculate several statistics as standard deviation. This will let you know how comfortable is your model doing such prediction.

This is just a method but there are several ways to estimate uncertainty.

There are some blogs and papers that might help you:

$\endgroup$
1
$\begingroup$

One approach is Monte Carlo dropout during prediction. For the same sample, the model will make several predictions while randomly dropping connections each time. This procedure is give an estimate of how robust the model is in predicting that sample and which connections are most important for successful prediction. Those connections are the learned features of the image.

$\endgroup$
1
  • $\begingroup$ Could you elaborate on how this procedure gives an estimate about the model's robustness for a test image and how these connections (learned features) stand out? $\endgroup$
    – Paris
    May 18, 2021 at 18:14
1
$\begingroup$

You can give following a try :

  1. Extract features of your working images. - take out weights of last-1 layer
  2. Detect these features importance. You can use Eli5 for feature importance.
  3. Extract the features of image which you want to test
  4. Find the distance of features (cosine similarity) of important features stored in db vs the new image features.
  5. If the distance is too high, then probably the image would be classified as wrong.

To make a hypothesis, a POC is required.

$\endgroup$
2
  • $\begingroup$ I've tried using a feature extractor to get a tuple of 512 features for each image. Will cosine similarity work for such a (high dimensional) space? Because I've read somewhere that in high dimensional spaces all vector tend to be close to orthogonal. $\endgroup$
    – Paris
    May 21, 2021 at 19:01
  • $\begingroup$ Distance metric being used in Siamese networks can be utilized here. They follow similar approach. en.wikipedia.org/wiki/Siamese_neural_network $\endgroup$ May 23, 2021 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.