CertNote/ 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
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
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
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
    • 1.Neural Network Basics: From the Perceptron to Backpropagation
    • 2.CNN: Convolutional Neural Networks and Computer Vision
    • 3.RNNs and Sequence Models: From LSTM to Transformer
    • 4.Training Techniques and Transfer Learning
    • 5.Week 7 Synthesis: Deep Learning Summary
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← MLS-C01/Week 7/Day 2

Based on the MLS-C01 exam guide·Report an error

MLS-C01· AssociateWeek 7 · Day 2~31 min read

Day 2 - CNN: Convolutional Neural Networks and Computer Vision

📌 Key Takeaways

  • A CNN processes images efficiently thanks to three ideas: local receptive fields + weight sharing + translation invariance.
  • Convolution extracts patterns and pooling shrinks the size. Pooling has no learnable parameters.
  • You must clearly distinguish classification (labels) / object detection (boxes + classes) / semantic segmentation (pixels).
  • ResNet's residual (skip) connections are the fix for the problem that networks of 100+ layers would not train.
  • SageMaker provides the Image Classification, Object Detection, and Semantic Segmentation built-ins plus Ground Truth labeling.

Why Convolution, Not Fully Connected?

Images and video have an enormous number of pixels. Feeding them straight into a fully connected (Dense) neural network makes the parameter count explode, and the network also fails to learn translation invariance. A convolutional neural network (CNN) solves this by sliding small filters across the whole image to extract local patterns.

  • A 224×224×3 color image flattened into a Dense layer gives roughly 150,000 input nodes.
  • If the first hidden layer has 1,000 nodes, that is 150 million weights — an explosion.
AspectFully connected (Dense)Convolution (CNN)
Range one neuron seesThe whole imageA small local region (receptive field)
ParametersBlow up in proportion to input sizeFixed at filter size × number of filters
An object that movedTreated as a different inputThe same filter still detects it
Training data requiredLargeRelatively small

The three ideas a CNN uses:

  • Local receptive field: one neuron sees only a small region, not the whole image.
  • Weight sharing: the same filter is reused at every position, which collapses the parameter count.
  • Translation invariance: a cat is detected with the same filter wherever it is.

Weight sharing rests on the assumption that "a filter that finds a cat's ear works exactly the same way at any position in the image." This assumption reduces the parameters to learn and lets the model generalize well even on limited data. It builds the property "the meaning of an image is preserved under spatial shifts" into the structure itself as an inductive bias.

MLS-C01 does not ask about the internal math of CNNs. It asks about the roles of convolution and pooling, image classification vs object detection, and choosing SageMaker built-ins and architectures.

Convolution Layer

A small filter (kernel) slides over the input and a dot product is computed at each position, producing a feature map.

Input image  *  Filter (e.g., 3x3)  →  Feature map
(emphasizes edges, texture, shape patterns)

Convolution Hyperparameter Table

HyperparameterWhat it determinesEffect on the outputRule of thumb
Number of filtersHow many kinds of patterns to detectThe output channel count equals the number of filtersUsually increased as the network gets deeper
Kernel sizeRegion seen at once (3×3, 5×5, etc.)Larger shrinks the output more and costs more computeSmaller captures finer detail
StrideStep size of the filterLarger gives a smaller outputActs as downsampling
PaddingWhether to pad the edges with 0ssame = keep the size, valid = shrinkUse same to preserve size
Stride 1 + same padding           Stride 2
┌───────────┐                    ┌───────────┐
│ ▢▢▢▢▢▢▢▢ │ → size preserved    │ ▢▢▢▢▢▢▢▢ │ → shrinks to half size
└───────────┘                    └───────────┘

Abstraction deepens as layers are stacked: low level (edges) → mid level (texture, parts) → high level (whole objects).

One side of the output is determined by the four hyperparameters:

output size = floor( (input size + 2×padding − kernel size) / stride ) + 1
output channels = number of filters

As layers stack up, the region of the original image that one neuron sees (its receptive field) grows. A single 3×3 filter sees only 3×3, but stacking another 3×3 on top makes it see 5×5 relative to the original. That is why a VGG-style design that stacks small kernels deeply can see a wide region with fewer parameters than one large kernel. Pooling and large strides make this expansion even faster.

  • If the question says "we want to keep the output size unchanged," the answer is same padding. Increasing the stride or choosing valid padding shrinks the size.

Pooling Layer

Pooling reduces the spatial size of the feature map, lowering computation and making the model robust to small position changes.

TypeOperationCharacteristic
Max PoolingMaximum within the regionPreserves the strongest features, most common
Average PoolingAverage within the regionSmooth downsampling
Global Average PoolingAverage over each whole channelReplaces Dense and reduces parameters
  • Pooling has no learnable parameters (it is a fixed operation).
  • Downsampling widens the receptive field and reduces overfitting.

⚠️ Trap: An option saying "pooling adds weights to raise expressiveness" is wrong. Adding weights is the role of convolution and Dense layers.

Typical CNN Architecture

[Conv → ReLU → Pool] × N  →  Flatten/GAP  →  Dense  →  Softmax
   Feature extraction (backbone)            Classification head

A typical CNN structure that repeats convolution and pooling to abstract from low-level to high-level patterns

  • The front part (conv/pool blocks) is the feature extractor (backbone).
  • The back part (Dense + Softmax) is the classification head.
  • Transfer learning (Day 4) often reuses the backbone and trains only the head.
BlockWhat it doesLearnable parametersIn transfer learning
ConvExtracts local patternsYes (filter weights)Usually reused (frozen)
ReLUInjects nonlinearityNone—
PoolSpatial reduction, robustnessNone—
Flatten / GAPTurns the 2D feature map into a vectorNoneGAP is better for saving parameters
Dense + SoftmaxDecides the classYesUsually replaced and retrained
  • Flatten spreads the entire feature map into the Dense layer, so parameters surge. In a question saying "the fully connected layer has too many parameters," replacing it with Global Average Pooling is the right direction.

Representative Architectures

Knowing the names and core ideas gives you clues in the question stem.

ArchitectureKey idea
LeNetEarly CNN (handwritten digit recognition)
AlexNetRevived deep learning with ReLU, dropout, and GPUs (2012)
VGGSimple, regular structure that stacks 3×3 filters deeply
ResNetResidual (skip) connections make training of very deep networks possible
InceptionCombines multiple kernel sizes in parallel

There was a paradox where making a network deeper actually made training worse (vanishing gradients). ResNet's residual/skip connection adds the input directly to the output (H(x)=F(x)+x), creating a shortcut for gradients to flow, so networks of 100+ layers train stably. The exam asks about it as the fix for "a deep network fails to train."

Image Classification vs Object Detection vs Segmentation

Distinguishing the CNN applications precisely is the heart of the exam.

TaskOutputQuestion it answersRepresentative algorithmsSageMaker built-in
Image classification1 label (or several) per image"What is this picture?"General CNNs such as ResNet, VGGImage Classification
Object detectionClass + bounding box for multiple objects"Where, what, and how many?"SSD, YOLO, Faster R-CNNObject Detection
Semantic segmentationClass per pixel"Which object is each pixel?"U-Net, FCNSemantic Segmentation

⚠️ Trap: "How many are where" is detection; "separate regions pixel by pixel" is segmentation. A single verb in the stem ("count/locate" vs "pixel-level") decides the answer.

SageMaker Built-ins and Data Formats

  • Image Classification: single- or multi-label classification. ResNet-based. Supports a transfer learning mode.
  • Object Detection: SSD-based. Outputs boxes + classes.
  • Semantic Segmentation: pixel-level classification.
  • Input is usually RecordIO (recommended, fast) or image files + annotations. For large data, use Pipe mode streaming.
  • Labeling: SageMaker Ground Truth (provides task templates for bounding boxes and segmentation).

Situation → AWS Choice Mapping Table

SituationChoiceWhy
Attach one category to each photoImage ClassificationThe standard built-in for classification tasks
Count and locate people and vehicles from store CCTVObject DetectionNeeds box + class output
Separate building regions at pixel level in satellite imagesSemantic SegmentationNeeds a class per pixel
No ground-truth bounding boxesGround TruthProvides labeling task templates and a workforce
Training data is several TB and cannot fit on diskPipe mode + RecordIOStreams input from S3
Start quickly from pretrained weightsTransfer learning mode / JumpStartLittle data, short time

When Data Is Scarce: Augmentation and Transfer Learning

TechniqueEffectWhenCaution
Rotation / flipGains orientation diversityObjects whose orientation does not matterFlipping letters or digits breaks their meaning
Random cropGains position and scale diversityMost classification tasksMake sure the target is not cropped out
Color jitterRobust to lighting changesWhen lighting conditions varyAvoid if the color itself is the label
Transfer learning (pretrained weights)High generalization with little dataFirst choice when data is scarceGain shrinks if the domain is too different

When images are scarce, data augmentation (rotation, flipping, cropping, color jitter) increases training diversity and reduces overfitting. SageMaker Image Classification and Object Detection have augmentation options built in. Also, transfer learning with ImageNet-pretrained weights performs better and takes less time than training from scratch on little data (linked to Day 4).

Apply augmentation to the training set only. Augmenting the validation or test set distorts the evaluation.

Reading Classification Performance — Metric Interpretation Table

Image classification is still classification. When classes are skewed, accuracy misleads people.

MetricWhat it tells youWhen to prioritizeTrap
AccuracyShare of all predictions that were rightOnly when classes are balancedIn a 1% defect-rate inspection, "everything is normal" is also 99%
PrecisionOf those called positive, how many are truly positiveFalse-positive cost is high (scrapping good products)Easy to raise by predicting positive for only a few
RecallShare of actual positives caughtFalse-negative cost is high (shipping defective products)Predicting everything positive gives 1.0
F1Balance of precision and recallWhen the two costs are similarHides which side is the problem
ROC-AUCDiscrimination independent of thresholdComparing modelsOptimistic under extreme imbalance
PR-AUCDiscrimination for the minority classWhen defects are very rareValue changes if the class ratio changes

Question Clue → Answer Mapping

If the question says thisIt points to
"We want to know which category each image belongs to"Image classification
"How many are where," "location and count"Object detection (SSD/YOLO)
"At pixel level," "separate regions precisely"Semantic segmentation (U-Net/FCN)
"There is no label data," "annotation work is needed"Ground Truth
"Only a few hundred training images"Transfer learning + data augmentation
"Making the network deeper made training fail"ResNet (residual connections)
"The input data is too large and loading is slow"RecordIO + Pipe mode
"The fully connected layer has too many parameters"Global Average Pooling

If you see only "improve accuracy" and automatically pick a deeper architecture, you will be wrong. When there is also a clue that data is scarce, the answer is not a bigger structure but transfer learning and augmentation.

Symptom → Cause → Remedy

SymptomCauseFirst remedy
Only training accuracy is high, validation is lowInsufficient data → overfittingData augmentation + transfer learning
Training got worse after stacking more layersVanishing gradientsResidual (skip) connections (ResNet family)
GPU out of memory (OOM)Batch size or image resolution too largeReduce batch size, adjust input resolution
Cannot get object locationsWrong task type chosen (solving it as classification)Switch to object detection
Training data loading is the bottleneckFile-by-file I/ORecordIO + Pipe mode
Dense head has too many parametersFlatten wired directly inReplace with Global Average Pooling

The next post covers data where order, not space, creates meaning — RNN, LSTM, GRU, and the Transformer.

📖 Glossary

  • Convolution: an operation that slides a small filter over the input and computes dot products to extract local patterns.
  • Filter (kernel) / feature map: the small grid of weights a convolution learns / the output produced by passing the input through that filter. One channel is created per filter.
  • Stride / padding: the step size of the filter / a setting that pads the edges with 0s to control the output size.
  • Local receptive field: the small range of input one neuron sees. It widens as layers get deeper.
  • Weight sharing: reusing the same filter at every position in the image. Parameters shrink greatly.
  • Translation invariance: the property that an object is still detected with the same filter even if it moves within the image.
  • Pooling: an operation that shrinks the feature map using the maximum or average of a region. It has no learnable parameters.
  • Residual (skip) connection: a structure that adds the input directly to the output, creating a shortcut for gradients to flow. The core of ResNet.
  • Backbone / head: the front part that extracts features / the back part that produces the final prediction. Transfer learning usually reuses the backbone.
  • RecordIO: the input format SageMaker recommends, which bundles many images to favor sequential reads. It is used together with the bounding-box annotations that object detection outputs.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

You need to know "how many vehicles and pedestrians are in the photo and where they are located." Which task type is MOST appropriate?

Question 2

Which of the following is NOT a role of the pooling layer in a CNN?

Question 3

Which representative architecture introduced residual (skip) connections so that networks can be trained stably even when stacked more than 100 layers deep?

Question 4

What is the key reason a CNN is advantageous for images compared with a fully connected (Dense) neural network?

Question 5

When image training data is very scarce, what is the MOST appropriate first remedy for reducing overfitting?

PreviousNeural Network Basics: From the Perceptron to BackpropagationWeek 7 · Day 1Next RNNs and Sequence Models: From LSTM to TransformerWeek 7 · Day 3

Official references

  • MLS-C01 official exam page(opens in a new tab)
  • Amazon SageMaker AI documentation(opens in a new tab)

On this page

  • Key Takeaways
  • Why Convolution, Not Fully Connected?
  • Convolution Layer
  • Convolution Hyperparameter Table
  • Pooling Layer
  • Typical CNN Architecture
  • Representative Architectures
  • Image Classification vs Object Detection vs Segmentation
  • SageMaker Built-ins and Data Formats
  • Situation → AWS Choice Mapping Table
  • When Data Is Scarce: Augmentation and Transfer Learning
  • Reading Classification Performance — Metric Interpretation Table
  • Question Clue → Answer Mapping
  • Symptom → Cause → Remedy
  • Glossary
  • Practice Questions