---
title: "AI Notebooks - Tutorial - Brain tumor segmentation using U-Net"
description: "Over the past few years, the field of computer vision has experienced significant growth. It encompasses a wide range of methods for acquiring, processing, anal"
url: https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/ai-notebooks-tuto-image-segmentation-unet-tumors
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 - Brain tumor segmentation using U-Net

Over the past few years, the field of **computer vision** has experienced significant growth. It encompasses a wide range of methods for acquiring, processing, analyzing, and understanding digital images.

Among these methods, one is called **image segmentation**.

The purpose of this tutorial is to show you how it is possible to build and train a brain tumor segmentation model with **OVHcloud AI Notebooks**. You will be able to learn the concepts of medical imaging, image segmentation, model evaluation, and much more. We will use a popular convolutional neural network named **U-Net**.

At the end of this tutorial, you will have learned the principal methods to **segment brain tumors**.

**Note:**

We will train this model on the _[BraTS2020 dataset](http://braintumorsegmentation.org/)_. We will show you how you can easily download the dataset in the notebook tutorial.

 

## 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
- A [Kaggle](https://www.kaggle.com/) account to download the dataset

 

## Instructions

You can launch the notebook from the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/) or via the ovhai [CLI](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/cli-run-notebook.md).

A direct link to the full code can be found [here](https://github.com/ovh/ai-training-examples/blob/main/notebooks/computer-vision/image-segmentation/tensorflow/brain-tumor-segmentation-unet/notebook_image_segmentation_unet.ipynb).

 

### Launching a Jupyter notebook with "Tensorflow" via UI (Control Panel)

To launch your notebook from the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/), refer to the following steps.

 

#### Code editor

Choose the `Jupyterlab` code editor.

 

#### Framework

In this tutorial, the `tensorflow` framework is used. If you use another environment, there may be some compatibility problems such as missing libraries.

 

#### Resources

Using GPUs is recommended because medical imaging is a training-intensive task.

**Note:**

Here, using `1 GPU` is sufficient.

 

### Launching a Jupyter notebook with "Tensorflow" via CLI

_If you do not use our CLI yet, follow [this guide](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/cli-install-client.md) to install it._

If you want to launch your notebook with the OVHcloud AI CLI, choose the `jupyterlab` editor and the `tensorflow` framework.

To access the different versions of `tensorflow` available, run the following command:

```console
ovhai capabilities framework list -o yaml
```

**Note:**

If you do not specify a version, your notebook starts with the default version of `tensorflow`.

You will also need to choose the number of CPUs/GPUs (`<nb-cpus>` or `<nb-gpus>`) to use in your notebook.

**Note:**

Here we recommend using `1 GPU`.

To launch your notebook, run the following command:

```console
ovhai notebook run tensorflow jupyterlab \
        --name <notebook-name> \
        --framework-version <tensorflow-version> \
        --gpu <nb-gpus>
```

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

 

### Accessing the notebooks

Once our [AI examples repository](https://github.com/ovh/ai-training-examples/) has been cloned in your environment, find your notebook by following this path: `ai-training-examples` > `notebooks` > `computer-vision` > `image-segmentation` > `tensorflow` > `brain-tumor-segmentation-unet` > `notebook_image_segmentation_unet.ipynb`.

A preview of this notebook can be found on GitHub [here](https://github.com/ovh/ai-training-examples/blob/main/notebooks/computer-vision/image-segmentation/tensorflow/brain-tumor-segmentation-unet/notebook_image_segmentation_unet.ipynb).

 

## Go further

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.
