Rainfall, also known as precipitation, is crucial for environmental stability. Accurate precipitation monitoring is vital for weather forecasting and creating early flood warning systems. In this project we have developed an acoustic rain gauge that estimates rainfall by using sound as input data.
Figure 1: Experiment setup
The setup guide can be found here.
Davis AeroCone 6466M Rain Gauge - The mechanical rain gauge used as a reference for comparing rainfall against acoustic readings.
Raspberry Pi - Used as a DAQ device for high-resolution and high-sampling-rate audio recording.
The USB mic captures audio files saved in WAV format with a fixed duration. The parameters for the audio files (e.g., sampling rate, sample duration, bit size, total recording time, etc.) can be set in the config.yaml
file. The recorded audio files are analyzed for deep learning modeling.
The recorded WAV files are saved with a timestamp (yyyy_mm_dd_hh_mm_ss_millisec.wav
) as shown below:
2023_11_06_16_13_11_011224.wav
daq_pi.py
and davis_logger.py
- These are the main script files for data acquisition and model inference. daq_pi.py
is used for automated audio recording on Raspberry Pi and model inference. davis_logger.py
logs data from the Davis rain gauge using the Raspberry Pi's GPIO pins. These scripts can be initiated with the nohup
command or by adding them to the ~/.bashrc
profile.
If added to the ~/.bashrc
profile, the script will run everytime the device boots up/user logs in/terminal opened. nohup home/pi/raingauge/code/daq_pi.py &
nohup /home/pi/raingauge/code/davis_logger.py &
OR
nano ~/.bashrc
# Appened the following line to the end of .bashrc file
python3 /home/pi/raingauge/code/daq_pi.py & python3 /home/pi/raingauge/code/davis_logger.py
# Reboot the device
sudo reboot
mech_vs_non_mech_dataset_creation.ipynb
contains the Kaggle script to combine wave files recorded along with mechanical rain gauge data to create training data for deep learning modeling.
seq_mech_vs_non_mech.ipynb
contains the LSTM modeling code which uses acoustic and mechanical data for rainfall estimation
Epochs | Model | Features | MAPE | R² | Correlation |
---|---|---|---|---|---|
25 | LSTM | STFT | 15.76% | 0.9683 | 0.9033 |
25 | LSTM | Chroma | 45.15% | 0.9700 | 0.1982 |
25 | LSTM | MFCC | 96.53% | 0.3418 | 0.4469 |
Table 1: Performance of LSTM model on various features
This project is licensed under the MIT License - see the LICENSE file for details.
You can find us at:
ICFOSS
Greenfield Stadium,
Opposite University of Kerala Campus, Karyavattom,
Thiruvananthapuram, Kerala 695581
For more information, visit our website.