"other" class in Image classification In the MNIST dataset, you have 10 defined classes, one for each digit. But you don't have a "not a digit" class. It seems that most image classification datasets are the same. But in a business setting, for a production model, you could certainly get invalid images that don't correspond to any of the defined classes.

So let's say you were to create a handwritten digit image classifying model to be used in a real-world project. If you don't have a "not a digit" class, then if somebody submits a picture of the letter "M", then it will incorrectly be classified as one of the 10 digit classes.

So, in this example, should you define a "not a digit" class and train the model on a set of images that the model may be expected to receive that have nothing to do with handwritten digits such that invalid images are correctly classified as "not a digit"?
You can have that but I recommend something else for your case. Suppose that you have 10 classes of digits that they are mutually exclusive. Consequently, your output vector will always be on-hot encoded. In a simple case, your output vector should contain ten entries for each class. To make your model distinguish between those inputs which are digits and those which are not, do the following:

Increase the size of output to eleven. Provide data-set that contains eleven-entries labels. the first entry corresponds to the existence of a digit. If it is a digit the first entry should be one and next 10 entries should be activated for the according to the value of the digit. So, your labels will not be one-hot encoded. If the input is not a digit the first entry of the output should be zero and other entries are don't cares.