DSAIL Bioacoustics System

A Raspberry Pi based acoustic sensor.

Introduction

Climate change and human expansion have resulted in degradation of the biosphere. This has posed a great threat to biodiversity. Africa has one of the most diverse fauna on the globe. Uncontrolled human activities and the fact that the effects of climate change are most felt within the tropics means the rich biodiversity is at risk. This calls for increased conservation efforts.

To effectively conserve ecosystems, we need to monitor their current states and the changes taking place in them. This means that we need to collect data from them and analyse it. Traditionally, data is collected from ecosystems by carrying out physical surveys. This is where ecologists and researchers go to the field to observe the ecological community in its natural state. Due to the extensive nature of the environment, physical surveys require a lot of human labour and are, therefore, expensive. This makes it hard to carry them out continuously and hence are done periodically. Therefore, we have to devise other efficient ways of collecting data continuously from the ecosystems.

Acoustic monitoring of animals is one of the non-invasive methods of monitoring wildlife continuously. The method entails recording sounds of animals in a given habitat and analysing them to determine the presence of a given species [1] . Animals produce characteristic calls that can be used to identify them using the recordings only [2] . An expert taking a walk in the park can tell different animals from the sound they produce only even without seeing them.

Advancement in technology has seen development of handheld devices that can be used to record sound. Using these devices, we can develop acoustic sensor systems and deploy them in the field to collect acoustic data. This will enable us to continuously monitor our ecosystems remotely.

At the Centre for Data Science and Artificial Intelligence (DSAIL), Dedan Kimathi University of Technology, we have developed a Raspberry Pi based acoustic sensor that will be used in acoustic monitoring of bird species. In the following sections, I will describe the acoustic sensor.

DSAIL Bioacoustics System

The DSAIL Bioacoustics System is a Raspberry Pi based acoustic sensor that was developed at DSAIL. The system was developed with the aim to collect acoustic data of birds and also perform automatic classification of birds from their vocalizations. Currently, we have been able to successfully deploy the system at Dedan Kimathi University of Technology Conservancy for data collection. We are looking forward to coming back to narrate the story of how we have successfully classified various birds at our conservancy.

Back to what this blog is about, the DSAIL Bioacoustics System can be divided into two; hardware and software. The hardware is the physical part of the system whereas the software is a set of instructions that control the performance of the hardware. Now, let us dive into each of these components and see how they complete the system

Hardware

The main parts that make up the hardware are the Raspberry Pi, power source, power supply board, the microphone and mounting mast.

i. The Raspberry Pi

The Raspberry Pi is an inexpensive single board computer that was developed as an educational tool but has found broad applications. The Raspberry Pi is the central device that controls the acoustic sensor and is used to record and save audio.

ii. Power source

Our acoustic sensor will almost always be deployed far away from the from the grid. This means we have to look for alternative means of powering the system. The system is powered using a solar power system that comprises a solar panel and a battery. The solar panel is used to convert solar energy into electricity that is stored in the battery. The stored energy is used to power the system even in absence of the sun. Kenya sits right at the equator and, therefore, receives ample sunshine throughout the year which means our system can run for a very long period without the battery running out of juice.

iii. Power supply board

This was one of the most important parts of the design. Sun as a source of energy is characterized by intermittence like most of the other renewable sources of energy. Intermittency in solar energy is brought about by days that are cloudy and nights when there is no sunlight. Therefore, there is a need to continuously monitor the status of the battery to prevent the Raspberry Pi shutting down due to the battery getting drained. Shutting the Raspberry Pi abruptly due to loss of power may result in corruption of its storage.

The power supply board was designed to enable the Raspberry Pi to monitor the level of the battery and make an informed decision of when to shut down i.e. when the battery voltage drops to the cut-off voltage. The board is also able to switch the Raspberry Pi back on after the battery has been recharged. This was a milestone achievement in that one can deploy the system and leave it in the wild for a long period without having to worry about power fluctuations affecting the system. Ideally it is a fit and forget system if you could ask me.

iv. USB microphone

The USB microphone is used together with the Raspberry Pi to record sound. The USB microphone used has a soundcard to sample the sound and feed it to the Raspberry Pi. The Raspberry Pi does not take in analog inputs hence the choice of the microphone.

v. Mounting mast

This is the structure used to hold the system during deployment. The mast is a long metal rod and it has an adapter box attached to it to house the acoustic sensor and a rail on top where the solar panel rests.

Responsive image

Figure 1: The acoustic sensor at DSAIL Lab

Responsive image

Figure 2: The power supply board

Responsive image

Figure 3: The acoustic sensor deployed at the conservancy.

Software

For our acoustic sensor, we have developed two main programs to control the operation of the hardware. The first program is the power management program and the second one is the audio data collection program. In the following sections, we will go through the two programs.

i. Power management program

This is the program responsible for enabling the Raspberry Pi to control the Power supply board. The program enables the Raspberry Pi to monitor the status of the battery and to initiate the shutdown protocol of the entire system whenever the battery voltage gets to the cut-off voltage. The program also sets an alarm on the DS3231 alarm incorporated in the power supply board to wake the Raspberry Pi later after the battery has been recharged. Currently, the system is also designed to operate for a certain period of time during the day. Therefore, the decision to shutdown the system is based either on the level of the battery or the time of the day.

Responsive image

Figure 4: Power management program flowchart

ii. Audio data collection program

This program enables the Raspberry Pi to record audio. The program is designed such that it makes the Raspberry Pi to stream audio continuously but only saves segments of the stream that contain acoustic activities. This is done by comparing the energy of small blocks of the stream with the mean of energies of blocks of sound recorded during a silent condition. Blocks that exhibit energy that is more than two standard deviations away from this mean are considered to contain acoustic activity and are saved as recordings.

Responsive image

Figure 5: Audio data collection program flowchart

Deployment

After the acoustic sensor and the programs to run it were developed, we deployed it at the conservancy for data collection. We have been able to record about a hundred hours of audio. The data contains sounds of birds and non-birds sounds. We are looking forward to having the data cleaned and annotated and use it in developing machine learning (ML) models for automatic acoustic classification of bird species.

Conclusion

The DSAIL Bioacoustics System is an acoustic system that has been tailored at DSAIL. The system has so far been successfully deployed for acoustic data collection. Soon we will have the acoustic sensor loaded with ML models for acoustic classification of birds and have it out in the field monitoring birds for wildlife conservation. This will greatly beef up the current conservation efforts.

[1] C. Desjonquères, S. Linke and T. Gifford, "Passive acoustic monitoring as a potential tool to survey animal and ecosystem processes in freshwater environments," Freshwater Biology, vol. 65, no. 1, pp. 7--19, 2020.

[2]C. wa Maina, "Listening to the Mountain: Using Audio Recorders to Monitor Forest Birds in Kenya, Nyeri," Medium, 2017.

Publications

[1] G. Kiarie and C. wa Maina, "Raspberry Pi Based Recording System for Acoustic Monitoring of Bird Species," in 2021 IST-Africa Conference (IST-Africa), 2021. View

[2] G. Kiarie, J. Kabi and C. wa Maina, "DSAIL power management board: Powering the Raspberry Pi autonomously off the grid," HardwareX, vol. 12, p. e00337, 2022. View

Technical Reports

[1] G. Kiarie and C. wa Maina, "Raspberry Pi Based Recording System for Acoustic Monitoring of Bird Species," DSAIL Technical Report (DSAIL-2020-001), 2020.