Open
Conversation
Collaborator
|
정말 잘 적어주셨습니다!! ViT가 SOTA 성능을 보여준다한들, 데이터 효율이나 구조적 안정성으로 인해 ResNet이 아직까지도 많이 사용되는 것 같습니다. 수고하셨습니다 윤서님~~ 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vision Transformer는 최근 이미지 분류 분야에서 뛰어난 성능을 보이며 SOTA 모델로 자리 잡았음에도 ResNet은 여전히 널리 활용되고 있는 이유는 데이터 효율성, 구조적 안정성이라고 생각합니다.
ResNet은 CNN 기반 모델로 합성곱 연산을 통해 이미지의 공간적 구조와 인접 픽셀 간의 관계를 자연스럽게 학습할 수 있는 강한 귀납적 편향을 가지고 있습니다. ResNet의 구조적 특성 덕분에 보다 적은 데이터에서도 안정적으로 특징을 학습할 수 있습니다. 또한, 학습 초기 단계에서도 빠르게 수렴하는 경향이 있습니다.
반면에, ViT는 self-attention 기반 구조로 이미지의 지역적 특성을 자동으로 가정하지는 않기 때문에 충분한 데이터와 사전학습이 없으면 성능이 크게 저하될 수 있어서 소규모 데이터셋을 사용하거나 실제 산업 현장에서는 ResNet이 안정적이고 효율적이라고 판단될 수 있습니다.
실습 결과 pretrained=True로 설정한 ViT는 10 epoch 학습 후 Train Accuracy 95.18%, Validation Accuracy 90.11%를 기록하였고 loss curve에서도 train과 validation loss가 안정적으로 감소하는 모습을 보였습니다. 또한 confusion matrix를 통해 대부분의 클래스에서 0.85~0.95 수준의 높은 분류 성능을 확인할 수 있었고 전체 macro average 또한 0.90으로 안정적인 일반화 성능을 보였습니다.
반면에 pretrained=False로 설정하여 실습한 결과, 무작위 초기화 상태에서 학습하였기 때문에 10 epoch 이후 Train Accuracy 약 68%, Validation Accuracy는 약 66% 수준에 머물렀습니다. Accuracy curve를 보면 수렴 속도가 느리고 전체적인 성능이 크게 향상되지 않았습니다. 이것은 모델이 충분하게 시각적 표현을 학습하지 못했다는 것을 알 수 있습니다. ViT는 구조적으로 초대형 Transformer 기반 모델로 CNN과 달리 이미지의 공간적 구조에 대한 강한 귀납적 편향이 없기 때문에 대규모 데이터 기반의 사전학습이 중요하여 pretrained=True로 설정해야합니다.
pretrained=True의 경우 이미 대규모 데이터에서 학습된 저수준 및 중간 수준의 시각적 특징을 활용할 수 있어 파인튜닝만으로도 빠르게 높은 성능에 도달할 수 있고 반면에 pretrained=False는 모든 파라미터를 처음부터 학습해야 하므로 제한된 데이터와 짧은 학습 epoch로는 충분한 성능을 확보하기 어렵다고 볼 수 있습니다.