{"id":17716534,"url":"https://github.com/davipatti/birdbrain","last_synced_at":"2025-04-01T16:30:26.525Z","repository":{"id":85013644,"uuid":"134292155","full_name":"davipatti/birdbrain","owner":"davipatti","description":"Code for searching the www.xeno-canto.org bird sound database, and training a machine learning model to classify birds according to their sounds.","archived":false,"fork":false,"pushed_at":"2019-03-17T14:46:18.000Z","size":17,"stargazers_count":27,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-24T17:02:55.466Z","etag":null,"topics":["bird-species-classification","birds","birdsong","machine-learning","python","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davipatti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-05-21T16:01:45.000Z","updated_at":"2024-07-25T05:58:06.000Z","dependencies_parsed_at":"2023-03-08T16:30:35.621Z","dependency_job_id":null,"html_url":"https://github.com/davipatti/birdbrain","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"f4e685e04bf831f5e770c6b1a842c1bb685b8acb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davipatti%2Fbirdbrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davipatti%2Fbirdbrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davipatti%2Fbirdbrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davipatti%2Fbirdbrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davipatti","download_url":"https://codeload.github.com/davipatti/birdbrain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620222,"owners_count":20806722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bird-species-classification","birds","birdsong","machine-learning","python","tensorflow"],"created_at":"2024-10-25T13:13:40.515Z","updated_at":"2025-04-01T16:30:26.229Z","avatar_url":"https://github.com/davipatti.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BirdBrain\n\nThis repo contains code to search the [Xeno-canto](https://www.xeno-canto.org/) bird sound database, and train a machine learning model to classify birds according to those sounds.\n\n## Setup\n\nFFMPEG is required for audio processing.\n\nOn OS X this can be downloaded and installed using Homebrew:\n~~~bash\n$ brew install ffmpeg\n~~~\n\nClone this repo and `cd` into the repositories root directory.\n\nInstall python libraries. (This repo has bee tested using python 3.6.5.)\n\n~~~bash\n$ pip install -r requirements.txt\n~~~\n\nTo use the shell scripts for downloading and processing data, and training a model, set these environment variables:\n\n* `BIRDBRAIN_ROOT` should point to this repositories root directory.\n* `TENSORFLOW_SRC_ROOT` should point to the tensor flow source code root directory.\n* `BACKGROUND_NOISE` should point to the `_background_noise_` directory which is downloadable here: download.tensorflow.org/data/speech_commands_v0.02.tar.gz.\n\n## Download recordings\n\n`bin/search_xeno_canto.py --help` shows command line options:\n\n~~~\nusage: search_xeno_canto.py [-h] [-q QUERY] [-d] [-m MAXSIZE]\n                            [-n MAXNDOWNLOADS] [-p DIRECTORY]\n\nSearch for bird song recordings from https://www.xeno-canto.org that match a\nquery.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -q QUERY, --query QUERY\n                        Query. See https://www.xeno-canto.org/help/search for\n                        details. Example: \"gen: columba sp: palumbus q \u003e : C\"\n  -d, --download        Download records that match the query.\n  -m MAXSIZE, --max-file-size MAXSIZE\n                        Only download files smaller than max-file-size bytes.\n  -n MAXNDOWNLOADS, --max-number-downloads MAXNDOWNLOADS\n                        Maximum number of files to download.\n  -p DIRECTORY, --directory DIRECTORY\n                        Directory to save downloads.\n~~~\n\nAn example search:\n\n~~~bash\nsrc/search_xeno_canto.py --download \\\n                         --query \"Wood pigeon\" \\\n                         --max-file-size 600000 \\\n                         --directory data/downloads \\\n                         --max-number-downloads 1000\n~~~\n\nA batch of queries can be searched using `bin/download.sh batch.txt`. Here `batch.txt` is a text file containing one query per line. See `common.txt` for an example.\n\n## Convert and split\n\nRecording have to be converted to 16-bit little-endian PCM-encoded WAVE format. This is done by `bin/mpeg-to-wav.sh` which converts mpeg files in `data/downloads` and puts them in `data/wav`.\n\nRecordings are then split into 3 second segments using `bin/split-wav.sh`. This is a constraint of the machine learning model that is used, which requires training samples of a similar length of time. Segmented files are saved to `data/samples/GEN_SP` where `GEN_SP` corrseponds to the genus and species of each recording.\n\n## Model training\n\nTraining uses TensorFlow, and specifically the model outlined and implemented in this [tutorial](https://www.tensorflow.org/versions/master/tutorials/audio_recognition). Training is run by using `bin/run_training.sh`. To understand the output of the model, follow training progress, and produce a simple app for android smartphones, see more details on the TensorFlow tutorial, linked above.\n\nRun `\"$TENSORFLOW_SRC_ROOT\"/tensorflow/examples/speech_commands/train.py --help` to see command line options available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavipatti%2Fbirdbrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavipatti%2Fbirdbrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavipatti%2Fbirdbrain/lists"}