Amazon MLS-C01: Deep Learning & Computer Vision — Study Guide
Part of the AWS Machine Learning Specialty MLS-C01 — Study Guide. Practice with verified answers in the Amazon exam hub, or take timed practice tests on ExamRoll.io.
Architectures, transfer learning, and model selection
Convolutional backbones like ResNet and Inception family remain workhorses for vision: ResNet (50/101) offers stable residual learning for deep feature hierarchies, while Inception modules provide multi-scale feature aggregation that helps with varied object sizes. For modern trade-offs, EfficientNet and MobileNet prioritize FLOPs-to-accuracy, making them strong choices for mobile/edge. In practice on AWS, start from pretrained ImageNet weights (available in TorchVision, TensorFlow Hub, or via SageMaker training containers) and apply transfer learning by replacing the classification head, using a much lower learning rate for backbone layers and a higher rate for newly initialized heads. Freeze early layers for small datasets and progressively unfreeze in stages to avoid catastrophic forgetting. Decision criteria: choose heavier backbones (ResNet101, Inception-ResNet) for large datasets and latency-tolerant endpoints (ml.p3 or ml.p4 instances), and lightweight backbones (MobileNetV3, EfficientNet-lite) when deploying via SageMaker Neo or AWS IoT Greengrass to constrained devices. A common trap is fine-tuning with the same high learning rate used for training from scratch; instead adopt discriminative learning rates, use weight decay, and validate transferability by monitoring feature-space layer activations and validation loss for overfitting signals.
Training practices, augmentation, and dataset/labeling considerations
High-quality labeled data is the foundation for reliable vision models. Use Amazon SageMaker Ground Truth to build labeling workflows with bounding boxes, polygons, or semantic masks, and enforce private workforces, IAM restrictions, and S3 KMS encryption to meet data access controls. Mitigate label noise with consensus and review rounds and use active learning to prioritize ambiguous or rare examples. For small or imbalanced datasets employ aggressive, task-appropriate augmentation: photometric transforms, random crops, rotations, cutout, mixup or mosaic augmentations for detection; use class-balanced sampling, focal loss, or class-weighted cross-entropy to address severe class imbalance. Split data to avoid leakage: for user- or store-level dependencies, perform grouped or time-based splits rather than naive random splits; a frequent trap is leaking future timestamps or multiple images of the same object across train/val/test. For medical or regulated data, enable network isolation for SageMaker Training jobs, encrypt S3 with KMS, restrict notebook access via VPC endpoints, and rotate credentials using Secrets Manager. Track experiments and metrics with SageMaker Experiments to correlate augmentation, learning rates, and regularization choices.
Object detection and segmentation: architectures, metrics, and pitfalls
Object detection choices include one-stage detectors like YOLO and RetinaNet for real-time throughput and two-stage detectors like Faster R-CNN for higher accuracy and small-object localization. Add Feature Pyramid Networks (FPN) to improve multi-scale detection; use Mask R-CNN or DeepLabv3+ for instance and semantic segmentation tasks. Anchors, IoU thresholds, and Non-Max Suppression (NMS) heavily affect results: tune anchor sizes/aspect ratios to dataset object scales and choose appropriate IoU for positive/negative assignment. Evaluation must use mAP across IoU levels (AP50, AP75) plus per-class recall/precision curves—relying solely on accuracy obscures localization failures. In AWS workflows, use SageMaker training with PyTorch/TensorFlow containers for custom architectures, store datasets in S3 with manifest files for Ground Truth, and validate with SageMaker Processing jobs. Common traps are using overly large input sizes for inference (increases latency) or ignoring class imbalance in object counts; optimize by applying class-specific augmentation, using weighted losses, or two-stage training where a generic detector is followed by per-class refiners. For production, export models to ONNX or TorchScript and validate exported outputs vs. training outputs to avoid operator mismatch.
Inference optimization, deployment, and monitoring for GPU and edge
Optimizing inference requires profiling the entire pipeline, not only GPU compute. Low GPU utilization often stems from CPU-bound preprocessing, small batch sizes, synchronous endpoint latency, or I/O waits. Profile with SageMaker Debugger and CloudWatch metrics to identify bottlenecks, then apply remedies: increase batch size or use asynchronous inference; convert models to TorchScript/ONNX and enable TensorRT optimizations on NVIDIA-backed instances; use mixed precision (AMP/bfloat16) on p4/p3 instances; compile with SageMaker Neo for target hardware or deploy Elastic Inference to attach fractional acceleration to CPU instances for moderate throughput. For edge deployment, use SageMaker Edge Manager or AWS IoT Greengrass with models compiled by Neo, apply quantization and pruning to shrink model size, and run on-device batching where possible. Configure SageMaker multi-model endpoints or provisioned concurrency to handle cold starts and use automatic scaling policies based on GPU memory utilization and request latency. Also enable Model Monitor to detect input drift and SageMaker Model Registry for controlled model promotion; common traps include compiling models with unsupported ops for Neo or forgetting to provision IAM roles and VPC endpoints for private S3 access, which causes deployment failures.
Practical Problem: Use-Case Scenario
Scenario: QuickServe Corp runs an on-prem point-of-sale system and uses SageMaker for model training and inference; images from store cameras are stored in a private S3 bucket with KMS encryption. They want a production pipeline to detect queue length at registers and deploy a lightweight model to edge devices for real-time alerts.
Challenge: Build and deploy an accurate, low-latency queue-counting model that respects data security (private S3, KMS) and runs on constrained edge hardware while enabling safe retraining with new labeled data.
Recommended Approach:
- Train a detector using a pretrained MobileNetV3 backbone (in SageMaker PyTorch container) fine-tuned on Ground Truth-labeled bounding boxes stored in KMS-encrypted S3; use grouped splits by store to avoid leakage.
- Use augmentation (random crop, horizontal flip, brightness jitter) and focal loss to handle class imbalance between queue vs non-queue frames; validate with AP50 and per-class recall.
- Export model to TorchScript/ONNX, compile with SageMaker Neo targeting the edge device, and deploy via AWS IoT Greengrass or SageMaker Edge Manager with model signing and IAM role permitting only necessary S3 artifacts.
- Monitor performance with periodic batch uploads to S3, run SageMaker Processing jobs for drift detection, and retrain in SageMaker using versioned datasets in S3 and Model Registry with controlled rollout to edge.
Rationale: This approach uses efficient transfer learning and device-specific compilation to meet latency and size constraints, enforces security via KMS and IAM, and implements a monitored retraining loop to maintain accuracy while preventing data leakage.
← Modeling — Supervised · All domains · Natural Language Processing →
Practice these questions → · Timed practice on ExamRoll.io →
Pass the whole exam — not just this question
You found this answer. Get every verified question and explanation in one place, and save hours of prep. Free to start.
Pass your exam →