my data is of multi-class, multi-label type, and I plan to have 100 output classes in total.

My input X to the model is audio data, my y is a one-hot encoded numpy array with 100 columns showing a 1 to indicate the respective class (e.g. y = [0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 ...]

model = Sequential()
model.add(...) # more layers ... CNN ...
model.add(...) # more layers ... LSTM ...
model.add(Dense(512, input_dim=n_inputs, kernel_initializer='he_uniform', activation='relu'))
model.add(Dense(100, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam')

At the moment, I only have audio files belonging to only 12 (of the planned 100) classes. Which means that 88 columns of y are not assigned any 1 currently.

Then after training with the current 12-classes data (NSize ~ 16000), I run model.predict(...) and get probabilities for almost all of the 100 columns, some of them quite high percentages.

Is this possible that a model outputs quite high prediction probabilities for classes which it never received as input? Any suggestions to fix that? (I can almost 100% exclude an error on the one-hot encoding of y)

Kind regards, ziggyler


1 Answer 1


Deep Learning models try to learn different unique properties of a class from training samples. With enough training samples the model learns which feature corresponds to which class. So without any training samples, there is no chance that a model will learn to classify to that class. But you can use pretrained models that requires little to no training samples as they are trained on huge dataset.

  • $\begingroup$ Thanks for your answer! So it seems that I have a general underlying problem for my model if I'm getting high probabilities (0.7 and above) for classes which are not even present in the training data .... :( $\endgroup$
    – ziggyler
    Aug 1, 2021 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.