Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Tune an Image Classification Model

Focus mode
Tune an Image Classification Model - Amazon SageMaker AI

Automatic model tuning, also known as hyperparameter tuning, finds the best version of a model by running many jobs that test a range of hyperparameters on your dataset. You choose the tunable hyperparameters, a range of values for each, and an objective metric. You choose the objective metric from the metrics that the algorithm computes. Automatic model tuning searches the hyperparameters chosen to find the combination of values that result in the model that optimizes the objective metric.

For more information about model tuning, see Automatic model tuning with SageMaker AI.

Metrics Computed by the Image Classification Algorithm

The image classification algorithm is a supervised algorithm. It reports an accuracy metric that is computed during training. When tuning the model, choose this metric as the objective metric.

Metric Name Description Optimization Direction
validation:accuracy

The ratio of the number of correct predictions to the total number of predictions made.

Maximize

Tunable Image Classification Hyperparameters

Tune an image classification model with the following hyperparameters. The hyperparameters that have the greatest impact on image classification objective metrics are: mini_batch_size, learning_rate, and optimizer. Tune the optimizer-related hyperparameters, such as momentum, weight_decay, beta_1, beta_2, eps, and gamma, based on the selected optimizer. For example, use beta_1 and beta_2 only when adam is the optimizer.

For more information about which hyperparameters are used in each optimizer, see Image Classification Hyperparameters.

Parameter Name Parameter Type Recommended Ranges
beta_1

ContinuousParameterRanges

MinValue: 1e-6, MaxValue: 0.999

beta_2

ContinuousParameterRanges

MinValue: 1e-6, MaxValue: 0.999

eps

ContinuousParameterRanges

MinValue: 1e-8, MaxValue: 1.0

gamma

ContinuousParameterRanges

MinValue: 1e-8, MaxValue: 0.999

learning_rate

ContinuousParameterRanges

MinValue: 1e-6, MaxValue: 0.5

mini_batch_size

IntegerParameterRanges

MinValue: 8, MaxValue: 512

momentum

ContinuousParameterRanges

MinValue: 0.0, MaxValue: 0.999

optimizer

CategoricalParameterRanges

['sgd', ‘adam’, ‘rmsprop’, 'nag']

weight_decay

ContinuousParameterRanges

MinValue: 0.0, MaxValue: 0.999

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.