Tiny Transformers for Environmental Sound Classification at the Edge

David Elliott, Carlos E. Otero, Steven Wyatt, Evan Martino
3/22/2021
cs.SDcs.LGeess.AS
transformer-attention

Official code: ai-techsystems/deepC (605 stars, C++, Apache-2.0, ONNX, last commit 2025-07-22).

Abstract

With the growth of the Internet of Things and the rise of Big Data, data processing and machine learning applications are being moved to cheap and low size, weight, and power (SWaP) devices at the edge, often in the form of mobile phones, embedded systems, or microcontrollers. The field of Cyber-Physical Measurements and Signature Intelligence (MASINT) makes use of these devices to analyze and exploit data in ways not otherwise possible, which results in increased data quality, increased security, and decreased bandwidth.

Show full abstract

However, methods to train and deploy models at the edge are limited, and models with sufficient accuracy are often too large for the edge device. Therefore, there is a clear need for techniques to create efficient AI/ML at the edge. This work presents training techniques for audio models in the field of environmental sound classification at the edge. Specifically, we design and train Transformers to classify office sounds in audio clips. Results show that a BERT-based Transformer, trained on Mel spectrograms, can outperform a CNN using 99.85% fewer parameters. To achieve this result, we first tested several audio feature extraction techniques designed for Transformers, using ESC-50 for evaluation, along with various augmentations. Our final model outperforms the state-of-the-art MFCC-based CNN on the office sounds dataset, using just over 6,000 parameters -- small enough to run on a microcontroller.

View on arXivView PDF

Code Implementations(1)

ONNXApache-2.0

vendor independent TinyML deep learning library, compiler and inference framework microcomputers and micro-controllers

60593C++, FortranJun 22, 20191 years agoApache-2.0
arduinoarduino-nano-33-ble-sensearm64deep-learningedge-devices+14 more

Similar Papers

Cite this paper

@article{elliott2021tiny,
  title  = {Tiny Transformers for Environmental Sound Classification at the Edge},
  author = {David Elliott and Carlos E. Otero and Steven Wyatt and Evan Martino},
  year   = {2021},
  eprint = {2103.12157},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.12157}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2103.12157.svg)](https://codeofpaper.com/paper/2103.12157)

Discussion