How to determine unknown class in CNN

2 次查看(过去 30 天)
I'm training a CNN characterised by 3 classes.
As expected, when I introduce a new image (unknown-not belonging to any of the 3 classes),the model predicts it as any of the 3 classes, with a score that is around 0.98, so quite high. Since it is not possible to apply any type of threshold, is there a way to recognise the unknown class by means of the CNN?
I've read something related to open set NN, but I don't know if it is possible to apply it on Matlab and how.

回答(1 个)

Vidip
Vidip 2023-11-2
I understand you want to handle unknown classes in a Convolutional Neural Network (CNN). When you introduce a new image (unknown-not belonging to any of the 3 classes), the model predicts it as any of the 3 classes, with a score that is around 0.98. This might be because of overfitting as it can lead to high confidence predictions even when they are incorrect, especially for classes that the model was not exposed to during training. To mitigate the impact of overfitting and make more reliable predictions, you can consider the following steps:
  1. Regularization: Apply regularization techniques, such as dropout or L2 regularization, during training. Regularization helps prevent overfitting and encourages the model to learn more general features.
  2. Data Augmentation: Increase the diversity of your training dataset by applying data augmentation techniques, such as random rotations, translations, or scaling. This can help the model generalize better to unseen examples.
After addressing overfitting and training a more robust model, you can set a threshold for your confidence score, if the highest predicted class probability is less than the threshold, classify the sample as the "unknown" class.
For further information, refer to the documentation links below:

类别

Help CenterFile Exchange 中查找有关 Recognition, Object Detection, and Semantic Segmentation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by