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
> 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/).
@@ -23,94 +28,122 @@ Typically, computer vision models for object detection work well for datasets wi
23
28
24
29
To help with this problem, automated ML supports tiling as part of the public preview computer vision capabilities. The tiling capability in automated ML is based on the concepts in [The Power of Tiling for Small Object Detection](https://openaccess.thecvf.com/content_CVPRW_2019/papers/UAVision/Unel_The_Power_of_Tiling_for_Small_Object_Detection_CVPRW_2019_paper.pdf).
25
30
26
-
When tiling, each image is divided into a grid of tiles. Adjacent tiles overlap with each other in width and height dimensions. The tiles are cropped from the original as shown in the following image.
31
+
When tiling, each image is divided into a grid of tiles. Adjacent tiles overlap with each other in width and height dimensions. The tiles are cropped from the original as shown in the following image.
* An Azure Machine Learning workspace. To create the workspace, see [Create workspace resources](quickstart-create-resources.md).
33
38
34
-
* This article assumes some familiarity with how to configure an [automated machine learning experiment for computer vision tasks](how-to-auto-train-image-models.md).
39
+
* This article assumes some familiarity with how to configure an [automated machine learning experiment for computer vision tasks](how-to-auto-train-image-models.md).
35
40
36
41
## Supported models
37
42
38
-
Small object detection using tiling is currently supported for the following models:
39
-
40
-
* fasterrcnn_resnet18_fpn
41
-
* fasterrcnn_resnet50_fpn
42
-
* fasterrcnn_resnet34_fpn
43
-
* fasterrcnn_resnet101_fpn
44
-
* fasterrcnn_resnet152_fpn
45
-
* retinanet_resnet50_fpn
43
+
Small object detection using tiling is supported for all models supported by Automated ML for images for object detection task.
46
44
47
45
## Enable tiling during training
48
46
49
-
To enable tiling, you can set the `tile_grid_size` parameter to a value like (3, 2); where 3 is the number of tiles along the width dimension and 2 is the number of tiles along the height dimension. When this parameter is set to (3, 2), each image is split into a grid of 3 x 2 tiles. Each tile overlaps with the adjacent tiles, so that any objects that fall on the tile border are included completely in one of the tiles. This overlap can be controlled by the `tile_overlap_ratio` parameter, which defaults to 25%.
47
+
To enable tiling, you can set the `tile_grid_size` parameter to a value like `'3x2'`; where 3 is the number of tiles along the width dimension and 2 is the number of tiles along the height dimension. When this parameter is set to `'3x2'`, each image is split into a grid of 3 x 2 tiles. Each tile overlaps with the adjacent tiles, so that any objects that fall on the tile border are included completely in one of the tiles. This overlap can be controlled by the `tile_overlap_ratio` parameter, which defaults to 25%.
50
48
51
-
When tiling is enabled, the entire image and the tiles generated from it are passed through the model. These images and tiles are resized according to the `min_size` and `max_size` parameters before feeding to the model. The computation time increases proportionally because of processing this extra data.
49
+
When tiling is enabled, the entire image and the tiles generated from it are passed through the model. These images and tiles are resized according to the `min_size` and `max_size` parameters before feeding to the model. The computation time increases proportionally because of processing this extra data.
52
50
53
-
For example, when the `tile_grid_size` parameter is (3, 2), the computation time would be approximately seven times when compared to no tiling.
51
+
For example, when the `tile_grid_size` parameter is `'3x2'`, the computation time would be approximately seven times when compared to no tiling.
54
52
55
53
You can specify the value for `tile_grid_size` in your hyperparameter space as a string.
The value for `tile_grid_size` parameter depends on the image dimensions and size of objects within the image. For example, larger number of tiles would be helpful when there are smaller objects in the images.
66
80
67
81
To choose the optimal value for this parameter for your dataset, you can use hyperparameter search. To do so, you can specify a choice of values for this parameter in your hyperparameter space.
When a model trained with tiling is deployed, tiling also occurs during inference. Automated ML uses the `tile_grid_size` value from training to generate the tiles during inference. The entire image and corresponding tiles are passed through the model, and the object proposals from them are merged to output final predictions, like in the following image.
> It's possible that the same object is detected from multiple tiles, duplication detection is done to remove such duplicates.
84
115
>
85
116
> Duplicate detection is done by running NMS on the proposals from the tiles and the image. When multiple proposals overlap, the one with the highest score is picked and others are discarded as duplicates.Two proposals are considered to be overlapping when the intersection over union (iou) between them is greater than the `tile_predictions_nms_thresh` parameter.
86
117
87
-
You also have the option to enable tiling only during inference without enabling it in training. To do so, set the `tile_grid_size` parameter only during inference, not for training.
118
+
You also have the option to enable tiling only during inference without enabling it in training. To do so, set the `tile_grid_size` parameter only during inference, not for training.
88
119
89
-
Doing so, may improve performance for some datasets, and won't incur the extra cost that comes with tiling at training time.
120
+
Doing so, may improve performance for some datasets, and won't incur the extra cost that comes with tiling at training time.
90
121
91
-
## Tiling hyperparameters
122
+
## Tiling hyperparameters
92
123
93
124
The following are the parameters you can use to control the tiling feature.
94
125
95
126
| Parameter Name | Description | Default |
96
127
| --------------- |-------------| -------|
97
-
|`tile_grid_size`| The grid size to use for tiling each image. Available for use during training, validation, and inference.<br><br>Tuple of two integers passed as a string, e.g`'(3, 2)'`<br><br> *Note: Setting this parameter increases the computation time proportionally, since all tiles and images are processed by the model.*| no default value |
128
+
|`tile_grid_size`| The grid size to use for tiling each image. Available for use during training, validation, and inference.<br><br> Should be passed as a string in`'3x2'` format.<br><br> *Note: Setting this parameter increases the computation time proportionally, since all tiles and images are processed by the model.*| no default value |
98
129
|`tile_overlap_ratio`| Controls the overlap ratio between adjacent tiles in each dimension. When the objects that fall on the tile boundary are too large to fit completely in one of the tiles, increase the value of this parameter so that the objects fit in at least one of the tiles completely.<br> <br> Must be a float in [0, 1).| 0.25 |
99
130
|`tile_predictions_nms_thresh`| The intersection over union threshold to use to do non-maximum suppression (nms) while merging predictions from tiles and image. Available during validation and inference. Change this parameter if there are multiple boxes detected per object in the final predictions. <br><br> Must be float in [0, 1]. | 0.25 |
100
131
101
132
102
133
## Example notebooks
103
134
104
-
See the [object detection sample notebook](https://github.com/Azure/azureml-examples/tree/main/python-sdk/tutorials/automl-with-azureml/image-object-detection/auto-ml-image-object-detection.ipynb) for detailed code examples of setting up and training an object detection model.
See the [object detection sample notebook](https://github.com/Azure/azureml-examples/blob/main/sdk/jobs/automl-standalone-jobs/automl-image-object-detection-task-fridge-items/automl-image-object-detection-task-fridge-items.ipynb) for detailed code examples of setting up and training an object detection model.
105
138
106
139
>[!NOTE]
107
-
> All images in this article are made available in accordance with the permitted use section of the [MIT licensing agreement](https://choosealicense.com/licenses/mit/).
140
+
> All images in this article are made available in accordance with the permitted use section of the [MIT licensing agreement](https://choosealicense.com/licenses/mit/).
* Learn more about [how and where to deploy a model](/azure/machine-learning/how-to-deploy-managed-online-endpoints).
113
-
* For definitions and examples of the performance charts and metrics provided for each job, see [Evaluate automated machine learning experiment results](how-to-understand-automated-ml.md).
146
+
* For definitions and examples of the performance charts and metrics provided for each job, see [Evaluate automated machine learning experiment results](how-to-understand-automated-ml.md).
114
147
*[Tutorial: Train an object detection model (preview) with AutoML and Python](tutorial-auto-train-image-models.md).
115
148
* See [what hyperparameters are available for computer vision tasks](reference-automl-images-hyperparameters.md).
116
-
*[Make predictions with ONNX on computer vision models from AutoML](how-to-inference-onnx-automl-image-models.md)
149
+
*[Make predictions with ONNX on computer vision models from AutoML](how-to-inference-onnx-automl-image-models.md)
> 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/).
19
+
20
+
In this article, you'll learn how to train an object detection model to detect small objects in high-resolution images with [automated ML](concept-automated-ml.md) in Azure Machine Learning.
21
+
22
+
Typically, computer vision models for object detection work well for datasets with relatively large objects. However, due to memory and computational constraints, these models tend to under-perform when tasked to detect small objects in high-resolution images. Because high-resolution images are typically large, they are resized before input into the model, which limits their capability to detect smaller objects--relative to the initial image size.
23
+
24
+
To help with this problem, automated ML supports tiling as part of the public preview computer vision capabilities. The tiling capability in automated ML is based on the concepts in [The Power of Tiling for Small Object Detection](https://openaccess.thecvf.com/content_CVPRW_2019/papers/UAVision/Unel_The_Power_of_Tiling_for_Small_Object_Detection_CVPRW_2019_paper.pdf).
25
+
26
+
When tiling, each image is divided into a grid of tiles. Adjacent tiles overlap with each other in width and height dimensions. The tiles are cropped from the original as shown in the following image.
* An Azure Machine Learning workspace. To create the workspace, see [Create workspace resources](quickstart-create-resources.md).
33
+
34
+
* This article assumes some familiarity with how to configure an [automated machine learning experiment for computer vision tasks](how-to-auto-train-image-models.md).
35
+
36
+
## Supported models
37
+
38
+
Small object detection using tiling is supported for all models supported by Automated ML for images for object detection task.
39
+
40
+
## Enable tiling during training
41
+
42
+
To enable tiling, you can set the `tile_grid_size` parameter to a value like (3, 2); where 3 is the number of tiles along the width dimension and 2 is the number of tiles along the height dimension. When this parameter is set to (3, 2), each image is split into a grid of 3 x 2 tiles. Each tile overlaps with the adjacent tiles, so that any objects that fall on the tile border are included completely in one of the tiles. This overlap can be controlled by the `tile_overlap_ratio` parameter, which defaults to 25%.
43
+
44
+
When tiling is enabled, the entire image and the tiles generated from it are passed through the model. These images and tiles are resized according to the `min_size` and `max_size` parameters before feeding to the model. The computation time increases proportionally because of processing this extra data.
45
+
46
+
For example, when the `tile_grid_size` parameter is (3, 2), the computation time would be approximately seven times when compared to no tiling.
47
+
48
+
You can specify the value for `tile_grid_size` in your hyperparameter space as a string.
49
+
50
+
```python
51
+
parameter_space = {
52
+
'model_name': choice('fasterrcnn_resnet50_fpn'),
53
+
'tile_grid_size': choice('(3, 2)'),
54
+
...
55
+
}
56
+
```
57
+
58
+
The value for `tile_grid_size` parameter depends on the image dimensions and size of objects within the image. For example, larger number of tiles would be helpful when there are smaller objects in the images.
59
+
60
+
To choose the optimal value for this parameter for your dataset, you can use hyperparameter search. To do so, you can specify a choice of values for this parameter in your hyperparameter space.
When a model trained with tiling is deployed, tiling also occurs during inference. Automated ML uses the `tile_grid_size` value from training to generate the tiles during inference. The entire image and corresponding tiles are passed through the model, and the object proposals from them are merged to output final predictions, like in the following image.
> It's possible that the same object is detected from multiple tiles, duplication detection is done to remove such duplicates.
77
+
>
78
+
> Duplicate detection is done by running NMS on the proposals from the tiles and the image. When multiple proposals overlap, the one with the highest score is picked and others are discarded as duplicates.Two proposals are considered to be overlapping when the intersection over union (iou) between them is greater than the `tile_predictions_nms_thresh` parameter.
79
+
80
+
You also have the option to enable tiling only during inference without enabling it in training. To do so, set the `tile_grid_size` parameter only during inference, not for training.
81
+
82
+
Doing so, may improve performance for some datasets, and won't incur the extra cost that comes with tiling at training time.
83
+
84
+
## Tiling hyperparameters
85
+
86
+
The following are the parameters you can use to control the tiling feature.
87
+
88
+
| Parameter Name | Description | Default |
89
+
| --------------- |-------------| -------|
90
+
|`tile_grid_size`| The grid size to use for tiling each image. Available for use during training, validation, and inference.<br><br>Tuple of two integers passed as a string, e.g `'(3, 2)'`<br><br> *Note: Setting this parameter increases the computation time proportionally, since all tiles and images are processed by the model.*| no default value |
91
+
|`tile_overlap_ratio`| Controls the overlap ratio between adjacent tiles in each dimension. When the objects that fall on the tile boundary are too large to fit completely in one of the tiles, increase the value of this parameter so that the objects fit in at least one of the tiles completely.<br> <br> Must be a float in [0, 1).| 0.25 |
92
+
|`tile_predictions_nms_thresh`| The intersection over union threshold to use to do non-maximum suppression (nms) while merging predictions from tiles and image. Available during validation and inference. Change this parameter if there are multiple boxes detected per object in the final predictions. <br><br> Must be float in [0, 1]. | 0.25 |
93
+
94
+
95
+
## Example notebooks
96
+
97
+
See the [object detection sample notebook](https://github.com/Azure/azureml-examples/tree/main/python-sdk/tutorials/automl-with-azureml/image-object-detection/auto-ml-image-object-detection.ipynb) for detailed code examples of setting up and training an object detection model.
98
+
99
+
>[!NOTE]
100
+
> All images in this article are made available in accordance with the permitted use section of the [MIT licensing agreement](https://choosealicense.com/licenses/mit/).
* Learn more about [how and where to deploy a model](/azure/machine-learning/how-to-deploy-managed-online-endpoints).
106
+
* For definitions and examples of the performance charts and metrics provided for each job, see [Evaluate automated machine learning experiment results](how-to-understand-automated-ml.md).
107
+
*[Tutorial: Train an object detection model (preview) with AutoML and Python](tutorial-auto-train-image-models.md).
108
+
* See [what hyperparameters are available for computer vision tasks](reference-automl-images-hyperparameters.md).
109
+
*[Make predictions with ONNX on computer vision models from AutoML](how-to-inference-onnx-automl-image-models.md)
0 commit comments