CoolFace
Modelpublic

google/bit-50

sourceHugging Faceapache-2.0updated 4y agoView on Hugging Face
5likes19kdownloads
README.md79 linesDownload Raw Back to root
1---2license: apache-2.03tags:4- vision5- image-classification6datasets:7- imagenet-1k8---9 10# Big Transfer (BiT)11 12The BiT model was proposed in [Big Transfer (BiT): General Visual Representation Learning](https://arxiv.org/abs/1912.11370) by Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, Neil Houlsby.13BiT is a simple recipe for scaling up pre-training of [ResNet](resnet)-like architectures (specifically, ResNetv2). The method results in significant improvements for transfer learning.14 15 16Disclaimer: The team releasing ResNet did not write a model card for this model so this model card has been written by the Hugging Face team.17 18## Model description19 20The abstract from the paper is the following:21 22*Transfer of pre-trained representations improves sample efficiency and simplifies hyperparameter tuning when training deep neural networks for vision. We revisit the paradigm of pre-training on large supervised datasets and fine-tuning the model on a target task. We scale up pre-training, and propose a simple recipe that we call Big Transfer (BiT). By combining a few carefully selected components, and transferring using a simple heuristic, we achieve strong performance on over 20 datasets. BiT performs well across a surprisingly wide range of data regimes -- from 1 example per class to 1M total examples. BiT achieves 87.5% top-1 accuracy on ILSVRC-2012, 99.4% on CIFAR-10, and 76.3% on the 19 task Visual Task Adaptation Benchmark (VTAB). On small datasets, BiT attains 76.8% on ILSVRC-2012 with 10 examples per class, and 97.0% on CIFAR-10 with 10 examples per class. We conduct detailed analysis of the main components that lead to high transfer performance.*23 24 25## Intended uses & limitations26 27You can use the raw model for image classification. See the [model hub](https://huggingface.co/models?search=bit) to look for28fine-tuned versions on a task that interests you.29 30### How to use31 32Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:33 34```python35from transformers import BitImageProcessor, BitForImageClassification36import torch37from datasets import load_dataset38 39dataset = load_dataset("huggingface/cats-image")40image = dataset["test"]["image"][0]41 42feature_extractor = BitImageProcessor.from_pretrained("google/bit-50")43model = BitForImageClassification.from_pretrained("google/bit-50")44 45inputs = feature_extractor(image, return_tensors="pt")46 47with torch.no_grad():48    logits = model(**inputs).logits49 50# model predicts one of the 1000 ImageNet classes51predicted_label = logits.argmax(-1).item()52print(model.config.id2label[predicted_label53>>> tabby, tabby cat54```55 56For more code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/main/en/model_doc/bit).57 58### BibTeX entry and citation info59 60```bibtex61@misc{https://doi.org/10.48550/arxiv.1912.11370,62  doi = {10.48550/ARXIV.1912.11370},63  64  url = {https://arxiv.org/abs/1912.11370},65  66  author = {Kolesnikov, Alexander and Beyer, Lucas and Zhai, Xiaohua and Puigcerver, Joan and Yung, Jessica and Gelly, Sylvain and Houlsby, Neil},67  68  keywords = {Computer Vision and Pattern Recognition (cs.CV), Machine Learning (cs.LG), FOS: Computer and information sciences, FOS: Computer and information sciences},69  70  title = {Big Transfer (BiT): General Visual Representation Learning},71  72  publisher = {arXiv},73  74  year = {2019},75  76  copyright = {arXiv.org perpetual, non-exclusive license}77}78 79```