์๋ ํ์ธ์.
Plain Network(๋จ์ํ Layer์ ๊น๊ฒ ์์)์์ ๋ฐ์ํ๋ Vanishing Gradient(๊ธฐ์ธ๊ธฐ ์์ค), Overfitting(๊ณผ์ ํฉ) ๋ฑ์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ReLU, Batch Nomalization ๋ฑ ๋ง์ ๊ธฐ๋ฒ์ด ์์ต๋๋ค.


ILSVRC ๋ํ์์ 2015๋ , ์ฒ์์ผ๋ก Human Recognition๋ณด๋ค ๋์ ์ฑ๋ฅ์ ๋ณด์ธ ๊ฒ์ด ResNet์ ๋๋ค.
๊ทธ ์์ฉ์ ๋ฌด์ง๋ง์งํ ๋ ผ๋ฌธ ์ธ์ฉ ์๋ก ํ์ธํ ์ ์์ต๋๋ค.
๊ทธ๋ ๊ธฐ ๋๋ฌธ์ ResNet์ ๋ฅ๋ฌ๋ ์ด๋ฏธ์ง ๋ถ์ผ์์ ๋ฐ์ด๋ธ๋ก ํตํ๊ณ ์์ต๋๋ค.

Plain Network๋ ๋จ์ํ Convolution ์ฐ์ฐ์ ๋จ์ํ ์๋๋ค๋ฉด, ResNet์ Block๋จ์๋ก Parameter์ ์ ๋ฌํ๊ธฐ ์ ์ ์ด์ ์ ๊ฐ์ ๋ํ๋ ๋ฐฉ์์ ๋๋ค.

F(x) : weight layer => relu => weight layer
x : identity
weight layer๋ค์ ํต๊ณผํ F(x)์ weight layer๋ค์ ํต๊ณผํ์ง ์์ x์ ํฉ์ ๋ ผ๋ฌธ์์๋ Residual Mapping ์ด๋ผ ํ๊ณ , ๊ทธ๋ฆผ์ ๊ตฌ์กฐ๋ฅผ Residual Block์ด๋ผ ํ๊ณ , Residual Block์ด ์์ด๋ฉด Residual Network(ResNet)์ด๋ผ๊ณ ํฉ๋๋ค.
Residual Mapping์ ๊ฐ๋จํ์ง๋ง, Overfitting, Vanishing Gradient ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์ด ์ฑ๋ฅ์ด ํฅ์๋์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ ๋ค์ํ ๋คํธ์ํฌ ๊ตฌ์กฐ์์ ์ฌ์ฉ๋๋ฉฐ, 2017๋
ILSVRC์ ์ฐ์นํ SeNet์์ ์ฌ์ฉ๋ฉ๋๋ค. ( ์ด ๊ธ์ ์ด ์ด์ ์ด๊ธฐ๋ ํฉ๋๋ค. )


class Residual_Block(nn.Module):
def __init__(self, in_dim, mid_dim, out_dim):
super(Residual_Block,self).__init__()
# Residual Block
self.residual_block = nn.Sequential(
nn.Conv2d(in_dim, mid_dim, kernel_size=3, padding=1),
nn.ReLU,
nn.Conv2d(mid_dim, out_dim, kernel_size=3, padding=1),
)
self.relu = nn.ReLU()
def forward(self, x):
out = self. residual_block(x) # F(x)
out = out + x # F(x) + x
out = self.relu(out)
return out
๊ทธ๋ฆฌ๊ณ Residual Block ์๊ฐ ํ BottleNeck์ด ๋์ต๋๋ค. ์๋ ๊ธ์ ์ฐธ๊ณ ํ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
coding-yoon.tistory.com/116?category=825914
[๋ฅ๋ฌ๋] DeepLearning CNN BottleNeck ์๋ฆฌ(Pytorch ๊ตฌํ)
์๋ ํ์ธ์. ์ค๋์ Deep Learning ๋ถ์ผ์์ CNN์ BottleNeck๊ตฌ์กฐ์ ๋ํด ์์๋ณด๊ฒ ์ต๋๋ค. ๋ํ์ ์ผ๋ก ResNet์์ BottleNeck์ ์ฌ์ฉํ์ต๋๋ค. ResNet์์ ์ผ์ชฝ์ BottleNeck ๊ตฌ์กฐ๋ฅผ ์ฌ์ฉํ์ง ์์๊ณ , ์ค๋ฅธ์ชฝ์..
coding-yoon.tistory.com
ResNet ์๋ฌธ
Deep Residual Learning for Image Recognition
Deeper neural networks are more difficult to train. We present a residual learning framework to ease the training of networks that are substantially deeper than those used previously. We explicitly reformulate the layers as learning residual functions with
arxiv.org
'๐ Python > Deep Learning' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
์๋ ํ์ธ์.
Plain Network(๋จ์ํ Layer์ ๊น๊ฒ ์์)์์ ๋ฐ์ํ๋ Vanishing Gradient(๊ธฐ์ธ๊ธฐ ์์ค), Overfitting(๊ณผ์ ํฉ) ๋ฑ์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ReLU, Batch Nomalization ๋ฑ ๋ง์ ๊ธฐ๋ฒ์ด ์์ต๋๋ค.


ILSVRC ๋ํ์์ 2015๋ , ์ฒ์์ผ๋ก Human Recognition๋ณด๋ค ๋์ ์ฑ๋ฅ์ ๋ณด์ธ ๊ฒ์ด ResNet์ ๋๋ค.
๊ทธ ์์ฉ์ ๋ฌด์ง๋ง์งํ ๋ ผ๋ฌธ ์ธ์ฉ ์๋ก ํ์ธํ ์ ์์ต๋๋ค.
๊ทธ๋ ๊ธฐ ๋๋ฌธ์ ResNet์ ๋ฅ๋ฌ๋ ์ด๋ฏธ์ง ๋ถ์ผ์์ ๋ฐ์ด๋ธ๋ก ํตํ๊ณ ์์ต๋๋ค.

Plain Network๋ ๋จ์ํ Convolution ์ฐ์ฐ์ ๋จ์ํ ์๋๋ค๋ฉด, ResNet์ Block๋จ์๋ก Parameter์ ์ ๋ฌํ๊ธฐ ์ ์ ์ด์ ์ ๊ฐ์ ๋ํ๋ ๋ฐฉ์์ ๋๋ค.

F(x) : weight layer => relu => weight layer
x : identity
weight layer๋ค์ ํต๊ณผํ F(x)์ weight layer๋ค์ ํต๊ณผํ์ง ์์ x์ ํฉ์ ๋ ผ๋ฌธ์์๋ Residual Mapping ์ด๋ผ ํ๊ณ , ๊ทธ๋ฆผ์ ๊ตฌ์กฐ๋ฅผ Residual Block์ด๋ผ ํ๊ณ , Residual Block์ด ์์ด๋ฉด Residual Network(ResNet)์ด๋ผ๊ณ ํฉ๋๋ค.
Residual Mapping์ ๊ฐ๋จํ์ง๋ง, Overfitting, Vanishing Gradient ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์ด ์ฑ๋ฅ์ด ํฅ์๋์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ ๋ค์ํ ๋คํธ์ํฌ ๊ตฌ์กฐ์์ ์ฌ์ฉ๋๋ฉฐ, 2017๋
ILSVRC์ ์ฐ์นํ SeNet์์ ์ฌ์ฉ๋ฉ๋๋ค. ( ์ด ๊ธ์ ์ด ์ด์ ์ด๊ธฐ๋ ํฉ๋๋ค. )


class Residual_Block(nn.Module):
def __init__(self, in_dim, mid_dim, out_dim):
super(Residual_Block,self).__init__()
# Residual Block
self.residual_block = nn.Sequential(
nn.Conv2d(in_dim, mid_dim, kernel_size=3, padding=1),
nn.ReLU,
nn.Conv2d(mid_dim, out_dim, kernel_size=3, padding=1),
)
self.relu = nn.ReLU()
def forward(self, x):
out = self. residual_block(x) # F(x)
out = out + x # F(x) + x
out = self.relu(out)
return out
๊ทธ๋ฆฌ๊ณ Residual Block ์๊ฐ ํ BottleNeck์ด ๋์ต๋๋ค. ์๋ ๊ธ์ ์ฐธ๊ณ ํ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
coding-yoon.tistory.com/116?category=825914
[๋ฅ๋ฌ๋] DeepLearning CNN BottleNeck ์๋ฆฌ(Pytorch ๊ตฌํ)
์๋ ํ์ธ์. ์ค๋์ Deep Learning ๋ถ์ผ์์ CNN์ BottleNeck๊ตฌ์กฐ์ ๋ํด ์์๋ณด๊ฒ ์ต๋๋ค. ๋ํ์ ์ผ๋ก ResNet์์ BottleNeck์ ์ฌ์ฉํ์ต๋๋ค. ResNet์์ ์ผ์ชฝ์ BottleNeck ๊ตฌ์กฐ๋ฅผ ์ฌ์ฉํ์ง ์์๊ณ , ์ค๋ฅธ์ชฝ์..
coding-yoon.tistory.com
ResNet ์๋ฌธ
Deep Residual Learning for Image Recognition
Deeper neural networks are more difficult to train. We present a residual learning framework to ease the training of networks that are substantially deeper than those used previously. We explicitly reformulate the layers as learning residual functions with
arxiv.org