Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Practical: Building a segmentation network

An article linking to a Colab notebook which demonstrates image segmentation using PyTorch on the Oxford flower dataset.
Two rows of images showing an original image of a flower, a user annotated image mask, the output from a deep learning network, and a predicted binary mask
© The University of Nottingham
An example of using deep learning with PyTorch for image segmentation.

In the linked Colab notebook we will again use the Oxford flower dataset and PyTorch to make a deep learning network that segments flowers within images. We’re able to do this since the dataset comes with pre-segmented versions of the images we can use to train the network.

In the notebook we will cover the following:

  • downloading and using the segmented image maps in a new custom Dataset object
  • importing and adapting a network from PyTorch we can train to perform the segmentation
  • training the network using the binary cross entropy loss function
  • testing and visualising the output.

Follow the link below and work through the Colab notebook step by step.

Image segmentation using deep learning in PyTorch

You may wish to open the link in a new browser tab so you can refer back here quickly.

Please leave any questions or comments below.

This article is from the free online

Deep Learning for Bioscientists

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now