Giter Site home page Giter Site logo

harshgupta1810 / audio_classification- Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.42 MB

This project is an implementation of audio classification using Mel-Frequency Cepstral Coefficients (MFCC) and Neural Networks

Jupyter Notebook 98.84% Python 0.14% HTML 1.01%
artificial-intelligence audio-classification deep-learning mfccs nuralnetwork tensorflow

audio_classification-'s Introduction

Audio Alchemy: Audio Classification using MFCC and Neural Networks

This project is an implementation of audio classification using Mel-Frequency Cepstral Coefficients (MFCC) and Neural Networks. Uncover impressive performance metrics and practical real-world applications of our audio classification project.

Dataset Description

The dataset used for this project is the UrbanSound8K dataset, which contains 8732 labeled sound excerpts (<=4s) of urban sounds from 10 classes: air_conditioner, car_horn, children_playing, dog_bark, drilling, engine_idling, gun_shot, jackhammer, siren, and street_music. The classes are drawn from the urban sound taxonomy. The audio files are pre-sorted into ten folds (folders named fold1-fold10) to help in the reproduction of and comparison with the automatic classification results.

Dataset Source

The dataset can be downloaded from Kaggle using the following command:

kaggle datasets download -d chrisfilo/urbansound8k

Table of Contents

  1. Project Name
  2. Dataset Description
  3. Table of Contents
  4. frontend
  5. Project Demo
  6. Installation
  7. Usage
  8. Configuration
  9. Contributing)

Frontend for Audio Classification

This is the frontend part of the Audio Classification project. It consists of a Flask web application (app.py) and an HTML template (index.html) for audio classification.

app.py

This Flask web application serves as the backend for the audio classification. It loads the trained model and provides an endpoint for audio prediction.

Project Setup

  1. Install the required libraries using pip.
pip install flask tensorflow numpy librosa
  1. Save the trained model as final_model1.h5 in the same directory as app.py.

Code Explanation

  • The Flask application loads the trained model using tf.keras.models.load_model.
  • It defines two routes - / for rendering the main page and /predict for handling audio classification.
  • When a POST request is made to /predict, it reads the audio file from the request, extracts MFCC features, and performs audio classification using the loaded model.
  • The predicted class label is returned as the response.

index.html

This HTML template creates a simple web page for audio classification. Users can either drag and drop an audio file or select it using the file input. The predicted class label will be displayed, and the audio will be played on the page.

Code Explanation

  • The template uses CSS styles for styling and responsiveness.
  • It contains a drop area where users can drag and drop the audio file or use the file input to upload.
  • The JavaScript code handles the file upload, sends it to the backend for classification, and displays the predicted class label on the page.
  • The predicted class label is shown in a result div, and the audio is played using the audio element.

Note: This frontend is designed to work with the backend code provided earlier. Make sure to run the Flask web application (app.py) to use this frontend for audio classification.


Frontend code designed and developed by Harsh Gupta (Desperate Enuf).

Project Name

Audio Alchemy : Audio Classification using MFCC and Neural Networks

Project Demo

video Demo

demo

frontend photos

f f1

Installation

  1. Clone the repository to your local machine.
git clone <https://github.com/harshgupta1810/Audio_Classification>

Usage

  1. Download the UrbanSound8K dataset from Kaggle using the provided command.

  2. Run the Jupyter notebook audio_classification.ipynb to preprocess the audio data, extract MFCC features, and create and train the neural network model.

  3. To use the trained model for prediction, load the saved model and pass an audio file through it. An example of doing this is given in the last section of the Jupyter Notebook.

Contributing

If you wish to contribute to this project, please follow the guidelines below:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes with descriptive commit messages.
  4. Push your changes to your forked repository.
  5. Create a pull request to the original repository.

Designed and developed by Harsh Gupta (Desperate Enuf).

audio_classification-'s People

Contributors

harshgupta1810 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.