フィルターのクリア

How to determine unknown class in CNN

4 ビュー (過去 30 日間)
Gaia Cioffi
Gaia Cioffi 2022 年 5 月 12 日
回答済み: Vidip 2023 年 11 月 2 日
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 Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by