Cert Notes/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
SCS-C03 · SpecialtySecurity - Specialty
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
  • Week 1
    • 1.The ML Lifecycle (from a Specialty Perspective)
    • 2.Data Storage for ML: S3, EFS, FSx for Lustre, and Data Formats
    • 3.Data Ingestion: Kinesis, Glue, Batch vs. Streaming
    • 4.Data Labeling: SageMaker Ground Truth, Active Learning, Label Quality
    • 5.Week 1 Comprehensive Review: ML Overview & Data Engineering 1
  • Week 2
    • 1.Data Transformation and ETL: AWS Glue, Spark, and EMR
    • 2.Automating ML Training Pipelines: Step Functions and SageMaker Pipelines
    • 3.Data Augmentation and Synthesis: Addressing Insufficient and Imbalanced Data
    • 4.Data Storage and Access Optimization: Pipe vs File Mode, FSx for Lustre, Distributed Training
    • 5.Week 2 Comprehensive Review: From Transformation to Distributed Training Data Supply
  • Week 3
    • 1.Data Cleaning: Missing Values, Outlier Detection, Duplicates and Errors
    • 2.Feature Engineering: Scaling, Encoding, and Binning
    • 3.Time Series, Text Features, and High-Cardinality Categorical Handling
    • 4.SageMaker Tools: Data Wrangler, Processing Job, Feature Store
    • 5.Week 3 Comprehensive Review: Cleaning and Feature Engineering
  • Week 4
    • 1.Dimensionality Reduction: PCA, t-SNE, and the Curse of Dimensionality
    • 2.Feature Selection: Filter, Wrapper, Embedded, Importance, Multicollinearity
    • 3.Data Visualization: Distribution, Correlation, QuickSight, Insights
    • 4.Handling Class Imbalance: Over/Undersampling, SMOTE, Class Weights, Evaluation
    • 5.Week 4 Comprehensive Review: Dimensionality, Feature Selection, Visualization, Imbalance
  • Week 5
    • 1.Statistical Foundations: Distribution, Central Tendency, Dispersion, Transformations, Sample and Population
    • 2.Correlation and Relationships: Correlation Coefficients, Causation vs. Correlation, Multivariate Relationships
    • 3.Data Leakage: Causes, Detection, Prevention; Time Series Leakage; Target Leakage
    • 4.Validation Design: train/validation/test Split, Cross-Validation, Time Series Split, Stratified Sampling
    • 5.Week 5 Comprehensive Review: Statistics and Validation Design
  • Week 6
    • 1.Algorithm Selection: Problem Type to Mapping
    • 2.SageMaker Builtin 1: XGBoost, Linear Learner, K-Means, KNN
    • 3.SageMaker Builtin 2: Text, Image, Time Series, Recommendation
    • 4.Unsupervised/Anomaly Detection: RCF, PCA, IP Insights, Topic Models (LDA/NTM)
    • 5.Week 6 Comprehensive Review: Algorithm Selection and SageMaker Builtins
  • Week 7
    • 1.Neural Network Foundations: Perceptron to Backpropagation
    • 2.CNN: Convolutional Neural Networks and Computer Vision
    • 3.RNNs and Sequences: From LSTM to Transformer
    • 4.Learning Techniques and Transfer Learning
    • 5.Week 7 Synthesis: Deep Learning Summary
  • Week 8
    • 1.SageMaker Training Jobs: Estimator, Input Modes, Distributed Learning, Spot
    • 2.Hyperparameter Tuning (AMT): Bayesian, Random, Hyperband
    • 3.Overfitting/Underfitting: Diagnosis and Regularization/Data Augmentation
    • 4.Learning Optimization: Batch Size, Learning Rate, Gradient Issues, Debugger/Profiler
    • 5.Week 8 Review: Training, Tuning, Generalization
  • Week 9
    • 1.Classification Evaluation Metrics: Accuracy, Precision, Recall, F1 and Confusion Matrix
    • 2.ROC/AUC and Threshold Adjustment: Reading Model Performance with Curves
    • 3.Regression Evaluation Metrics: RMSE, MAE, MAPE, R² and Residual Analysis
    • 4.Model Debugging and Bias: SageMaker Debugger and Clarify
    • 5.Week 9 Review: Evaluation and Debugging
  • Week 10
    • 1.Inference Options: Real-time vs Serverless vs Asynchronous vs Batch Transform
    • 2.Real-time Endpoint Operations: Configuration, Auto Scaling, Multi-Model
    • 3.Inference Optimization: Neo, Elastic Inference, Inferentia, Inference Pipelines
    • 4.Deployment Strategies: A/B Testing, Blue/Green, Canary, Shadow, Rollback
    • 5.Week 10 Review: ML Implementation & Operations 1 — Deployment & Inference
  • Week 11
    • 1.Model Monitoring: SageMaker Model Monitor and Drift Response
    • 2.MLOps: SageMaker Pipelines, Model Registry, CI/CD
    • 3.ML Security: IAM Execution Roles, VPC Isolation, KMS Encryption
    • 4.Operations & Cost: Cost Optimization, Logging/Audit, Disaster Recovery
    • 5.Week 11 Review: Monitoring, MLOps, Security, Operations
  • Week 12
    • 1.Domains 1 & 2 Integration: Data Engineering + EDA
    • 2.Domain 3 Integration: Modeling (Algorithm to Evaluation)
    • 3.Domain 4 Integration: ML Implementation & Operations
    • 4.Synthesis: 4 Domains + End-to-End Scenarios
    • 5.D-Day Wrap-Up: Exam Structure, Time Allocation, Requirement Translation Tables, Trap Roundup
← MLS-C01/Week 1/Day 4
MLS-C01· AssociateWeek 1 · Day 4~17 min read

Day 4 - Data Labeling: SageMaker Ground Truth, Active Learning, Label Quality

The ceiling of a supervised model is set not by the algorithm but by label quality. If the labels are wrong, even the best model learns wrong answers ("garbage in, garbage out"). Yet the cost of having humans hand-label hundreds of thousands of images is enormous. The Specialty exam asks "how do you meet this labeling requirement cheaply and accurately?", and SageMaker Ground Truth sits at the center of the answer.

Today we cover (1) the structure of Ground Truth and workforce selection, (2) automated labeling (active learning) that cuts costs, and (3) consensus techniques that guarantee label quality.

SageMaker Ground Truth: The Labeling Workflow

Ground Truth composes a labeling job from (1) input data (S3), (2) a labeling task type, (3) a workforce (who does the labeling), and (4) a labeling UI template. The output comes in the standardized augmented manifest (JSON Lines) format, ready to use directly for training.

Supported task types: image classification, bounding box (object detection), semantic segmentation, text classification, named entity recognition, video, and more.

import boto3
sm = boto3.client("sagemaker")
 
sm.create_labeling_job(
    LabelingJobName="cat-dog-bbox",
    LabelAttributeName="annotations",
    InputConfig={"DataSource": {"S3DataSource": {
        "ManifestS3Uri": "s3://my-lake/labeling/input.manifest"}}},
    OutputConfig={"S3OutputPath": "s3://my-lake/labeling/output/"},
    RoleArn=role_arn,
    LabelCategoryConfigS3Uri="s3://my-lake/labeling/labels.json",
    HumanTaskConfig={
        "WorkteamArn": private_workteam_arn,        # workforce selection (table below)
        "PreHumanTaskLambdaArn": prehuman_lambda,
        "TaskTitle": "Draw boxes around cats and dogs",
        "NumberOfHumanWorkersPerDataObject": 3,     # 3 workers label each object → consensus
        "TaskTimeLimitInSeconds": 300,
    },
)

The workforce (who does the labeling) is chosen based on data sensitivity and cost.

WorkforceCharacteristicsSuitable data
Amazon Mechanical TurkLarge-scale, low-cost public workersNon-sensitive public data, fast high volume
PrivateTrusted groups such as internal employeesConfidential or regulated data (medical, financial)
VendorProfessional vendors from AWS MarketplaceTasks requiring expertise (e.g., medical image reading)

💡 Related theory: Exposing sensitive data (patient imaging, PII) to a public workforce like Mechanical Turk is a compliance violation. In such cases you must use a Private workforce (internal) or a trusted Vendor. The Specialty exam frequently asks "which labeling workforce for sensitive medical/financial data?", and the answer is almost always Private or Vendor. Choosing Mechanical Turk based on cost and scale alone is walking into the trap.

Active Learning: Cutting Costs with Automated Labeling

Ground Truth's core cost-saving feature is automated data labeling (active learning). How it works:

  1. Humans label a portion of the data (the seed).
  2. A model is trained on those labels.
  3. The model scores predictions over the full dataset, and high-confidence predictions are adopted as automatic labels.
  4. Only the low-confidence (ambiguous) items are sent back to humans.
  5. The model is retrained on the newly human-labeled data, and the cycle repeats.

The key insight: by concentrating human effort on the borderline cases the model is unsure about, you achieve high quality even though humans label only a fraction of the full dataset.

# Adding LabelingJobAlgorithmsConfig to create_labeling_job enables active learning
labeling_algorithm = {
    "LabelingJobAlgorithmsConfig": {
        # Built-in algorithm ARN matching the task type (image classification example)
        "LabelingJobAlgorithmSpecificationArn":
            "arn:aws:sagemaker:us-east-1:027400017018:labeling-job-algorithm-specification/image-classification"
    }
}
# High-confidence objects get auto-labeled by the model; only ambiguous objects route to humans → lower cost

💡 Related theory: Active learning starts from the premise that "not all data is equally useful for training." Samples the model is already confident about carry low information value for additional labels, while ambiguous samples near the decision boundary (high-uncertainty samples) carry the most information. The strategy of selecting only these ambiguous samples to ask humans about is called uncertainty sampling. The more data you have and the tighter the labeling budget, the greater the payoff.

Guaranteeing Label Quality: Consensus and Verification

Humans err too. A single labeler makes mistakes from slips, bias, and fatigue. Ground Truth provides several mechanisms for quality.

  • Consensus: Setting NumberOfHumanWorkersPerDataObject to 2-5 has multiple workers label the same object, and the results are aggregated (majority vote or weighted) into the final label.
  • Annotation consolidation: The logic that merges multiple answers. Provided by default and replaceable with a custom Lambda.
  • Quality verification workflows: A separate workforce reviews and corrects the labeling output.
# Consensus: 3 workers label each object → the consolidation algorithm produces the final label
"NumberOfHumanWorkersPerDataObject": 3,
# Consolidation logic (majority vote by default), or specify a custom consolidation Lambda
"AnnotationConsolidationConfig": {
    "AnnotationConsolidationLambdaArn": consolidation_lambda_arn
}

A metric for measuring label quality is inter-annotator agreement (agreement between labelers, e.g., Cohen's kappa). Low agreement is a signal that the task guidelines are ambiguous or the task is inherently hard.

💡 Related theory: Label noise directly cuts into the upper bound of model performance. Consensus-based labeling cancels random errors through majority voting, reducing noise, but systematic bias — where all labelers err in the same direction (e.g., due to ambiguous guidelines) — cannot be caught by consensus. That is why you also need clear labeling guidelines and a procedure that validates labelers against a golden set (samples with known ground truth). Cost trades off against accuracy and labeler count, and reducing the amount of human labeling itself via active learning is the standard play that wins on both cost and quality.

Labeling Alternatives: Do You Really Need All That Data?

There are questions to ask before labeling. (1) Can a pretrained model + transfer learning get by with fewer labels? (2) Can data augmentation multiply the existing labels? (3) Can weak supervision provide heuristic labels? The Specialty exam often asks "ways to reduce labeling cost," and active learning and transfer learning show up as correct answers.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

You must label 500,000 patient X-rays. The data is medical information containing PII. What is the most appropriate workforce choice?

Question 2

The labeling budget for 1 million images is tight. Which Ground Truth feature concentrates human labeling effort on the highest-information samples to reduce total cost?

Question 3

To reduce random human error in labeling output, you want multiple workers to label the same object and have the results aggregated. What do you configure in Ground Truth?

Question 4

Which label quality problem is hard to reduce even with consensus-based labeling?

Question 5

Which of the following is the LEAST appropriate approach to fundamentally reducing labeling costs for a large-scale image classification model?

PreviousData Ingestion: Kinesis, Glue, Batch vs. StreamingWeek 1 · Day 3Next Week 1 Comprehensive Review: ML Overview & Data Engineering 1Week 1 · Day 5

On this page

  • SageMaker Ground Truth: The Labeling Workflow
  • Active Learning: Cutting Costs with Automated Labeling
  • Guaranteeing Label Quality: Consensus and Verification
  • Labeling Alternatives: Do You Really Need All That Data?
  • Practice Questions