TransWikia.com

Baby cry detection model using binary classification through logistic regression

Data Science Asked by Muhammad Waqar Anwar on March 30, 2021

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.

One Answer

As your context, You convert your audio clips to spectrogram images. The spectrogram is a visual representation of the spectrum of frequencies of sound.
Now you need to Extract Features from your dataset. There are many feature extraction technique for audio data (See this blog for knowledge).
The state of the art features extraction is now using: MFCC — Mel-Frequency Cepstral Coefficients.
By using librosa library we can easily implement the MFCC.
Here are some resources for MFCC :

After you extract features (Converted into MFCC), Then you need fit them into the Logistic Regression Model as you wanted. I share some resources which experiment with MFCC Features and Logistic Regression:

And for learn logistic regression, you may follow Machine Learning By Stanford, Coursera or follow this from youtube.

Answered by AIFahim on March 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP