EfficientNet 模型在 ImageNet-1k 数据集上以 224x224 的分辨率进行训练。该模型由 Mingxing Tan 和 Quoc V. Le 在论文 EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks 中提出,并首次在 此仓库 发布。
免责声明:EfficientNet 的发布团队未为此模型撰写模型卡片,因此本模型卡片由 Hugging Face 团队编写。
EfficientNet 是一种移动端友好的纯卷积模型(ConvNet),它提出了一种新的缩放方法,使用一个简单但高效的复合系数来统一缩放深度、宽度和分辨率等所有维度。

您可以将原始模型用于图像分类。请参阅 模型中心 以查找您感兴趣的特定任务的微调版本。
以下是使用此模型将 COCO 2017 数据集的图像分类为 1000 个 ImageNet 类别之一的方法:
import torch
from datasets import load_dataset
from transformers import EfficientNetImageProcessor, EfficientNetForImageClassification
dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]
preprocessor = EfficientNetImageProcessor.from_pretrained("google/efficientnet-b0")
model = EfficientNetForImageClassification.from_pretrained("google/efficientnet-b0")
inputs = preprocessor(image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label]),如需更多代码示例,请参阅 文档。
@article{Tan2019EfficientNetRM,
title={EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks},
author={Mingxing Tan and Quoc V. Le},
journal={ArXiv},
year={2019},
volume={abs/1905.11946}
}