Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keras Applications lets you load pretrained deep-learning models for prediction, feature extraction, or fine-tuning. Choose a model for your task, configure its classifier and input shape, and use that architecture’s own preprocessing convention—because preprocessing is not interchangeable across model families.

What Keras Applications provides

Keras Applications is a collection of deep-learning model architectures distributed with pretrained weights. The weights download automatically when you instantiate a model and are stored under ~/.keras/models/. You can use an application model directly for prediction, as a feature extractor, or as the pretrained base for fine-tuning.

The model constructor determines how you start: whether to load pretrained weights, retain the original classification head, and expose a representation for another task.

Choose a model using the right comparisons

The live Keras catalog reports model size, ImageNet top-1 and top-5 accuracy, parameter count, depth, and CPU and GPU inference time. Treat these as catalog-listed comparisons, not guarantees for your hardware, inputs, or application. Benchmark candidate models on your deployment setup before making latency or accuracy decisions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Model Size ImageNet top-1 ImageNet top-5 Parameters Depth
Xception 88 MB 79.0% 94.5% 22.9M 81
VGG16 528 MB 71.3% 90.1% 138.4M 16

These are the values listed in the Keras model catalog; the surfaced catalog does not state a publication year for them. The right choice depends on the trade-off that matters to you: for example, model size and measured latency for deployment, or validation performance on your own task.

Load a pretrained model and adapt its output

Application constructors commonly provide options such as weights, include_top, input_shape, and pooling. Check the selected architecture’s API page for exact accepted values and input constraints.

  • weights="imagenet" loads pretrained ImageNet weights; weights=None initializes randomly, and a weights-file path can load other saved weights.
  • include_top=True retains the original classification head. Use it when you want the model’s original classifier and compatible input dimensions.
  • include_top=False removes that head, which is useful for feature extraction or attaching a classifier for your own labels.
  • When the top is removed, pooling=None leaves the final convolutional output as a four-dimensional tensor. Supported pooling options such as "avg" or "max" produce a two-dimensional feature representation.

Input dimensions are architecture-specific. For example, VGG16 with its default ImageNet classifier uses a 224 × 224 RGB input. Keep three color channels and consult the model’s API documentation before changing spatial dimensions. See the VGG API reference for VGG-specific requirements.

Preprocess inputs according to the architecture

Use the preprocessing function documented for the model family you selected. A generic image scaling or channel conversion can silently give a model inputs in the wrong format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Model family Input convention
VGG16 and VGG19 Use the family’s preprocess_input: it converts RGB to BGR and zero-centers each channel using ImageNet means, without scaling.
ResNet Use ResNet preprocessing: RGB-to-BGR conversion and channel zero-centering, without scaling.
ResNetV2 Scale pixel values to [-1, 1]. Its convention differs from ResNet.
EfficientNet Preprocessing is included in the model by default. Provide pixel values in [0, 255]; the documented preprocess_input is a pass-through.
EfficientNetV2 With default preprocessing enabled, provide [0, 255] values. If using include_preprocessing=False, provide values in [-1, 1].
ConvNeXt Normalization is included in the model. Feed float or uint8 pixel tensors in [0, 255].
NASNet and MobileNet Use each family’s own documented preprocessing function; do not assume another family’s convention.

These conventions are documented on the VGG, ResNet, EfficientNet, EfficientNetV2, ConvNeXt, NASNet, and MobileNet API pages. In particular, do not add external normalization blindly to EfficientNet, EfficientNetV2 with its default preprocessing, or ConvNeXt: these models already handle preprocessing internally.

Use a pretrained model for a new classification task

A common transfer-learning approach is to reuse an ImageNet-trained base and replace its original classifier with a head suited to your labels. Keras Applications documentation demonstrates this workflow; training details such as which layers to unfreeze and the learning-rate schedule depend on your dataset and task.

  1. Load the base: instantiate the chosen application with weights="imagenet" and include_top=False. Set the input shape to one supported by that architecture.
  2. Add a task-specific head: use the extracted features as input to a classifier sized for your classes. Choose pooling or another feature-shaping step appropriate to the model output.
  3. Train the new head first: freeze the pretrained base while fitting the newly added classifier.
  4. Fine-tune selectively: unfreeze suitable base layers and continue training with a suitably cautious learning rate. The appropriate layers and schedule are task-dependent; do not treat an example’s hyperparameters as universal settings.
  5. Evaluate on held-out data: compare against the requirements of your use case, then benchmark inference on the hardware and input pipeline you plan to deploy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check documentation and terms for your use case

Keras model APIs and catalog figures are live documentation and can change. The catalog figures above are presented as currently listed values, without an implied publication year. The cited Keras documentation does not establish third-party licensing terms for every model weight or dataset; check the relevant model and dataset terms for a deployment-specific legal or licensing decision.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.