Skip to content

TinyPART/TinyChirp

Repository files navigation

TinyChirp

If you cite this work, please cite the below reference:

Z. Huang, A. Tousnakhoff, P. Kozyr, R. Rehausen, F. Bießmann, R. Lachlan, C. Adjih, E. Baccelli. TinyChirp: Bird Song Recognition Using TinyML Models on Low-power Wireless Acoustic Sensors, in Proceedings of the IEEE International Symposium on the Internet of Sounds. Erlangen, Germany, September 2024. [Preprint]

Get Source Code

It is important to clone the submodules along, with --recursive option.

git clone --recursive git@github.com:TinyPART/TinyBirdSounds.git

Or open the git shell after clone, and type the following command.

git submodule init
git submodule update

Prequisites

This Repo is tested under:

  • Linux Mint 21.1 (5.15.0-58-generic)
  • Python 3.10.8

Prepare for datasets

please refer to datasets/README.md

Prepare for model training and evaluation

(under construction...)

(Optional) Prepare for measuring resource consumption

  1. Get RIOT: please refer to the RIOT's repo.
  2. Get RIOT_ML: please refer to the RIOT-ML repo.
  3. Install ARM-Toolchain: please refer to https://doc.riot-os.org/getting-started.html#the-build-system

Pilot Study

To reproduce the results, please refer to pilot/pilot_analysis.ipynb.

Also it shows the performance of baseline and power-saving.

Evaluation of TinyML Models

Executing TinyChirp Models

If you installed RIOT_ML you can execute models on a PC (native) or on a board.

Before model execution set the environment variable to tell python where to find the packages:

export TVM_HOME={path-to-tvm-base-dir}
export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}

optionally:

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6:$LD_PRELOAD

TFLite models

Use native to run directly on a PC or specify board:

cd RIOT-ML/
python u-toe.py --per-model --board native {path-to-tinychirp-base-dir(TinyBirdSounds)}/tinyml_models/CNN_Mel/cnn_mel_spec_16kHz_full_int_q.tflite

Torch models

CNN-Time example:

cd {path-to-tinychirp-base-dir(TinyBirdSounds)}/tinyml_models/CNN_Time/deployment/streaming_cnn/

If you run directly on a PC (native):

make BOARD=native
make BOARD=native term

If you run on a board (e.g. microbit-v2):

make BOARD=microbit-v2 flash
make BOARD=microbit-v2 term

Classification Performance

To reproduce the results, please refer to evaluate/evaluate.ipynb.

Resource Consumption

(under construction...)

Repo Structure

├── artifacts   # different trials...
├── baseline    # Implementation of Baseline in C
├── datasets    # Datasets from kaggle
├── evaluate    # Jupyter notebook for classification evaluation
├── mel_spectrogram # Implementation of Mel-Spectrogram
├── pilot # Jupyter notebook for pilot study
└── tinyml_models # Models and their implementations in C
    ├── CNN_Mel
    ├── CNN_Time
    ├── SqueezeNet_Mel
    ├── SqueezeNet_Time
    ├── Transformer_Time
    └── utils # Dataloader, mel-transformer etc.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •