본문 바로가기

인공지능/Python

Introduction of Image Segmentation

목차

       

      Image Segmentation이란

      이름 그대로 image를 분할하는 방법이다. classification은 한장의 image가 어떤 클래스일지 맞추는 작업이고, object detection은 특정 object의 bounding box를 찾는 작업이다. segmentation은 더 나아가서 image의 모든 픽셀에 대해서 클래스를 예측하는 작업이다.

       

      Image Segmentation의 구분

      Semantic segmentation, Instance segmentation, Panoptic segmentation으로 구분이 가능하다. 간단히 설명하면 semantic segmentation은 단순히 pixel의 클래스를 구분 하는 작업이고, instance segmentation은 같은 클래스여도 서로다른 개체를 구분해주는 작업이다. 그리고 panoptic segmentation은 앞서 설명한 semantic segmentation과 instance segmentation을 합친 작업이라고 생각하면 된다. 아래 그림의 예시와 같이 클래스별로 구분할 것인지(semantic segmentation), 개체를 찾고 해당 개체의 segment를 찾을 것인지, semantic segmentation에서 개체를 구분할 것인지에 따라 다르게 본다.

      Semantic segmentation, Instance segmentation, Panoptic segmentation

       

      Deep Learning-based Image Segmentation Methods

      Image segmentation에는 여러가지 방법이 있어왔다. 하지만 본 글에서는 Deep learning에 기반한 방법론에 대한 내용을 작성한다.

      Traditional image segmentation method

      Convolutional Encoder-Decoder Architecture

      SegNet(by Badrinarayanan et. a. 2015)을 통해 segmentation 분야에서 encoder-decoder 구조는 인기가 많아졌다. bottle neck 형태로 구성되어 encoder에서는 convolution을 이용한 downsampling block에서 입력의 feature map을 추출하고, decoder에서는 feature map을 upsampling하면서 클래스 별로 segment map을 만든다.

      Convolutional encoder-decoder architecture

      encoder-decoder architecture에서 위치정보는 down sampling을 진행함에 따라 output stride가 늘어나기 때문에 조금씩 사라지게 된다. 이를 해결하기위해 U-Net에서 skip-connection을 적용했고 효과는 굉장했다. 특히 의학 이미지를 이용한 연구에서 성능이 좋았는데, 질병 진단을 위한 세포 segmentation에서 U-Net이 SOTA(State Of The Art)를 달성했다. U-Net 구조는 다음과 같다.

      U-Net architecture

      U-net의 뒤를 이어서 DeepLab이 semantic segmentation의 SOTA를 달성했는데, DeepLab은 down sampling에서 위치 정보를 잃는 것을 방지하기 위해 atrous spatial pyramid pooling(ASPP)을 사용했다. ASPP를 이용한 multi-scale feature extraction은 입력의 크기와 관계없이 segment를 수행할 수 있게 했다.

      ASPP(Atrous Spatial Pyramid Pooling)

      Semantic segmentation과 Instance segmentation에서 가장 중요한 부분 중 하나인 경계선 정보를 복구하기위해서 FC-CRFs(Fully connected conditional random fields)를 사용했다. CRFs 덕분에 Deeplab은 FCN, SegNet보다 훨씬 정확한 segment map을 만들어 낼 수 있었다.

      SegNet, U-Net, DeepLab 논문을 통해서 mask-rcnn, deeplab 시리즈(v2, v3, v3+), PspNet, GSCNN과 같은 모델들이 탄생했다.

       

      Application of Image Segmentation

      간단하게 나열식으로 정리하겠다.

      Robotics (Machine Vision)

      • Instance segmentation for robotic grasping
      • Recycling object picking
      • Autonomous navigation and SLAM 

      Medical Imaging

      • X-Ray segmentation
      • CT scan organ segmentation
      • Dental instance segmentation
      • Digital pathology cell segmentation
      • Surgical video annotation

      Smart Cities

      • Pedestrian detection
      • Traffic analytics
      • License plate detection
      • Video Surveillance

      Self Driving Cars

      • Drivable surface semantic segmentation
      • Car and pedestrian instance segmentation
      • In-vehicle object detection (stuff left behind by passengers)
      • Pothole detection and segmentation

       

      Reference

      1) https://www.v7labs.com/blog/image-segmentation-guide

       

      Image Segmentation: Deep Learning vs Traditional [Guide]

      What is image segmentation for machine learning and how does it work? Learn about different image segmentation algorithms and models. Explore examples.

      www.v7labs.com