🎵 Trained CNN model for Genre classification on GTZAN dataset [CNN Model: https://github.com/Hguimaraes/gtzan.keras]
In the ./weights/
you can find trained model weights and model architecture.
Also, you can download .h5 file and place it manually to ./weights/ directory using this link.
For test this trained model, you can run python3 predict_vgg16.py
.
Also, if you want to test your custom song or turn off debug messages, you can change code in the get_genre()
's function arguments.
For example, you can input your song path instead default ./audios/classical_music.mp3
path or toggle next boolean function's argument to turn off debug messages.
For train CNN model of deep learning:
- Read the audios as melspectrograms, spliting then into 3s windows with 50% overlaping resulting in a dataset with the size 19000x129x128x1 (samples x time x frequency x channels)**.
- Shuffle the input and split into train and test (70%/30%)
- Train the CNN and validate using the validation dataset
** In the case of the VGG, the channel need to have 3 channels
-
Training (at Epoch 35):
-
Training loss: 0.1283
-
Training accuracy: 0.9596
-
-
Testing:
-
Test loss: 0.3936
-
Test accuracy: 0.8921
-