
구현은 조금 빡빡해서 리뷰를 먼저하고 구현은 천천히 업로드 할 예정이다. Swin Transformer는 Shifted Window의 줄임말에 Transformer를 붙인 용어이다. 용어 그대로 Shifted window를 활용해 성능을 개선시킨 모델이라 논문을 읽지 않아도 추측해 볼 수 있다. 나오게 된 것은 다양한 scale을 갖는 visual entities를 커버하고, Large resolution의 이미지 인풋에 대해서 patch words를 잘 구성해야한다는 점을 motive로 하여 개발이 된 모델이다. 논문 제목 : Swin Transformer : Hierachical Vision Transformer using Shifted Windows Abstract NLP와 비전에서의 domain ..
기존 CNN모델들과 다르게 image patch 처리를 해줘야하는 코드가 추가되었다. 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.manual_seed(seed) torch.cuda.manual_..

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의 기본 아이디어를 간단하게 리뷰하고 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...