Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Audio classification with Keras: presence of human voice

I'd like to create an audio classification system with Keras that simply determines whether a given sample contains human voice or not. Nothing else. This would be my first machine learning attempt.

This audio preprocessor exists. It claims not to be done, but it's been forked a few times:

https://github.com/drscotthawley/audio-classifier-keras-cnn

I don't understand how this one would work, but I'm ready to give it a try:

https://github.com/keunwoochoi/kapre

But let's say I got one of those to work, would the rest of the process be similar to image classification? Basically, I've never fully understood when to use Softmax and when to use ReLu. Would this be similar with sound as it would with images once I've got the data mapped as a tensor?

like image 526
eje211 Avatar asked Sep 21 '17 22:09

eje211


1 Answers

Sounds can be seen as a 1D image and be worked with with 1D convolutions. Often, dilated convolutions may do a good work, see Wave Nets

Sounds can also be seen as sequences and be worked with RNN layers (but maybe they're too bulky in amount of data for that)

For your case, you need only one output with a 'sigmoid' activation at the end and a 'binary_crossentropy' loss.

  • Result = 0 -> no voice
  • Result = 1 -> there's voice

When to use 'softmax'?

The softmax function is good for multiclass problems (not your case) where you want only one class as a result. All the results of a softmax function will sum 1. It's intended to be like a probability of each class.

It's mainly used at the final layer, because you only get classes as the final result.

It's good for cases when only one class is correct. And in this case, it goes well with the loss categorical_crossentropy.

Relu and other activations in the middle of the model

These are not very ruled. There are lots of possibilities. I often see relu in image convolutional models.

Important things to know are they "ranges". What are the limits of their outputs?

  • Sigmoid: from 0 to 1 -- at the end of the model this will be the best option for your presence/abscence classification. Also good for models that want many possible classes together.
  • Tanh: from -1 to 1
  • Relu: from 0 to limitless (it simply cuts negative values)
  • Softmax: from 0 to 1, but making sure the sum of all values is 1. Good at the end of models that want only 1 class among many classes.
like image 77
Daniel Möller Avatar answered Oct 23 '22 03:10

Daniel Möller