Bird
Raised Fist0

Data Labeling Strategies - Human Annotation vs Weak Supervision

THEORYintermediateInterview freq: high
Choose your preparation mode6 modes available
⚖️
Human Annotation vs Weak Supervision

For a new product feature requiring labeled data, would you choose human annotation or weak supervision? Justify your choice.

📊
Comparison
DimensionHuman AnnotationWeak Supervision
Label AccuracyHighMedium
CostHighLow
ScalabilityLowHigh
Time to LabelSlowFast
Bias RiskMediumHigh
✅
Verdict
Default to weak supervision for datasets over 100K instances where budget is limited and rapid iteration is needed; switch to human annotation when accuracy is critical and budget allows.
💡
Key Insight
The choice between human annotation and weak supervision hinges on the trade-off between accuracy and scalability.
⚠️
Interview Trap
❌ Wrong: Always choose human annotation for better accuracy.
Ignoring scalability and cost constraints for large datasets.
✅ Consider the trade-off between accuracy and scalability, especially under budget constraints.
Human Annotation
"High accuracy and reliability of labels"
  • Expensive and time-consuming for large datasets
  • Scalability issues with increasing data volume
  • Potential for human bias in labeling
Ideal When
  • When n < 10K and high label accuracy is critical
  • When domain expertise is required for labeling
  • When budget allows for high-quality manual labeling
Google uses human annotation for critical datasets where precision is paramount, such as medical imaging.
Weak Supervision
"Scalable and cost-effective for large datasets"
  • Lower initial label accuracy
  • Requires careful tuning of labeling functions
  • Potential for propagating label noise
Ideal When
  • When n > 100K and budget is limited
  • When rapid iteration is needed
  • When label noise can be tolerated or corrected
Snorkel AI uses weak supervision to quickly generate labeled datasets for NLP tasks, enabling rapid prototyping.
🐍
Human Annotation - Example
▼ Show
Python
import pandas as pd
# Simulate human annotation process
labels = pd.Series(['cat', 'dog', 'bird'])
data = pd.DataFrame({'image_id': [1, 2, 3], 'label': labels})
print(data)
🐍
Weak Supervision - Example
▼ Show
Python
import numpy as np
# Simulate weak supervision with labeling functions
labels = np.random.choice(['cat', 'dog', 'bird'], size=1000)
data = np.array([(i, label) for i, label in enumerate(labels)])
print(data[:5])
✅
Use Human Annotation When
  • •When n < 10K and label accuracy > 95% is required
  • •When domain-specific knowledge is essential
  • •When budget allows for manual labeling
✅
Use Weak Supervision When
  • •When n > 100K and budget is constrained
  • •When rapid prototyping is needed
  • •When label noise can be managed post-labeling
↳
Nuances
  • For small datasets with high stakes, human annotation is often worth the cost.
  • Weak supervision can be surprisingly effective when combined with post-labeling noise correction.
  • In domains with rapid changes, weak supervision allows for faster adaptation.

Practice

(1/5)
1. When designing a CNN for image classification, why might you choose to use a smaller receptive field in the initial layers?
medium
A. To capture more global features early on
B. To reduce the computational cost of the network
C. To capture fine-grained local features
D. To increase the depth of the network without increasing parameters

Solution

  1. Step 1: Understand receptive fields

    Smaller receptive fields in initial layers help capture fine-grained local features, which are crucial for understanding detailed patterns.
  2. Step 2: Eliminate wrong options

    To capture more global features early on is incorrect because global features are captured in deeper layers. To reduce the computational cost of the network is incorrect as smaller receptive fields don't necessarily reduce computational cost. To increase the depth of the network without increasing parameters is incorrect because depth and parameters are not directly related to receptive field size.
  3. Final Answer:

    Option C -> Option C
  4. Quick Check:

    Smaller fields capture local details. [OK]
Hint: Smaller fields capture local details. [OK]
Common Mistakes:
2. When deciding between MLflow and Weights & Biases for experiment tracking, which scenario makes MLflow a better choice?
medium
A. When you need advanced hyperparameter tuning capabilities.
B. When you require seamless integration with cloud-based Jupyter notebooks.
C. When you need a self-hosted solution with minimal external dependencies.
D. When you need real-time collaboration features for a large team.

Solution

  1. Step 1: Compare MLflow and W&B features

    MLflow is often chosen for self-hosting due to its open-source nature.
  2. Step 2: Match features to scenarios

    MLflow's self-hosting is ideal for environments with strict data privacy requirements.
  3. Final Answer:

    Option C -> Option C
  4. Quick Check:

    MLflow = Self-hosting [OK]
Hint: MLflow = Self-hosting [OK]
Common Mistakes:
3. A machine learning model is consistently overfitting on a dataset. What is the most likely cause?
medium
A. The dataset is too small.
B. The model has too many parameters.
C. The model is too simple.
D. The learning rate is too high.

Solution

  1. Step 1: Identify symptoms of overfitting.

    Overfitting occurs when a model learns noise instead of the signal.
  2. Step 2: Determine the cause related to model complexity.

    Too many parameters can lead to overfitting by capturing noise.
  3. Final Answer:

    Option B -> Option B
  4. Quick Check:

    Overfitting often means too complex a model. [OK]
Hint: Overfitting often means too complex a model. [OK]
Common Mistakes:
4. You are tasked with deploying a calibrated model for a real-time fraud detection system. Which approach ensures both calibration and low latency?
hard
A. Use a pre-trained calibrated model with Platt Scaling
B. Use Isotonic Regression with online learning
C. Use Platt Scaling with batch processing
D. Use a pre-trained calibrated model with Isotonic Regression

Solution

  1. Step 1: Consider latency and calibration.

    Real-time systems require low latency, favoring pre-trained models.
  2. Step 2: Evaluate each approach.

    Batch processing (A) and online learning (B) introduce latency. Pre-trained models (C, D) are faster, but Platt Scaling (C) is more efficient than Isotonic Regression (D).
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Pre-trained + Platt = fast calibration. [OK]
Hint: Pre-trained + Platt = fast calibration. [OK]
Common Mistakes:
5. In a real-time system where predictions need to be made quickly, which approach to linear regression is more suitable and why?
hard
A. Stochastic Gradient Descent because it updates weights more frequently
B. Least Squares because it provides the exact solution
C. Batch Gradient Descent because it processes the entire dataset at once
D. Mini-batch Gradient Descent because it balances speed and accuracy

Solution

  1. Step 1: Consider real-time constraints

    Stochastic Gradient Descent (SGD) updates weights after each data point, allowing for faster, more frequent updates suitable for real-time systems.
  2. Step 2: Eliminate wrong options

    Batch Gradient Descent (A) is too slow for real-time, Least Squares (C) is not iterative, and Mini-batch (D) is a compromise but not as fast as SGD.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    SGD updates weights after each data point. [OK]
Hint: SGD updates weights after each data point. [OK]
Common Mistakes:
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard