model_efficientnet: EfficientNet Models

model_efficientnetR Documentation

EfficientNet Models

Description

Constructs EfficientNet model architectures as described in EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. These models are designed for image classification tasks and provide a balance between accuracy and computational efficiency through compound scaling.

Usage

model_efficientnet_b0(pretrained = FALSE, progress = TRUE, ...)

model_efficientnet_b1(pretrained = FALSE, progress = TRUE, ...)

model_efficientnet_b2(pretrained = FALSE, progress = TRUE, ...)

model_efficientnet_b3(pretrained = FALSE, progress = TRUE, ...)

model_efficientnet_b4(pretrained = FALSE, progress = TRUE, ...)

model_efficientnet_b5(pretrained = FALSE, progress = TRUE, ...)

model_efficientnet_b6(pretrained = FALSE, progress = TRUE, ...)

model_efficientnet_b7(pretrained = FALSE, progress = TRUE, ...)

Arguments

pretrained

(bool): If TRUE, returns a model pre-trained on ImageNet.

progress

(bool): If TRUE, displays a progress bar of the download to stderr.

...

Other parameters passed to the model implementation, such as num_classes to change the output dimension.

Functions

  • model_efficientnet_b0(): EfficientNet B0 model

  • model_efficientnet_b1(): EfficientNet B1 model

  • model_efficientnet_b2(): EfficientNet B2 model

  • model_efficientnet_b3(): EfficientNet B3 model

  • model_efficientnet_b4(): EfficientNet B4 model

  • model_efficientnet_b5(): EfficientNet B5 model

  • model_efficientnet_b6(): EfficientNet B6 model

  • model_efficientnet_b7(): EfficientNet B7 model

Task

Image classification with 1000 output classes by default (ImageNet).

Input Format

The models expect input tensors of shape (batch_size, 3, H, W), where H and W should typically be 224 for B0 and scaled versions for B1–B7 (e.g., B7 uses 600x600).

Variants and Scaling

Model Width Depth Resolution Params (M) GFLOPs Top-1 Acc.
B0 1.0 1.0 224 5.3 0.39 77.1
B1 1.0 1.1 240 7.8 0.70 79.1
B2 1.1 1.2 260 9.2 1.00 80.1
B3 1.2 1.4 300 12.0 1.80 81.6
B4 1.4 1.8 380 19.0 4.20 82.9
B5 1.6 2.2 456 30.0 9.90 83.6
B6 1.8 2.6 528 43.0 19.0 84.0
B7 2.0 3.1 600 66.0 37.0 84.3

See Also

Other classification_model: model_alexnet(), model_convnext, model_efficientnet_v2, model_facenet, model_inception_v3(), model_maxvit(), model_mobilenet_v2(), model_mobilenet_v3, model_resnet, model_vgg, model_vit

Examples

## Not run: 
model <- model_efficientnet_b0()
image_batch <- torch::torch_randn(1, 3, 224, 224)
output <- model(image_batch)
imagenet_label(which.max(as.numeric(output)))

## End(Not run)

## Not run: 
# Example of using EfficientNet-B5 with its native image size
model <- model_efficientnet_b5()
image_batch <- torch::torch_randn(1, 3, 456, 456)
output <- model(image_batch)
imagenet_label(which.max(as.numeric(output)))

## End(Not run)


torchvision documentation built on Nov. 6, 2025, 9:07 a.m.