Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Keras · Class

applications.EfficientNetB0

EfficientNetB0 creates the B0 EfficientNet image-classification model, optionally using ImageNet-pretrained weights. Its options support standard classification, custom inputs, and feature extraction without the top classifier.

How it works

EfficientNetB0 constructs the B0 EfficientNet image-classification architecture and returns it as a Keras model. By default it includes the classifier and loads ImageNet weights; you can instead omit the top layer for feature extraction, choose a custom input shape, and select pooling for the resulting features.

Syntax

keras.applications.EfficientNetB0(include_top=True, weights="imagenet", input_tensor=None, input_shape=None, pooling=None, classes=1000, classifier_activation="softmax", name="efficientnetb0")

Parameters

NameTypeDescription
include_topbooleanWhether to include the fully-connected layer at the top of the network. Defaults to true.
weightsstring | nullNone for random initialization, "imagenet" for pretrained weights, or a weights-file path. Defaults to "imagenet".
input_tensorKerasTensor | nullOptional Keras tensor to use as image input.
input_shapetuple | nullOptional three-channel shape; only specify it when include_top is false.
poolingstring | nullOptional pooling mode for the feature output when include_top is false.
classesintegerNumber of classes for the classifier. Defaults to 1000.
classifier_activationstring | nullActivation for the classifier. Defaults to "softmax".
namestringModel name. Defaults to "efficientnetb0".

Returns

A model instance.

Key points

  • The factory builds the EfficientNetB0 architecture as a Keras application model.
  • The returned object is intended for image classification and supports the normal Keras model workflow.
  • ImageNet-pretrained parameters are available through the weights argument, which defaults to the ImageNet option.
  • include_top determines whether the model contains its final fully connected classification layer.
  • input_tensor allows an existing Keras input tensor to become the model's image input.
  • The name argument assigns the model's string name and defaults to efficientnetb0.

Common mistakes

  • Provide input_shape only when include_top is false; the documentation also requires exactly three input channels.
  • The weights argument accepts random initialization, ImageNet weights, or a weights-file path; other values are unsupported.
  • Setting include_top to false removes the final classifier, so the model is no longer configured with the default top classification layer.

Example: Load an ImageNet-pretrained EfficientNetB0

from keras.applications import EfficientNetB0

model = EfficientNetB0(weights="imagenet")
print(model.output_shape)

Creates the ImageNet-pretrained classifier using the default 1,000-class output and prints its output shape.

When to use it

Pretrained image classification

Classify images using the standard ImageNet setup.

Feature extraction

Reuse convolutional representations in a downstream model.

Transfer learning

Replace the original classifier with a task-specific output layer.

Training from scratch

Initialize a model without pretrained parameters.

Interview questions

QWhat does EfficientNetB0 return and what are its defaults?

EfficientNetB0 is instantiated with keras.applications.EfficientNetB0 and returns a Keras image-classification model. Its default configuration includes the top classifier and uses ImageNet-pretrained weights.

Follow-up: How would you adapt it for feature extraction? Set include_top=False, provide a compatible input shape if needed, and choose pooling such as average pooling to obtain feature vectors.

QHow does include_top affect configuration?

include_top controls whether the fully connected classifier is present. When it is false, input_shape may be specified and must have exactly three channels.

Follow-up: Why remove the top? It lets the backbone produce representations that can feed a task-specific classifier rather than forcing the original ImageNet classifier.

QWhat values can weights take?

weights can be None, "imagenet", or a path to a weights file. The default is "imagenet", so the model can start from pretrained parameters rather than random initialization.

Follow-up: When would None be appropriate? Use it when training from scratch or when pretrained weights are unsuitable for the target domain.

  • EfficientNetB1
  • EfficientNetB2
  • EfficientNetB3
  • EfficientNetB4
  • EfficientNetB5
  • EfficientNetB6
  • EfficientNetB7
  • keras.applications.efficientnet.decode_predictions

Source: EfficientNet models. Checked 2026-10-15.