---
title: "AI Notebooks - Tutorial - Audio analysis and classification with AI"
description: "The purpose of this tutorial is to show how it is possible to train a model in order to classify sounds. To do this, we take as an example a dataset of marine m"
url: https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/ai-notebooks-marine-mammal-sounds-classification
lang: en
---
> For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt.

# AI Notebooks - Tutorial - Audio analysis and classification with AI

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

 

## Requirements

- Access to the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/)
- An AI Notebooks project created inside a [Public Cloud project](https://us.ovhcloud.com/public-cloud/) in your OVHcloud account
- A user for AI Notebooks
- Two [Object Storage containers](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/compliance.md) to store the data and the model
- Your own dataset

 

## Instructions

### Uploading your dataset on Public Cloud Storage

If you want to upload it from the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/), go to the `Object Storage` section via the `Public Cloud` menu and [create a new object container](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/compliance.md) by `+ Create an object container`.

**Note:**

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 guide](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/cli-access-data.md). You have to choose the region, the name of your container, and the path where your data is located, and use the following command:

```bash
ovhai bucket object upload <container>@<region> <paths>
```

**Note:**

This tutorial has been completed with the [Best of Watkins Marine Mammal Sound Database](https://cis.whoi.edu/science/B/whalesounds/index.cfm). If you don't have your own dataset, you can use it by downloading the dataset on [Hugging Face](https://huggingface.co/datasets/confit/wmms/tree/main).

 

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

**Warning:**

**NOTE:** 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, and 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](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/cli-access-data.md).

To be able to use the source code below in this article you have to create two Object Storage containers and a git repository mounted as follows:

- mount point name: `/workspace/data`, permissions: `read & write`
- mount point name: `/workspace/saved_model`, permissions: `read & write`
- mount point name: `/workspace/ai-training-examples`, permissions: `read & write`, Git URL: `https://github.com/ovh/ai-training-examples.git`

`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](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/cli-access-data.md) you want to attach and the number of GPUs (`<nb-gpus>`) to use on your notebook and use the following command:

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

For example:

```bash
ovhai notebook run one-for-all jupyterlab \
  --name marine-mammal-sounds-classification \
  --gpu 1 \
  --volume marine-mammal-sounds@US-EAST-VA/:/workspace/data:RW:cache \
  --volume marine-mammal-model@US-EAST-VA/:/workspace/saved_model:RW:cache \
  --volume https://github.com/ovh/ai-training-examples.git:/workspace/ai-training-examples:RW
```

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 can train the model!

A preview of this notebook can be found on GitHub [here](https://github.com/ovh/ai-training-examples/blob/main/notebooks/audio/audio-classification/notebook-marine-sound-classification.ipynb).

 

## Go further

- If you want to train your model, check out [this tutorial](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/ai-training-train-marine_mammal_sound.md).
- You can also compare two methods for audio classification tasks by following [this tutorial](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/ai-training-models-comparaison-wandb.md).

Browse all the [AI & Machine Learning guides](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/landing-page-ai-machine-learning.md).

Browse the rest of the [OVHcloud US documentation](https://docs.us.ovhcloud.com/en/index.md) for guides on our other products and services.

Learn more about [AI & Machine Learning](https://us.ovhcloud.com/public-cloud/ai-machine-learning/) on the OVHcloud US website.

If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](https://us.ovhcloud.com/professional-services/) to get a quote and ask our Professional Services experts for a custom analysis of your project.
