Skip to content
RH★RYAN
HANGRALIMDEVELOPER / BALI, ID

ML / AUDIO

Music Recommendation

A Streamlit app that listens to an uploaded WAV file, predicts one of five genres, and recommends up to ten similar tracks using audio features.

Find your next track in the sound.
THE ROLE
Machine Learning Developer · University Team Project
THE WHEN
2024
BUILT WITH
PythonLibrosaSVMCosine SimilarityStreamlit

Starting with the sound

This university team project explores a simple question: can an uploaded song lead to other songs with similar audio characteristics? The app accepts a WAV file, plays it back, displays genre scores, and recommends tracks from its local library.

The system covers five genres: blues, classical, pop, reggae, and rock.

The recommendation pipeline

  1. Extract the audio features. Librosa computes 13 mel-frequency cepstral coefficients (MFCCs), summarized by their means across the track.
  2. Apply the training scaler. The saved StandardScaler transforms the uploaded track into the same feature space used to train the model.
  3. Classify the genre. A support vector machine selects the genre. The interface displays relative genre scores and a comparison chart.
  4. Rank similar tracks. Within the predicted genre, cosine similarity compares the upload against the library’s scaled feature vectors. The app returns up to ten matches and provides playback when the audio files are available.

Training and delivery

The training notebook uses an RBF-kernel SVM, an 80/20 train-test split, and five-fold grid search over its regularization and kernel parameters. Both the selected model and the fitted scaler are saved for the Streamlit app to reuse.

What I learned

The project brought feature extraction, classification, and retrieval into one working interface. It also made the consequences of the design clear: the predicted genre determines the recommendation pool, and similarity is based on the chosen audio features. Keeping training, library preparation, and inference consistent is essential to making that pipeline work.

CASE FILE / 06THAT'S THE STORY.

LET'S BUILD THE NEXT ONE ↗
UP NEXT / CASE FILE 07

Face Expression Classification

From pixels to expressions.

← THE COMPLETE LINEUPBACK TO BASE ↑
YOU'VE GOT A DIRECT LINE.

RYAN'S GUIDE

The inside story on the work.

AI PORTFOLIO GUIDEASK AWAY
THIS IS WHERE THE CONVERSATION STARTS.
Ryan's guide

Hey! I'm Ryan's AI portfolio guide. Want the story behind a project, his background, or what he builds? You're in the right place.

PICK A CONVERSATION STARTER

ENTER: SEND SHIFT + ENTER: NEW LINE

Have something personal to discuss? Email Ryan ↗