timm documentation

BEiT

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

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
features_only=True feature map✓ (strides 16, 16, 16)
forward_intermediates()✓
prune_intermediate_layers()✓
입력 크기 무관, 변경 불필요✗
set_input_size()✓
dynamic_img_size=True✗
set_grad_checkpointing()✓
레이어별 LR 감쇠(group_matcher())✓
reset_classifier()✓

✓ 지원됨, ✓ (정사각형) 정사각형 크기만 지원됨, ✗ 미지원, – 필요 없음(모델이 이미 모든 입력 크기를 허용함). 무작위로 초기화된 모델(Beit의 beit_base_patch16_224, 224)에서 각 기능을 실행하여 확인했습니다. 동일한 클래스의 다른 아키텍처도 동일한 동작을 하는 것으로 예상됩니다. 자세한 내용은 Model API 페이지를 참조하세요.

아키텍처

아키텍처매개변수 (M)GMAC입력 크기사전 학습된 가중치
beit_base_patch16_22486.5317.582242
beit_base_patch16_38486.7455.543841
beit_large_patch16_224304.4361.602242
beit_large_patch16_384305.00191.213841
beit_large_patch16_512305.67362.245121
beitv2_base_patch16_22486.5317.582243
beitv2_large_patch16_224304.4361.602243

GMACs와 매개변수 수는 각 아키텍처의 기본 입력 크기 및 분류기에 대한 값이며, 벤치마크 결과에서 가져왔습니다.

사전 학습된 가중치

Top-1은 results-imagenet.csv에 나열된 평가 크기에서 측정된 ImageNet-1k 검증 정확도입니다. - 가중치에 ImageNet-1k 결과가 없는 경우(예: 사전 학습 또는 이미지-텍스트 가중치)에는 표시하지 않습니다. Classes는 사전 학습된 분류기의 크기를 나타내며, 분류기가 없는 가중치의 경우 none입니다.

가중치입력 크기Top-1(%)평가 크기클래스라이선스Hub
beit_base_patch16_224.in22k_ft_in22k224--21841apache-2.0timm
beit_base_patch16_224.in22k_ft_in22k_in1k22485.2382241000apache-2.0timm
beit_base_patch16_384.in22k_ft_in22k_in1k38486.8143841000apache-2.0timm
beit_large_patch16_224.in22k_ft_in22k224--21841apache-2.0timm
beit_large_patch16_224.in22k_ft_in22k_in1k22487.4862241000apache-2.0timm
beit_large_patch16_384.in22k_ft_in22k_in1k38488.3803841000apache-2.0timm
beit_large_patch16_512.in22k_ft_in22k_in1k51288.5765121000apache-2.0timm
beitv2_base_patch16_224.in1k_ft_in1k22485.5962241000apache-2.0timm
beitv2_base_patch16_224.in1k_ft_in22k224--21841apache-2.0timm
beitv2_base_patch16_224.in1k_ft_in22k_in1k22486.4942241000apache-2.0timm
beitv2_large_patch16_224.in1k_ft_in1k22487.4142241000apache-2.0timm
beitv2_large_patch16_224.in1k_ft_in22k224--21841apache-2.0timm
beitv2_large_patch16_224.in1k_ft_in22k_in1k22488.4062241000apache-2.0timm

인용

@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}
}
Update on GitHub