I have a CNN trained on classes = [dog, cat, frog] and in the testing-phase-only, I want to include several pictures of horses to see which known classes those images get classified as. Any idea how to implement this in a Keras model?
One thing I've tried, but I don't like is to distribute the horse pictures equally and randomly across the training images for the known classes (dog, cat, and frog) and then see what happens with the testing images. I'm worried the number of horse images (though relatively small) would negatively impact the model's knowledge of a Here is the corresponding code:
<x_train, x_test, y_train, and y_test has already been done prior to this step>
clsLst = [dog, cat, frog]
clsRemove = horse
seed(1)
newClsLst = [0,0,0]
for I in range(0,len(y_train)):
if y_train[i][clsRemove] = 1.0:
y_train[i][clsRemove] = 0.0
randIndex = random.randint(0,8)
newCls = clsLst[randIndex]
newClsLst[newCls] = newClsLst[newCls] + 1
y_train[i][newCls] = 1.0
This is only my second time using Keras and I don't have a programming background so all tips and overexplaining is appreciated.