Skip to content

Shubham91999/GenreSense

Repository files navigation

🎵 GenreSense

An AI-powered music classification system that bridges the gap between machine learning and modern web experiences. GenreSense uses a custom-trained Logistic Regression model to identify musical genres in real-time, integrated with the YouTube Music API for seamless track discovery and playback.


📱 Visual Overview

1. Dynamic Search & Discovery

GenreSense Home

Immersive Hero section with integrated search entry points.


2. Real-time Music Search

Search Results

Lightning-fast search results powered by the YouTube Music API.


3. ML-Powered Genre Analysis

Genre Prediction

Detailed breakdown of features and genre probabilities processed by our Logistic Regression model.


🧠 The ML Core

The classification engine is built on a Logistic Regression model optimized with Principal Component Analysis (PCA).

  • Dimensionality Reduction: We use PCA to compress 12 high-fidelity audio features (Tempo, Dynamics, Vocal Presence, etc.) while preserving 95% of the variance.
  • Accuracy: Optimized pipeline achieving ~84.6% accuracy on the target dataset.
  • Preprocessing: Robust pipeline using StandardScaler for normalization and LabelEncoder for target variables.

🛠️ Tech Stack

Full Stack Engineering

  • Frontend: Next.js 15+ (App Router), TypeScript, Framer Motion (Animations), TailwindCSS.
  • Backend: FastAPI (Python), RESTful API Design, CORS Middleware.
  • Audio Integration: YouTube Music API (ytmusicapi) & ReactPlayer.

Machine Learning

  • Libraries: Scikit-Learn, Pandas, NumPy.
  • Serialization: Joblib (Model persistence).

Infrastructure & DevOps

  • Containerization: Docker & Docker Compose (Multi-stage builds).
  • Deployment: Render (Blueprints/Infrastructure as Code).
  • CI/CD: Environment synchronization and standalone production builds.

📂 Architecture

├── backend/               # FastAPI + ML Inference Engine
│   └── models/            # Serialized ML Artifacts (Pickles/Joblib)
├── genresense/            # Next.js 15 Frontend (Static Export)
├── Dockerfile             # Unified Root Build (Multi-stage)
├── classification.ipynb   # Research, EDA & Model training
└── render.yaml            # Single-service Infrastructure as Code

🚀 Getting Started

Local Environment

# Backend (FastAPI)
cd backend && pip install -r requirements.txt
uvicorn main:app --port 8000

# Frontend (Next.js)
cd genresense && npm install
npm run dev

Production Deployment

This project is optimized for a single-container deployment.

  1. Connect your GitHub repository to Render.
  2. Select Web Service.
  3. Render will automatically detect the root Dockerfile and deploy both the AI Backend and the UI as a single service.

🧑‍💻 Author

Shubham Kulkarni
Full Stack Software Engineer & ML Enthusiast

Bridging the gap between complex data models and beautiful user interfaces.

🔗 LinkedInGitHub


If you see potential in this project, feel free to give it a star! 🌟

About

An AI-powered music classification system. Effortlessly search, play, and identify music genres using a custom PCA + Logistic Regression pipeline. Built with FastAPI, Next.js, and Docker.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors