dhkim0225 / 1day_1paper

read 1 paper everyday (only weekday)
53 stars 1 forks source link

[47] Augmenting Convolutional networks with attention-based aggregation (PatchConvNet) #75

Open dhkim0225 opened 2 years ago

dhkim0225 commented 2 years ago

CNN 의 attention-based global map 이 non-local reasoning 이 가능하도록 만들자!

paper code

코드는 deit 레포에 올린다고는 되어... 있는데 아직 안 올라온 듯. 1저자는 DeIT 저자의 Hugo Touvron

image DINO 방식의 visualization 결과. 가장 오른쪽 column 색깔 다른 이유는 class-wise visualization 을 수행했기 때문. image

Contribution

  1. Revisit learned "attention-based pooling"
  2. class-wise attention map 뽑기
  3. PatchConvNet 제안.

Attention-based pooling with PatchConvNet

image conv backbone 거친 후, 16x16 patch 를 만들어서 1x1-3x3-1x1 구조 태움.

batch-size 가 크면 layer-norm 보다 batch-norm이 성능 더 높았음. 그래도 layer-norm이 large-model 학습이나 큰 image-resolution에서 유리했음. 그림의 column/trunk 구조에서 normalization 은 layer-norm 사용

trunk output 에서 Attention-based pooling 이 적용됨. 걍 cross-attention 쓴 거임. ~그림이 상당히 비직관적임~ 그니까... conv stem output이랑 trunk output 으로 cross attention. trunk ouputquery, conv stem outputkey, value 임.

근데, num-head 는 1, attention 수행도 1번. computation 이 많기 때문에, column/trunk 까지만 objective 주면서 쭉 학습시키고, 추가로 finetuning small batch 로 좀 더 돌림.

Results

ImageNet-1K

2048 batch로 400 epoch 돌렸음.

아니 ㅋㅋ fair 하지 않은 것 같은데... 300 epoch 돌려야 하는 거 아닌가?
참고로 swin 은 1024 batch 에 300 epoch 돌림.
심지어 convmixer-1536/20 은 150 epoch 인데, 400epoch이랑 비교해놓고 어? 이걸 sota라고 해놓고 있네? 어?
DEiT 저자가???? 이걸??? 

image image

마음에 안들으니 여기까지만. visualize 결과는 흥미롭기 때문에, 관련 프로젝트 할 때 참고하는 정도로 해야할 듯. 이걸 이용해서 weakly supervised segmentation 을 한다면?

dhkim0225 commented 2 years ago

천상혁님과 관련해서 이것저것 이야기를 해 보았음.

모델 퍼포먼스를 최대한 끌어낼 수 있게 parameter 를 tuning 해보자는 사람들이 조금씩 생겨나고 있는 듯 함. 이전 모델들은 이전 모델들이 충분히 학습한 것이라고 가정. 물론 이러면, regularize&augmentation 빡세게 주고 오래 학습시키는게 장땡 아닌가 싶기도 한데, 국룰처럼 사용하고 있는 학습 방식이 model performance 를 전부 끌어내지 못할 수도 있는 것이 사실임.

새롭게 적용한 학습 방식을 기존 모델들에 적용해봐도 좋지 않은가? 라 생각할 수 있음. 그래도 되지만,,, 새롭게 적용한 학습 parameter 들은 전부 제안한 모델에 맞춰져 있을 것이기 때문에, 이게 또 fair comparison이 아닐 수 있음.

그래도 기재 하는 게 맞다고 생각을 함 paper 에서 써둔 수치랑, 새로운 schedule 적용해서 돌린 수치까지 전부 기록하면 훨씬 도움 될 듯. 참고를 위해 옆에 epoch 정도 써 놨으면 더 도움이 되었을 것 같음.