<p>One way to do this can be found in this paper - <a href="https://arxiv.org/pdf/1511.06233.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1511.06233.pdf</a></p>

<p>The paper also compares the result generated by simply putting the threshold on the final scores and the (OpenMax) technique proposed by the author.</p>
Machine learning classifying algorithm with "unknown" class
<p>I understand that if I train a ML classifying algorithm on sample pictures of apples, pears and bananas, it will be able to classify new pictures in one of those three categories. But if I provide a picure of a car, it will also classify it in one of those three classes because it has nowhere else to go.</p>

<p>But is there a ML classifying algorithm that would be able to tell if a item/picture is not really beloning to any of the classes it was trained for? I know I could create a "unknown" class and train it on all sorts of pictures that are neither apples, pears or bananas, but the training set would need to be huge I assume. That does not sound very practical.</p>