Skip to content

MTG/sens-sensor

Repository files navigation


Logo

The Smart Environmental Noise System (SENS) is an advanced sensor technology designed for real-time acoustic monitoring, with a focus on urban environments. Built on a Raspberry Pi platform, SENS captures sound continuously and processes it locally using custom-developed software based on small and efficient artificial intelligence algorithms. SENS calculates acoustic parameters, including Sound Pressure Level (SPL), and makes predictions of the perceptual sound attributes of pleasantness and eventfulness (ISO 12913), along with detecting the presence of specific sound sources such as vehicles, birds, and human activity, among others. To safeguard privacy, all processing occurs directly on the device in real-time ensuring that no audio recordings are permanently stored or transferred. Additionally, the system transmits the extracted audio representation through the wireless network to a remote server, made possible using mobile data connectivity. SENS technology represents an innovative step in environmental noise monitoring, offering real-time processing and robust privacy protection. A single SENS device or a network of them could serve as a powerful tool for understanding the acoustic characteristics of soundscapes with efficiency and flexibility.

About The Project

This work was supported by the project ''Soundlights: Distributed Open Sensors Network and Citizen Science for the Collective Management of the City's Sound Environments'' (9382417), a collaboration between the Music Technology Group (Universitat Pompeu Fabra) and Bitlab Cooperativa Cultural.

It is funded by BIT Habitat (Ajuntament de Barcelona) under the program La Ciutat Proactiva; and by the IA y Música: Cátedra en Inteligencia Artificial y Música (TSI-100929-2023-1) by the Secretaría de Estado de Digitalización e Inteligencia Artificial and NextGenerationEU under the program Cátedras ENIA 2022.

Logo Logo Logo Logo

(back to top)

Reference

  • Amaia Sagasti, Martín Rocamora, Frederic Font: Prediction of Pleasantness and Eventfulness Perceptual Sound Qualities in Urban Soundscapes - DCASE Workshop 2024 Paper link DCASE webpage
  • Amaia Sagasti Martínez - MASTER THESIS: Prediction of Pleasantness and Eventfulness Perceptual Sound Qualities in Urban Soundscapes - Sound and Music Computing Master (Music Technology Group, Universitat Pompeu Fabra - Barcelona) Master Thesis Report link Zenodo

Environment set up

This section provides all the necessary information to set up the working environment.

NOTE: This project is only compatible with 64-bit RaspberryPi architecture. Check your architecture by opening a terminal and running:

uname -m

If the output is aarch64, you have a 64-bit ARM architecture --> COMPATIBLE

The followiing list details the set up process:

1) Download and install Python=3.10.14

Python 3.10.14 download web.

Follow instructions below (or link)

sudo apt-get update

sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev

wget https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tar.xz # or download directly from link above

# Navigate to directory where download is
tar -xvf Python-3.10.14.tar.xz

cd Python-3.10.14

./configure --enable-optimizations # be patient

make -j 4 # be waaay more patient here

sudo make altinstall

python3.10 --version # to verify installation

2) Install dependencies

It is recommended to create a virtual environment. Example with venv:

# Go to home directory

/usr/local/bin/python3.10 -m venv my_env

# to activate
source my_env/bin/activate

# to deactivate
my_env deactivate

This code uses LAION-AI's CLAP model. Install CLAP with:

git clone https://github.com/LAION-AI/CLAP.git

Finally, install sens-sensor specific requirements. For that, navigate your terminal to the SENS project folder and run:

cd sens-sensor

pip install -r requirements.txt

Now you are ready to start using sens-sensor repository.

(back to top)

Raspberry Pi device information

This project is implemented in a RaspberryPi model B. The device has a microphone connected as well as a Mobile Network Module with a SIM card. Additionally, three LED pins are connected.

Run code

The following three images indicate the 3 main processes that create SENS working. Each process is executed through a different python script that is called in different terminal windows.

audio capture process

audio processing process

result sending process

NOTE: All inputs indicated in orange color indicate that they are defined in parameters.py This file contains all the configuration parameters, variables and paths to the necessary files.

Other scripts

Together with the three main scripts, we provide extra code for other processes involved in SENS project context but not necessary to be run in the actual developped sensor.

  • simulate_SENS.py: This script simulates SENS sensor on a pre-recorded WAV audio. The input audio is analysed in chunks of audio data. The resulting output are saved in JSON files containing the predictions, Leq and LAeq of each audio chunk.

  • main_send_lib.py: SENS sensor was used in an experiment developed in a library under the framework of a project called SOUNDLIGHTS. This project research how real-time message signs could be use to improve the acoustic quality. The sensor was connected through the wireless network to a LED screen (connected to another RaspberryPi). In this scenario, SENS was calculating SPL and predicting the presence of human activity. This information was sent to the LED screen together with a threshold value using this script. The LED screen interpreted the message and prompted different messages, with the goal to influence people behaviour inside the library. Additionally, the sensor through main_send_lib.py also sends the resulting predictions to the remote server.

License

See LICENSE for more information.

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •