Skip to content

mezone1994/predictify

Repository files navigation

🎧 Predictify - Urban Sound Classification with Machine Learning

Predictify is a full-stack AI-powered web application that identifies types of urban sounds (like sirens, dog barks, or drilling) from audio files using a trained machine learning model. Users can upload an audio clip through a modern UI, and the app will analyze and predict the sound type using Python and a Random Forest model.


🌟 Key Features

  • 🎙 Upload and analyze audio files (MP3, WAV, etc.)
  • 🤖 Real-time machine learning prediction using Python
  • 🧠 Trained with UrbanSound8K dataset
  • 💡 Dual feature extraction: MFCC + Mel Spectrogram
  • 🕹 Interactive and animated frontend with React + Lottie
  • 🌙 Light/Dark mode toggle
  • 📁 Audio upload history and playback

🛠 Tech Stack

Layer Technology
Frontend React, Framer Motion, Lottie
Backend Node.js, Express, Multer
ML Model Python, Librosa, Scikit-learn
Dataset UrbanSound8K

🚀 Quick Start

1. Clone the repository

git clone https://github.com/mezone1994/predictify.git
cd predictify

2. Setup Backend

cd Backend
npm install
node server.js

3. Setup Frontend

cd ../client
npm install
npm start

4. Train ML Model

cd ../
python preprocessing/preprocessing.py

📁 Project Structure

predictify/
│
├── Backend/                # Node.js server files
│   ├── controllers/        # Controller logic
│   ├── models/             # Python execution logic
│   ├── routes/             # Express routes
│   └── server.js           # Main server file
│
├── client/                 # React frontend
│   ├── App.js              # Main React app
│   └── TeamModal.js        # Team member info modal
│
├── preprocessing/          # Feature extraction and model training
│   └── preprocessing.py    # Full training script
│
├── uploads/                # Uploaded audio files
├── deploy.py               # Predicts class of uploaded file
├── voice_processing_model.pkl  # Saved ML model
├── *.csv                   # Processed training/validation/test data
├── UrbanSound8K/           # Dataset and metadata
└── README.md

🧪 How Prediction Works

  1. Audio file is uploaded via React and sent to Express.
  2. File is saved in /uploads using Multer.
  3. deploy.py is executed from Node.js using child_process.spawn().
  4. Python:
    • Loads the .pkl model
    • Extracts MFCC features
    • Predicts class using Random Forest
    • Returns class ID, label, and description
  5. Node parses result and sends it to the React frontend.

🧠 Model Training Overview

Step-by-step (in preprocessing.py):

  • Extract MFCC or Mel Spectrogram from UrbanSound8K.
  • Save datasets as:
    • training_file_method1.csv
    • validation_file_method1.csv
    • testing_file_method1.csv
  • Train two Random Forest models (one for each method).
  • Evaluate and compare them.
  • Save the best performing model as voice_processing_model.pkl.

🔉 Example Sound Classes

ID Label Description
0 air_conditioner Humming of an AC unit
1 car_horn Beep sound of a car horn
2 children_playing Laughter and playful noises from kids
3 dog_bark Woof or yap from a dog
4 drilling Mechanical sound of a drill
5 engine_idling Car engine running while parked
6 gun_shot Loud sharp sound of a firearm
7 jackhammer Percussive drilling noise
8 siren Emergency siren wail
9 street_music Outdoor music performance

📷 UI Preview

Preview


📚 References


👨‍💻 Developed By

*Group 13 - Mcmaster Students


📄 License

MIT License © 2025 Moayed Mahmoud
Free to use and modify with credit.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors