Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regional Attention Based Deep Feature for Image Retrieval #40

Open
chullhwan-song opened this issue Aug 8, 2018 · 1 comment
Open

Comments

@chullhwan-song
Copy link
Owner

https://sglab.kaist.ac.kr/RegionalAttention/

@chullhwan-song
Copy link
Owner Author

chullhwan-song commented Aug 8, 2018

what ?

  • R-MAC based deep feature
  • 여기에다가 attention 추가한 feature - context aware regional attention network
  • DIR연구와 달리, 단순히 pre-trained single-pass 개념의 학습 > softmax + imagenet으로 한듯.
    • DIR 나 delf는 neuralcode의 dataset 의 학습셋으로 이용
    • 여기서는, context aware regional attention network 학습하기 위해 imagenet을 적용한듯

Regional Attentive Deep Feature

image
image
image

  • (figure.2) regional attention network+R-MAC 결합형태 수식
  • 빨간 부분이 R-MAC : image
  • 녹색 부분이 regional attention network : image
    • image
      • image 는 각 cropped feature map인 R에 대해, mean pooling 한 형태
      • image 는 각각 linear transformation(fc)
      • image 에서 d는 crop 갯수(정확상, 논문에 나오지 않았음), k는 conv feature map에 대한 channel
      • 최종적으로 regional attention network는 d 차원의 vector인듯 --> ????
  • 여기서는 하나 개념을 추가 - figure 2에서 보면 Context-aware regional vector : image
    image
    • image : concat 연산 (in the channel space)
    • regional attention network 의 input값인 image 와 concat 연산을 통해 결합
    • image 은 convolution feature map
    • convolution feature map과 image(각 cropped feature map인 R에 대해, mean pooling 한 형태)와 concat한다는게...살짝 이해가 안감,
    • 내가 제대로 이해했다면, convolution feature map는 WxHxC 이고 image는 1x1xC 인데. dimension 구조가 다른데..어떻게 하지?? concat ?
      • image 연산에 대해 자세한 설명이 없고, "the whole feature vector" 라고만 나와 있음.ㅠ
        • 소스보고 이해할수 밖에 - 이해하면 업데이트 ㅠ
  • 소스를 보면, ContextAwareRegionalAttentionNetwork 에서, 다음과 같이 나온다.
...
data = features[batch_ind]
# mean pooling with both of regional feature map and global feature map
outputs[roi_ind, :, ph, pw] = torch.cat((torch.mean(
                            torch.mean(data[:, hstart:hend, wstart:wend], 1, keepdim=True), 2, keepdim=True).view(-1)
                                                          , torch.mean(
                            torch.mean(data, 1, keepdim=True), 2, keepdim=True).view(-1)), 0)  # noqa
...
  • 식이 어려운데 R-MAC을 알면 단순해짐. 실제 연산은 R-MAC과 동일하고 다만 max pooling이 아니라 mean pooling으로 대체하기만 하면됨.
  • 그래서, 각각의 crop feature map 단위 기준으로,
    • Regional Attentive Deep Feature = { crop:ith = (mean_pooling(crop_feature_map_crop_i);mean_pooling(feature_map_batch_j)),,,,,,}
      • ; 는 concat
    • 즉, 각각의 crop 단위마다 전체 feature map을 하나씩 붙히는 방식
      • mean_pooling(feature_map_batch_j) 부분을 한번만 해도 되는데 crop마다 하고 있음...< 단순화가 필요 할듯~

실험

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant