# Baby cry detection model using binary classification through logistic regression

I need some help regarding my final year project. I am fairly new to machine learning and I have tried a lot to understand how to train a model using logistic regression.

I have two datasets of audio clips of 5 seconds each, one of the babies crying voices and one of baby 'not crying'.

I want to train the model using logistic regression on google colab. Now I have been successful converting the audio clips to spectrogram images. But I am stuck in training the model because I am unable to understand how to train the model (the code is very complex where ever I have seen it up till now).

What I want is to train the model using logistic regression, and get 100 weights at the output. Then what will happen is that I will record baby crying audio using Arduino. Then I will get 100 data points from newly recorded audio.

Then the previous and new 100 weights will be multiplied one to one. and then added. and then a sigmoid function will be run on it(all of this calculation after getting 100 weights, will not happen in google colab but in Arduino).

And then if the output value is greater than 0.5, it means that baby is crying (which means that the newly recorded audio is of the baby crying) and if the value is less than 0.5, it means the baby is not crying. Now the 100 data points from the Arduino recording, have a range of 0 to 1. It will be good if the 100 weights of the trained model also lie between 0 to 1.

Any help regarding the code or links to a good tutorial video on logistic regression will be much appreciated.

• Is your dataset files .wav format? Feb 28 at 14:40
• @Fahim No, the file is mp3 format. Feb 28 at 14:58
• I added the logistic regression tutorial in the answer from where I learned. You may mark the Answer as accepted then. Mar 2 at 16:16

By using librosa library we can easily implement the MFCC.