model_efficientnet_v2: EfficientNetV2 Models

model_efficientnet_v2R Documentation

EfficientNetV2 Models

Description

Constructs EfficientNetV2 model architectures as described in EfficientNetV2: Smaller Models and Faster Training.

Usage

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

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

model_efficientnet_v2_l(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_v2_s(): EfficientNetV2-S model

  • model_efficientnet_v2_m(): EfficientNetV2-M model

  • model_efficientnet_v2_l(): EfficientNetV2-L 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). Typical values for H and W are 384 for V2-S, 480 for V2-M, and 512 for V2-L.

Variants

Model Resolution Params (M) GFLOPs Top-1 Acc.
V2-S 384 24 8.4 83.9
V2-M 480 55 24 85.1
V2-L 512 119 55 85.7

See Also

model_efficientnet

Other classification_model: model_alexnet(), model_convnext, model_efficientnet, 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_v2_s()
input <- torch::torch_randn(1, 3, 224, 224)
output <- model(input)

# Show Top-5 predictions
topk <- output$topk(k = 5, dim = 2)
indices <- as.integer(topk[[2]][1, ])
scores <- as.numeric(topk[[1]][1, ])
glue::glue("{seq_along(indices)}. {imagenet_label(indices)} ({round(scores, 2)}%)")

## End(Not run)

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