I have chosen to build a Music Genre Classifier for a Deep Learning Project and its very nice to get strated watching your playlist. I watched now several videos from this playlist and it's super helpful and straight forward. Thanks!
Hi Valerio, great series, one question, how did you choose the *learning_rate* value (0,0001)? is this an empirical standard or is it related to the size of the dataset or..? Thank you or your time
hello Valerio, thanks so much for the great and easy way to an explanation. I am trying to implement dropout and regularization methods for my project, however, results don't change at all, still cannot understand what is the problem and why it does not work for my project. The model is quite similar to your model which is what you explained...
Just a note: when encountering a loss function like in 15:10, early stopping would not help. If you'd apply it the shown way, you'd basically just saying "This Ain't It, Chief" to the network only after it started. Early stopping can be applied if the generalization error of the network increases again after the network already learnt some things (and then gets worse again). I would argue that your acc/loss curves indicate that the used network is not really able to learn anything and therefore you should go for other regularization methods, that actually allow the network to learn from the given data.
That's a good point - thank you for the feedback. The error plot I showed isn't the best example for showing when to use early stopping. I hope the message was conveyed nonetheless :)
Great explanation, thank you so much! I'd like to ask you, does the L1 and L2 regularization consider only the weights of the neurons or also the biases ,if any, as penalty? (I'm referring to the term |Wi|)
Hi, Thanks. I have a question . I saw your explain for the Dropout for Dense layer (fully connected) As for Convolutional neural networks, Should we add Dropout for the Convolutional layers as well ? or just for the Dense layers ? Eran
One doubt I had is in data augmentation you said more data the better. Well I'm doing this as my graduation project. I used a 22gb dataset but I got an accuracy of 40% . So I'm going to use your dataset and do the project. Thank you for the videos. I plan on deploying the model , where do I refer to learn that?
Yep, the general rule is the more data the better. However, the quality of the data is also important. By that, I mean that the tracks in the same genre category should be quite similar, and, at the same time, different categories should sound substantially different. If that's not the case, the algorithm will have a difficult time learning patterns in the data. Also, in this video, we're using a simple multi-layer perceptron, which isn't particularly effective for this task. In the next couple of videos, we'll learn about convolutional neural nets, which tend to perform better on genre classification. By using a CNN, you should be able to improve the accuracy on your dataset. Finally, it's worth mentioning that music genre classification isn't a well-defined problem. Even human evaluators sometimes disagree when bucketing songs into different genres. All this to say that music genre classification has a ceiling, and you can't expect 95% accuracy ;) As for your question, you can deploy a TensorFlow model as a Flask API. The process is a bit tricky. In a month or two, I intend to release a mini-series on how to do deploy an audio-based AI model with Docker, Flask and AWS. If you can't wait until then, I'm afraid you'll have to do a bit of search on the Internet. Unfortunately, I'm not aware of any solid reference on the subject. I hope this helps :)
Hi Valerio, thank you so much for your detailed tutorials. I have greatly benefitted. My query is , isn't the validation accuracy too low compared to test accuracy? In image classification the validation accuracy is mostly over 90%. Is the validation accuracy in sound analysis considered 'good' if I get 60% v?
That really depends on the problem. All things considered, where you're dealing with subjective tasks (e.g., recognizing genres) the validation accuracy will generally be lower.
22:00 I thought he would say another thing than "use L2 if is complex" xD that was so obvious to see come as he said before use L1 for simple data and L2 and complex data xD
sir i really like your tutorial ,It help me a lot but i have an issue,Sir i have doubt regarding the accuracy . Sir as according to your graph we have solved overfitting problem but if you will look for accuracy for training set ,now it has been decreased to 70 % even if here you are using 100 epochs but in previous one with 50 epochs we got accuracy for training to 97 % .So to overcome with overfitting we have decreased our accuracy so . Will it not affect our model? Any other solution regarding this?
@@ValerioVelardoTheSoundofAI but sir my doubt is that in second case even we have 100 epochs but still we are getting 70% accuracy for our training set according to your code but in previous code we got 97% with 50 epochs ?
@@coding_kit in the initial run, the model was clearly overfitting the data. That's an issue we must avoid for the sake of generalising our system to unseen data.
Полезное видео, только один момент не понравился - после дропаута и регуляризации нельзя сказать, что модель стала классифицировать лучше, по сравнению с прошлым результатом. Для тестового набора показатели примерно те же самые. Она просто на тренировочном наборе стала хуже результаты выдавать. и соответственно разница в результатах на тестовом и тренировочном наборе стала гораздо меньше
Great tutorial! I just have one quick question, is there a way to make my model converge? Seems like every time I run it, it shows a different value. Thank you!
Showing different value is normal, because the training process is non-deterministic. If you want to use the model, then you don't have to train it each time, but train it once, and the retrieve use it to predict.
Thank you so much for this amazing series!! Although I'm having trouble with this one thing that my model is showing a sudden drop in accuracy at 74th epoch resulting in overall poor accuracy. Any suggestions what should I do to fix this problem ?
Not sure what's happening there. Have you tried re-running the training? Also, does the drop in accuracy concern the training set or the validation set?
@@ValerioVelardoTheSoundofAI Yes, I have tried running it multiple times, but it has always shown a drop around the 70th epoch. I've also tried increasing the #epochs to 150 but despite that it reaches to 60-62% max at 120th epoch and becomes almost constant after that.
Can you help me regarding model.predict() for this model? I am getting this when I try to predict using a test wav file for the model.h5 file. AttributeError: 'str' object has no attribute 'shape'. Can you help please , Thank You.
It's difficult to say what the issue may be. From what I gather, you're passing a string instead of an array somewhere. Strings don't have 'shape' - arrays do. Have you checked that you're passing a Numpy array/list of arrays, or TensorFlow tensor/list of tensors as an argument to model.predict()?
@@ValerioVelardoTheSoundofAI but for this model the input will be the .wav file right or we will first have to convert it to json before passing the predict method? I gave .wav file as input for the predict method.
@@painfgaming8229 nope - you should pre-process the wav file, extracting the MFCCs as I've done in a previous video. When you use a model for inference (i.e., prediction), you should pass data of the same type as taht you've used for training. The intermediate passage of storing the MFCC as a Json file isn't really needed. The step by step process is: 1- load the wav file with Librosa, 2- use Librosa to extract the MFCCs with the same parameters used for training, 3- feed the extracted MFCCs to model.predict(). I hope this helps!
Finally!!! The Kind of explanation i was expecting for past couple of years from experts.
ThankYou Valerio for this Deep Learning series.
Awesome Series, The best course on neural networks, I learned here more than university. Efficient, practical, excellent...
Thanks!
I have chosen to build a Music Genre Classifier for a Deep Learning Project and its very nice to get strated watching your playlist. I watched now several videos from this playlist and it's super helpful and straight forward. Thanks!
a video on audio data augmentation would be great!!!
One of the best videos, I have ever seen on solving overfitiing issues with neural networks... Learning a lot from you...
Overfitting knowledgments in my genre classifier/AI Music!
Thanks a lot. Your explanation of everything is totally outstanding.
Thank you :)
Super great content! I love your chill approach to solve these problems and to teach!
Thank you :)
Hi Valerio, great series, one question, how did you choose the *learning_rate* value (0,0001)? is this an empirical standard or is it related to the size of the dataset or..? Thank you or your time
hello Valerio, thanks so much for the great and easy way to an explanation. I am trying to implement dropout and regularization methods for my project, however, results don't change at all, still cannot understand what is the problem and why it does not work for my project. The model is quite similar to your model which is what you explained...
Just a note: when encountering a loss function like in 15:10, early stopping would not help. If you'd apply it the shown way, you'd basically just saying "This Ain't It, Chief" to the network only after it started. Early stopping can be applied if the generalization error of the network increases again after the network already learnt some things (and then gets worse again). I would argue that your acc/loss curves indicate that the used network is not really able to learn anything and therefore you should go for other regularization methods, that actually allow the network to learn from the given data.
That's a good point - thank you for the feedback. The error plot I showed isn't the best example for showing when to use early stopping. I hope the message was conveyed nonetheless :)
You are doing a great job!
Thank you!
thank you so much it has been a helpful series for me keep uploading thank you :)
Really happy you're liking the series!
Too good mate
A video on Time series augmentation would be awesome
That will probably be a whole series! Stay tuned :)
@@ValerioVelardoTheSoundofAI yaaaahoooooo looking forward :-D
Great explanation, thank you so much! I'd like to ask you, does the L1 and L2 regularization consider only the weights of the neurons or also the biases ,if any, as penalty? (I'm referring to the term |Wi|)
Hi,
Thanks. I have a question .
I saw your explain for the Dropout for Dense layer (fully connected)
As for Convolutional neural networks, Should we add Dropout for the Convolutional layers as well ? or just for the Dense layers ?
Eran
I actually like your videos :D
Excellent course
15/11/2020
One doubt I had is in data augmentation you said more data the better. Well I'm doing this as my graduation project. I used a 22gb dataset but I got an accuracy of 40% . So I'm going to use your dataset and do the project. Thank you for the videos.
I plan on deploying the model , where do I refer to learn that?
Yep, the general rule is the more data the better. However, the quality of the data is also important. By that, I mean that the tracks in the same genre category should be quite similar, and, at the same time, different categories should sound substantially different. If that's not the case, the algorithm will have a difficult time learning patterns in the data. Also, in this video, we're using a simple multi-layer perceptron, which isn't particularly effective for this task. In the next couple of videos, we'll learn about convolutional neural nets, which tend to perform better on genre classification. By using a CNN, you should be able to improve the accuracy on your dataset. Finally, it's worth mentioning that music genre classification isn't a well-defined problem. Even human evaluators sometimes disagree when bucketing songs into different genres. All this to say that music genre classification has a ceiling, and you can't expect 95% accuracy ;)
As for your question, you can deploy a TensorFlow model as a Flask API. The process is a bit tricky. In a month or two, I intend to release a mini-series on how to do deploy an audio-based AI model with Docker, Flask and AWS. If you can't wait until then, I'm afraid you'll have to do a bit of search on the Internet. Unfortunately, I'm not aware of any solid reference on the subject.
I hope this helps :)
@@ValerioVelardoTheSoundofAI Thank you for the guidance! looking forward to your future videos.
It seems like the val accuracy hasn't changed much (still around 60%)? Shouldnt we be getting better accuracy if we have less overfitting?
wow thanks
Hi Valerio, thank you so much for your detailed tutorials. I have greatly benefitted. My query is , isn't the validation accuracy too low compared to test accuracy? In image classification the validation accuracy is mostly over 90%. Is the validation accuracy in sound analysis considered 'good' if I get 60% v?
That really depends on the problem. All things considered, where you're dealing with subjective tasks (e.g., recognizing genres) the validation accuracy will generally be lower.
liked and subscribed w vid bro
22:00 I thought he would say another thing than "use L2 if is complex" xD that was so obvious to see come as he said before use L1 for simple data and L2 and complex data xD
sir i really like your tutorial ,It help me a lot but i have an issue,Sir i have doubt regarding the accuracy .
Sir as according to your graph we have solved overfitting problem but if you will look for accuracy for training set ,now it has been decreased to 70 % even if here you are using 100 epochs but in previous one with 50 epochs we got accuracy for training to 97 % .So to overcome with overfitting we have decreased our accuracy so .
Will it not affect our model?
Any other solution regarding this?
It's possible that we may need more epochs and/or a more complex model (i.e., more layers / neurons) to increase accuracy in the training set.
@@ValerioVelardoTheSoundofAI but sir my doubt is that in second case even we have 100 epochs but still we are getting 70% accuracy for our training set according to your code but in previous code we got 97% with 50 epochs ?
@@coding_kit in the initial run, the model was clearly overfitting the data. That's an issue we must avoid for the sake of generalising our system to unseen data.
@@ValerioVelardoTheSoundofAI i got it sir ,thank you
Полезное видео, только один момент не понравился - после дропаута и регуляризации нельзя сказать, что модель стала классифицировать лучше, по сравнению с прошлым результатом. Для тестового набора показатели примерно те же самые. Она просто на тренировочном наборе стала хуже результаты выдавать. и соответственно разница в результатах на тестовом и тренировочном наборе стала гораздо меньше
Great tutorial! I just have one quick question, is there a way to make my model converge? Seems like every time I run it, it shows a different value. Thank you!
Showing different value is normal, because the training process is non-deterministic.
If you want to use the model, then you don't have to train it each time, but train it once, and the retrieve use it to predict.
Hi, i already saved the model and want to continue training the overfitting model, how to continue adding regularization to the saved model?
I have a question, the dataset files are of variable length. Can you suggest any thing which may help. your work is so great. Thank you
You could use zero padding.
How about derivatives mfcc order one and order 2? Would that help? more datapoints not necessarily new data or "augmented data"
Can you make video on "Audio Data Augmentation", in case if you have already made it , can you share the link?
I'm planning to have a mini-series on audio data augmentation in the next months. Stay tuned!
@@ValerioVelardoTheSoundofAI ok Thank you.
Thank you so much for this amazing series!!
Although I'm having trouble with this one thing that my model is showing a sudden drop in accuracy at 74th epoch resulting in overall poor accuracy. Any suggestions what should I do to fix this problem ?
Not sure what's happening there. Have you tried re-running the training? Also, does the drop in accuracy concern the training set or the validation set?
@@ValerioVelardoTheSoundofAI Yes, I have tried running it multiple times, but it has always shown a drop around the 70th epoch. I've also tried increasing the #epochs to 150 but despite that it reaches to 60-62% max at 120th epoch and becomes almost constant after that.
Is this classifier only a genre classifier or does it depend on the data sets you train with?
It depends on the data. The classifier doesn't know anything about music until is trained ;)
I am still getting loss of 2.4 for val_loss. whereas my train_loss is 0.26, Someone kindly help
im getting accuracy: 0.6519 val_accuracy: 0.5519
isnt that v less?
thats seems good
So what code should i write ahead of this to get the genre of a random music file which is not part of this data set ?
You can find similar code in the speech regocnition series, particularly in the keyword_spotting_service file.
Can you help me regarding model.predict() for this model?
I am getting this when I try to predict using a test wav file for the model.h5 file.
AttributeError: 'str' object has no attribute 'shape'.
Can you help please , Thank You.
It's difficult to say what the issue may be. From what I gather, you're passing a string instead of an array somewhere. Strings don't have 'shape' - arrays do. Have you checked that you're passing a Numpy array/list of arrays, or TensorFlow tensor/list of tensors as an argument to model.predict()?
@@ValerioVelardoTheSoundofAI yes I did pass it as an np array
@@ValerioVelardoTheSoundofAI but for this model the input will be the .wav file right or we will first have to convert it to json before passing the predict method? I gave .wav file as input for the predict method.
@@painfgaming8229 nope - you should pre-process the wav file, extracting the MFCCs as I've done in a previous video. When you use a model for inference (i.e., prediction), you should pass data of the same type as taht you've used for training. The intermediate passage of storing the MFCC as a Json file isn't really needed. The step by step process is: 1- load the wav file with Librosa, 2- use Librosa to extract the MFCCs with the same parameters used for training, 3- feed the extracted MFCCs to model.predict(). I hope this helps!
@@ValerioVelardoTheSoundofAI thank you fot responding I'll try this
what should i write to predict or test the datasets?
def predict(model, X, y):
X = X[np.newaxis, ...]
prediction = model.predict(X) # X -> (1, 130, 13, 1)
predicted_index = np.argmax(prediction, axis=1) # [3]
print("Excpected index: {}, Predicted index: {}".format(y, predicted_index))
X = X_test[99]
y = y_test[99]
predict(model, X, y)
Do some more projects please
I have new series with new projects.