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.
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, ...)
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
Image classification with 1000 output classes by default (ImageNet).
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).
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 |
Other models:
model_alexnet()
,
model_efficientnet_v2
,
model_inception_v3()
,
model_mobilenet_v2()
,
model_resnet
,
model_vgg
if (FALSE) { # \dontrun{
model <- model_efficientnet_b0()
image_batch <- torch::torch_randn(1, 3, 224, 224)
output <- model(image_batch)
which.max(as.numeric(output)) # class 815 in ImageNet is a Egyptian cat (see
# <https://image-net.org>)
} # }
if (FALSE) { # \dontrun{
# 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)
which.max(as.numeric(output))
} # }