|
| 1 | +--- |
| 2 | +title: AI Notebooks - Tutorial - Brain tumor segmentation using U-Net |
| 3 | +slug: notebooks/tuto-image-segmentation-unet-tumors |
| 4 | +excerpt: Implementing a Convolutional Neural Network for Brain Tumor Segmentation in Medical Imaging |
| 5 | +section: AI Notebooks - Tutorials |
| 6 | +order: 12 |
| 7 | +routes: |
| 8 | + canonical: 'https://docs.ovh.com/gb/en/publiccloud/ai/notebooks/tuto-image-segmentation-unet-tumors/' |
| 9 | +updated: 2023-04-13 |
| 10 | +--- |
| 11 | + |
| 12 | +**Last updated 13th April, 2023.** |
| 13 | + |
| 14 | +## Objective |
| 15 | + |
| 16 | +Over the past few years, the field of **computer vision** has experienced a significant growth. It encompasses a wide range of methods for acquiring, processing, analyzing and understanding digital images. |
| 17 | + |
| 18 | +Among these methods, one is called **image segmentation**. |
| 19 | + |
| 20 | +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**. |
| 21 | + |
| 22 | +At the end of this tutorial, you will have learnt the principal methods to **segment brain tumors**. |
| 23 | + |
| 24 | +{.thumbnail} |
| 25 | + |
| 26 | +> [!primary] |
| 27 | +> |
| 28 | +> 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. |
| 29 | +> |
| 30 | +
|
| 31 | +## Requirements |
| 32 | + |
| 33 | +- Access to the [OVHcloud Control Panel](https://www.ovh.com/auth/?action=gotomanager&from=https://www.ovh.de/&ovhSubsidiary=de) |
| 34 | +- An AI Notebooks project created inside a [Public Cloud project](https://www.ovhcloud.com/de/public-cloud/) in your OVHcloud account |
| 35 | +- A user for AI Notebooks |
| 36 | +- A [Kaggle](https://www.kaggle.com/) account to download the dataset |
| 37 | + |
| 38 | +## Instructions |
| 39 | + |
| 40 | +You can launch the notebook from the [OVHcloud Control Panel](https://www.ovh.com/auth/?action=gotomanager&from=https://www.ovh.de/&ovhSubsidiary=de) or via the ovhai [CLI](https://docs.ovh.com/de/publiccloud/ai/cli/getting-started-cli/). |
| 41 | + |
| 42 | +### Launching a Jupyter notebook with "Miniconda" via UI (Control Panel) |
| 43 | + |
| 44 | +To launch your notebook from the [OVHcloud Control Panel](https://www.ovh.com/auth/?action=gotomanager&from=https://www.ovh.de/&ovhSubsidiary=de), refer to the following steps. |
| 45 | + |
| 46 | +#### Code editor |
| 47 | + |
| 48 | +Choose the `Jupyterlab` code editor. |
| 49 | + |
| 50 | +#### Framework |
| 51 | + |
| 52 | +In this tutorial, the `tensorflow` framework is used. If you use another environment, there may be some compatibility problems such as missing libraries. |
| 53 | + |
| 54 | +#### Resources |
| 55 | + |
| 56 | +Using GPUs is recommended because medical imaging is a training intensive task. |
| 57 | + |
| 58 | +> [!primary] |
| 59 | +> |
| 60 | +> Here, using `1 GPU` is sufficient. |
| 61 | +> |
| 62 | +
|
| 63 | +### Launching a Jupyter notebook with "Miniconda" via CLI |
| 64 | + |
| 65 | +*If you do not use our CLI yet, follow [this guide](https://docs.ovh.com/de/publiccloud/ai/cli/install-client/) to install it.* |
| 66 | + |
| 67 | +If you want to launch your notebook with the OVHcloud AI CLI, choose the `jupyterlab` editor and the `tensorflow` framework. |
| 68 | + |
| 69 | +To access the different versions of `tensorflow` available, run the following command: |
| 70 | + |
| 71 | +```console |
| 72 | +ovhai capabilities framework list -o yaml |
| 73 | +``` |
| 74 | + |
| 75 | +> [!primary] |
| 76 | +> |
| 77 | +> If you do not specify a version, your notebook starts with the default version of `tensorflow`. |
| 78 | +> |
| 79 | +
|
| 80 | +You will also need to choose the number of CPUs/GPUs (`<nb-cpus>` or `<nb-gpus>`) to use in your notebook. |
| 81 | + |
| 82 | +> [!primary] |
| 83 | +> |
| 84 | +> Here we recommend using `1 GPU`. |
| 85 | +> |
| 86 | +
|
| 87 | +To launch your notebook, run the following command: |
| 88 | + |
| 89 | +```console |
| 90 | +ovhai notebook run tensorflow jupyterlab \ |
| 91 | + --name <notebook-name> \ |
| 92 | + --framework-version <tensorflow-version> \ |
| 93 | + --gpu <nb-gpus> |
| 94 | +``` |
| 95 | + |
| 96 | +You can then reach your notebook’s URL once the notebook is running. |
| 97 | + |
| 98 | +### Accessing the notebooks |
| 99 | + |
| 100 | +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`. |
| 101 | + |
| 102 | +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). |
| 103 | + |
| 104 | +## Go further |
| 105 | + |
| 106 | +There are many other tasks that exist in the computer vision field. Check our other tutorials to learn how to: |
| 107 | + |
| 108 | +- [Use Transfer Learning with ResNet50 for image classification](https://github.com/ovh/ai-training-examples/blob/main/notebooks/computer-vision/image-classification/tensorflow/resnet50/notebook-resnet-transfer-learning-image-classification.ipynb) |
| 109 | + |
| 110 | +- [Train YOLOv7 for American Sign Language recognition](https://github.com/ovh/ai-training-examples/blob/main/notebooks/computer-vision/object-detection/miniconda/yolov7/notebook_object_detection_yolov7_asl.ipynb) |
| 111 | + |
| 112 | +## Feedback |
| 113 | + |
| 114 | +Please send us your questions, feedback and suggestions to improve the service: |
| 115 | + |
| 116 | +- On the OVHcloud [Discord server](https://discord.com/invite/vXVurFfwe9) |
0 commit comments