Segmenting images (console)
If you're creating an image segmentation model, you must classify images as normal or anomaly. You must also add segmentation information to anomalous images. To specify segmentation information, you first specify anomaly labels for each type of anomaly, such as a dent or scratch, that you want your model to find. Then you specify an anomaly mask and anomaly label for each anomaly on anomalous images in your dataset.
Note
If you're creating an image classification model, you don't need to segment images and you don't need to specify anomaly labels.
Specifying anomaly labels
You define an anomaly label for each type of anomaly that's in the dataset images.
Specify anomaly labels
-
Open the Amazon Lookout for Vision console at https://console.aws.amazon.com/lookoutvision/
. -
In the left navigation pane, choose Projects.
-
In the Projects page, choose the project that you want to use.
-
In the left navigation pane of your project, choose Dataset.
-
In Anomaly labels choose Add anomaly labels. If you've previously added an anomaly label, choose Manage.
-
In the dialog box, do the following:
Enter the anomaly label that you want to add and choose Add anomaly label.
Repeat the previous step until you have entered every anomaly label that you want your model to find.
(Optional) Choose the edit icon to change the label name.
(Optional) Choose the delete icon to delete a new anomaly label. You can't delete anomaly types that your dataset is currently using using.
Choose Confirm to add the new anomaly labels to the dataset.
After you specify the anomaly labels, label the images by doing Labeling an image.
Labeling an image
To label an image for image segmentation, classify the image as normal or an anomaly. Then, use the annotation tool to segment the image by drawing masks that tightly cover the areas for each type of anomaly present in the image.
To label an image
-
If you have separate training and test datasets, choose the tab for the dataset that you want to use.
-
If you haven't already, specify the anomaly types for your dataset by doing Specifying anomaly labels.
-
Choose Start labeling.
-
Choose Select all images on this page.
-
If the images are normal, choose Classify as normal, otherwise choose Classify as anomaly.
To change the label for a single image, choose Normal or Anomaly under the image.
Note
You can filter image labels by choosing the desired label, or label state, in the Filters section. You can sort by confidence score in the Sorting options section.
For each anomalous image, choose the image to open the annotation tool. Add segmentation information by doing Segmenting an image with the annotation tool.
Choose Save changes.
If you've finished labeling your images, you can train your model.
Segmenting an image with the annotation tool
You use the annotation tool to segment an image by marking anomalous areas with a mask.
To segment an image with the annotation tool
Open the annotation tool by selecting the image in the dataset gallery. If necessary, choose Start labeling to enter labeling mode.
In the Anomaly labels section choose the anomaly label that you want to mark. If necessary, choose Add anomaly labels to add a new anomaly label.
Choose a drawing tool at the bottom of the page and draw masks that tightly covers anomalous areas for the anomaly label. The following image is an example of a mask that tightly covers an anomaly.
The following is an example of a poor mask that doesn't tightly cover an anomaly.
If you have more images to segment, choose Next and repeat steps 2 and 3.
Choose Submit and close to finish segmenting images.