본문 바로가기

AI 논문

[꼼꼼하게 논문 읽기]Hidden Two-Stream Convolutional Networks for Action Recognition ( 2018 )

728x90
반응형

이제 천천히 action recognition으로 한번 가봅시다

optical flow도 확보되었겠다

시작해볼게요

반응형

Abstract

  human actions의 videos를 Analyzing 하는 것은 video frames 중에 temporal relationships를 이해하는 것을 포함하죠. SOTA action recognition approaches는 CNNS을 위한 pre-compute motion imformation을 pre-compute한 traditional optical flow estimation methods 의존하죠. ( 사실 당시까지만 해도 성능이 안나옵니다만 여튼 ) 이런 two-stage approach 는 computationally expensive, storage demanding 그리고 end-to-end로 학습이 되지 않죠. 이 연구에서 저자들은 새로운 cnn architecture를 제안하는데 인접한 frames간에 motion information을 명확하게 capture하죠. 이 새로운 architecture를 hidden two-stream CNNS 라고 하는데 raw video frames을 input으로 주고 action classes를 optical flow 계산 없이 직접 예측하기 때문이죠. 저자들의 end-to-end approach는 two-stage baseline에 비해 10x 빠른 성능을 보여준다고 하네요. 

Introduction

   human action recognition의 field는 몇년 동안 빠르게 발전해왔죠. 저자들은 manually designed features로부터 CNN feature로 이동해왔죠. encoding appearance information 에서 encoding motion information; learning local features 에서 learing global video features. 성능 역시 지속적으로 상승했죠. end-to-end learning framework의 단계로 통합하면서 말이죠. 그럼에도 불구하고 SOTA CNN structures는 video frames로부터 직접적으로  motion information을 cpaturing하는데 어려움이 있죠. 대신에 전통적인 local optical flow estimation methods가 CNNS을 위한 motion information을 pre-compute하는데 사용되죠. 이 two-stage pipeline은 먼저 optical flow를 compute하고 난 뒤 optical flow에서 action label로의 mapping을 학습하죠. 이 pipeline은 다음과 같은 이유로 차선책이죠.

  - optical flow의 pre-computation은 time consuming하고 storage demanding 하죠

  - traditional optical flow estimation은 action recognition과 같은 final task에 완전히 독립적이며 때문에 차선책이 되죠

 

  이 문제를 해결하기 위해, 학자들은 다양한 방법을 제안하죠. 예를 들면 motion vector와 같은 새로운 representations나 RGB image difference나 RNN나 3D CNNS 같은 새로운 architecture를 제안하는 것등이 있겠죠. 그러나, 이들 중 다수는 action recognition에 있어 optical flow 만큼 효과적이지 않죠. 따라서 이 연구에서는 저자들은 위에서 언급한 문제를 직접해결 하는 방법을 다룹니다. 저자들은 end-to-end CNN approach를 적용하는데 optical flow를 학습하죠. 이는 computation과 storage 문제를 피하고 motion represestations를 얻기 위함이죠. 그러나, motion estimation model을 학습하는 데에 많은 문제를 직면했죠.

  - 저자들은 supervision 없이 models를 train해야 했죠. ground truth flow는 supervise training을 요구하기에 합성 data를 제외하고는 자원이 없습니다.

  - 저자들은 scratch로 부터 optical flow estimation models를 학습시켜야 했죠. models ( filters )는 optical flow estimation tasks를 위해 학습되고 다른 vision tasks와는 많은 차이가 있죠

  - 저자들은 traditional optical flow estimation loss functions을 사용할 수 없었습니다.

 

  이 challenges를 다루기 위해, 저자들은 먼저 consecutive frames의 set으로부터 optical flow를 generating하는 CNN을 학습했습니다. unsupervised loss functions와 specially designed operator의 set을 통해, 저자들은 새로운 training step은 optical flow를 생성하죠. 이 성능은 traditional methods와 유사한 성능이 나오죠. Fig 1에서 설명하듯이, 저자들은 이 Network를 MotionNet이라고 부릅니다.

  MotionNet이 주어지면 저자들은 이 것을 temporal stream과 concatenate합니다. temporal stream은 estimated optical flow를 action label로 map하는 CNN 이죠. 저자들은 concatenate 이후에 쌓여진 temporal stream CNN을 fine-tune합니다. end-to-end manner가 사용되고 input frames에 대한 action classes를 predice하죠. 저자들은 new approach를 hidden two-stream networks라고 부릅니다.

Related Work

  video에서 human activities를 understanding 하는데에 상당한 진보가 지난 몇난 간 이뤄졌죠. 초기에 traditional handcrafted features 는 Improved Dense Trajectories 같은 것들이 있고 몇 년간 video analysis를 지배했죠.  우월한 성능에도 불구하고 IDT와 그 모델의 성능 향상은 real aplications에 대해서는 만만치 않았죠. CNNs는 초기에는 IDTs보다 성능이 좋지 않았죠. 이 inferior performance는 CNNs 가 frames 들 중에서 motion information을 capturing하는데에 어려움이 있었기 때문이죠. 후에, two-stream CNNs 는 이 문제를 traditional optical flow estimation methods를 pre-computing하고 pre-computed optical flow를 encode하는 separate CNN 학습함으로써 다뤘죠. 이 additional stream은 temporal stream으로 알려져있고, CNNs의 정확성에 상당한 향상을 가져왔죠. 그리고 결국 IDT를 뛰어넘었죠. 이런 acuuracy improbements는 temporal motion information의 중요성을 나타내죠.

  그러나, CNN과 비교해서 optical flow calculation은 computationally expensive하죠. 이는 current two-stream의 주요한 bottleneck이고요. Zhange은 대안으로 motion vectors를 사용했죠. 이 간단한 향상은 20x 속도 향상을 가져왔죠. 기존 two-stream approaches에 비해 말이죠. 그러나, 속도 향상은 accuracy drop을 야기했죠. encoded motion vectors는 fine structures가 lack되었고, noisy와 inaccurate motion patteren이 포함되었죠. 이는 worse accuracy를 야기합니다. 이런 약점은 근본적이고 향상될 수 없죠. 다른 유망한 approach는 optical flow를 supervised CNNs를 통해 예측하는 것을 학습하는 것이죠. Ng는 optical flow를 사용했는데 traditional methods에 의해 계산된 optical flow였고, optical flow를 예측하는 network를 train하는 supervision으로써 사용했죠. 이 방식은 inference time에 optical flow의 pre-computation을 피했고, 처리 속도를 향상 시켰죠. 그러나 optical flow의 quality가 문제가 되었죠. Ilg는 ground truth 가 존재하는 합성 데이터로 trained된 network를 사용했죠. 그러나 real data와 합성 데이터의 차이가 문제가 되었죠. 저자들의 연구는 optical flow estimation problem을 더 본질적으로 유망한 방식으로 다뤘습니다. 저자들은 optical flow를 CNNs를 사용해서 예측하죠. 따라서 computation과 storage problems를 해결하죠. 저자들은 unsupervised pre-training을 수행합니다. 따라서 합성 데이터와의 domain gap 문제 역시 해결하죠.

  computational problem과 더불어, traditional optical flow estimation은 action recognition과 같은 final tasks와 완전히 독립적이죠. 그러나, 저자들의 방법은 end-to-end optimized 입니다. 이것은 encoding CNNs에 motion information을 도입하는 두가지 방법을 구별하는 것은 중요합니다. optical flow는 videos에서 motion information을 represent 하는데에 사용됨에도 불구하고 저자들은 optimal representation이 존재하는지 알 수 없죠. 사실 최근 연구는 fixed flow estimation은 general computer vision task에 대한 task-oriented flow 만큼 좋지 않다는 것을 밝히죠. 따라서 저자들은 저자들의 end-to-end learning framework가 더 좋은 motion representations를 추출하는데 도움이 될것이라 믿는답니다. 그러나,  표기상의 편의를 위해, 저자들은 learned motion represestation을 optical flow라고 하겠답니다.

Hidden Two-Stream Networks

  이 section에서는, 저자들은 제안한 hidden two-stream networks에 대해 상세히 다루는 데요. 저자들은 먼저 unsupervised network를 도입합니다. 이는 optical flow estimation을 위한 것이죠. section 3.1에 설명한다고 하네요. 저자들은 MotionNet이라고 부른다고 합니다. 3.2에서는 temporal stream network을 MotionNet에 쌓습니다. 이는 end-to-end training을 가능하게 하죠. 마지막으로 hidden two-stream CNNs를 도입합니다. 이는 stacked temporal stream에 spatial stream을 합친것이죠

  Unsupervised Optical Flow Learning

    저자들은 optical flow estimation을 image reconstruction problem으로 다루는데요. frame pair 가 주어지면 , optical flow를 생성하고 이는 하나의 frame이 다른 하나의 frame으로 reconstruct 되는 것을 가능하게 하죠. 형식적으로, 인접한 frames I1과 I2가 쌍으로 input으로 주어지면 CNN은 flow field V를 만들어내죠. 그러면 predicted flow field V와 I2를 활용해 I1'을 reconstruct 합니다. 이때 backward warping을 사용합니다. 식으로 표현하면 아래와 같죠.

intuition은 만약 estimated flow 와 다음 frame이 현재 frame을 reconstruct하는 데 사용될 수 있다면, network는 underlying motions의 representations를 학습할 수 있다는 것이죠.

  MotionNet

  MotionNet은 fully convolutional network인데요 contracting part와 expanding part로 구성되어 있죠. constracting part는 convolutional layers가 쌓여있고 expanding part는 combined convolutional과 deconvolutional layers의 chain으로 되어있죠. 

  먼저 , 저자들은 small displacement motion에 집중하는 network를 design했죠. YouTube videos 같은 real data에 대해, foreground motion은 작지만, background motion이 지배적인 문제를 종종 마주할 수 있었다고 하네요. 그래서 3 x 3 kernels를 적용했고 이는 network에서 local, small motions를 detect하는 데 사용되죠. 게다가, high frequency image details를 later stages에 대해 유지합니다. 처음 두 개의 convolutional layers는 striding을 사용하지 않죠.  image downsampling 을 위한 pooling 대신에 stride convolution을 사용합니다. pooling이 dense per-pixel prediction tasks에 대해 harmful 로 보여지기 때문이죠.

  다음으로, MotionNet은 multiple scales에서 multiple loss를 compute 합니다. skip connection 때문에, intermediate losses는 each other에 regularize할 수 있고, final objective에 빠르게 converge 하는 earlier layers를 guide할 수 있죠. 세 개의 loss functions를 사용했는데 더 좋은 optical flow를 생성하는데 도움이 되죠. 그 loss functions은 아래와 같습니다.

  V^x와 V^y는 추청된 optical flow인데요 u,v 채널을 가지고 있죠. ( H, V 방향을 그냥 u, v 라고 할게요 ). inverse warping T는 spatial transformer module 입니다.( 우리가 흔히 알고 있는 trasnformer와는 달라요 15년에 나온 거거든요, 여튼 ) 저자들은 robust convex error function을 사용하는데요, 일반적은 Charbonnier penalty 는 아래와 같죠.

이상치의 영성을 줄이기 위해 사용됩니다. h, w는 I_1와 I_2 image의 넓이와 높이를 뜻합니다.

  gradient V^x_x 와 V^x_y는 estimated flow field V^x의 gradient를 말하는데요. 이와 유사하게 gradient V^y_x와 V^y_y 역시 V_y의 gradients를 말하죠. Charbonnier penalty는 pixelwise loss에서 사용된 것과 같습니다.

u_p1과 u_p2는 I_p1과 I_p2 image patches를 뜻합니다. 그리고 sigma_p1과 simga_p2는 I_p1, I_p2의 variance를 뜻하죠. sigma_p1p2는 두 image patches의 covariance를 뜻합니다. c1과 c2는 constant인데요. 매우작은 denominator로써 division을 stabilize하죠. 실험을 통해 K는 8, c1과 c2는 0.0001, 0.001로 set합니다.

I1과 I1'의 similarity를 비교하기 위해, 저자들은 sliding window approach를 적용합니다 image를 local patches로 나누는데 말이죠. sliding window를 위한 stride는 수직, 수평 방향 모두 8로 set합니다. 따라서 SSIM loss function은 아래와 같이 정의됩니다.

여기서 N은 patches의 number 이고 sliding stride 8로 주어진 image로 부터 extract할 수 있죠. n은 patch index입니다. I_1n 과 I_n1'은 original image I1과 reconstructed image I1' 으로부터 두개의 해당하는 patches입니다. 저자들의 실험은 이 간단한 startegy가 estimated flow의 큰 향상을 가져왔다는 것을 보여준다고 하네요. 

 

  따라서 각 scale s에서 loss는 pixelwise reconstruction loss, piecewise smoothness loss, region-based SSIM loss의 weighted sum 입니다. 식은 아래와 같죠.

 lambda 1, lambda 2, 그리고 lambda 3 은 training 동안 different metrics의 relative importance를 weight하죠. 저자들은 5 scales에서 predicitions를 가지기 때문에 overall loss는 L_s의 weighted sum입니다. 식은 아래와 같죠

delta_s는 losses의 balance를 set합니다. 저자들은 보충 자료에서 이 weightes의 values를 결정하는 방법을 묘사한다고 하네요.

  세 번째, optical flow의 unsupervised learning 은 homogeneous regions에서 artifacts를 도입하는 데요. brightness assumption을 위반하기 때문이죠. 저자들은 deconvolutional layers 간에 additional convolutional layers를 도입하죠. flow confidence를 adding하는 것 original color images에 의해 multiplying되는 것과 유사하게 말이죠. 그러나 어떤 향상도 관찰 할 수 없었다고 하네요.

  MotionNet은 본질적으로 Flownet2와 다르다고 하는데요. 먼저, 저자들은 unsupervised learning을 수행하죠. Unsupervised learning은 합성 data와 real data 간의 domain gap을 피하도록 해주고요. Unsupervised learning은 target의 datasets가 ground truth optical flow를 가지고 있지 않더라도 end-to-end fashion에서 action recognition과 같은 target tasks에 대한 model를 train 하는 것을 가능하게 하죠. 두 번째로, 저자들의 network architecture는 carefully designed 되었는데요 efficiency와 accuracy에 balance를 위한 것이죠. MotionNet은 one network을 가지는 반면 FlowNet2는 5 개의 sub-networks를 가지고 있죠.

  Projecting Motion Features to Actions

  Motion Net과 temporal stream은 모두 CNNS 이고 이들이 주어지면, 이 두 module을 one stage로 결합하여 end-to-end training을 수행합니다. action labels로 motion features를 project하는 combination의 design에는 여러가지 방법이 있는 데요. 여기에 저자들은 두 가지 방법을 사용했는데요. stacking과 branching입니다.

  stacking은 가장 straightforward approach인데요 temporal stream의 앞에 MontionNet을 위치시키는 거죠. MotionNet을 off-the-shelf flow estimator로 다룹니다. Branching은 더 elegant 하죠. 이는 motion feature extraction과 action classification 모두에 대해 single network를 사용합니다. convolutional features는 two tasks에서 공유됩니다. space limitations 때문에, 저자들은 stacking이 더 effective하다는 것을 보충자료에서 보여준다고 하네요 ( 논문에서도 좀 보여주지 볼 수가 없으니.. ) stacking이 spatial stream에 complementary를 유지하면서도 action recognition performance를 더 좋게 보여줍니다. 저자들은 motion features를 action labels로 project하는 stacking을 선택하겠다고 하네요

  stacking에서, 저자들은 estimated flow를 normalize합니다. CNN encoding에 입력하기 전에 말이죠. 더 구체적으로 저자들은 먼저 20x20 pixel보다 큰 motions를 clip합니다. 다음으로 cilpped flow를 0 ~ 255 사이의 range로 normalize하죠. 저자들은 이런 normalizaition이 good temporal stream performance를 위해 중요하다고 말하며 새로운 normalization layer를 design합니다

  둘째로, network를 fine tune하는 방법을 조사했는데요. 이는 fine tunin동안 사용되는 loss를 포함하죠. 저자들은 different settings를 사용합니다. MotionNet을 Fixing하는 데, optical flow estimator fine-tune하는 action loss를 사용하지 않죠. MotionNet과 temporal stream CNN 모두는 fine-tuned 되는데, action categorical loss funtion이 계산되죠. unsupervised objective는 포함되지 않죠. 3 번째로, MotionNet과 temporal stream CNN을 fine-tuned하는데, all loss functions를 계산합니다. motion이 action과 related 되기 때문에 저자들은 이 multi-task way가 motion estimators를 더 잘 학습할 수 있길 바란다고 하네요.

  세번 째로, 저자들은 long-term motion dependencies를 capture할 필요가 있는데요. 저자들은 이것을 mutiple conflow fields의 stack을 도입함으로써 해결합니다.  Simonyan과 Zisserman 은 10 flow fields의 stack이 single flow field를 사용하는 것보다 더 higher accuracy를 달성하는데 더 도움이 된다는 것을 발견했죠. 저자들 역시 11 frames을 input으로 함으로써 10 optical flow을 생성하도록 했죠.

  Hidden Two-Stream Networks

  저자들은 또한 stacked temporal stream을 spatial stream에 combining한 결과를 보여줍니다. 이 결과는 중요하죠. stacked temporal stream이 complementary motion information이나 appearance information을 학습할 지에 대한 strong ㅑindicators이기 때문이죠.

  

이번 글은 여기까지 하도록 할게요

음 뭔가 알듯 말듯 한데.. 적용을 어떻게 해야할까요 ㅎㅎ

unsuervised는 사용하지 않을꺼고..

더 예전걸 참고 해봐야겠네요

다음글에서 뵐게요

728x90
반응형