Music Emotion classification algorithm based on AdaBoost __ algorithm

Source: Internet
Author: User
Music Emotion Classification algorithm based on AdaBoost-2015 Practice Design Summary

=========================================

Music Emotion classification algorithm based on Adaboost-2015 Internship design Summary written in the beginning 1 Thank you 2 reference music emotions Adaboost 1 about Code 11 training Samples 12 training results 13 to classify musical features

1. Written at the beginning

The Internship design topic is based on AdaBoost music mood classification algorithm , because in the company internship, participation in the project has just started not even a prototype, it is not appropriate to bring directly. Helpless can only draw up a topic, because for Sony Walkman Music analysis is very interested, so decided to write a music mood classification algorithm, read some papers, feel most use adaboost to complete, so finally drew up this topic. The teacher nodded over the subject and asked to embed the algorithm in a music player. 1.1 Thanks

The internship design, the main purpose is to learn the adaboost algorithm of the use of the process, most of the code is used ready-made, their main part is to combine the various parts together. To successfully complete the internship design, need to thank you for your selfless open source spirit, the design of the use of other people's Code, here special thanks to their authors:
Https://github.com/cbefus/CAMEL-A-Framework-for-Audio-Analysis
Https://github.com/yamaguchi23/adaboost
Https://github.com/FreedomZZQ/IcePlayer
Https://github.com/keli/netease-music
Another word of thanks. 1.2 reference materials

Resources are not much, mainly some papers as well as blogs, which I have listed here to
Adaboost
http://blog.csdn.net/tiandijun/article/details/48036025
http://blog.csdn.net/haidao2009/article/details/7514787
Http://wenku.baidu.com/link?url=77xTzysMJt7k90q1BUBpzuYmw5RWO_ Uevpp6qeu0lgcrxh-lqpremblmxmd9ufg-ohg3eza3on5fmcn9kjnx5sfmqklkwabaaekci8xuup7
Http://www.open-open.com/lib/view/open1436021046513.html
Related papers
The classification of music emotion based on AdaBoost
The research and realization of music classification system based on emotion
Research and implementation of music emotion classification algorithm under digital audio system 2 musical sentiment

Music is the art of expressing emotions, and it conveys a certain emotion through some precise combination, which may vary from person to person, but most feelings are similar and often are not simple emotions.
With regard to emotional types, see the biopsychology of mood and arousal, which is probably the Thayer model:

One dimension is arousal, from calm to excited, arousal with the physical activity of the individual and the energy of the music have light. Another dimension is valence, which increases gradually from sad to pleased, and valence is related to the internal psychological activity of the individual.
For simplicity's sake, we chose the Thayer model's excited, pleased, calm, sad four emotions for the classification type.
In these 4 moods, sad and pleased are typical negative emotions and positive emotions, and excited and calm are the representatives of higher and lower music intensity. 3 Adaboost

The AdaBoost content has been given here, which is to illustrate that there are many kinds of AdaBoost, in the code can be selected discrete AdaBoost, real AdaBoost, gentle AdaBoost. Although some information about Adaboost on the internet is discrete Adaboost, it does not prevent us from using the gentle Adaboost with better accuracy. (๑ ̀ㅂ ́) و✧ 3.1 about code

The adaboost part of the code uses the method that the Https://github.com/yamaguchi23/adaboost author has given to use, simple and straightforward. I'm adding a note to this section. 3.1.1 Training Samples

Training samples are needed first, and the authors suggest that some training examples can be obtained here. For example, this A1A is a training sample, and A1A.T is a test sample.
The sample format conforms to this format (LIBSVM format):
<label><index1>:<value1><index2>:<value2>..::...
We call this a "sample"
The label is usually +1 or 1, which means "yes" or "no".
Index is a number that represents the label of a feature
Value is a number that represents the values of the corresponding feature
And the training sample is a lot of row samples of data, probably long like this
+1 1:-0.137674 5:0.0218209 6:-0.616122 14:21387.2 16:83781.9

3.1.2 Training Results

In the program we choose the number of training, each training to get a weak classifier, this number is very important, anyway, not too little. About 5,000 samples of training samples, I used a 3w training.
The result of the training is a set of data, which is the "weak classifier" in AdaBoost, which forms the "strong classifier", which is probably long:
5
40 631.832 0.134146-0.711574
26 34401.2 0.391827-0.252791
26 22610.7 0.0810144-0.382917
13 30358.9 0.910024-0.0354104
40 448.577 0.134795-0.133638 5 represents the number of strong classifiers, but also the number of training. The 1th column, the characteristic marking of the strong classifier. corresponding to the 2nd column of index in the training sample, threshold or threshold 3rd column, the "score" 4th column given when the threshold is lower than the threshold value, the "Score" 3rd column and the 4th column given when the thresholds are greater, the values in discrete adaboost are the same, the symbols are the opposite, but AdaBoost and gentle adaboost are the opposite of symbols, but the values are not necessarily the same. 3.1.3 for classification

Given the training results, we can say that we have a model that predicts the type of music. The general process is: the first to obtain a musical eigenvalue value, the musical feature of the label is index, and then all the characteristics are equal to the index of the strong classifier to compare, and then compare, get "score", add "score", eventually if the "score" is greater than 0 description is, otherwise not
In C + + code, that's probably it.

    Double score = 0.0;
    for (int classifierindex = 0; Classifierindex < static_cast<int> (Weakclassifiers_.size ()); ++classifierindex) {
        score + = Weakclassifiers_[classifierindex].evaluate (featurevector);
    }

    return score;

In actual use, it is not appropriate to determine whether a type is only more than 0来, since it is often less than 0, so I am usually the most final result of the highest score in the 4 classification models. 4 Musical characteristics

In AdaBoost, we need to advance the characteristic value of music as a training sample, and we also need to extract the music features as a basis for predicting.
The extraction of musical features using the Https://github.com/cbefus/CAMEL-A-Framework-for-Audio-Analysis code is also straightforward, What we need to do is to say that the extracted features are grouped into the LIBSVM format, and that you must have no problem with the smart ones, this section can refer to my Code samplemaker that class.
Before using this code, you need to install FFTW This is the code to do about Fourier changes.
There are about 30 features that can be extracted, of which Calcwindowspectralirregularityk is a bug (j-1 this location). The more features of course the better the effect, but the slower the time will be, so there is a selective selection of some better.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.