I'm trying to make a "car sound detector" I have the data from https://urbansounddataset.weebly.com/urbansound.html site. Which has 1000 labeled sounds for 10 different classes(Car sound, dog bark, drill..etc). So using a binary classifier I want to detect if a given sound sample is a car -> label 1 or any other sound from that data set -> label 0.

So data is highly unbalanced. 1000 1-labeled car sounds against 9000 0-labeled other sounds.

To make a more balanced set, for example in both test and training sets I can create %50 / %50 split using oversampling(not sure its a good idea). But in a real life scenario (a microphone listening environment sounds) the ratio of a car sounds is not gonna be %50. Maybe for every 100 sounds the mic picked only one percent will be a car sound.

So what would be a better/realistic to way to prepare and split the data for test and training set?


I think you might have confused the concept of training set, validation set, and actual input. The training set helps you build a model; the validation test let you validate that performance of your model. (sometimes people also use real life testing test to ensure the model is not overfitting) Once you have a model created, your model will be like a black box that takes your input (i.e., could be a single sample) and give you a classification result. So it really doesn't matter if your only 1% of your input data is a car sound; if the model is built properly it will be able to give you a good prediction.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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