본문 바로가기
🏛 Research/Detection & Segmentation

[논문 리뷰] Feature Pyramid Networks for Object Detection / FPN / 객체의 스케일에 invariant한 네트워크

by 뭅즤 2022. 1. 13.
반응형

Object detection 뿐만 아니라 segmentation 분야에서도 자주 쓰이는 FPN(Feature Pyramid Network) 구조를 설명합니다.


FPN(Feature Pyramid Network) 

 

Object detection과 segmentation 분야에서는 object를 scale invariant 하게 잘 구별하는 것이 중요합니다. 이전 연구에서는 input 이미지의 크기를 바꿔가며 object를 찾았지만 이는 메모리와 계산량 측면에서 낭비적입니다.

그에 비해 FPN은 효율적으로 object scale에 invariant한 feature들을 추출할 수 있는 네트워크입니다.

 

 

좌 : 여러가지 prediction 방법, 우 : FPN

 

논문에서 말하는 'pyramid' 라는 단어는 서로 다른 resolution의 feature를 쌓아올린 형태를 뜻하고, feature의 resolution은 feature의 spatial size를 뜻합니다. Encoder의 layer별 output은 feature size가 모두 다르지만 모두 input image에 대한 embedding이므로 feature의 spatial size가 클수록 high-resolution이지만 embedding이 덜 되었기 때문에 low-level feature입니다. (spatial size가 작으면 반대로-)

 

FPN은 encoder에서 단계별로 서로 다른 resolution을 가지는 feature들을 추출하고(C2, C3, C4, C5), decoder의 가장 상위 layer에서부터 거꾸로 내려오면서 동일한 resolution을 가지는 encoder output feature와 합쳐준 뒤 prediction을 수행합니다. Decoder의 각 level에서 독립적으로 feature를 추출하여 object를 탐지하게 되는데, high-level의 이미 계산된 feature를 재사용(upsampling해서)하므로 multi scale feature들을 효율적으로 추출할 수 있다. 

 

Feature 를 합치는 방법은 encoder에서 추출한 feature는 1x1 conv로 channel을 decoder output 과 맞춰주고 decoder output은 spatial size를 encoder output 과 동일하게 맞추기 위해 nearest neighbor upsampling을 해준뒤 element-wise로 더해줍니다. 다시 말해 encoder feature와 decoder feature의 feature size를 맞춰준 뒤 더해주는 것입니다. 그 뒤에 그림에는 없지만 final feature map(P2, P3, P4, P5)을 생성하기 위해 각각의 합쳐진 feature에 3x3 convolution 을 해줍니다. 

 

생성된 final feature map으로 각각 prediction 할 수도 있고, final feature map들을 합쳐서(concat) 한번에 prediction을 수행할 수도 있습니다.

반응형