A deep learning model for mosquito species and sex classification based on a low-sample-rate raw audio signal. This code is published along with our Tiny MosquitoSong Data such that the readers can reproduce the results from our work.
The mosquito wingbeat sounds were collected from the laboratory of the Medical Entomology Department of the Faculty of Tropical Medicine at Mahidol University. The research has been approved for the animals involving research by the Institutional Review Board of the Faculty of Tropical Medicine, Mahidol University (FTM-ACUC 030/2020). The recordings consist of four mosquito species: Aedes aegypti, Aedes albopictus, Anopheles dirus, and Culex quinquefasciatus from both males (M) and females (F). Samples mosquitoes were from laboratory strains raised in the Medical Entomology Department of the Faculty of Tropical Medicine. They were individually put into a small cylindrical net cage (8cm in width and 12cm in height). A condenser microphone (Studio Behringer ECM8000 measurement) and a low-cost (Primo EM172) microphone with 24-bit depth and 96 kHz sampling rate was used to record the wingbeat sounds.
The raw recordings were processed by extracting only the periods containing wingbeat sounds. These wingbeat sounds were then split into the
Content
- 1324 wingbeat recordings correctly labeled with mosquitoes species and sex
- 4 mosquito species (Ae. aegypti, Ae. albopictus, An. dirus, Cu. quinquefasciatus)
- 3 genera of mosquito species (Aedes, Anopheles, Culex)
- 8 environment noise recordings
- 4 lighttraps fan noise recordings
conda create -n mosquito python=3.7
conda activate mosquito
pip install --upgrade pip
pip install numpy pandas matplotlib seaborn imblearn soundfile librosa jupyterlab
conda install -c conda-forge cudatoolkit=11.0 cudnn=8.0
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
pip install tensorflow==2.4.0To test the model performance. You can easily do it by following these steps.
- Download the mosquito and environmental noise recordings from this link.
- Place mosquito recordings to
./data/mosquito_recordings. - Place environmental noise recordings to
./data/environmental_noise_recordings. - Download the trained classification models from this link.
- Place classification models to
./modelsfolder. - Run all cells for
predictions.ipynb.
After the jupyter notebook file finished, the classification results will be generated as .xlsx file in classification_results folder. The results include per-class and average precision, recall, and F1-score. There are result from each round of 10-fold end as _raw file and average result end as _avg.
TBD
- For academic and non-commercial use only
- Apache License 2.0