We have worked on detecting the UAV’s DOA with a single node, which consists of two acoustic sensors and a Raspberry Pi, to overcome an acoustic sensor limitation through combining machine learning mechanisms (CNN, CRNN, ResNet50).
All details of this study are explained on materials listed below.
What things you need to install the software and how to install them:
-
Python 3.6
- This setup requires that your machine has python 3.6 installed on it. you can refer to this url https://www.python.org/downloads/ to download python. Once you have python downloaded and installed, you will need to setup PATH variables (if you want to run python program directly, detail instructions are below in how to run software section). To do that check this: https://www.pythoncentral.io/add-python-to-path-python-is-not-recognized-as-an-internal-or-external-command/.
- Setting up PATH variable is optional as you can also run program without it and more instructon are given below on this topic.
-
Second and easier option is to download anaconda and use its anaconda prompt to run the commands. To install anaconda check this url https://www.anaconda.com/download/
-
You will also need to download and install below 3 packages, 2 libraries after you install either python or anaconda from the steps above.
- pytorch
- librosa
- numpy
- scipy
- tqdm
- If you have chosen to install python 3.6 then run below commands in command prompt/terminal to install these packages
pip3 install torch torchvision
pip install librosa
pip install numpy
pip install scipy
pip install tqdm
- If you have chosen to install anaconda then run below commands in anaconda prompt to install these packages, libraries
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
conda install -c conda-forge librosa
conda install -c anaconda numpy
conda install -c anaconda scipy
conda install -c conda-forge tqdm
You can use dataset collected in person. There are 3 stages for preparing dataset.
- Extract UAV's audio from entire recorded audio file (wav format).
- Augment the extracted audio file.
- Split the augmented audio file into various length.
Those steps will be automatically executed by using the command below when you are on data directory so you can use our dataset for train and test.
./execute.sh
Also you can remove all the dataset with command bleow.
./clear.sh
You can download UAV's raw audio data into rawdata folder under data folder via this link (Download)
We have worked on three neural network models.
- CNN1D: cnn1d.py
- CRNN: cnn-lstm.py
- ResNet50: transfer_learning.py
There are three different data length(0.1, 0.5, 1.0 second) as a input size so length arguments are required. (0.1, 0.5 and 1.0 are ONLY available) If the arguments are more than one, then the models will be triained in a row.
You can train a model with a command below.
python3 [model] [input length]
- Example
python3 cnn1d.py 0.1 0.5 1.0
python3 cnn-lstm.py 0.1
python3 transfer_learning.py 1.0 0.5 0.1
You can inference trained model with inference.py on test set.
You can train a model with a command below.
python3 inference.py [trained model(.pth format)]
- Example
python3 inference.py ../model/Conv_Lstm_mfcc_1_2019-11-19_19:50:20.pth
If you want to inference on Raspberry Pi 3, please check this repository below.
It might help you to install pytorch on Raspberry Pi 3
- Sungyoun Seo(pleiades-s) - Audio data processing, Neural network models
- Seunghyun Yeo(yeoseunghyun) - Audio data processing, Acoustic node
- ksanjeevan inspires us with its model architecture.
- Junwon Hwang helps technical details for audio classification.
If you have any question, please email me or write an issue. Any questions are welcome :)