Giter Site home page Giter Site logo

few-shot-kws's Introduction

Code Repository for the paper Few-Shot Keyword Spotting with Prototypical Networks.

Few-Shot Keyword Spotting Pipeline

Installation

  1. Clone the repository:

    git clone https://github.com/ArchitParnami/Few-Shot-KWS 
    
  2. Create a conda environment:

    conda create -n FS-KWS
    
  3. If pip not installed, install pip by:

    conda install pip
    
  4. Install the required packages:

    pip install -r requirements.text
    
  5. Install the protonets package:

    cd Few-Shot-KWS
    python setup.py develop
    

Download & Prepare Few-Shot Keyword Spotting Dataset

cd Few-Shot-KWS/data/
python download_prepare_data.py

Train

To train a simple 2-way 1-shot experiment.

cd Few-Shot-KWS/scripts/train/few-shot/fewshotspeech
./train.sh 2 1 0 mymodel

Specify arguments to train.sh in the following manner

train.sh num_ways num_shots exp_type exp_id

  • num_ways
    • Number of classes
    • Eg. 2 or 4
  • num_shots
    • Number of samples per class.
    • Eg. 1,5
  • exp_type
    • Number indicating the type of experimental setup
      • 0 = Simple N-Way K-Shot Setup. No background, silence or unknown keywords.
      • 1 = Include Background
      • 2 = Include Silence
      • 3 = Include Unknown
      • 4 = Background + Silence
      • 5 = Background + Unkown
      • 6 = Unknown + Silence
      • 7 = Background + Silence + Unknown
  • exp_id
    • identifier = directory name
    • results are saved in Few-Shot-KWS/scripts/train/few-shot/fewshotspeech/results/[exp_id]

Evaluate

cd Few-Shot-KWS/scripts/predict/few-shot
python eval_results.py ../../train/few_shot/fewshotspeech/results/

The evaluation can be found in:

cat Few-Shot-KWS/scripts/train/few-shot/fewshotspeech/results/[exp-id]/[timestamp]/eval.txt

Results

Comaring test accuracy of different embedding networks on 4-way FS-KWS as we increase the number of support examples. The results are presented for four different cases discussed in the paper.

References

The code in this repository has been adapted from:

  1. https://github.com/jakesnell/prototypical-networks
  2. https://github.com/hyperconnect/TC-ResNet
  3. https://github.com/tensorflow/docs/blob/master/site/en/r1/tutorials/sequences/audio_recognition.md

Citation

@misc{parnami2020fewshot,
    title={Few-Shot Keyword Spotting With Prototypical Networks},
    author={Archit Parnami and Minwoo Lee},
    year={2020},
    eprint={2007.14463},
    archivePrefix={arXiv},
    primaryClass={eess.AS}
}

few-shot-kws's People

Contributors

architparnami avatar liux-pro 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.