
1편에서 ViT를 이해하는데 필요한 Transformer에 대해서 간단하게 알아봤다. https://ai.dreamkkt.com/64 [논문 리뷰] ViT 살펴보기 1편 - Transformer 비전 Task에서 많이 활용되는 ViT(Vision Transformer)를 이해하기 위해선 Attention과 Transformer 개념을 이해하고 있으면 좋다. 같이 한 번 살펴보자 Attention Attention은 주목 포인트를 찾는 방법이다. NLP.. ai.dreamkkt.com 이제 Computer Vision에 NLP에서 사용된 Transformer를 적용한 ViT에 대해서 리뷰해보자. 1. Abstract ViT가 나오기 전 Vision 분야에서는 Transformer 적용은 제한적이었다. CN..

비전 Task에서 많이 활용되는 ViT(Vision Transformer)를 이해하기 위해선 Attention과 Transformer 개념을 이해하고 있으면 좋다. 같이 한 번 살펴보자 Attention Attention은 주목 포인트를 찾는 방법이다. NLP 번역 Task에서 시작하여 CV에서는 Image captioning 등에 활용된다. hard attention과 soft attention으로 구분할 수 있다. Hard 버전은 0, 1로 attention을 계산하여 feature map을 표현한다. 이때 계산량이 많아 모든 위치에서 다 계산하지 않고 multinoulli 분포에서 sampling하는 방법으로 계산한다. Soft 버전은 0~1의 float로 attention을 계산하여 feature..

핵심아이디어는 SENet에서 나왔던 channel-wise response를 계산하여 이를 적용하는 것과 ReLU6에 H-Swish(HardSwish) 이다. 1. H-Swish $$ Swish(x) = x \sigma (x) $$ 로 표현되며 기존 ReLU에서 음수값에 대한 정보손실 문제를 해결하기 위한 함수이다. 하지만 Sigmoid 자체가 연산량이 크기 때문에 V3에서는 이를 줄이기 위해 Approximation을 한 함수를 제안한다. $$ H-Swish (x) = x \frac{ReLU6(x+3)}{6} $$ 이는 Swish를 잘 approximation 하고, 연산량도 줄어들어 mobile network에 필요한 연산량을 줄이는 방향과 부합한 방법이다. 2. V3 Unit 위의 그림처럼 ReLU..

SENet의 기본 아이디어를 간단하게 리뷰하고 ResNet101에 붙여보는 식으로 구현하려고 한다. 기본 ResNet101 구현은 다음 글을 참고하면 된다. 1. Idea SENet의 구조는 다음 그림으로 모든게 설명이된다. 각 채널별로 중요도(논문에서는 response, attention 등을 언급한다.)가 있어서 이를 계산하는 구조로 설계했다. 논문에서는 channel간 relationship에 focus를 두어 representation quality 향상을 목적으로 설계했다고 한다. feature map의 채널간 interdependency를 모델링하여 attention 처럼 계산하여 채널간 가중치를 부여하여 계산하는 방식을 택한다. 위의 그림을 설명하면 다음과 같다. input $X$ ($C`x..
논문에서 제시한 내용만 보고 구현한 코드 약간의 Naive한 점이 있지만 확실히 ResNet 등의 CNN 모델보다 학습속도가 빠르다! 그럼 바로 시작 1. Setup 기존과 동일하다. import torch.nn as nn import torch import torchvision import torchvision.transforms as transforms from torch.utils.data import DataLoader import torch.optim as optim import time import numpy as np import random import torch.backends.cudnn as cudnn seed = 2022 torch.manual_seed(seed) torch.cuda...

V1에서 달라진 점과 Architecture 중심으로 이야기를 하려고 한다. 0. Abstract MobileNet V2는 Bottleneck 간 skip-connection과 Inverted Residual Structure를 바탕으로 설계되었다. Block 안 expansion layer는 lightweight depthwise conv를 사용한다.(MobileNet v1과 같다.) 또한 representational power를 유지하려면 narrow layers에선 non-linearities를 제거하는 것이 중요하며 이를 실험적으로 확인했다. 이러한 아이디어를 바탕으로 실험한 결과 성능향상을 확인할 수 있었다. 1. Intro 현재 SOTA 모델들은 높은 computational cost(res..