Giter Site home page Giter Site logo

kunalvaidya99 / music-genre-classification Goto Github PK

View Code? Open in Web Editor NEW
25.0 1.0 12.0 30.65 MB

Music Genre Recognition App With Accuracy of 89%.

Home Page: http://ec2-3-134-82-239.us-east-2.compute.amazonaws.com:8501/

License: GNU General Public License v3.0

Jupyter Notebook 98.51% Python 1.44% Shell 0.05%
dnn deep-neural-networks music-genre-classification genre

music-genre-classification's Introduction

Music-Genre-Classification

Music Genre Classification using GTZAN Dataset.Here is the Link to Dataset GTZAN Dataset

I Made a Web App using Streamlit For the Convolutional Neural Network (CNN) Model and Deployed it on Amazon EC2 Streamlit App

The Dataset contains 10 Genres of music :

Genres

  • Blues
  • Classical
  • Country
  • Disco
  • Hip-Hop
  • Jazz
  • Metal
  • Pop
  • Reggae
  • Rock

Dataset

  • Each Genre contains 100 audio files each of duration 30s.
  • Divided 30s audio files into 10 files of 3s each.
  • This Data Augmentation really helps model learn better and it performes better on the test set.

Models

I have explored the problem using two approaches

  1. Using Deep Neural Network (DNN) Model which made use of features such as MFCC's,spectral centroids, extracted features are in features_3sec.csv
  2. Using Convolutional Neural Network (CNN) Model which made use of Mel Spectrogram of the Audio Files.

Results

Training Loss Plot

So this the training and test accuracy obtained after 250 epochs. A simple DNN model is also showing quite good test accuracy due to data augmentation

music-genre-classification's People

Contributors

kunalvaidya99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

music-genre-classification's Issues

Epoch 1/70 12/22 [===============>..............] - ETA: 8s - loss: 0.4481 - accuracy: 0.8300 - get_f1: 0.8416 --------------------------------------------------------------------------- UnidentifiedImageError Traceback (most recent call last) <ipython-input-39-b2a011903e5a> in <module>() ----> 1 model.fit_generator(train_generator,epochs=70,validation_data=vali_generator) 12 frames /usr/local/lib/python3.6/dist-packages/PIL/Image.py in open(fp, mode) 2860 warnings.warn(message) 2861 raise UnidentifiedImageError( -> 2862 "cannot identify image file %r" % (filename if filename else fp) 2863 ) 2864 UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7ff9217a4af0>

Screenshot (23)

Music Genre classification using cnn

Error in
y,sr = librosa.load('/content/gdrive/My Drive/kunal/genres/blues/blues.00020.wav')

RuntimeError: Error opening '/content/gdrive/My Drive/kunal/genres/blues/blues.00020.wav': System error.
image

NameError: name 'X_test' is not defined

preds = model.evaluate(x=X_test,y=Y_test)
print(preds[1])
print(preds[2])
when i ran this code it showed
NameError: name 'X_test' is not defined
how to solve it

issue with data generator

train_dir = "/content/gdrive/My Drive/spectrograms3sec/train/"
train_datagen = ImageDataGenerator(rescale=1./255)
train_generator = train_datagen.flow_from_directory(train_dir,target_size=(288,432),color_mode="rgba",class_mode='categorical',batch_size=128)

validation_dir = "/content/gdrive/My Drive/spectrograms3sec/test/"
vali_datagen = ImageDataGenerator(rescale=1./255)
vali_generator = vali_datagen.flow_from_directory(validation_dir,target_size=(288,432),color_mode='rgba',class_mode='categorical',batch_size=128)
output: Found 0 images belonging to 3 classes.
Found 0 images belonging to 3 classes.
why is so?

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.