AI Notebooks - Tutoriel - Analyse et classification audio avec l'IA (EN)

Comment classifier des sons avec une IA

Last updated 1st September, 2022.

Objective

The purpose of this tutorial is to show how it is possible to train a model in oder to classify sounds. To do this, we take as an example a dataset of marine mammals sounds.

image

Requirements

Instructions

Uploading your dataset on Public Cloud Storage

If you want to upload it from the OVHcloud Control Panel, go to the Object Storage section and create a new object container by clicking Object Storage > Create an object container.

image

In the OVHcloud Control Panel, you can upload files but not folders. For instance, you can upload a .zip file to optimize the bandwidth, then unzip it later when accessing it through your JupyterLab. You can also use the OVHcloud AI CLI to upload files and folders (and be more stable than through your browser).

If you want to run it with the CLI, just follow this this guide. You have to choose the region, the name of your container and the path where your data is located and use the following command:

ovhai data upload <region> <container> <paths>

This tutorial has been realized with the Best of Watkins Marine Mammal Sound Database. If you don't have your own dataset, you can use it by downloading the dataset on Kaggle.

Launching and accessing Jupyter notebook with "One image to rule them all" framework

Although this tutorial is based on the use of the TensorFlow image, we advise you to use this image: One image to rule them all. This will help you avoid errors when installing libraries such as Librosa or SoundFile, Python audio libraries.

You need to attach a volume if your data is in your OVHcloud Object Storage and you want to use it during your experiment. For more information on data, volumes and permissions, see our guide on data.

To be able to use the source code below in this article you have to create 2 Object Storage containers mounted as follows:

  • mount point name: /workspace/data, permissions: read & write
  • mount point name: /workspace/saved_model, permissions: read & write

Choose the same region as your object container > "One image to rule them all" framework > Attach Object Storage containers (the one that contains your dataset)

If you want to launch it with the CLI, choose the volume you want to attach and the number of GPUs (<nb-gpus>) to use on your notebook and use the following command:

ovhai notebook run one-for-all jupyterlab \
  --name <notebook-name> \
  --gpu <nb-gpus>
  --volume <container@region/prefix:mount_path:permission>

You can then reach your notebook’s URL once the notebook is running.

Find the notebook by following this path: ai-training-examples > notebooks > audio > audio-classification > notebook-marine-sound-classification.ipynb.

Experimenting classification sound notebook

Once your dataset is ready and uploaded, you are able to train the model!

A preview of this notebook can be found on GitHub here.

Go further

  • If you want to deploy a Streamlit app in order to classify marine mammal sounds using your model, please check out this notebook.
  • You can also compare two methods for audio classification task by following this tutorial.

Feedback

Please send us your questions, feedback and suggestions to improve the service:


Cette documentation vous a-t-elle été utile ?

N’hésitez pas à nous proposer des suggestions d’amélioration afin de faire évoluer cette documentation.

Images, contenu, structure… N’hésitez pas à nous dire pourquoi afin de la faire évoluer ensemble !

Vos demandes d’assistance ne seront pas traitées par ce formulaire. Pour cela, utilisez le formulaire "Créer un ticket" .

Merci beaucoup pour votre aide ! Vos retours seront étudiés au plus vite par nos équipes..


Ces guides pourraient également vous intéresser...

OVHcloud Community

Accedez à votre espace communautaire. Posez des questions, recherchez des informations, publiez du contenu et interagissez avec d’autres membres d'OVHcloud Community.

Echanger sur OVHcloud Community

Conformément à la Directive 2006/112/CE modifiée, à partir du 01/01/2015, les prix TTC sont susceptibles de varier selon le pays de résidence du client
(par défaut les prix TTC affichés incluent la TVA française en vigueur).