{"id":21425400,"url":"https://github.com/utrechtuniversity/animal-sounds","last_synced_at":"2025-07-14T08:32:29.588Z","repository":{"id":41400445,"uuid":"408387579","full_name":"UtrechtUniversity/animal-sounds","owner":"UtrechtUniversity","description":"Python modules for detecting Chimpanze sounds in bioacoustic datasets using machine learning and deep learning.","archived":false,"fork":false,"pushed_at":"2024-07-01T07:08:18.000Z","size":24882,"stargazers_count":10,"open_issues_count":13,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T05:51:15.412Z","etag":null,"topics":["audio-processing","deep-learning","machine-learning","speech","utrecht-university"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UtrechtUniversity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-20T09:46:40.000Z","updated_at":"2024-11-22T02:54:09.000Z","dependencies_parsed_at":"2024-11-22T21:41:11.325Z","dependency_job_id":null,"html_url":"https://github.com/UtrechtUniversity/animal-sounds","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/UtrechtUniversity/animal-sounds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtrechtUniversity%2Fanimal-sounds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtrechtUniversity%2Fanimal-sounds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtrechtUniversity%2Fanimal-sounds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtrechtUniversity%2Fanimal-sounds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UtrechtUniversity","download_url":"https://codeload.github.com/UtrechtUniversity/animal-sounds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtrechtUniversity%2Fanimal-sounds/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262651,"owners_count":23736442,"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":["audio-processing","deep-learning","machine-learning","speech","utrecht-university"],"created_at":"2024-11-22T21:28:15.110Z","updated_at":"2025-07-14T08:32:24.569Z","avatar_url":"https://github.com/UtrechtUniversity.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# animal-sounds\r\n\r\n\u003c!-- Include Github badges here (optional) --\u003e\r\n[![DOI](https://zenodo.org/badge/408387579.svg)](https://zenodo.org/badge/latestdoi/408387579)\r\n\u003c!-- e.g. Github Actions workflow status --\u003e\r\n\r\nThe aim of this software is to classify Chimpanze vocalizations in audio recordings from the tropical rainforests of Africa. The software can be used for processing raw audio data, extracting features, and apply and compare Support Vector Machines and Deep learning methods for classification. The pipeline is reusable for other settings and species or vocalization types as long as a certain amount of labeled data has been collected. The best performing models will be available here for general usage.\r\n\r\n\u003c!-- TABLE OF CONTENTS --\u003e\r\n## Table of Contents\r\n\r\n- [Animal Sounds](#animal-sounds)\r\n  - [Table of Contents](#table-of-contents)\r\n  - [About the Project](#about-the-project)\r\n    - [Dataset description](#dataset-description)\r\n    - [Preprocessing](#preprocessing)\r\n    - [Feature extraction](#feature-extraction)\r\n    - [Classification](#classification)\r\n    - [Built with](#built-with)\r\n    - [License](#license)\r\n    - [Relevant Publications](#relevant-publications)\r\n  - [Getting Started](#getting-started)\r\n    - [Project structure](#project-structure)\r\n  - [Contributing](#contributing)\r\n  - [Contact](#contact)\r\n\r\n\u003c!-- ABOUT THE PROJECT --\u003e\r\n## About the Project\r\n\r\n**Date**: June 2022\r\n\r\n**Researchers**:\r\n\r\n- Joeri Zwerts (j.a.zwerts@uu.nl)\r\n- Heysem Kaya (h.kaya@uu.nl)\r\n\r\n**Research Software Engineers**:\r\n\r\n- Parisa Zahedi (p.zahedi@uu.nl)\r\n- Casper Kaandorp (c.s.kaandorp@uu.nl)\r\n- Jelle Treep (h.j.treep@uu.nl)\r\n\r\n### Dataset description\r\nThe initial dataset for this project contains recordings in `.wav` format at 1 minute length and at a sample rate of 48000 samples/second. The recordings are taken at three locations in (or close to) the tropical rainforest of Cameroon and Congo:\r\n\r\n- Chimpanze sanctuary - Congo\r\n- Natural forest - Congo\r\n- Semi-natural Chimanze enclosures - Cameron \r\n\r\n### Preprocessing \r\n1. The Chimpanze sanctuary recordings are labeled into 2 classes (Chimpanze \u0026 background) using [Raven Pro](https://ravensoundsoftware.com/software/) annotation software, and extracted from the original recordings. Find scripts [here](./bioacoustics/1_wav_processing/raven_to_wav).\r\n\r\n2. To speed up the labeling process we developed an energy-change based algorithm to filter out irrelevant parts of the recordings, see [Condensation](./bioacoustics/1_wav_processing/condensation). This was done after a first labelling effort. After this another labelling effort took place on the condensed files.\r\n\r\n3. To increase and diversify our training set we have created synthetic samples by embedding the sanctuary vocalizations into the recorded jungle audio that is labeled as 'background', see [Synthetic data](./bioacoustics/1_wav_processing/syntetic_data).\r\n\r\nThe labeled sections of audio signal from the steps above are then split into frames of 0.5 seconds length with 0.25 seconds overlap. This results in the following input dataset for training the classifiers: \r\n\r\n|Dataset| # Chimpanze samples | # Background samples |\r\n| --- | --- | --- |\r\n| Sanctuary | 17.921 | 74.163 | \r\n| Synthetic | 68.757 | 97.149 | \r\n\r\nThe recordings from the Semi-natural Chimpanze enclosures are used as an independent evaluation of the classifiers that are described below.\r\n\r\n### Feature extraction\r\nWe trained the models on frames of 0.5 seconds.   \r\nBefore calculating features we apply a Butterworth bandpass filter with low cutoff at 100 Hz and a high cutoff at 2000 Hz.  \r\nFor classification using SVM we extract statistical features from different representations of the audio signal.  \r\nFor classification using Deep learning we use a mel spectrogram representation as input. \r\n\r\n| \u003cimg src=\"/img/melspectrogram.png\" width=\"400\" /\u003e | \r\n|:--:| \r\n| *Chimpanze vocalization in mel spectrogram representation* |\r\n\r\n### Classification\r\n**SVM**  \r\nFrom the 1140 statistical features from the previous step we select a normalized feature set of 50 features. The selection is based on feature importances computed with an Extra Trees Classifier. We train and optimize the SVM model on those 50 features using 'macro average recall' as evaluation criterion.\r\nOn the independent test set the SVM model establishes a 'macro average recall' of **0.87**.\r\n| \u003cimg src=\"/img/A6_matrix.png\" width=\"400\" /\u003e | \r\n|:--:| \r\n| *SVM prediction results for A6 recorder* |\r\n\r\n**Deep learning**  \r\nWe trained several architectures of Convolutional Neural Networks (CNN) and a Residual network model (Resnet). CNN10 is the best performing model.\r\n\r\n| Trained on| SVM | CNN | CNN10 | \r\n| --- | --- | --- | --- |\r\n| Sanctuary | 0.86 | 0.81 | 0.83 |\r\n| Synthetic | 0.65 | 0.82 | 0.85 |\r\n| Sanctuary + Synthetic | 0.87 | 0.83 | 0.87 | \r\n\r\n### Built with\r\n\r\n- [Python \u003e=3.8](https://www.python.org/)\r\n- [librosa](https://librosa.org/)\r\n- [scikit-learn](https://scikit-learn.org/stable/index.html)\r\n- [tensorflow](https://www.tensorflow.org/)\r\n\r\n\u003c!-- Do not forget to also include the license in a separate file(LICENSE[.txt/.md]) and link it properly. --\u003e\r\n### License\r\n\r\nThe code that is developed in this project is released under [Apache 2.0](LICENSE.md). Some of the scripts for [feature extraction](/bioacoustics/2_feature_extraction) that we use in this project are available under [CeCILL 1.1](https://github.com/malfante/AAA/blob/master/LICENSE_EN.txt) license. The scripts where this is the case contain license information at the header lines of the scripst. The original versions of these scripts are created by Marielle Malfante and are available via [GitHub](https://github.com/malfante/AAA).\r\n\r\n### Relevant publications\r\n\r\n- Introducing a central african primate vocalisation dataset for automated species classification.\\ \r\nZwerts, J. A., Treep, J., Kaandorp, C. S., Meewis, F., Koot, A. C., \u0026 Kaya, H. (2021).\\ \r\n[arXiv preprint](https://arxiv.org/pdf/2101.10390.pdf)\r\n- The INTERSPEECH 2021 Computational Paralinguistics Challenge: COVID-19 cough, COVID-19 speech, escalation \u0026 primates.\\\r\nSchuller, B. W., Batliner, A., Bergler, C., Mascolo, C., Han, J., Lefter, I., ... \u0026 Kaandorp, C. (2021).\\\r\n[arXiv preprint](https://arxiv.org/pdf/2102.13468.pdf)\r\n- Automatic Analysis Architecture, M. MALFANTE, J. MARS, M. DALLA MURA \r\nDOI: [10.5281/zenodo.126028](https://doi.org/10.5281/zenodo.1216028)\r\n\r\n\r\n\u003c!-- GETTING STARTED --\u003e\r\n## Getting Started\r\n\r\nTo obtain all methods in this repository:\r\n```\r\ngit clone https://github.com/UtrechtUniversity/animal-sounds.git\r\n```\r\n\r\nInstall all required python libraries:\r\n```\r\ncd animal-sounds\r\npython -m pip install -r requirements.txt\r\n```\r\n\r\n\r\n\r\nThere are two situations in which you can directly apply the scripts in this repository and we tailored the documentation towards these situations:\r\n1. You have audio data and a set of manual annotations (in e.g. txt or csv format) and want to use the whole pipeline including training your own model. Find getting started instructions for each step in the respective folders: [1_wav_processing](./bioacoustics/1_wav_processing), [2_feature_extraction](./bioacoustics/2_feature_extraction) and [3_classifier](./bioacoustics/3_classifier) \r\n2. [You have a highly similar dataset and want to use one of our models to help find Chimpanze vocalizations.](docs/tutorial.md)\r\n\r\n### Project structure\r\nThis project uses the following directory structure. After cloning the repository on your local PC, organize your data in the repository using the structure below to make sure the scripts 'know' where the data is located. \r\n\r\n```\r\n.\r\n├── .gitignore\r\n├── CITATION.md\r\n├── LICENSE.md\r\n├── README.md\r\n├── requirements.txt\r\n├── bioacoustics              \u003c- main folder for all source code\r\n│   ├── 1_wav_processing \r\n│   ├── 2_feature_extraction\r\n│   └── 3_classifier        \r\n├── data               \u003c- All project data, ignored by git\r\n│   ├── original_wav_files\r\n│   ├── processed_wav_files            \r\n│   └── txt_annotations           \r\n└── output\r\n    ├── features        \u003c- Figures for the manuscript or reports, ignored by git\r\n    ├── models          \u003c- Models and relevant training outputs\r\n    ├── notebooks       \u003c- Notebooks for analysing results\r\n    └── results         \u003c- Graphs and tables\r\n\r\n```\r\n\r\n\u003c!-- CONTRIBUTING --\u003e\r\n## Contributing\r\n\r\nContributions are what make the open source community an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\r\n\r\nTo contribute:\r\n\r\n1. Fork the Project\r\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\r\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\r\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\r\n5. Open a Pull Request\r\n\r\n\r\n\u003c!-- CONTACT --\u003e\r\n## Contact\r\n\r\n[Joeri Zwerts](https://www.uu.nl/medewerkers/JAZwerts) - j.a.zwerts@uu.nl\r\n\r\n[Research Engineering team](https://utrechtuniversity.github.io/research-engineering/) - research.engineering@uu.nl\r\n\r\nProject Link: [https://github.com/UtrechtUniversity/animal-sounds](https://github.com/UtrechtUniversity/animal-sounds)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futrechtuniversity%2Fanimal-sounds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futrechtuniversity%2Fanimal-sounds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futrechtuniversity%2Fanimal-sounds/lists"}