[DEEPNOID ์ํฌ์ธํธ๋ ์จ]_4_Classifcation 2. MobileNet & EfficientNet
220125 ์์ฑ
<๋ณธ ๋ธ๋ก๊ทธ๋ DEEPNOID ์ํฌ์ธํธ๋ ์จ์ ์ฐธ๊ณ ํด์ ๊ณต๋ถํ๋ฉฐ ์์ฑํ์์ต๋๋ค>
์ธ๊ณต์ง๋ฅ | Deepnoid
DEEPNOID๋ ์ธ๊ณต์ง๋ฅ์ ํตํ ์ธ๋ฅ์ ๊ฑด๊ฐ๊ณผ ์ถ์ ์ง ํฅ์์ ๊ธฐ์ ์ด๋ ์ผ๋ก ํ๊ณ ์์ต๋๋ค. ๋ฅ๋ ธ์ด๋๊ฐ ๊ฟ๊พธ๋ ์ธ์์, ์๋ฃ ์ธ๊ณต์ง๋ฅ์ด ์ง๊ธ๋ณด๋ค ํจ์ฌ ๋์ ๋ฒ์์ ์งํ์ ์ฐ๊ตฌ, ์ง๋จ, ์น๋ฃ์ ๋์
www.deepnoid.com
1. MobileNet
: Mobile ๊ธฐ๊ธฐ์์๋ ๋์๊ฐ๊ธฐ ์ํ ๊ฒฝ๋ํ๊ฐ ํต์ฌ!
: ์ฐ์ฐ๋ ๊ฐ์๋ฅผ ์ต์ฐ์ ์ผ๋ก ๋ชฉํ
- Depthwise Separable Convolution
1) Depthwise Convolution
: ๊ฐ๊ฐ์ feature map ์ ๋ํด 1-channel Conv ์ฐ์ฐ ์ํ ํ Concat ํํ๋ก ๊ฐ๊ฐ ๊ฒฐ๊ณผ feature map ์ฑ๋๋ณ๋ก ์์
2) Separable Convolution
: ์ฑ๋๋ณ๋ก ๊ตฌํด์ง feature map ์ 1x1 kernel Conv ์ฐ์ฐ์ผ๋ก ํ๋์ channel ๋ก ํฉ์ฑ
=> ๊ฐ๊ฐ ์ฐ์ฐ๋ feature map ๋ค์ด ํ๋์ ์์์ผ๋ก stack ๋ ํ 1x1 kernel Conv์ผ๋ก ์ฑ๋์๋ง ๋ฐ๊ฟ์ฃผ๋ ๊ฒ
2. ๊ธฐ์กด Conv ์ฐ์ฐ๋ ๊ณ์ฐ
: (Dk^2 * M) * Df^2 * (N * Dg^2)
- Dk : kernel size
- Df : input size
- Dg : output size
- M : input channel
- N : output channel
3. Depthwise Conv ์ฐ์ฐ๋ ๊ณ์ฐ
: (Dk^2 * 1) * Df^2 * (M * Dg^2)
- M = 1 : 1 channel ์ ๋ํด์๋ง ๋ ๋ฆฝ์ ์ผ๋ก Conv ์ฐ์ฐ ์ํ
- N = M : Depth Conv ๊ฒฐ๊ณผ ์์์ ์ธํ ์์์ ์ฑ๋ ์๋งํผ ๊ฐ๊ฐ ์ฐ์ฐ ์ํ ๊ฒฐ๊ณผ๋ฅผ concat์ผ๋ก ํฉ์นจ
4. Separable Conv ์ฐ์ฐ๋ ๊ณ์ฐ
: (1* M) * Df^2 * (N * Dg^2)
- Dk = 1 : 1x1 kernel convolution ์ํํ๊ธฐ ๋๋ฌธ์ 1 ์๊ฑฐ
- Df = Dg : 1x1 kernel convoluton ์ํํ๊ธฐ ๋๋ฌธ์ Df, Dg ํฌ๊ธฐ ๋ณํ X
5. ๊ธฐ์กด VS Depthwise Separable Conv
- ๊ธฐ์กด
= (Dk^2 * M) * Df^2 * (N * Dg^2)
- Depthwise Separable
=(M * Dk^2 * Df^2 * Dg^2) + (M*N*Df^2 * Dg^2)
= M * Df^2 * Dg^2 * (Dk^2 + N)
6. EfficientNet
: EfficientNet Baseline(MBconV) Block + Compound Scaling
์ฑ๋ฅ + ๊ณ์ฐ๋ GOOD
1) Inverted residual block (Linear Bottleneck)
- residual blokc
: ์ฑ์ปฌ ์๊ฐ ํด ๊ฒฝ์ฐ 1x1 Conv ์ฑ๋ ์๋ฅผ ์ค์ธ ํ 3x3 conv ์ํ ํ ๋ค์ ์ฑ๋ ๋๋ฆฐ ๋ค์ skip connection
- inverted residual block
: expansion layer๋ก ์ฑ๋์ ๋ฐ๋๋ก ๋๋ฆฐ ํ conv, ๋ค์ ์๋ ์ฑ๋ ํฌ๊ธฐ๋ก ์ค์ธ ๊ฒฐ๊ณผ๋ฅผ skip connection
- manifod
: ๊ณ ์ฐจ์ ์ฑ๋์ ์ ์ฐจ์์์ ํํ ๊ฐ๋ฅ
7. MBconV Block - SE Block
- squeeze
: fearure map ์ GAP(gloabl average pooling) ์ผ๋ก ์์ถ
- excitation
: ๊ฐ ์ฑ๋๋ณ ์ค์๋ ์ฐ์ฐ (relu + sigmoid)
=> SE Block : GAP + FC + ReLU + FC + Sigmoid
=> feature map ๋ณ๋ก ์ค์๋ ๊ณ์ฐ, ํด๋์ค ๋ถ๋ฅ์ ๋ ์ ํํ ์ ๋ณด ์ ๋ฌ
8. EfficientNet Baseline Block : MBconV Block
- mobile net
: depthwise separable
: inverted residual
- SENet
: squeeze
: excitation
9. Compound Scaling
: ๋ชจ๋ธ์ ์ฑ๋ฅ์ ํฅ์์ํฌ ์ ์๋ ์ต์ ์ Width, Depth, Resolution scaling