timm documentation
BEiT
BEiT
카테고리: ViT · 코드: timm/models/beit.py · 아키텍처: 7 · 프리트레이닝 가중치: 13 (ImageNet-1k 결과 포함 9개)
마스크 이미지 모델링으로 사전 학습된 BEiT 및 BEiT-v2 Vision Transformer입니다. BEiT는 마스크된 패치의 이산 시각 토큰을 예측하고, BEiT-v2는 타깃에 벡터 양자화 시각 토크나이저를 사용합니다. 여기 있는 가중치는 미세 조정된 분류 가중치입니다.
논문
사용
사전 학습된 가중치 로드, 이미지 전처리 및 파인튜닝에 대해서는 Quickstart를, 모델을 백본으로 사용하는 방법에 대해서는 Feature Extraction을 참고하세요.
>>> import timm
>>> model = timm.create_model('beit_base_patch16_224.in22k_ft_in22k_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)모델 API 지원
✓ 지원됨, ✓ (정사각형) 정사각형 크기만 지원됨, ✗ 미지원, – 필요 없음(모델이 이미 모든 입력 크기를 허용함). 무작위로 초기화된 모델(Beit의 beit_base_patch16_224, 224)에서 각 기능을 실행하여 확인했습니다. 동일한 클래스의 다른 아키텍처도 동일한 동작을 하는 것으로 예상됩니다. 자세한 내용은 Model API 페이지를 참조하세요.
아키텍처
| 아키텍처 | 매개변수 (M) | GMAC | 입력 크기 | 사전 학습된 가중치 |
|---|---|---|---|---|
beit_base_patch16_224 | 86.53 | 17.58 | 224 | 2 |
beit_base_patch16_384 | 86.74 | 55.54 | 384 | 1 |
beit_large_patch16_224 | 304.43 | 61.60 | 224 | 2 |
beit_large_patch16_384 | 305.00 | 191.21 | 384 | 1 |
beit_large_patch16_512 | 305.67 | 362.24 | 512 | 1 |
beitv2_base_patch16_224 | 86.53 | 17.58 | 224 | 3 |
beitv2_large_patch16_224 | 304.43 | 61.60 | 224 | 3 |
GMACs와 매개변수 수는 각 아키텍처의 기본 입력 크기 및 분류기에 대한 값이며, 벤치마크 결과에서 가져왔습니다.
사전 학습된 가중치
Top-1은 results-imagenet.csv에 나열된 평가 크기에서 측정된 ImageNet-1k 검증 정확도입니다. - 가중치에 ImageNet-1k 결과가 없는 경우(예: 사전 학습 또는 이미지-텍스트 가중치)에는 표시하지 않습니다. Classes는 사전 학습된 분류기의 크기를 나타내며, 분류기가 없는 가중치의 경우 none입니다.
| 가중치 | 입력 크기 | Top-1(%) | 평가 크기 | 클래스 | 라이선스 | Hub |
|---|---|---|---|---|---|---|
beit_base_patch16_224.in22k_ft_in22k | 224 | - | - | 21841 | apache-2.0 | timm |
beit_base_patch16_224.in22k_ft_in22k_in1k | 224 | 85.238 | 224 | 1000 | apache-2.0 | timm |
beit_base_patch16_384.in22k_ft_in22k_in1k | 384 | 86.814 | 384 | 1000 | apache-2.0 | timm |
beit_large_patch16_224.in22k_ft_in22k | 224 | - | - | 21841 | apache-2.0 | timm |
beit_large_patch16_224.in22k_ft_in22k_in1k | 224 | 87.486 | 224 | 1000 | apache-2.0 | timm |
beit_large_patch16_384.in22k_ft_in22k_in1k | 384 | 88.380 | 384 | 1000 | apache-2.0 | timm |
beit_large_patch16_512.in22k_ft_in22k_in1k | 512 | 88.576 | 512 | 1000 | apache-2.0 | timm |
beitv2_base_patch16_224.in1k_ft_in1k | 224 | 85.596 | 224 | 1000 | apache-2.0 | timm |
beitv2_base_patch16_224.in1k_ft_in22k | 224 | - | - | 21841 | apache-2.0 | timm |
beitv2_base_patch16_224.in1k_ft_in22k_in1k | 224 | 86.494 | 224 | 1000 | apache-2.0 | timm |
beitv2_large_patch16_224.in1k_ft_in1k | 224 | 87.414 | 224 | 1000 | apache-2.0 | timm |
beitv2_large_patch16_224.in1k_ft_in22k | 224 | - | - | 21841 | apache-2.0 | timm |
beitv2_large_patch16_224.in1k_ft_in22k_in1k | 224 | 88.406 | 224 | 1000 | apache-2.0 | timm |
인용
@inproceedings{beit,
title={{BEiT}: {BERT} Pre-Training of Image Transformers},
author={Hangbo Bao and Li Dong and Songhao Piao and Furu Wei},
booktitle={International Conference on Learning Representations},
year={2022},
url={https://openreview.net/forum?id=p-BhZSz59o4}
}
@article{beitv2,
title={{BEiT v2}: Masked Image Modeling with Vector-Quantized Visual Tokenizers},
author={Zhiliang Peng and Li Dong and Hangbo Bao and Qixiang Ye and Furu Wei},
year={2022},
eprint={2208.06366},
archivePrefix={arXiv},
primaryClass={cs.CV}
}