Tensorflow-Audio-Classification icon indicating copy to clipboard operation
Tensorflow-Audio-Classification copied to clipboard

Audio classification with VGGish as feature extractor in TensorFlow

Audio Classification

Classify the audios. In this repo, I train a model on UrbanSound8K dataset, and achieve about 80% accuracy on test dataset.

There is a pre-trained model in urban_sound_train, trained epoch is 1000

Usage

  • audio_train.py: Train audio model from scratch or restore from checkpoint.
  • audio_params.py: Configuration for training a model.
  • audio_inference_demo.py: Demo for test the trained model.
  • ./audio/*: Dependencies of training, model and datasets.
  • ./vggish/*: Dependencies of VGGish for feature extracting.

Env setup

Conda are recommended, just need one line: conda env create -f conda.env.yml

Train & Test

  1. Config parameters: audio_params.py.
  2. Train the model: python audio_train.py. (It will create tfrecords automaticly if not exists)
  3. Check the training process from tensorboard: tensorboard --logdir=./data/tensorboard
  4. Test the model: python audio_inference_demo.py.

Tools

Dataset

Ref. Blogs