Bird-Song-Detector is part of a research to improve bird vocalization identification. The Bird Song Detector is designed to detect bird vocalizations in audio files using a YOLO-based model from the BIRDeep project. The system converts audio files into spectrogram images, performs bird song detection on these images, and transforms the predictions into time segments.
The model has been trained on the BIRDeep dataset, which consists of audio recordings from Doñana National Park, located in Huelva, Spain. As such, the detector is particularly well-suited for identifying bird songs from this region and has not been tested on data from other areas.
For more information, visit the full BIRDeep Bird Song Detector repository.
This repository is part of the manuscript "A Bird Song Detector for Improving Bird Identification through Deep Learning: A Case Study from Doñana", which is currently under review.
The project is structured as follows:
App/ # Application code
assets/
images/ # Images for README and documentation
Code/ # Core code files
audio_processing.py # Functions for processing audio files
predict_on_audio.py # Script to predict bird songs in a single audio file
predict_on_folder.py # Script to predict bird songs in all audio files in a folder
Data/ # Data directory
Audios/ # Sample audio files (place your own here)
Images/ # Spectrogram images generated from audio files
Segments/ # Directory for detected audio segments
flagged/ # Generated files from the Gradio app
Models/ # Model directory
Bird Song Detector/ # YOLO model
BirdNET FineTuned BIRDeep/ # Fine-tuned YOLO model
README.md # This README file
environment.yml # Conda environment specification
-
Clone the repository:
git clone https://github.com/yourusername/Bird-Song-Detector.git cd Bird-Song-Detector
-
Create and activate conda environment from environment.yml:
conda env create -f environment.yml conda activate bird-song-detector
-
Install dependencies:
pip install -r requirements.txt
Run the script predict_on_audio.py to detect bird songs in a single audio file:
python Code/predict_on_audio.py
Run the script predict_on_folder.py to detect bird songs in all audio files in a folder:
python Code/predict_on_folder.py
For a more interactive experience, you can run the Gradio web interface (app.py) by executing the following:
python App/app.py
The web interface will be available at http://127.0.0.1:7860/
by default. On the main page, drag and drop your audio file into the upload box and click Detect Bird Song
to process it.
Once the detection is complete, you will see the following:
- A list of predicted bird song segments with their start time, end time, and confidence score.
- The corresponding spectrogram image with bounding boxes indicating detected bird songs.
You can then click on the Generate Segments
button to download a ZIP file containing the individual detected audio segments in WAV format.
The generated ZIP file will contain the predictions WAV format with the name of original audio file followed by the start and end time of the detection and the confidence score.
This project is licensed under the MIT License. See the LICENSE file for details.