You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-auto-train-image-models.md
+57-58Lines changed: 57 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -270,14 +270,52 @@ For computer vision tasks, you can launch either [individual runs](#individual-r
270
270
271
271
Automatic sweeps can yield competitive results for many datasets. Additionally, they do not require advanced knowledge of model architectures, they take into account hyperparameter correlations and they work seamlessly across different hardware setups. All these reasons make them a strong option for the early stage of your experimentation process.
272
272
273
-
## Automatically sweeping model hyperparameters (AutoMode)
273
+
### Primary metric
274
+
275
+
An AutoML training job uses a primary metric for model optimization and hyperparameter tuning. The primary metric depends on the task typeas shown below; other primary metric values are currently not supported.
You can control the resources spent on your AutoML Image training job by specifying the `timeout_minutes`, `max_trials`and the `max_concurrent_trials`for the job in limit settings as described in the below example.
285
+
286
+
Parameter | Detail
287
+
-----|----
288
+
`max_trials`| Parameter for maximum number of configurations to sweep. Must be an integer between 1and1000. When exploring just the default hyperparameters for a given model algorithm, set this parameter to 1. The default value is1.
289
+
`max_concurrent_trials`| Maximum number of runs that can run concurrently. If specified, must be an integer between 1and100. The default value is1. <br><br>**NOTE:**<li> The number of concurrent runs is gated on the resources available in the specified compute target. Ensure that the compute target has the available resources for the desired concurrency. <li>`max_concurrent_trials`is capped at `max_trials` internally. For example, if user sets `max_concurrent_trials=4`, `max_trials=2`, values would be internally updated as`max_concurrent_trials=2`, `max_trials=2`.
290
+
`timeout_minutes`| The amount of time in minutes before the experiment terminates. If none specified, default experiment timeout_minutes is seven days (maximum 60 days)
### Automatically sweeping model hyperparameters (AutoMode)
274
312
275
313
> [!IMPORTANT]
276
314
> This feature is currently in public preview. This preview version is provided without a service-level agreement. Certain features might not be supported or might have constrained capabilities. For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
277
315
278
316
It is generally hard to predict the best model architecture and hyperparameters for a dataset. Also, in some cases the human time allocated to tuning hyperparameters may be limited. For computer vision tasks, you can specify a number of runs and the system will automatically determine the region of the hyperparameter space to sweep. You do not have to define a hyperparameter search space, a sampling method or an early termination policy.
279
317
280
-
### Triggering AutoMode
318
+
#### Triggering AutoMode
281
319
282
320
You can run automatic sweeps by setting `max_trials` to a value greater than 1in`limits`and by not specifying the search space, sampling method and termination policy. We call this functionality AutoMode; please see an example below.
283
321
@@ -306,11 +344,11 @@ A number of runs between 10 and 20 will likely work well on many datasets. The [
306
344
> Launching automatic sweeps via the UIisnot supported at this time.
307
345
308
346
309
-
## Individual runs
347
+
### Individual runs
310
348
311
349
In individual runs, you directly control the model algorithm and hyperparameters. The model algorithm is passed via the `model_name` parameter.
312
350
313
-
### Supported model algorithms
351
+
#### Supported model algorithms
314
352
315
353
The following table summarizes the supported models for each computer vision task.
In general, deep learning model performance can often improve with more data. Data augmentation is a practical technique to amplify the data size and variability of a dataset which helps to prevent overfitting and improve the model’s generalization ability on unseen data. Automated ML applies different data augmentation techniques based on the computer vision task, before feeding input images to the model. Currently, there's no exposed hyperparameter to control data augmentations.
350
-
351
-
|Task | Impacted dataset | Data augmentation technique(s) applied |
352
-
|-------|----------|---------|
353
-
|Image classification (multi-classand multi-label) | Training <br><br><br> Validation & Test| Random resize and crop, horizontal flip, color jitter (brightness, contrast, saturation, and hue), normalization using channel-wise ImageNet’s mean and standard deviation <br><br><br>Resize, center crop, normalization |
354
-
|Object detection, instance segmentation| Training <br><br> Validation & Test |Random crop around bounding boxes, expand, horizontal flip, normalization, resize <br><br><br>Normalization, resize
355
-
|Object detection using yolov5| Training <br><br> Validation & Test |Mosaic, random affine (rotation, translation, scale, shear), horizontal flip <br><br><br> Letterbox resizing|
356
-
357
-
### Primary metric
358
-
359
-
The primary metric used for model optimization and hyperparameter tuning depends on the task type. Using other primary metric values is currently not supported.
You can control the resources spent on your AutoML Image training job by specifying the `timeout_minutes`, `max_trials`and the `max_concurrent_trials`for the job in limit settings as described in the below example.
369
-
370
-
Parameter | Detail
371
-
-----|----
372
-
`max_trials`| Parameter for maximum number of configurations to sweep. Must be an integer between 1and1000. When exploring just the default hyperparameters for a given model algorithm, set this parameter to 1. The default value is1.
373
-
`max_concurrent_trials`| Maximum number of runs that can run concurrently. If specified, must be an integer between 1and100. The default value is1. <br><br>**NOTE:**<li> The number of concurrent runs is gated on the resources available in the specified compute target. Ensure that the compute target has the available resources for the desired concurrency. <li>`max_concurrent_trials`is capped at `max_trials` internally. For example, if user sets `max_concurrent_trials=4`, `max_trials=2`, values would be internally updated as`max_concurrent_trials=2`, `max_trials=2`.
374
-
`timeout_minutes`| The amount of time in minutes before the experiment terminates. If none specified, default experiment timeout_minutes is seven days (maximum 60 days)
When training computer vision models, model performance depends heavily on the hyperparameter values selected. Often, you might want to tune the hyperparameters to get optimal performance. For computer vision tasks, you can sweep hyperparameters to find the optimal settings for your model. This feature applies the hyperparameter tuning capabilities in Azure Machine Learning. [Learn how to tune hyperparameters](how-to-tune-hyperparameters.md).
398
388
@@ -436,15 +426,15 @@ search_space:
436
426
437
427
---
438
428
439
-
### Define the parameter search space
429
+
#### Define the parameter search space
440
430
441
431
You can define the model algorithms and hyperparameters to sweep in the parameter space. You can either specify a single model algorithm or multiple ones.
442
432
443
433
* See [Individual runs](#individual-runs) for the list of supported model algorithms for each task type.
444
434
* See [Hyperparameters for computer vision tasks](reference-automl-images-hyperparameters.md) hyperparameters for each computer vision task type.
445
435
* See [details on supported distributions for discrete and continuous hyperparameters](how-to-tune-hyperparameters.md#define-the-search-space).
446
436
447
-
### Sampling methods for the sweep
437
+
#### Sampling methods for the sweep
448
438
449
439
When sweeping hyperparameters, you need to specify the sampling method to use for sweeping over the defined parameter space. Currently, the following sampling methods are supported with the `sampling_algorithm` parameter:
450
440
@@ -457,7 +447,7 @@ When sweeping hyperparameters, you need to specify the sampling method to use fo
457
447
> [!NOTE]
458
448
> Currently only random and grid sampling support conditional hyperparameter spaces.
459
449
460
-
### Early termination policies
450
+
#### Early termination policies
461
451
462
452
You can automatically end poorly performing runs with an early termination policy. Early termination improves computational efficiency, saving compute resources that would have been otherwise spent on less promising configurations. Automated MLfor images supports the following early termination policies using the `early_termination` parameter. If no termination policy is specified, all configurations are run to completion.
463
453
@@ -498,8 +488,7 @@ sweep:
498
488
499
489
---
500
490
501
-
502
-
### Fixed settings
491
+
#### Fixed settings
503
492
504
493
You can pass fixed settings or parameters that don't change during the parameter space sweep as shown below.
505
494
@@ -523,6 +512,16 @@ training_parameters:
523
512
524
513
---
525
514
515
+
## Data augmentation
516
+
517
+
In general, deep learning model performance can often improve with more data. Data augmentation is a practical technique to amplify the data size and variability of a dataset which helps to prevent overfitting and improve the model’s generalization ability on unseen data. Automated ML applies different data augmentation techniques based on the computer vision task, before feeding input images to the model. Currently, there's no exposed hyperparameter to control data augmentations.
518
+
519
+
|Task | Impacted dataset | Data augmentation technique(s) applied |
520
+
|-------|----------|---------|
521
+
|Image classification (multi-classand multi-label) | Training <br><br><br> Validation & Test| Random resize and crop, horizontal flip, color jitter (brightness, contrast, saturation, and hue), normalization using channel-wise ImageNet’s mean and standard deviation <br><br><br>Resize, center crop, normalization |
522
+
|Object detection, instance segmentation| Training <br><br> Validation & Test |Random crop around bounding boxes, expand, horizontal flip, normalization, resize <br><br><br>Normalization, resize
523
+
|Object detection using yolov5| Training <br><br> Validation & Test |Mosaic, random affine (rotation, translation, scale, shear), horizontal flip <br><br><br> Letterbox resizing|
524
+
526
525
## Incremental training (optional)
527
526
528
527
Once the training run is done, you have the option to further train the model by loading the trained model checkpoint. You can either use the same dataset or a different one for incremental training.
0 commit comments