2023
Music Genre Bot
Telegram bot for music classification
Overview
An open-source Telegram bot that classifies music files by genre using a trained neural network. You send an audio file via Telegram, the bot extracts audio features with Librosa, runs them through the model, and returns the predicted genre.
The Problem
Genre tagging by hand is tedious and inconsistent at scale. I wanted a bot you could send a music file to and get a genre back, with no software beyond Telegram.
My Role
Designed the full ML pipeline from data preprocessing to model training, and built the Telegram bot interface and deployment packaging.
Key Features
- —Audio file input via Telegram, across multiple formats and song lengths
- —Librosa-powered audio feature extraction (MFCCs, chroma, spectral centroid)
- —TensorFlow 2.0 neural network trained on genre classification (Rock, Pop, Jazz, Classical, and more)
- —Modular codebase: bot.py, preprocess.py, and neural_network.py
- —Real-time genre prediction sent back to the user in the chat
Challenges
Audio feature extraction quality swings with file format and encoding. Getting consistent input representations across different music files took a lot of preprocessing normalization.
What I Learned
Preprocessing quality mattered more than architecture here. Standardizing feature extraction moved the accuracy further than any change I made to the model.