Коммит
5d97797124
|
@ -7,6 +7,7 @@ import x7 from "./lesson-7.json";
|
|||
import x8 from "./lesson-8.json";
|
||||
import x9 from "./lesson-9.json";
|
||||
import x10 from "./lesson-10.json";
|
||||
import x12 from "./lesson-12.json";
|
||||
import x23 from "./lesson-23.json";
|
||||
const quiz = { 0 : x1[0], 1 : x2[0], 2 : x3[0], 3 : x4[0], 4 : x5[0], 5 : x7[0], 6 : x8[0], 7 : x9[0], 8 : x10[0], 9 : x23[0] };
|
||||
const quiz = { 0 : x1[0], 1 : x2[0], 2 : x3[0], 3 : x4[0], 4 : x5[0], 5 : x7[0], 6 : x8[0], 7 : x9[0], 8 : x10[0], 9 : x12[0], 10 : x23[0] };
|
||||
export default quiz;
|
|
@ -0,0 +1,123 @@
|
|||
[
|
||||
{
|
||||
"title": "AI for Beginners: Quizzes",
|
||||
"complete": "Congratulations, you completed the quiz!",
|
||||
"error": "Sorry, try again",
|
||||
"quizzes": [
|
||||
{
|
||||
"id": 112,
|
||||
"title": "Segmentation: Pre Quiz",
|
||||
"quiz": [
|
||||
{
|
||||
"questionText": "There are ____ segmentation algorithms?",
|
||||
"answerOptions": [
|
||||
{
|
||||
"answerText": "1",
|
||||
"isCorrect": false
|
||||
},
|
||||
{
|
||||
"answerText": "2",
|
||||
"isCorrect": true
|
||||
},
|
||||
{
|
||||
"answerText": "3",
|
||||
"isCorrect": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"questionText": "Segmentation is a _____ task",
|
||||
"answerOptions": [
|
||||
{
|
||||
"answerText": "computer vision",
|
||||
"isCorrect": true
|
||||
},
|
||||
{
|
||||
"answerText": "natural language processing",
|
||||
"isCorrect": false
|
||||
},
|
||||
{
|
||||
"answerText": "neural networks",
|
||||
"isCorrect": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"questionText": "Segmentation networks consist of ____ and ____ parts",
|
||||
"answerOptions": [
|
||||
{
|
||||
"answerText": "classifier, divider",
|
||||
"isCorrect": false
|
||||
},
|
||||
{
|
||||
"answerText": "encoder, Decoder",
|
||||
"isCorrect": true
|
||||
},
|
||||
{
|
||||
"answerText": "generator, discriminator",
|
||||
"isCorrect": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 212,
|
||||
"title": "Segmentation: Post Quiz",
|
||||
"quiz": [
|
||||
{
|
||||
"questionText": "____ extracts features from input image",
|
||||
"answerOptions": [
|
||||
{
|
||||
"answerText": "decoder",
|
||||
"isCorrect": false
|
||||
},
|
||||
{
|
||||
"answerText": "generator",
|
||||
"isCorrect": false
|
||||
},
|
||||
{
|
||||
"answerText": "encoder",
|
||||
"isCorrect": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"questionText": "____ transforms input features into mask image",
|
||||
"answerOptions": [
|
||||
{
|
||||
"answerText": "decoder",
|
||||
"isCorrect": true
|
||||
},
|
||||
{
|
||||
"answerText": "generator",
|
||||
"isCorrect": false
|
||||
},
|
||||
{
|
||||
"answerText": "encoder",
|
||||
"isCorrect": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"questionText": "SegNet relies on ____ to train multi-layered network",
|
||||
"answerOptions": [
|
||||
{
|
||||
"answerText": "batch normalization",
|
||||
"isCorrect": true
|
||||
},
|
||||
{
|
||||
"answerText": "height normalization",
|
||||
"isCorrect": false
|
||||
},
|
||||
{
|
||||
"answerText": "weight normalization",
|
||||
"isCorrect": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -238,6 +238,34 @@ Lesson 10E Generative Adversarial Networks: Post Quiz
|
|||
- Keeping balance between generator and discriminator
|
||||
+ all of the above
|
||||
|
||||
Lesson 12B Segmentation: Pre Quiz
|
||||
* There are ____ segmentation algorithms?
|
||||
- 1
|
||||
+ 2
|
||||
- 3
|
||||
* Segmentation is a _____ task
|
||||
+ computer vision
|
||||
- natural language processing
|
||||
- neural networks
|
||||
* Segmentation networks consist of ____ and ____ parts
|
||||
- classifier, divider
|
||||
+ encoder, Decoder
|
||||
- generator, discriminator
|
||||
|
||||
Lesson 12E Segmentation: Post Quiz
|
||||
* ____ extracts features from input image
|
||||
- decoder
|
||||
- generator
|
||||
+ encoder
|
||||
* ____ transforms input features into mask image
|
||||
+ decoder
|
||||
- generator
|
||||
- encoder
|
||||
* SegNet relies on ____ to train multi-layered network
|
||||
+ batch normalization
|
||||
- height normalization
|
||||
- weight normalization
|
||||
|
||||
Lesson 23B Multi-Agent Modeling: Pre Quiz
|
||||
* By modeling the behavior of simple agents, we can understand more complex behaviors of a system.
|
||||
+ true
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
We have already learnt about Object Detection, which allows us to locate objects in the image by predicting their *bounding boxes*. However, for some tasks we do not only need bounding boxes, but also more precise object localization. This task is called **segmentation**.
|
||||
|
||||
## [Pre-lecture quiz](https://black-ground-0cc93280f.1.azurestaticapps.net/quiz/112)
|
||||
|
||||
Segmentation can be viewed as **pixel classification**, whereas for **each** pixel of image we must predict its class (*background* being one of the classes). There are two main segmentation algorithms:
|
||||
|
||||
* **Semantic segmentation** only tells pixel class, and does not make a distinction between different objects of the same class
|
||||
* **Instance segmentation** divides classes into different instances.
|
||||
* **Instance segmentation** divides classes into different instances.
|
||||
|
||||
For instance segmentation 10 sheep are different objects, for semantic segmentation all sheep are represented by one class.
|
||||
|
||||
|
@ -22,7 +24,7 @@ There are different neural architectures for segmentation, but they all have the
|
|||
|
||||
> Image from [this publication](https://arxiv.org/pdf/2001.05566.pdf)
|
||||
|
||||
We should especially mention the loss function that is used for segmentation. In classical autoencoders we need to measure the similarity between two images, and we can use mean square error to do that. In segmentation, each pixel in the target mask image represents the class number (one-hot-encoded along the third dimension), so we need to use loss functions specific for classification - cross-entropy loss, averaged over all pixels. If the mask is binary - **binary cross-entropy loss** (BCE) is used.
|
||||
We should especially mention the loss function that is used for segmentation. In classical autoencoders we need to measure the similarity between two images, and we can use mean square error to do that. In segmentation, each pixel in the target mask image represents the class number (one-hot-encoded along the third dimension), so we need to use loss functions specific for classification - cross-entropy loss, averaged over all pixels. If the mask is binary - **binary cross-entropy loss** (BCE) is used.
|
||||
|
||||
## Segmentation for Medical Imaging
|
||||
|
||||
|
@ -34,13 +36,19 @@ We will train a model to segment any nevus from the background.
|
|||
|
||||
## Notebooks
|
||||
|
||||
Open [the notebook](SemanticSegmentationPytorch.ipynb) to learn more about different semantic segmentation architectures and see them in action.
|
||||
Open the notebook to learn more about different semantic segmentation architectures and see them in action.
|
||||
|
||||
* [Semantic Segmentation Pytorch](SemanticSegmentationPytorch.ipynb)
|
||||
* [Semantic Segmentation TensorFlow](SemanticSegmentationTF.ipynb)
|
||||
|
||||
## [Post-lecture quiz](https://black-ground-0cc93280f.1.azurestaticapps.net/quiz/212)
|
||||
|
||||
## [Lab](lab/README.md)
|
||||
|
||||
In this lab, we encourage you to try ** human body segmentation** using [Segmentation Full Body MADS Dataset](https://www.kaggle.com/datasets/tapakah68/segmentation-full-body-mads-dataset) from Kaggle.
|
||||
In this lab, we encourage you to try **human body segmentation** using [Segmentation Full Body MADS Dataset](https://www.kaggle.com/datasets/tapakah68/segmentation-full-body-mads-dataset) from Kaggle.
|
||||
|
||||
> ✅ Todo: Conclusion
|
||||
|
||||
## Assignment
|
||||
|
||||
Body segmentation is just one of the common tasks that we can do with images of people. Another important tasks include **skeleton detection** and **pose detection**. Try out [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose) library to see how pose detection can be used.
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Let's not plot some of the images from the dataset to see how they look like:"
|
||||
"Let's now plot some of the images from the dataset to see how they look like:"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -547,7 +547,7 @@
|
|||
"\n",
|
||||
"This leads us to the idea of **skip connections** between convolution layers in encoder and decoder. This architecture is very common for semantic segmentation, and is called **U-Net**. Skip connections at each convolution level helps network not to lose information about features from original input at this level.\n",
|
||||
"\n",
|
||||
"We will use quite simple CNN architecture here, bit U-Net can also use more complex encoder for feature extraction, such as ResNet-50.\n",
|
||||
"We will use quite simple CNN architecture here, but U-Net can also use more complex encoder for feature extraction, such as ResNet-50.\n",
|
||||
"\n",
|
||||
"<img src=\"images/unet.png\" width=\"70%\">\n",
|
||||
"\n",
|
||||
|
@ -738,15 +738,6 @@
|
|||
" image_mask.append(mask)\n",
|
||||
"plotn(plots, (predictions, image_mask), only_mask=True)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "2XCSTDlhWsSv"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
@ -598,7 +598,7 @@
|
|||
"source": [
|
||||
"## U-Net\n",
|
||||
"\n",
|
||||
"Very simple architecture that used skip connections. Skip connections at each convolution level helps network doesn't lost information about features from original input at this level.\n",
|
||||
"Very simple architecture that uses skip connections. Skip connections at each convolution level helps network doesn't lost information about features from original input at this level.\n",
|
||||
"\n",
|
||||
"U-Net usually has a default encoder for feature extraction, for example resnet50.\n",
|
||||
"\n",
|
||||
|
@ -979,15 +979,6 @@
|
|||
" image_mask.append(mask)\n",
|
||||
"plotn(plots, (predictions, image_mask))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 220,
|
||||
"metadata": {
|
||||
"id": "2XCSTDlhWsSv"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
@ -294,7 +294,7 @@
|
|||
"\n",
|
||||
"To improve the accuracy, let's use pre-trained neural network as feature extractor. Feel free to experiment with VGG-16/VGG-19 models, ResNet50, etc.\n",
|
||||
"\n",
|
||||
"> Since this training is slower, you may start with training the model for the small number of epochs, eg. 3. You can alsways resume training to further improve accuracy if needed.\n",
|
||||
"> Since this training is slower, you may start with training the model for the small number of epochs, eg. 3. You can always resume training to further improve accuracy if needed.\n",
|
||||
"\n",
|
||||
"We need to normalize our data differently for transfer learning, thus we will reload the dataset again using different set of transforms:"
|
||||
]
|
||||
|
|
Загрузка…
Ссылка в новой задаче