The article studies "uses the depth study Keras and TensorFlow to build a music recommendation system" _ Depth Learning Algorithm

Source: Internet
Author: User
Tags keras

This article is only the blogger himself used to organize the extracts retained, such as interested in the topic, please read the original.

Original address
https://zhuanlan.zhihu.com/p/28310437

Well done in the domestic music app NetEase cloud, shrimp music and QQ music will recommend favorite music.
Recommendation algorithm is a computer professional algorithm, through some mathematical algorithms, to infer what the user may like.

Implementation process
Collect a lot of data, processing and model training

1. Download MP3 file
The first thing to do is to download a large number of samples of MP3 files. 9 genres, each randomly selected 1000. Broken rackets, dance halls, slow rocking, drums and bass, classic electroacoustic, hip-hop, micro-sound dance, rock, psychedelic.

2, conversion sound frequency domain diagram
This part is an attempt to condense the information from the music, extract the main features and eliminate all "noise", essentially a reduced-dimensional preprocessing, the first stage is to convert audio to image format.
Using the discrete Fourier transform, the audio signal is converted to the frequency domain, and the collected 9,000 MP3 audio files are processed, each song is stored as a spectral image. A spectral graph is a visualization of the spectrum of a sound that changes over time, and the intensity of the color on the picture represents the sound amplitude of that frequency.

The picture above is about 20 seconds of hip-hop music produced by the sound. The x-axis represents the time, and the y-axis represents the frequency of the sound.

3 Split image for 256x256
In order to train the data, all the images need to be unified to the same size, and all spectral graphs will be divided into 256x256 sizes.
After cutting to get more than 185,000 pictures, each image to mark. The dataset is divided into 120000 training sets, 45000 verification sets and 20000 test sets.

4 Training an convolution neural network
The network learns spectrum images of different types of music, uses type labels and trains the network to recognize the type of music from the image.

The graph above is a convolution neural network model constructed by the paper, the upper left spectral image converts the image into a digital matrix that represents the color of each pixel, and then the data is fed into the Softmax classifier at the lower right corner after being processed by the convolution layer, the pool layer and the full connection layer, and the classifier gives a 9-digit vector, Each of them corresponds to the probability of 9 kinds of music schools, and finally chooses the schools with the maximum probability position as the final recognition genre.

The performance of 5 convolution neural networks
This paper constructs a convolution neural network model which can classify music genres of songs with 75% precision.
The following is a detailed breakdown of the classification accuracy for each type of song:

Psychedelic Dance: 91%
Drums and bass: 90%
Ballroom: 79%
Broken Beat: 78%
Classic Electric tone: 71%
Slow shake: 71%
Rock/Indie music: 70%
Micro-acoustic Dance: 63%
Hip Hop/rb:61%
You can see from the results that you have excelled at classifying psychedelic sounds, and that the classification of hip hop/RB music is not as good as it might be because there are some intersections between datasets that may result in lower classification accuracy, such as hip-hop, shredding and ballroom comparisons. And the psychedelic sound is completely different from the other 8 types of music, which may be the reason for its excellent performance.

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.