<ARYA/>
← All projects

2023

Music Genre Bot

Telegram bot for music classification

PythonTensorFlow 2.0LibrosaTelegram Bot APINeural Networks

Overview

An open-source Telegram bot that classifies music files by genre using a trained neural network. Users 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 is tedious to do manually and inconsistent at scale. The goal was a bot anyone could send a music file to and instantly get a genre classification — without needing any 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 — supports multiple formats and varying 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 varies significantly by file format and encoding. Getting consistent input representations across different music files required careful preprocessing normalization.

What I Learned

Audio ML is surprisingly sensitive to preprocessing quality. Model performance improved significantly when feature extraction was standardized — architecture was a secondary concern.