Concept
Built-in algorithms: image and video
Image Classification, Object Detection and Semantic Segmentation, and when Rekognition is the better choice.
Image Classification
- Output
- A label per image
- Training data
- Images with labels
Object Detection
- Output
- Boxes and labels
- Training data
- Images and box annotations
Semantic Segmentation
- Output
- A class per pixel
- Training data
- Images and masks
| Algorithm | Output | Training data |
|---|---|---|
| Image Classification | A label per image | Images with labels |
| Object Detection | Boxes and labels | Images and box annotations |
| Semantic Segmentation | A class per pixel | Images and masks |
What it is
Three built-in algorithms handle images. Image Classification gives a label for each image (or several labels, in multi-label mode). Object Detection finds each object and returns a bounding box and a label. Semantic Segmentation labels every pixel with a class, for tasks such as road scenes. The built-in algorithms read images, so for video, extract frames and run them on the frames.
What it is
They are neural networks, so you train on GPU instances. Often you use transfer learning: start from a network pre-trained on a large image set and fine-tune it on your images, which needs far fewer images and less time. Both MXNet and TensorFlow versions exist; the TensorFlow ones fine-tune pre-trained TensorFlow Hub models.
Input: images as JPEG or PNG files, or packed RecordIO files. Object Detection also needs annotation files with the boxes, and Semantic Segmentation needs a mask image for each training image.
What it is
Compare Amazon Rekognition. Use Rekognition when its standard labels fit. Use Rekognition Custom Labels for your own objects with a few images and no ML code. Use a SageMaker AI algorithm when you need control over the network, tuning or training data at scale.
Remember
- Image Classification: one label per image. Object Detection: boxes and labels. Semantic Segmentation: a class per pixel.
- Train on GPU instances.
- Transfer learning starts from a pre-trained network and needs fewer images.
- Formats: image files (JPEG, PNG) or RecordIO. Detection needs box annotations. Segmentation needs mask images.
Remember
- Video: run the algorithm on extracted frames.
- Standard objects: Rekognition. Your own objects with no code: Rekognition Custom Labels.
On the exam
- “Draw a box around each defect in factory photos” points to Object Detection.
- “Label every pixel as road, car or person” points to Semantic Segmentation.
- “Train an image classifier with only a few hundred images” points to transfer learning.
- “Find our own logo with no ML code” points to Rekognition Custom Labels.
In this task · 2.2
- Built-in algorithms for tabular data
- Built-in algorithms: clustering, dimensionality reduction, anomaly
- Built-in algorithms: text, sequence and forecasting
- Built-in algorithms: image and video
- Training jobs, script mode and ML libraries
SageMaker AMT
- Reducing training time
- Distributed training and HyperPod
- Overfitting, underfitting and catastrophic forgetting
- Combining models
- Epochs, steps, batch size and learning rate
- Task-specific prompt engineering
- Fine-tuning and continued pre-training in Bedrock
- PEFT, LoRA and fine-tuning on SageMaker
- Model distillation
- Optimizing retrieval and embedding models