Machine Learning Based Music Genre Classification and Recommendation System

Music has an important role in our life. It is also known that music helps to relax and strengthen the human spirit. The widespread use of the Internet has led to significant changes and developments in the music industry. The increase and widespread use of online music listening and sales platforms, the constant updating of these platforms and the classification of music genres can be given as examples of these developments. Music genre classification is an important step for the music recommendation system. In order for music to be classified by individuals require to listen to many songs and choose their genre. This is a difficult process and waste of time. In this paper, it is aimed to classify music according to its genres by using machine learning algorithms and to suggest similar types of music to the user. For this purpose, the features of the music files were extracted with digital signal processing techniques, and the music genres were automatically detected by using machine learning algorithms with the obtained features and a recommendation system was developed. The GTZAN dataset was chosen to be used in the study. Eight different machine learning models were trained in the Jupyter Notebook environment and the findings were compared. For this purpose, the data set was split into two sets as 80% training and 20% testing, and the accuracy of the models was evaluated. Among the tested models, the most successful result was obtained with the XGBoost algorithm with an accuracy rate of 91,792%.