Official repository for:
Pruning vs XNOR-Net: A ComprehensiveStudy on Deep Learning for AudioClassification in Microcontrollers
- Please follow official repository for ACDNet to prepare the audio datasets for these experiments
- For AudioEvent dataset, the scripts are in this repository audio/resources/ae_
Example: python audio/trainer.py --model_path 'path/to/mini/or/micro/acdnet' --dataset 'esc10 or esc50 or us8k' --data '/path/to/dataset/' --xnor 0 --nClasses 50 --model_name 'file_name_tosave_the_trained_model'
- ACDNet on ESC-10:
python audio/trainer.py --model_path '' --dataset 'esc10' --data '/path/to/dataset/' --xnor 0 --nClasses 10 --model_name 'model_name'
- ACDNet on us8k:
python audio/trainer.py --model_path '' --dataset 'us8k' --data '/path/to/dataset/' --xnor 0 --nClasses 10 --model_name 'model_name'
- ACDNet on AudioEvent (20 class):
python audio/trainer.py --model_path '' --dataset 'audioevent' --data '/path/to/dataset/' --xnor 0 --nClasses 20 --model_name 'model_name'
- Mini-ACDNet on ESC-50:
python audio/trainer.py --model_path 'audio/models/mini_acdnet.pt' --dataset 'esc50' --data '/path/to/dataset/' --xnor 0 --nClasses 50 --model_name 'model_name'
- Micro-ACDNet on ESC-10:
python audio/trainer.py --model_path 'audio/models/micro_acdnet.pt' --dataset 'esc10' --data '/path/to/dataset/' --xnor 0 --nClasses 10 --model_name 'model_name'
- XACDNet on ESC-50:
python audio/trainer.py --model_path '' --dataset 'esc50' --data '/path/to/dataset/' --xnor 1 --nClasses 50 --model_name 'xacdnet_esc50'
- XMicroACDnet on ESC-40:
python audio/trainer.py --model_path 'audio/models/micro_acdnet.pt' --dataset 'esc40' --data '/path/to/dataset/' --xnor 1 --nClasses 40 --model_name 'xmicro_acdnet_esc40'
- XMiniAcdnet on US8k:
python audio/trainer.py --model_path 'audio/models/mini_acdnet.pt' --dataset 'us8k' --data '/path/to/dataset/' --xnor 1 --nClasses 10 --folds_to_train '[1,2]' --model_name 'xmini_acdnet_us8k'
Note: You can use the pretrained micro and mini acdnets files or use your own mini and micro acdnet versions using ACDNet repository
- Update settings
opt.dataset, opt.data, opt.model_path, opt.model_name, opt.split
inaudio/quantization.py
- Run:
python audio/quantization.py
- Create a folder to store the datasets and copy the path
- Update
args.datasetpath
with the copied path inimage/resources/prepare_dataset.py
- Update
args.datasetpath
with the copied path inimage/resources/prepare_dataset_cifar100.py
- Update
args.dataset_path
inimage/resources/settings.py
- To prepare CIFAR-10, run in terminal:
python image/resources/prepare_dataset.py
- To prepare CIFAR-100, run in terminal:
python image/resources/prepare_dataset_cifar100.py
- CIFAR-10:
python resnet/trainer.py --dataset 'cifar10' --icl 0 --classes 10
- CIFAR-100:
python resnet/trainer.py --dataset 'cifar100' --icl 0 --classes 100
- For incremental training (e.g. CIFAR-30):
python resnet/trainer.py --dataset 'cifar100' --icl 1 --classes 30
- CIFAR-10:
python resnet/bin_trainer.py --dataset 'cifar10' --icl 0 --classes 10
- CIFAR-100:
python resnet/bin_trainer.py --dataset 'cifar100' --icl 0 --classes 100
- For incremental training (e.g. CIFAR-30):
python resnet/bin_trainer.py --dataset 'cifar100' --icl 1 --classes 30