Starr
Starr

Reputation: 13

CNN audio classifier trained with 3 classes and the sum of the prediction should be less than one

I built a CNN audio classifier with 3 classes. My problem is that their are more than 3 classes, e.g. a fourth could be "noise". So when I call be prediction the sum of these 3 classes is always 1.

prediction = model.predict([X])

Is it somehow possible to extract the accuracy of each class so the sum of these accuracies is less then 1?

Upvotes: 1

Views: 49

Answers (1)

Andrew Holmgren
Andrew Holmgren

Reputation: 1275

If you use a softmax activation function you are forcing the outputs to sum to 1, thereby making a relative confidence score between your classes. Perhaps, without knowing more about your data and application, a "1 vs all" type scheme would work better for your purposes. For example, each class could have a sigmoid activation function and you could pick the highest prediction but if that prediction doesn't score high enough on a sensitivity threshold then none of the classes are predicted and as such is empty or implicitly "noise."

Upvotes: 1

Related Questions