본문 바로가기
  • AI 개발자가 될래요
논문 리뷰

[논문 리뷰] Accurate Facial Image Parsing at Real-Time Speed

by 꿀개 2023. 4. 3.

https://paperswithcode.com/paper/accurate-facial-image-parsing-at-real-time

 

Papers with Code - Accurate facial image parsing at real-time speed

#6 best model for Face Parsing on CelebAMask-HQ (Mean F1 metric)

paperswithcode.com

 

Accurate Facial Image Parsing at Real-Time Speed 논문 리뷰

 

Abstract

promising accuracy와 eal-time inference speed로 동작 가능한 face parsing 네트워크 제안

일반 이미지 파싱과 face 파싱의 차이점을 분석하고 전통적인 FCN을 살펴본다.

Face Parsing improvements를 위해 다음 3가지를 제안한다.

  1. Normalized Receptive Field
  2. Statistic Contextual Loss Function, which integrates contextual information and regularizes features
  3. semi-supervised distillation scheme that effectively transfers the learned knowledge to a lighter network

 

Introduction

- face parsing 정의

The task of face parsing is to extract the semantic constituents (e.g. mouth, eyes and nose) from facial portraits at pixel-wise level.

- 활용 분야

This task has been long studied and is the basic part in many other fields such as face detection and recognition, 3D modeling, face deblurring and so on.

- 이 논문에서는

we propose a real-time deep learning scheme for face parsing task with state-of-the-art performance.

 

- general image parsing task와의 비교

1. 입력 이미지가 매우 제한적이다. 

preprocessing 과정에서 face align이 필요하다. 보통 5개의 랜드마크를 먼저 찾고 affine transformation으로 이미지가 같은 위치에 오도록 한다. 따라서 다른 이미지라도 facial constituent(성분) 들은 비슷한 크기를 갖고 있다.

2. each parsing class (or facial components)가 모든 이미지에 존재한다.

파싱 클래스는 모델이 학습하는 동안 계속해서 나타나는데, 이러한 파싱 클래스의 연속적인 출현은 모델이 보다 안정적인 정보를 얻을 수 있게 해준다. 이 정보를 이용하여 모델은 더 견고한 기능 통계를 구축할 수 있고, 이를 이용하여 추가적인 기능 규제를 수행할 수 있다. 이를 통해 모델은 보다 일반화된 결과를 얻을 수 있게 된다.

3. 몇몇 semantic 요소들은 설명할 수 없는 low level characteristics이 없다.

Some 요소들은 모호한 경계선을 갖고 있지만(코와 피부, 머리카락과 배경), Some others는 색이나 texture의 variance가 더 크다(눈). 이는 face parsing이 boundary based나 color based 방식이 적합하지 않다는 것을 의미한다.

 

- 주장

이 논문에서는, face parsing with the constraint of real-time inference speed as well as promising accuracy 의 3가지 새로운 방식을 제안한다.

The framework is shown in Figure 1.

 

1. Normalized Receptive Field

이 개념은 input image size와 네트워크 구조 간의 상당한 상관관계를 설명한다. 최적의 Normalized Receptive Field는 task-dependent하고 데이터셋와 네트워크 구조에 일반적이어서 선행 연구로 작용할 수 있다. Normalized Receptive Field를 조정하는 것은 significant boost in performance를 가져올 수 있다.

2. 새로운 loss function, namely the Statistical Contextual Loss (or sc loss for short).

"sc loss"는 face parsing 작업에서 효과적인 metric learning 방법을 활용하여 구성된다. 이 방법은 feature cluster center를 구성하고, 이를 기반으로 하여 feature들과 중심들 간의 거리를 계산한다. 이때, 거리 계산은 유클리드 norm을 더 효과적으로 사용할 수 있는 하위 feature space 에서 이루어진다. 실험을 통해 sc loss를 사용하는 것은 더 긍정적인 효과를 가져오는 것으로 확인되었다.

3. higher inference speed의 demand를 충족시키기 위해서 학습된 네트워크를 lighter 네트워크로 전이시키는 새로운 semi-supervised distilation scheme를 제안한다. 

 

Related Works

  • 딥러닝 모델 이전

- J. Warrell and S. J. D. Prince, “Labelfaces: Parsing facial features by multiclass labeling with an epitome prior,” in Proc. ICIP, 2009, pp. 2481–2484.

: used multinomial priors to model facial structures basing on patches with further refinement via a hierarchical face model.

- K. Luu, T. H. N. Le, K. Seshadri, and M. Savvides, “Facecut— A robust approach for facial feature segmentation,” in Proc. ICIP, 2012, pp. 1841–1844.

: positive features of the Modified Active Shape Model and GrowCut algorithm were combined to ensure more robustness.

  • 딥러닝 based 모델

- patch-based and only parse facial components, excluding hair and face skin. -> [7], [18]

- S. Liu, J. Shi, J. Liang, and M.-H. Yang, “Face parsing via recurrent propagation,” in Proc. BMVC, 2017, pp. 1–10

: proposed a two-stage CNN-RNN hybrid network. The first CNN stage predicted both face parsing mask as well as semantic contours of facial components while the following RNN network performed refinement based on the contours predictions.

- U. Güçlü et al. (2017). “End-to-end semantic face segmentation with conditional random fields as convolutional, recurrent and adversarial networks.” [Online]. Available: https://arxiv.org/abs/1703.03305

: designed a CNN-RNN hybrid network with an additional adversarial loss and takes a coarse parsing mask initialized by landmarks as input.

- L. Zhou, Z. Liu, and X. He. (2017). “Face parsing via a fullyconvolutional continuous CRF neural network.” [Online]. Available: https://arxiv.org/abs/1708.03736

: proposed a deep FCNbased continuous CRF network to integrate superpixel content, contour and continuous CRF model into a unified framework.

 

REVISIT THE NETWORK’S DESIGN

네트워크의 receptive field 에 대해 다뤄본다.

 

A. The Normalized Receptive Field

수용 영역이란 하나의 뉴런이 연결된 데이터의 범위를 나타내며, 이미지 파싱 네트워크를 설계할 때 이를 고려하는 것이 매우 중요하다. 올바른 수용 영역을 디자인하는 것은 이미지 파싱 네트워크의 정확도와 효율성을 높이는 데에 큰 영향을 미치며, 이를 통해 더욱 효과적인 이미지 분석이 가능해진다.

receptive field를 결정하는 3요소: image size, object size and network structure

다른 이미지 분야에서는 오브젝트의 크기 변이가 크기 때문에 pyramid 같은 구조의 네트워크를 사용해야 하지만, face parsing에서는 이미지와 오브젝트의 변이가 적기 때문에 네트워크가 straightforward해야 한다.

그래서 이 논문은 input image size($s$ 로 표기)와 receptive field($r$ 로 표기)의 효과를 제공하는 Normalized Receptive Field (denote as $r_{norm}$) 를 제안한다.

$r_{norm} = r / s$

 

편의를 위해, $s$와 $r$ 은 정향형으로 가정한다. 따라서 가로, 세로 어느 쪽 길이를 사용해도 이 이미지의 크기를 나타낼 수 있다.

이 개념의 효율성을 증명하기 위해, 많은 실험들이 Helen과 LFW 데이터셋을 이용하여 진행되었다. 

아래 그림은 $s$와 $r$에 따른 f1 score를 나타낸다. x축은 $r$를, y축은 $s$를 나타내고, 원점을 지나는 기울기가 $r_{norm}$인 직선은 Normalized Receptive Fields가 $r_{norm}$인 모든 네트워크와 연결되어있다.

Quantitative results of FCN networks trained with different input image size and receptive field

 

이 실험을 통해 몇 가지 중요한 결론이 도출되었다.

  • Face Parsing을 위한 최적의 $r_{norm}$이 존재한다.

: 대부분의 모든 최고 성능은 optimal $r_{norm}$을 따라서 분포되어있다. 이것의 의미는 입력 이미지 사이즈가 고정되어있을 때, optimal $r_{norm}$은 higher convolutional layers에서 가장 적합한 *팽창(dilation) 비율을 선택하는 것에 도움을 줄 수 있다.

* 팽창 비율: 커널(kernel)의 크기를 확장시키는 기술로, 합성곱 레이어에서 feature map의 크기를 유지하면서 넓은 영역의 정보를 수용할 수 있게 해줌

 

  • 더 좋은 성능을 추구하기 위해, 네트워크를 디자인 할 때 오직 input image size or receptive field만 고려하는 것은 적절하지 않다.

: input image가 더 클수록 더 좋은 결과를 보장하진 않는 반면에 optimal receptive field는 input size에 따라 다르다. 이 두 요인이 함께 고려되어야 한다.

 

  • 같은 parsing task에서, optimal $r_{norm}$ 값들은 데이터셋에 따라 변하기 쉽다.

 

  • 같은 parsing task에서, optimal $r_{norm}$ 값들은 다른 네트워크 아키텍쳐에 따라 변하기 쉽다.

 

  • optimal $r_{norm}$은 특정 parsing task에만 연관되어 있다.

: parsing target이 비슷할 때, 데이터셋이 다름에도 불구하고 네트워크는 비슷한 optimal $r_{norm}$을 공유할 수 있다.

 

결론적으로, optimal $r_{norm}$은 데이터셋 및 네트워크 구조에 상관없이 일관되며, 특정 파싱 대상에만 관련되기 때문에 얼굴 파싱 작업에서 양적인 사전 지식으로 사용될 수 있다. 일단 input image size와 같은 모델 세팅이 결정되면, 사용자들은 optimal $r_{norm}$을 네트워크를 빠르게 만들기 위해 사용할 수 있다. 이것은 특정 데이터셋이나 task에 국한되어 있는 것이 아니다. 작은 input image size를 가진 깊은 네트워크의 경우 dilation rate를 1로 줄이는 것이 더 큰 $r_{norm}$을 얻을 것이다. upsampling operation은 feature map을 확장하고 $r_{norm}$을 줄이기 위해 사용된다.

 

B. Use Landmark Heatmap

랜드마크 검출 결과는 중요한 얼굴 구성 요소의 위치를 제공하며 false positive를 줄여준다. 이 아이디어는 처음으로 

A. Jackson, M. Valstar, and G. Tzimiropoulos, “A CNN cascade for landmark guided semantic part segmentation,” in Proc. ECCV Workshops, Geometry Meets Deep Learning (ECCVW), 2016, pp. 143–155.

논문에서 주장되었다.

이 정보를 사용하기 위해, 검출 결과는 one-channel 히트맵을 만들기 위해 사용된다. 모든 영역이 0인 맵에서 각 랜드마크의 위치에 값이 255인 사각형을 그리고 가우시안 블러를 적용한다. 그 다음, 히트맵은 이미지와 함께 네트워크의 입력으로 사용된다. 네트워크에 하나의 입력 채널을 더 추가하기 위해 [30]에서 설명한 방법을 따르고, 첫 번째 컨볼루션 레이어에 초기화되지 않은 가중치를 추가한다. 

 

STATISTICAL CONTEXTUAL LOSS

Statistical Contextual Loss function은 학습 시에 사용되는 추가적인 정규화 작업으로 제안된다. sc loss가 graph models보다 컨텍스트 정보를 통합하는 데 더 효과적이며, 이 이점에 대해 논의하겠다.

 

A. A Brief Review on Center Loss & Range Loss

center loss와 range loss는 feature cluster centers라 불리는 글로벌 통계를 사용한다

$c_{j}$는 $j$ 번째 클래스의 feature center이다. 이는 아래 learning-based 방식으로 정해진다.

- $x_{i}, y_{i}$ : $i$번째 픽셀의 feature와 class label

- $m$: feature map의 픽셀 수

- [.]: 괄호 안의 명제가 참이면 1을 리턴, 거짓이면 0을 리턴 (Iverson bracket)

 

centers는 네트워크의 파라미터 중 일부로 간주되고, $l_{2}$ weight decay가 적용된다. center loss는 $intra-class$ loss term이 있지만, range loss는 $inter-class$ loss term이 추가 된다. 두 terms은 다음 식으로 정의된다.

- $Q$, $R$: 가장 짧은 center distance를 갖고 있는 두 클래스를 나타냄

- $d$: 거리 여유(margin)를 조절하는 상수를 의미. 즉, "d"값이 크면 같은 클래스의 특징들 사이의 거리가 더 멀어지도록 학습되며, 작으면 더 가까워지도록 학습됨.

이 논문에서는 center loss와 $L_{inter}$, $L_{intra}$의 조합을 베이스라인으로 사용한다.