[WEEK 5-6] Getting into it

muhammet özgür
bbm406f17
Published in
3 min readJan 5, 2018

Different approaches, classifiers, data-sets have been tried to get right choice. First of all, features were picked which would be used later as any machine learning problem.KNN, SVM and CNN classifiers are used for this project.SVM and KNN is implemented by scikit-learn pythonmodule. We used keras with tensorflow backend for CNN implementation.

In implementation detail, we try to design our project according to OOP and modularity rules. We implemented abstract base classifier as super class to other models and we could use inheritance abilities of python which reduced number of code line so much. At the same time, we could implement another classifiers easily with this strategy.

For instance, before we changed our feature extraction method, our CNN model could not fit because of RAM, too. That is why, we implemented basic fully connected Neural Network by using keras to see how it ended up with features and that was pretty fast to implement.
Lack of RAM and lack of NVDIA card, we could fit our model on GPU with keras if we had one which would speed up whole project process time, forced us to use batch learning. CNN supports that kind of learning natively, but KNN does not so we had to keep whole feature array on the disk. Linear SVM does not support in sci-kit library.

Thus, we used SGDClassifier from scikit-learn library which uses Stochastic Gradient Descent (SGD) with linear classifiers such as SVM, logistic regression etc.
Before explaining our CNN model, our basic approach was using some kind of voting system with those models for our prediction method.

Firstly, songs were splited as you remembered. In the case of 30 seconds part with 41 overlapping frames, 60 mel-band, we had about 63 parts from only one song. Thus, the most predicted label is picked for that song with its possibility. For instance, 53 parts are predicted as ’ege’, label ’ege’ would be picked with possibility 53=60 for that song. Those possibilities are needed because of our voting system.

After whole models predicted songs, algorithm averages possibilities of same songs that has same label from different models.That average probability is vote number of that label for the song. Say, if we have 3 models and first model predicts first song as ’ege’ with 30% probability, second model predicts first song as ’ege’ with 80% probability and third model predicts first song as ’trakya’ with 70% probability. In that case, first and second model probabilities average which is 55 would be vote number of ’ege’ and 70 would be vote number of ’trakya’. Thus ’trakya’ would be picked as a final label.

Also, some threshold value can be sent that if final predicted label’s probability is smaller than that threshold value, that means that value does not satisfy and any label cannot be picked. Actually, we used that property as trust parameter which means if probability is smaller than trust value, it is not trustful. Surely that property does not gain any advantage for system but we can see the trust level of predictions. However it has weakness such as if labels has same probabilities, it picks label arbitrarily

--

--