2018.08.22에 발표된 Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation,

일명 DeepLabv3+에 대해서 리뷰하도록 하겠습니다.




DeepLab은 v1부터 가장 최신 버전인 v3+까지 총 4개의 버전이 있습니다.


1. DeepLabv1 (2015) : Semantic Image Segmentation with Deep Convolutional Nets and Fully Connected CRFs 


2. DeepLabv2 (2017) : DeepLab : Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs


3. DeepLabv3 (2017) : Rethinking Atrous Convolution for Semantic Image Segmentation


4. DeepLabv3+ (2018) : Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation



이 중 가장 최신의 논문이며 뛰어난 성능을 보이고 있는 DeepLabv3+에 대해서 다루도록 하겠습니다.





Abstract


1. Spatial pyramid pooling moduleEncode-decoder structure 각각의 장점을 합쳐 더욱 더 좋은 성능을 보이는 DeepLabv3+를 제시합니다.

- Spatial pyramid pooling module : Rate가 다른 여러 개의 atrous convolution을 통해 다양한 크기(multi-scale)의 물체 정보를 encode할 수 있습니다.

- Encode-decoder structure : 공간 정보(spatial information)를 점진적으로 회복함으로써 더욱 정확하게 물체의 바운더리를 잡아낼 수 있습니다.


2. Xception model을 backbone network로 사용합니다.


3. The depthwise separable convolution을 통해 encoder-decoder를 더욱 빠르고 정확하게 합니다.


4. 후처리(post-processing) 작업 없이 PASCAL VOC 2012와 Cityscapes의 test data에 대해 각각 89.0%와 82.1%의 성능을 보입니다.

- v2까지는 모델의 output에 CRF를 거치는 post-processing을 통해 더욱 정확한 바운더리를 잡아내었습니다.




1. Introduction


- Atrous convolution을 통해 extracted encoder features의 resolution을 임의로 할 수 있습니다. 이는 기존의 Encoder-decoder model에서는 불가능했습니다.


나머지 내용은 모두 Abstract에서 언급한 것과 동일하기 때문에 생략하도록 하겠습니다.




2. Related Work


- Atrous Convolution

사진 출처


 Atrous에서 trous는 구멍(hole)을 의미합니다. 즉, convolution에서 중간중간을 비워두고 특정 간격의 픽셀에 대해서 합성곱을 한다고 생각할 수 있습니다. Atrous convolution에는 rate라는 parameter가 존재하는데 사진에서 r이 rate에 해당합니다. r이 커질수록 필터는 더 넓은 영역을 담을 수 있게 됩니다.

 장점 : 동일한 수의 파라미터를 이용함에도 불구하고 필터의 receptive field를 키울 수 있습니다. 따라서 semantic segmentation에서는 디테일한 정보가 중요하므로 여러 convolution과 pooling 과정에서 디테일한 정보가 줄어들고 특성이 점점 추상화되는 것을 어느정도 방지할 수 있습니다.



 


- (a) Spatial Pyramid Pooling

 다른 rates의 atrous convolution을 parallel하게 적용하여 다양한 크기(multi-scale)의 정보를 담을 수 있습니다.


- (b) Encoder-Decoder

 Encoder-decoder는 human pose estimation, object detection, 그리고 semantic segmentation을 포함해 다양한 컴퓨터 비전 영역에서 좋은 성능을 보여왔습니다. Encoder 부분은 점점 feature maps을 줄여 higher semantic information을 잡아낼 수 있습니다. 또한 Decoder 부분은 점진적으로 공간 정보(spatial information)를 회복합니다.

 이 논문에서는 encoder module로 이전 버전인 DeepLabv3을 사용할 것을 제시하고 있습니다.





- Depthwise separable convolution

Depthwise separable convolution은 Mobilenet 논문에 담긴 사진과 링크에서 사용한 사진을 통해 정리하도록 하겠습니다.



Standard Convolution




위의 그림은 일반적으로 사용되는 convolution을 나타낸 사진입니다.

하나의 3x3 filter가 input channel과 동일한 channel을 가지고 합성곱을 하면 channel이 1인 output이 나오게 됩니다.

이러한 filter를 원하는 output channel의 개수만큼 사용합니다.


이를 일반화하여 나타내면 위와 같습니다.

Dk는 filter의 크기이고 M은 input channel, 그리고 N은 output channel (= filter의 개수)를 의미합니다.




Depth Separable Convolution



Depth separable convolution은 두 가지 과정을 거칩니다.


1. Depth Convolution : filter의 channel이 input channel과 같은 것이 아니라 1로 두어서

convolution 결과 channel의 변화가 생기지 않도록 한다.


2. Pointwise Convolution : 1x1 filter를 원하는 output channel의 개수만큼 사용하여 channel의 개수를 맞춰준다.



위의 그림을 참고하면


Depthwise convolution 과정에서 사용되는 filter는 channel이 1이고 filter의 개수가 input channel인 M과 같습니다.

그리고 Pointwise convolution에서 사용되는 filter는 channel이 input channel인 M이고

filter의 개수가 원하는 output channel과 같습니다.



Depth Separable Convolution의 장점으로는

일반적인 Convolution과 비슷한 과정을 거치지만 사용되는 parameter의 수를 획기적으로 줄여

모델의 속도를 향상시킬 수 있습니다.


※ 잘 이해가 되지 않으시는 분은 PR-044: MobileNet을 참고하시면 좋을 것 같습니다!








3. Methods



- 3.1 Encoder-Decoder with Atrous Convolution

 DeepLabv3+에서는 Encoder로 DeepLabv3을 사용하고 Decoder로 bilinear upsampling 대신에 U-net과 유사하게 concat해주는 방법을 사용합니다.


 1) Encoder (DeepLabv3) : DCNN(Deep Convolutional Neural Network)에서 Atrous convolution을 통해 임의의 resolution으로 특징을 뽑아낼 수 있도록 합니다. 여기서 output stride의 개념이 쓰이는데 'input image의 resolution과 최종 output의 resolution의 비'로 생각하시면 됩니다. (The ratio of input image spatial resolution to the final output resolution) 즉, 최종 feature maps이 input image에 비해 32배 줄어들었다면 output stride는 32가 됩니다. Semantic segmentation에서는 더욱 디테일한 정보를 얻어내기 위해서 마지막 부분의 block을 1개 혹은 2개를 삭제하고 atrous convolution을 해줌으로써 output stride를 16혹은 8로 줄입니다. 

 그리고 다양한 크기의 물체 정보를 잡아내기 위해 다양한 rates의 atrous convolution을 사용하는 ASPP(Atrous Spatial Pyramid Pooling)를 사용합니다.


 2) Decoder : 이전의 DeepLabv3에서는 decoder 부분을 단순히 bilinear upsampling해주었으나 v3+에서는 encoder의 최종 output에 1x1 convolution을 하여 channel을 줄이고 bilinear upsampling을 해준 후 concat하는 과정이 추가되었습니다. 이를 통해 decoder 과정에서 효과적으로 object segmentation details을 유지할 수 있게 되었습니다.



- 3.2 Modified Aligned Xception


 DeepLabv3+에서는 Xception을 backbone으로 사용하지만 MSRA의 Aligned Xception과 다른 3가지 변화를 주었습니다.

 1) 빠른 연산과 메모리의 효율을 위해 entry flow network structure를 수정하지 않았습니다.

 2) Atrous separable convolution을 적용하기 위해 모든 pooling operation을 depthwise separable convolution으로 대체했습니다.

 3) 각각의 3 x 3 depthwise convolution 이후에 추가적으로 bath normalization과 ReLU 활성화 함수를 추가해주었습니다.




4. Experimental Evalution


DeepLabv3에서 사용했던 ResNet대신에 Xception을 backbone으로 사용하였을 때

Error rate가 더 낮음을 확인할 수 있습니다.





표를 통해 Decoder를 추가한 것이 훨씬 높은 mIOU를 보인다는 것을 확인할 수 있습니다.


또한 예시를 통해 살펴보면

중간 사진은 DeepLabv3과 동일하게 단순히 BU(Bilinear Upsampling)만 사용한 것이고

오른쪽 사진은 U-net과 유사하게 concat 과정이 있는 decoder를 사용한 것입니다.


이를 통해 Decoder 과정에서 boundary information을 잘 잡아내었음을 확인할 수 있습니다.




5. Conclusion


 DeepLab은 segmentation task의 문제점에 대한 해결책을 찾으며 v1부터 꾸준하게 발전해온 모델입니다. 또한 Atrous convolution과 decoder를 통해 segmentation을 더욱 더 정확하게 할 수 있음을 보여주었습니다.






6. Reference

 1. DeepLabv3+ 리뷰 : https://blog.lunit.io/2018/07/02/deeplab-v3-encoder-decoder-with-atrous-separable-convolution-for-semantic-image-segmentation/

 2. Atrous Convolution : https://www.mdpi.com/2072-4292/9/5/498/html

 3. MobileNet : https://arxiv.org/abs/1704.04861 (Paper)

                    http://machinethink.net/blog/googles-mobile-net-architecture-on-iphone/

                    https://www.youtube.com/watch?v=7UoOFKcyIvM&feature=youtu.be (PR-044)