Complete Technical Paper Content โ Ai Music Recommendation
1. Executive Abstract, Problem Formulation & Background
๐ง AI Mood-Based Music Recommender A deep learningโbased music recommendation system that predicts the userโs mood from audio features and suggests songs accordingly. Built using a hybrid CNN-LSTM architecture , this project bridges the gap between static playlists and real-time emotional context. ๐ Problem Statement Traditional music platforms recommend songs based on: Genre Listening history However, they fail to capture the userโs current emotional state , leading to irrelevant recommendations. ๐ก Solution This system: Classifies songs into mood categories using deep learning Uses audio features to infer emotional tone Provides personalized, mood-based recommendations via a Streamlit app ๐ Dataset Source: Spotify Audio Features dataset (Kaggle) Size: ~2000 songs Features: 9 base audio features ๐ฏ Mood Labeling Strategy Mood labels were generated using feature-based thresholding : High Energy โ Energy > 0.8 Chill / Acoustic โ Acousticness > 0.7 Groovy โ Danceability > 0.7 Focus / Instrumental โ Instrumentalness > 0.5 This rule-based labeling simulates real-world mood tagging and enables supervised learning. ๐ Methodology & Pipeline Data Collection (Kaggle dataset) Mood Label Generation Feature Engineering (17 features: 9 base + 8 engineered) Preprocessing (StandardScaler, train-test split) Model Training (CNN-LSTM) Evaluation (Accuracy, F1-score, confusion matrix) Deployment (Streamlit web app) ๐ง Model Architecture Hybrid Deep Learning Model: Conv1D layers โ extract spatial/audio patterns LSTM layers โ capture temporal dependencies Dense layers โ classification Flow: Input โ Conv1D โ Conv1D โ MaxPool โ LSTM โ Dense โ Softmax Optimizer: Adam Epochs: 200 Parameters: ~135K ๐ Results โ Training Accuracy: 95% โ Test Accuracy: 85% Per-Class F1 Score: High Energy: 0.94 Chill/Acoustic: 0.91 Groovy: 0.86 Mixed Vibe: 0.72 Focus/Instrumental: 0.68 ๐ Web Application (Streamlit) The system includes an interactive UI with 3 modules: 1๏ธโฃ Mood Explorer Select mood Get ranked song recommendations 2๏ธโฃ Feature Predictor Adjust audio sliders Real-time mood prediction 3๏ธโฃ Song Inspector Compare labeled vs predicted mood Visual radar chart ๐ฎ Example Input Mood: High Energy Recommended Songs: Blinding Lights Save Your Tears Levitating ๐ Tech Stack Python TensorFlow / Keras Scikit-learn Streamlit Pandas, NumPy, Plotly ๐ Project Structure ai-mood-music-recommender/ โ โโโ model/ โโโ app.py โโโ mood_labeling.py โโโ requirements.txt โโโ README.md ๐ Future Improvements Spotify API integration Real-time emotion detection (camera/text) Mobile application version ๐ฉโ๐ป Author Charmi Vasa B.Tech CSE (AI-ML)
A deep learningโbased music recommendation system that predicts the userโs mood from audio features and suggests songs accordingly. Built using a hybrid CNN-LSTM architecture , this project bridges the gap between static playlists and real-time emotional context.
However, they fail to capture the userโs current emotional state , leading to irrelevant recommendations.
This rule-based labeling simulates real-world mood tagging and enables supervised learning.
ai-mood-music-recommender/ โ โโโ model/ โโโ app.py โโโ mood_labeling.py โโโ requirements.txt โโโ README.md
2. Related Work, Literature Survey & Algorithmic Foundations
Deep Learning Project: Song Recommendation System In this project, we are motivated by shazamโs music recommendation system. The goal of this project is to output the genre and recommend a list of songs using the input music provided by the users. The team attempted various ways to improve the model, such as experimenting with different model designs and fine tuning hyperparameters such as the optimizers and learning rate. To find out more, the details can be found in the report. -Spectral Centroid: -Sound Wave: 1. Getting Started 1.1 Dataset preparation Download the GTZAN Dataset preprocessed Visualize an individual audio file Directory structure should be as such: . โโโ checkpoints โ โโโ cnn โ โโโ gru โ โโโ incp โ โโโ lstm โ โโโ resnet โ โโโ rnn โโโ data โ โโโ images_original โ โโโ blues โ โโโ classical โ โโโ country โ โโโ disco โ โโโ hiphop โ โโโ jazz โ โโโ metal โ โโโ pop โ โโโ reggae โ โโโ rock โโโ img โโโ notebooks โ โโโ Audio_Preprocessing.ipynb โ โโโ Basecode.ipynb โ โโโ CustomCNN_HyperparameterTuning.ipynb โ โโโ CustomCNN.ipynb โ โโโ Dataset_Visualisation.ipynb โ โโโ deep_learning_song_embedding.ipynb โ โโโ InceptionModule.ipynb โ โโโ Initial_Recommender_System.ipynb โ โโโ RecurrentNet.ipynb โ โโโ ResNet.ipynb โ โโโ Song_Embeddings.ipynb โโโ requirements.txt โโโ src โโโ config โ โโโ __pycache__ โ โ โโโ eval_config.cpython-39.pyc โ โ โโโ preprocess_dataset_config.cpython-39.pyc โ โ โโโ song_embed_config.cpython-39.pyc โ โ โโโ train_config.cpython-39.pyc โ โโโ eval_config.py โ โโโ train_config.py โโโ evaluate_song_embed.py โโโ evaluate.py โโโ extract_song_embed.py โโโ inference.py โโโ models โ โโโ CustomCNN.py โ โโโ InceptionModule.py โ โโโ ResNet.py โ โโโ __pycache__ โ โโโ CustomCNN.cpython-39.pyc โ โโโ InceptionModule.cpython-39.pyc โ โโโ ResNet.cpython-39.pyc โโโ train.py โโโ preprocess_dataset.py โโโ utils โโโ __pycache__ โ โโโ eval_utils.cpython-39.pyc โ โโโ extract_song_embed.cpython-39.pyc โ โโโ inference_utils.cpython-39.pyc โ โโโ model_utils.cpython-39.pyc โ โโโ preprocessing_utils.cpython-39.pyc โ โโโ train_utils.cpython-39.pyc โโโ eval_utils.py โโโ model_utils.py โโโ preprocessing_utils.py โโโ train_utils.py 1.2 Setup environment Install all the required dependencies pip3 install -r requirements.txt 1.3 Change working directory path Open config/train_configs and config/eval_configs Change the default --working_dir in line 9 to your own absolute path or specify it during training/evaluation 2. How to run 2.1 Training model Change directory to /src cd src Run training code python3 train.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch cnn $ python3 train.py --help usage: train.py [-h] [--working_dir WORKING_DIR] [-a ARCH] [--checkpoints_path CHECKPOINTS_PATH] [--test_size TEST_SIZE] [--num_workers NUM_WORKERS] [--trg_batch_size TRG_BATCH_SIZE] [--val_batch_size VAL_BATCH_SIZE] [--test_batch_size TEST_BATCH_SIZE] [--num_epochs NUM_EPOCHS] [--lr LR] [--momentum MOMENTUM] [--gamma GAMMA] [--optimizer_type OPTIMIZER_TYPE] [--step_size STEP_SIZE] [--no_cuda] optional arguments: -h, --help show this help message and exit --working_dir WORKING_DIR The ROOT working directory -a ARCH, --arch ARCH The architecture of model --checkpoints_path CHECKPOINTS_PATH The path of the pretrained checkpoint --test_size TEST_SIZE Train test split --num_workers NUM_WORKERS Number of threads for loading data --trg_batch_size TRG_BATCH_SIZE Batch size --val_batch_size VAL_BATCH_SIZE Batch size --test_batch_size TEST_BATCH_SIZE Batch size --num_epochs NUM_EPOCHS Number of epochs to train --lr LR Learning rate --momentum MOMENTUM Momentum --gamma GAMMA Gamma --optimizer_type OPTIMIZER_TYPE Type of optimizer: sgd or adam --step_size STEP_SIZE Step size --no_cuda If true, cuda is not used. For CNN approach: python3 train.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch cnn For InceptionModule approach: python3 train.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch incp For ResNet approach: python3 train.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch resnet For RecurrentNet approach: (RNN) python3 train.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch rnn (LSTM) python3 train.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch lstm (GRU) python3 train.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch gru 2.2 Evaluation of model Change directory to /src cd src Run evaluation code python3 evaluate.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch cnn $ python3 evaluate.py --help usage: evaluate.py [-h] [--working_dir WORKING_DIR] [-a ARCH] [--test_size TEST_SIZE] [--num_workers NUM_WORKERS] [--trg_batch_size TRG_BATCH_SIZE] [--val_batch_size VAL_BATCH_SIZE] [--test_batch_size TEST_BATCH_SIZE] [--no_cuda] optional arguments: -h, --help show this help message and exit --working_dir WORKING_DIR The ROOT working directory -a ARCH, --arch ARCH The architecture of model --test_size TEST_SIZE Train test split --num_workers NUM_WORKERS Number of threads for loading data --trg_batch_size TRG_BATCH_SIZE Batch size --val_batch_size VAL_BATCH_SIZE Batch size --test_batch_size TEST_BATCH_SIZE Batch size --no_cuda If true, cuda is not used. 2.3 Extracting song embedding Change directory to /src cd src Run evaluation code python3 extract_song_embed.py --no_cuda --working_dir <ABS PATH>/deep_learning_project $ python3 extract_song_embed.py --help usage: train.py [-h] [--working_dir WORKING_DIR] [--test_size TEST_SIZE] [--num_workers NUM_WORKERS] [--trg_batch_size TRG_BATCH_SIZE] [--val_batch_size VAL_BATCH_SIZE] [--test_batch_size TEST_BATCH_SIZE] [--num_epochs NUM_EPOCHS] [--lr LR] [--momentum MOMENTUM] [--gamma GAMMA] [--optimizer_type OPTIMIZER_TYPE] [--step_size STEP_SIZE] [--no_cuda] optional arguments: -h, --help show this help message and exit --working_dir WORKING_DIR The ROOT working directory --checkpoints_path CHECKPOINTS_PATH The path of the pretrained checkpoint --test_size TEST_SIZE Train test split --num_workers NUM_WORKERS Number of threads for loading data --trg_batch_size TRG_BATCH_SIZE Batch size --val_batch_size VAL_BATCH_SIZE Batch size --test_batch_size TEST_BATCH_SIZE Batch size --num_epochs NUM_EPOCHS Number of epochs to train --lr LR Learning rate --momentum MOMENTUM Momentum --gamma GAMMA Gamma --optimizer_type OPTIMIZER_TYPE Type of optimizer: sgd or adam --step_size STEP_SIZE Step size --no_cuda If true, cuda is not used. 2.4 Evaluation of song embedding Change directory to /src cd src Run evaluation code python3 evaluate_song_embedding.py --no_cuda --working_dir <ABS PATH>/deep_learning_project 2.5 Inference Change directory to /src cd src Run inference code python3 inference.py --no_cuda --working_dir <ABS PATH>deep_learning_project Choose the song file via the GUI Close the window Song recommendations will be shown on your terminal!
In this project, we are motivated by shazamโs music recommendation system. The goal of this project is to output the genre and recommend a list of songs using the input music provided by the users. The team attempted various ways to improve the model, such as experimenting with different model designs and fine tuning hyperparameters such as the optimizers and learning rate. To find out more, the details can be found in the report.
. โโโ checkpoints โ โโโ cnn โ โโโ gru โ โโโ incp โ โโโ lstm โ โโโ resnet โ โโโ rnn โโโ data โ โโโ images_original โ โโโ blues โ โโโ classical โ โโโ country โ โโโ disco โ โโโ hiphop โ โโโ jazz โ โโโ metal โ โโโ pop โ โโโ reggae โ โโโ rock โโโ img โโโ notebooks โ โโโ Audio_Preprocessing.ipynb โ โโโ Basecode.ipynb โ โโโ CustomCNN_HyperparameterTuning.ipynb โ โโโ CustomCNN.ipynb โ โโโ Dataset_Visualisation.ipynb โ โโโ deep_learning_song_embedding.ipynb โ โโโ InceptionModule.ipynb โ โโโ Initial_Recommender_System.ipynb โ โโโ RecurrentNet.ipynb โ โโโ ResNet.ipynb โ โโโ Song_Embeddings.ipynb โโโ requirements.txt โโโ src โโโ config โ โโโ __pycache__ โ โ โโโ eval_config.cpython-39.pyc โ โ โโโ preprocess_dataset_config.cpython-39.pyc โ โ โโโ song_embed_config.cpython-39.pyc โ โ โโโ train_config.cpython-39.pyc โ โโโ eval_config.py โ โโโ train_config.py โโโ evaluate_song_embed.py โโโ evaluate.py โโโ extract_song_embed.py โโโ inference.py โโโ models โ โโโ CustomCNN.py โ โโโ InceptionModule.py โ โโโ ResNet.py โ โโโ __pycache__ โ โโโ CustomCNN.cpython-39.pyc โ โโโ InceptionModule.cpython-39.pyc โ โโโ ResNet.cpython-39.pyc โโโ train.py โโโ preprocess_dataset.py โโโ utils โโโ __pycache__ โ โโโ eval_utils.cpython-39.pyc โ โโโ extract_song_embed.cpython-39.pyc โ โโโ inference_utils.cpython-39.pyc โ โโโ model_utils.cpython-39.pyc โ โโโ preprocessing_utils.cpython-39.pyc โ โโโ train_utils.cpython-39.pyc โโโ eval_utils.py โโโ model_utils.py โโโ preprocessing_utils.py โโโ train_utils.py
$ python3 train.py --help usage: train.py [-h] [--working_dir WORKING_DIR] [-a ARCH] [--checkpoints_path CHECKPOINTS_PATH] [--test_size TEST_SIZE] [--num_workers NUM_WORKERS] [--trg_batch_size TRG_BATCH_SIZE] [--val_batch_size VAL_BATCH_SIZE] [--test_batch_size TEST_BATCH_SIZE] [--num_epochs NUM_EPOCHS] [--lr LR] [--momentum MOMENTUM] [--gamma GAMMA] [--optimizer_type OPTIMIZER_TYPE] [--step_size STEP_SIZE] [--no_cuda] optional arguments: -h, --help show this help message and exit --working_dir WORKING_DIR The ROOT working directory -a ARCH, --arch ARCH The architecture of model --checkpoints_path CHECKPOINTS_PATH The path of the pretrained checkpoint --test_size TEST_SIZE Train test split --num_workers NUM_WORKERS Number of threads for loading data --trg_batch_size TRG_BATCH_SIZE Batch size --val_batch_size VAL_BATCH_SIZE Batch size --test_batch_size TEST_BATCH_SIZE Batch size --num_epochs NUM_EPOCHS Number of epochs to train --lr LR Learning rate --momentum MOMENTUM Momentum --gamma GAMMA Gamma --optimizer_type OPTIMIZER_TYPE Type of optimizer: sgd or adam --step_size STEP_SIZE Step size --no_cuda If true, cuda is not used.
python3 train.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch resnet
3. Dataset Ingestion, Preprocessing & Stochastic Augmentations
python3 evaluate.py --no_cuda --working_dir <ABS PATH>/deep_learning_project --arch cnn
$ python3 evaluate.py --help usage: evaluate.py [-h] [--working_dir WORKING_DIR] [-a ARCH] [--test_size TEST_SIZE] [--num_workers NUM_WORKERS] [--trg_batch_size TRG_BATCH_SIZE] [--val_batch_size VAL_BATCH_SIZE] [--test_batch_size TEST_BATCH_SIZE] [--no_cuda] optional arguments: -h, --help show this help message and exit --working_dir WORKING_DIR The ROOT working directory -a ARCH, --arch ARCH The architecture of model --test_size TEST_SIZE Train test split --num_workers NUM_WORKERS Number of threads for loading data --trg_batch_size TRG_BATCH_SIZE Batch size --val_batch_size VAL_BATCH_SIZE Batch size --test_batch_size TEST_BATCH_SIZE Batch size --no_cuda If true, cuda is not used.
python3 extract_song_embed.py --no_cuda --working_dir <ABS PATH>/deep_learning_project
$ python3 extract_song_embed.py --help usage: train.py [-h] [--working_dir WORKING_DIR] [--test_size TEST_SIZE] [--num_workers NUM_WORKERS] [--trg_batch_size TRG_BATCH_SIZE] [--val_batch_size VAL_BATCH_SIZE] [--test_batch_size TEST_BATCH_SIZE] [--num_epochs NUM_EPOCHS] [--lr LR] [--momentum MOMENTUM] [--gamma GAMMA] [--optimizer_type OPTIMIZER_TYPE] [--step_size STEP_SIZE] [--no_cuda] optional arguments: -h, --help show this help message and exit --working_dir WORKING_DIR The ROOT working directory --checkpoints_path CHECKPOINTS_PATH The path of the pretrained checkpoint --test_size TEST_SIZE Train test split --num_workers NUM_WORKERS Number of threads for loading data --trg_batch_size TRG_BATCH_SIZE Batch size --val_batch_size VAL_BATCH_SIZE Batch size --test_batch_size TEST_BATCH_SIZE Batch size --num_epochs NUM_EPOCHS Number of epochs to train --lr LR Learning rate --momentum MOMENTUM Momentum --gamma GAMMA Gamma --optimizer_type OPTIMIZER_TYPE Type of optimizer: sgd or adam --step_size STEP_SIZE Step size --no_cuda If true, cuda is not used.
python3 evaluate_song_embedding.py --no_cuda --working_dir <ABS PATH>/deep_learning_project
4. Neural Network Backbone, Layer Specifications & Loss Formulations
This project develops a deep learning-based music recommendation system inspired by Shazam. It predicts genre of input songs and recommends similar tracks by learning rich song embeddings using CNN, ResNet, and recurrent neural networks. The system features comprehensive audio preprocessing, model training, and an interactive inference interface
AI Music Recommendation System VibeStream - an AI music discovery platform that recommends tracks using content-based filtering, collaborative filtering, and a hybrid ML scoring engine. Deployed on Vercel with a Flask backend. Table of Contents About The Project Key Features Live Demo Built With How It Works Project Structure Getting Started Deployment Contributing License Contact About The Project VibeStream is an AI-powered music recommendation system with a Flask web interface deployed on Vercel. It combines three recommendation strategies: Content-Based Filtering - Computes cosine similarity between songs using weighted audio features (energy, danceability, tempo) and categorical features (genre, mood). Audio features are weighted 3x higher than genre/mood to prevent categorical dominance and ensure recommendations consider actual sound characteristics. Collaborative Filtering - Identifies the 10 most similar listeners based on listening history, normalizes their interaction scores by activity level, and recommends tracks the target user hasn't heard. Hybrid Engine - Merges both approaches with a 55/45 weighted split (content/collaborative), averages duplicate recommendations, and boosts songs found by both methods by 15%. Key Features Hybrid AI Recommendations - Weighted combination of content-based and collaborative filtering Content-Based Audio DNA - Cosine similarity with properly weighted audio features (energy, danceability, tempo) + genre/mood encoding Collaborative Listener Matching - Finds top-10 similar users, normalizes by activity, surfaces unexplored tracks Preference Sliders - Fine-tune discovery by energy, danceability, and tempo (BPM) in real time Song Search - Search by title or artist to find tracks with matching audio profiles Dark Mode UI - Responsive design with card-based layouts and score badges Synthetic Data Generation - Built-in generator for 500 songs and 50 user interaction profiles Live Demo The app is deployed on Vercel: https://music-recommendation-system-<your-project>.vercel.app Built With Technology Purpose Python 3.11 Core language Flask Web framework and WSGI entry point for Vercel scikit-learn Cosine similarity, MinMaxScaler, StandardScaler pandas / NumPy Data processing and feature engineering Vercel Serverless deployment platform How It Works User Input (genre / mood / energy / danceability / tempo) | v Feature Engineering - One-hot encode genre (8) + mood (6) - MinMaxScaler on energy, danceability, tempo - Weight: audio features x3, genre/mood x 1/sqrt(cols) | v Content-Based Filtering - Cosine similarity matrix (500x500 songs) - Top-N most similar tracks, excluding user history | v Collaborative Filtering - User-item interaction matrix (50 users x 472 songs) - Cosine similarity between users - Top-10 similar users, weighted recommendations - Normalized by per-user activity level | v Hybrid Scoring - content_score * 0.55 + collab_score * 0.45 - +0.15 boost for songs found by both methods | v Ranked Recommendations (top-8) Recommendation Methods Method Input Algorithm Output Content-Based Song ID Cosine similarity on weighted audio features Similar tracks with match score Collaborative User ID User similarity x normalized interaction scores Tracks from similar listeners Hybrid User ID Weighted blend of content + collaborative Combined ranked playlist Preferences Genre/Mood/Sliders Euclidean distance in MinMax-scaled 3D space Tracks matching desired vibe Search Text query String matching on title/artist + content recs Search results + similar tracks Project Structure Music-Recommendation-System/ | |-- api/ | +-- index.py # Flask WSGI app (Vercel entry point) |-- templates/ | +-- index.html # HTML template with inline CSS |-- static/ | +-- style.css # CSS (reference copy, inlined in template) |-- recommendation_engine.py # ML engine: content, collaborative, hybrid filtering |-- data_generator.py # Generates synthetic songs.csv and interactions.csv |-- app.py # Streamlit version (for local use) |-- get_yt_info.py # YouTube track info utility |-- songs.csv # 500 synthetic songs with audio features |-- interactions.csv # 1,451 user-song interactions (50 users) |-- vercel.json # Vercel deployment configuration |-- requirements.txt # Python dependencies (pandas, numpy, scikit-learn, flask) |-- .gitignore +-- README.md Getting Started Prerequisites Python 3.8+ pip Installation 1. Clone the repository git clone https://github.com/Gotam-Dulhani/Music-Recommendation-System.git cd Music-Recommendation-System 2. Create a virtual environment (recommended) python -m venv venv # Windows venv \S cripts \a ctivate # macOS / Linux source venv/bin/activate 3. Install dependencies pip install -r requirements.txt 4. Generate the dataset (optional - refresh synthetic music data) python data_generator.py Running Locally Option A: Flask (same as production) flask --app api.index run Open http://localhost:5000 Option B: Streamlit (original UI) streamlit run app.py Open http://localhost:8501 Deployment Vercel Push to GitHub Import repository on vercel.com/new Vercel auto-detects the Python runtime from vercel.json and api/index.py Deploy - no build configuration needed The vercel.json routes all requests to the Flask app in api/index.py : { "builds" : [{ "src" : " api/index.py " , "use" : " @vercel/python " }], "routes" : [ { "src" : " /static/(.*) " , "dest" : " /static/$1 " }, { "src" : " /(.*) " , "dest" : " /api/index.py " } ] } Contributing Fork the repo Create a feature branch: git checkout -b feature/AmazingFeature Commit your changes: git commit -m " Add AmazingFeature " Push and open a Pull Request: git push origin feature/AmazingFeature License Distributed under the MIT License . See LICENSE for details. Contact Gotam Dulhani GitHub: https://github.com/Gotam-Dulhani Acknowledgments Flask Documentation scikit-learn Documentation pandas Documentation Vercel Python Runtime
VibeStream - an AI music discovery platform that recommends tracks using content-based filtering, collaborative filtering, and a hybrid ML scoring engine. Deployed on Vercel with a Flask backend.
VibeStream is an AI-powered music recommendation system with a Flask web interface deployed on Vercel. It combines three recommendation strategies:
Content-Based Filtering - Computes cosine similarity between songs using weighted audio features (energy, danceability, tempo) and categorical features (genre, mood). Audio features are weighted 3x higher than genre/mood to prevent categorical dominance and ensure recommendations consider actual sound characteristics.
5. Training Protocol, Convergence Behavior & Experimental Evaluation
Collaborative Filtering - Identifies the 10 most similar listeners based on listening history, normalizes their interaction scores by activity level, and recommends tracks the target user hasn't heard.
Hybrid Engine - Merges both approaches with a 55/45 weighted split (content/collaborative), averages duplicate recommendations, and boosts songs found by both methods by 15%.
The app is deployed on Vercel: https://music-recommendation-system-<your-project>.vercel.app
User Input (genre / mood / energy / danceability / tempo) | v Feature Engineering - One-hot encode genre (8) + mood (6) - MinMaxScaler on energy, danceability, tempo - Weight: audio features x3, genre/mood x 1/sqrt(cols) | v Content-Based Filtering - Cosine similarity matrix (500x500 songs) - Top-N most similar tracks, excluding user history | v Collaborative Filtering - User-item interaction matrix (50 users x 472 songs) - Cosine similarity between users - Top-10 similar users, weighted recommendations - Normalized by per-user activity level | v Hybrid Scoring - content_score * 0.55 + collab_score * 0.45 - +0.15 boost for songs found by both methods | v Ranked Recommendations (top-8)
Music-Recommendation-System/ | |-- api/ | +-- index.py # Flask WSGI app (Vercel entry point) |-- templates/ | +-- index.html # HTML template with inline CSS |-- static/ | +-- style.css # CSS (reference copy, inlined in template) |-- recommendation_engine.py # ML engine: content, collaborative, hybrid filtering |-- data_generator.py # Generates synthetic songs.csv and interactions.csv |-- app.py # Streamlit version (for local use) |-- get_yt_info.py # YouTube track info utility |-- songs.csv # 500 synthetic songs with audio features |-- interactions.csv # 1,451 user-song interactions (50 users) |-- vercel.json # Vercel deployment configuration |-- requirements.txt # Python dependencies (pandas, numpy, scikit-learn, flask) |-- .gitignore +-- README.md
Model Figures & Evaluation Curves (4 Images)
Deep Learning Execution Pipeline
(Preprocessing)
(Feature Extraction)
(Self-Attention)
(Loss Optimization)