Music Genre Classification

Classification model to predict the genre of a Spotify song based on its audio features. Final project for CIS 5450 (Big Data Analytics).

Overview

I wanted to see which audio features distinguish musical genres beyond what I could hear myself. Our team used Spotify datasets to compare six genres and train classifiers on their audio features.

Project notebook

Methods

We cleaned and explored Spotify audio-feature datasets from Kaggle, addressed class imbalance, and prepared features for the models. We then implemented machine learning models (random forest, XGBoost, neural network) to compare their performance in classifying songs into one of six genre categories. Finally, we used hypothesis testing to evaluate patterns we observed in the data.

Results

We found that each model performed moderately well in classifying songs into genres, but there was overlap between some genres that limited their performance. This was one of my first chances to bring data cleaning, visualization, model training, and evaluation together in one project.

Our Random Forest confusion matrix shows which genres were most often confused.
Rock and classical music have contrasting audio-feature profiles.
PCA also showed overlap between genres, with classical being a more distinct group.

Skills Used

  • Programming: scikit-learn, PyTorch, Plotly, Pandas, NumPy
  • ML concepts: PCA, t-SNE, XGBoost, Random Forest, deep learning, SMOTE, hyperparameter tuning