You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggestion:
To improve keeping track of what each notebook is doing and why, a summary of each notebook could be added at the top or end of each notebook. For example the Semantic segmentation notebook could contain a single cell stating something along the lines of merging all the section names.
the objective:
Our goal is to produce a model that can take an image as input and produce a segmented equivalent image
the method:
1 - You have already implemented a U-Net architecture in the previous exercise. We will use it as a starting point for this exercise. You should also already have the dataset and the dataloader implemented, along with a simple train loop with MSELoss.
2 - One of the most important parts of training a model is evaluating it. We need to know how well our model is doing and if it is improving.
We will start by implementing a metric to evaluate our model. Evaluation is always specific to the task, in this case semantic segmentation.
We will use the Dice Coefficient to evaluate the network predictions.
We can use it for validation if we interpret set $a$ as predictions and $b$ as labels. It is often used to evaluate segmentations with sparse foreground, because the denominator normalizes by the number of foreground pixels. The Dice Coefficient is closely related to Jaccard Index / Intersection over Union.
3 - Often our models will perform better on the evaluation dataset if we augment our training data.
This is because the model will be exposed to a wider variety of data that will hopefully help cover the full distribution of data in the validation set. We will use the torchvision.transforms
to augment our data.
4 - The next step to do would be to improve our loss function - the metric that tells us how close we are to the desired output. This metric should be differentiable, since this is the value to be backpropagated. The are multiple losses we could use for the segmentation task.
Take a moment to think which one is better to use. If you are not sure, don't forget that you can always google! Before you start implementing the loss yourself, take a look at the losses already implemented in PyTorch. You can also look for implementations on GitHub.
(Here specifically I would add a line about how to choose each Loss function, Optimizer, final activation function and insist on their interplay - but maybe it was a bit unclear to me because the day was cut short)
I hope this can be useful :)
The text was updated successfully, but these errors were encountered:
Suggestion:
To improve keeping track of what each notebook is doing and why, a summary of each notebook could be added at the top or end of each notebook. For example the Semantic segmentation notebook could contain a single cell stating something along the lines of merging all the section names.
Our goal is to produce a model that can take an image as input and produce a segmented equivalent image
1 - You have already implemented a U-Net architecture in the previous exercise. We will use it as a starting point for this exercise. You should also already have the dataset and the dataloader implemented, along with a simple train loop with MSELoss.
2 - One of the most important parts of training a model is evaluating it. We need to know how well our model is doing and if it is improving.
We will start by implementing a metric to evaluate our model. Evaluation is always specific to the task, in this case semantic segmentation.
We will use the Dice Coefficient to evaluate the network predictions.
We can use it for validation if we interpret set
3 - Often our models will perform better on the evaluation dataset if we augment our training data.
This is because the model will be exposed to a wider variety of data that will hopefully help cover the full distribution of data in the validation set. We will use the
torchvision.transforms
to augment our data.
4 - The next step to do would be to improve our loss function - the metric that tells us how close we are to the desired output. This metric should be differentiable, since this is the value to be backpropagated. The are multiple losses we could use for the segmentation task.
Take a moment to think which one is better to use. If you are not sure, don't forget that you can always google! Before you start implementing the loss yourself, take a look at the losses already implemented in PyTorch. You can also look for implementations on GitHub.
(Here specifically I would add a line about how to choose each Loss function, Optimizer, final activation function and insist on their interplay - but maybe it was a bit unclear to me because the day was cut short)
I hope this can be useful :)
The text was updated successfully, but these errors were encountered: