---
# System prepended metadata

title: U-net
tags: [ML]

---

# U-net
###### tags: `ML`
reference: 
* [U-Net: Convolutional Networks for Biomedical Image Segmentation](https://pdfs.semanticscholar.org/0704/5f87709d0b7b998794e9fa912c0aba912281.pdf)
* [medical image segmentation](https://towardsdatascience.com/medical-image-segmentation-part-1-unet-convolutional-networks-with-interactive-code-70f0f17f46c6)
* [presentation about U-Net](https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/u-net-teaser.mp4)
### Main idea
* typical use of convolutional networks is on classification tasks, where the output to an image is a **single class label**.
*  in biomedical image processing, the desired output should include **localization**
> a class label is supposed to be assigned to each pixel.

![](https://i.imgur.com/9BO9n5N.png)

### Structure
![](https://i.imgur.com/YeVI6u9.png)

* `the contracting part`: repeated application of two 3x3 convolutions (unpadded convolutions), each followed by a rectified linear unit (ReLU) and a 2x2 max pooling operation with stride 2 for **downsampling**. At each downsampling step we **double** the number of **feature channels**.
![](https://i.imgur.com/IDIJmHL.png)
![](https://i.imgur.com/RK9Rc4d.png)

* `the expansive path`: consists of an upsampling of the feature map followed by a 2x2 convolution (“up-convolution”) that **halves** the number of feature channels, a concatenation with the correspondingly cropped feature map from the contracting path, and two 3x3 convolutions, each followed by a ReLU.
![](https://i.imgur.com/s61PbwN.png)

> **ReLU**
> 線性整流作為神經元的激活函數，定義了該神經元在線性變換  $w^Tx+b$  之後的非線性輸出結果。
> 換言之，對於進入神經元的來自上一層神經網絡的輸入向量 $x$，使用線性整流激活函數的神經元會輸出
> $max(0,w^Tx+b)$
> 至下一層神經元或作為整個神經網絡的輸出.

![](https://i.imgur.com/zL7MUNn.png)

#### challenge
1. training data not enough
> use excessive data augmentation by applying **elastic deformations** to the available training images
![](https://i.imgur.com/ACtonvF.jpg)

2. separation of touching objects in cell segmentation
> separating background labels between touching cells obtain a large **weight** in the **loss function**.
> ![](https://i.imgur.com/iuWaVwj.png)

### Concept
##### cross entropy
衡量要找出正確答案，不同的策略，所要消耗的成本。
![](https://i.imgur.com/CRa3sTK.png)

##### ground truth image
`Labeling the pixels` in your image with the information, which object they belong to. 
This can be a manual (and very time-consuming) process or be semi-automatic (run some segmentation algorithms and only correct wrong pixel manually)
![](https://i.imgur.com/O5LtDTY.png)
