1
$\begingroup$

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?

$\endgroup$
3
  • $\begingroup$ Btw, for Urbansound8k it is important to respect the existing foods. As otherwise you will get data leakage and overconfident results. Many clips come from the same recording and mixing that across folds violates independence requirement $\endgroup$
    – Jon Nordby
    Oct 4, 2020 at 13:42
  • $\begingroup$ For a proper evaluation on your task, you should collect data that is more representative than Urbansound8k is likely to be. $\endgroup$
    – Jon Nordby
    Oct 4, 2020 at 13:43
  • $\begingroup$ Your time test set should reflect the natural distribution of classes. Only the training set should be modified with over/undersampling. $\endgroup$
    – Jon Nordby
    Oct 4, 2020 at 13:44

1 Answer 1

1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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