I have a CNN built with Keras, based on a multilayer perceptron. The last layer is softmax.
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d_1 (Conv2D) (None, 248, 248, 32) 896
_________________________________________________________________
activation_1 (Activation) (None, 248, 248, 32) 0
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 124, 124, 32) 0
_________________________________________________________________
conv2d_2 (Conv2D) (None, 122, 122, 32) 9248
_________________________________________________________________
activation_2 (Activation) (None, 122, 122, 32) 0
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 61, 61, 32) 0
_________________________________________________________________
conv2d_3 (Conv2D) (None, 59, 59, 64) 18496
_________________________________________________________________
activation_3 (Activation) (None, 59, 59, 64) 0
_________________________________________________________________
max_pooling2d_3 (MaxPooling2 (None, 29, 29, 64) 0
_________________________________________________________________
flatten_1 (Flatten) (None, 53824) 0
_________________________________________________________________
dense_1 (Dense) (None, 64) 3444800
_________________________________________________________________
activation_4 (Activation) (None, 64) 0
_________________________________________________________________
dropout_1 (Dropout) (None, 64) 0
_________________________________________________________________
dense_2 (Dense) (None, 9) 585
_________________________________________________________________
activation_5 (Activation) (None, 9) 0
=================================================================
Total params: 3,474,025
Trainable params: 3,474,025
Non-trainable params: 0
_________________________________________________________________
Now, during classification, there are some cases in which I know in advance my input is not class A, or B, or C (because of some specific business logic).
Example : I have an image X that I want to classify. My CNN can classify between 10 different classes. I know, without doing anything, that my input is not class A or class B.
Is there any way I could theoretically take advantage of this knowledge to help the classification process ?
Since the last layer is in softmax, I was thinking of setting the values of the output neurons I know are not the right answer to 0 and redistribute this value among potentially right neurons.
I hope my question was clear enough.