CV Quiz 8

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

37 Terms

1
New cards

Recognition tasks (the 6 types)

Verification: is that a lamp?

Detection: where are the people?

Identification: is that Potala Palace (a specific instance)?

Object categorization: label the objects (mountain, tree, building, people).

Scene and context categorization: outdoor, city.

Activity/event recognition: what are these people doing?

2
New cards

Why template matching fails for recognition

Pointwise correlation of a model pattern with the image (e.g., normalized correlation to find a chair) gives "pretty much garbage" output. It is inadequate for 3D scenes because of occlusion, changes in viewing angle, and articulation of parts

3
New cards

SIFT matching: when it works vs. not

Works well for object instances (a specific object or distinctive images such as logos).

Not great for generic object categories, because different instances of a category do not share the same local appearance

4
New cards

Image classifier (definition)

Input: an image.

Output: a class label, generally one of the discrete labels used in training (e.g., cat, dog, cow, toaster).

The semantic gap: The difference between what we see and what the computer sees (a grid of pixel values). It is why classification is hard: nothing in the raw numbers says what we see

5
New cards

Challenges for image classification (5)

Illumination

deformation

occlusion

background clutter

intraclass variation (instances of the same class look very different)

6
New cards

Why recognition is under-constrained

Distinct realities can produce the same image, so we generally can't compute the "right" answer, only the most likely one. That requires a prior to condition on, and we learn the prior from data

7
New cards

Statistical learning framework

y = f(x)

x is the feature representation of the image, f is the prediction function, and y is the output prediction.

Training: given a labeled training set {(x1, y1), …, (xN, yN)}, learn f by minimizing prediction error on the training set.

Testing: given an unlabeled test instance x, predict y = f(x)

8
New cards

Classifiers listed

kNN (k-nearest neighbors)

linear classifier

neural network

deep neural network

9
New cards

Linear classifier: score function

f(xᵢ, W, b) = W xᵢ + b

xᵢ is the image stretched into a single column vector, W is the weights matrix (one row per class), b is the bias vector (one per class), and the output is a vector of class scores. W and b are the parameters.

Parametric approach: f(x, W) maps the image to class scores.

W = num of classes * image size (flat)

Num parameters = W + b

10
New cards

Linear classifier: geometric interpretation + hard cases

The parameters define a hyperplane for each class (a line in 2D). The class score is the signed distance from that hyperplane, so a class score is proportional to distance from the corresponding hyperplane in the space of all images

Hard cases for a linear classifier: Data that cannot be separated by a line/hyperplane (e.g., one class forming a ring around another in the original space)

11
New cards

Feature transform trick

Map the data into a feature space where the classes become linearly separable.

Example: (x, y) → (r, θ) with r = √(x² + y²), θ = tan⁻¹(y/x).

A linear classifier in feature space is a nonlinear classifier in the original space

12
New cards

Image features vs. neural networks

Old pipeline: hand-designed feature extraction, then a trainable classifier f that outputs 10 class scores (only the classifier is trained).

Deep network: one network trained end-to-end maps pixels directly to the class scores, so the features are learned too

13
New cards

Last layer of a CNN

The last layer of most CNNs is just a linear classifier.

Key idea: do enough processing in the earlier layers that, by the end of the network, the classes are linearly separable

14
New cards

CNN application: digit recognition

Convolutional networks that classified handwritten digits and were deployed commercially to process handwritten checks. Trained with the backprop algorithm

15
New cards

CNN definition (two key properties) + why took off

A multi-layer neural network with (1) local connectivity: neurons in a layer are connected only to a small region of the layer before it, and (2) shared weights: the same parameters are used across spatial positions

CNN + big datasets (ImageNet) + GPUs → great improvement from hand engineered features . CNNs provided the architecture, ImageNet provided the data, and GPUs provided the comput.

16
New cards

hand Engineered vs. learned features

Engineered: feature extraction, then pooling, then a classifier, then the label.

CNN: stacked Convolution/pool layers, then Dense layers, then the label, all trained in a supervised manner by backpropagation. In CNNs the filter weights are learned from data

17
New cards

CNN layer types (4)

Convolutional layer

activation layer (ReLU: y = max(0, x)),

pooling layer, normalization (x̂ = (x − μ)/√(σ² + ε)),

fully-connected layer (y = Wx + b)

18
New cards

Convolution layer: what one filter does

A filter always extends the full depth of the input volume.

Slide it over all spatial positions, computing a dot product + bias at each: wᵀx + b.

One filter gives one 1×H′×W′ activation map.

19
New cards

Convolution layer hyperparameters and output size

Input: Cin × H × W
Hyperparameters: kernel size K = (KH×KW), number of filters Cout, padding P, stride S.

Weights/Parameters: Cout × Cin × KH × KW (+ Cout if including bias)

Cout filters size: Cin × KH × KW

bias: Cout.

same padding: P = (K − 1) / 2 (preserves spatial dimensions)

Output: Cout × H′ × W′

with H′ = (H − K + 2P)/S + 1 and W′ = (W − K + 2P)/S + 1

20
New cards

Parameters: conv vs. fully connected

Fully connected: input size × output size + output size = num of weights weights.

Convolutional: usually orders of magnitude fewer.

Reasons: local connectivity (each unit sees kernel size, not the whole image) and weight sharing (same filter at every position)

Note: Spatial size (H, W), padding, and stride do not change a conv layer's parameter count, because the filters are shared across positions

21
New cards

Receptive field rule

Stride and pooling multiply the receptive field instead of adding to it. This is how a CNN gets global context

  • r_l = r_(l−1) + (k_l − 1) · j_(l−1) and j_l = j_(l−1) · s_l, where r = receptive field, j = jump (distance between adjacent units, in input pixels), k = kernel size, s = stride, starting at r_0 = 1, j_0 = 1.

  • Closed form: r = 1 + Σ_l (k_l − 1) · S_l with S_l = s_1 · s_2 · … · s_(l−1).

  • Stride-1 stack of L layers: r = L(K − 1) + 1


22
New cards

1×1 convolution

Mixes channels at a single pixel: a learned linear map from input channels to output channels, applied identically at every position.

Why it matters: cheap channel reduction before an expensive 3×3

23
New cards

Stacking convs without a nonlinearity

Two stacked linear convs collapse into one: y = W₂(W₁x) = (W₂W₁)x = Wₙx.

Fix: add a nonlinearity (e.g., ReLU) between conv layers so depth adds representational power

24
New cards

Activation functions

output = activation(wᵀx + b).

25
New cards

Pooling

Reduces the dimensionality of the features, making them more manageable.

Applied to each feature (activation) map separately.

Max pooling with a 2×2 filter and stride 2 keeps the max in each window.

Learnable parameters: none

output C×H′×W′ with H′ = (H − K)/S + 1 and W′ = (W − K)/S + 1 .

26
New cards

Fully-connected layer

Stretch the input I to a vector and compute y = Wx + b.

For o outputs, W is o × I^T;

each output is the dot product of one row of W with the whole input

27
New cards

Typical CNN layer pattern

INPUT → [[CONV → RELU]*N → POOL?]*M → [FC → RELU]*K → FC,

where * means repetition, POOL? is optional

28
New cards

What a CNN learns

A hierarchical representation of the data.

Typical first-layer filters look like oriented edges/color blobs (inferred from the figure); deeper layers combine them into more complex patterns (shown by visualizing the learned filters)

29
New cards

Plain Deeper networks + problem

Deeper networks learn richer representations and perform better: But plain deeper networks become hard to train/optimize and can perform worse (not from overfitting).

Stacking more layers on a plain CNN makes the deeper model perform worse, and it is not due to overfitting. Deeper models are very hard to optimize

30
New cards

ResNet

Fix to plain deeper networks: have the layers fit a residual mapping instead of the direct underlying mapping (the block's output is added to its input).

  • Learn F(x) = H(x) − x and add x back, rather than learning the underlying mapping H(x) directly.


It reduces the vanishing gradient problem and allows training networks with many more layers

  • Gradient shortcut: ∂L/∂x = ∂L/∂y · (1 + ∂F/∂x), so the "1" reaches every layer undiminished


31
New cards

MobileNet: main idea

Depthwise separable convolution: factor the conv kernel into two operations, a depthwise conv (one spatial filter per input channel) and a pointwise conv (1×1 conv that mixes channels).

Built for efficient embedded/mobile vision

32
New cards

MobileNet: compute savings


Input H_in × W_in × C_in, output H_out × W_out × C_out with KH × KW kernels.

Normal conv: C_out · KH × KW · C_in · H_out · W_out multiplications.

Depthwise: C_in · KH × KW · 1 · H_out · W_out. Pointwise: C_out · 1 · C_in · H_out · W_out. Total C_in · H_out · W_out · (KH × KW + C_out), about 1 / (1/C_out + 1/(KH × KW)) fewer.


Full MobileNet: ~1% accuracy loss vs. its full-convolution version, using about 1/9 of the multiply-adds and 1/7 of the parameters

33
New cards

Human stereopsis and disparity

Disparity occurs when the eyes fixate on one object (d = 0 there);

other objects appear at different visual angles.

Disparity d = r − l (positions in the right and left eye)

34
New cards

Random dot stereograms

Test of whether we identify local brightness patterns before fusion (monocular) or after (binocular): a pair of synthetic images made by randomly spraying black dots on white objects.

Each image alone looks random, but viewed stereoscopically it shows 3D structure.

Conclusion: binocular fusion is not directly tied to the physical retinas but involves the central nervous system (an imaginary "cyclopean retina" that combines left and right images)

35
New cards

Stereograms and autostereograms

Stereograms: pairs of images fused to give a sense of depth.

Autostereograms: exploit disparity as a depth cue using a single image

36
New cards
Neural network learning setup

Score function (nonlinear): s = W2 max(0, W1 x + b1) + b2.

Data loss per element: L_i = Σ_(j≠y_i) max(0, s_j − s_(y_i) + 1).

L2 regularization: R(W) = Σ_k W_k².

Total loss: L = (1/N) Σ_i L_i + λR(W1) + λR(W2).

Goal: compute ∂L/∂W1, ∂L/∂W2, ∂L/∂b1, ∂L/∂b2, then optimize with SGD

37
New cards
What a loss does and what it needs

A loss takes the network's output vector plus the label and collapses them into a single scalar to differentiate.

Requirements: differentiable almost everywhere, and its gradient must be informative where the model is currently wrong.

Changing the loss changes the model: same architecture and data with a different loss gives a different predictor.

Most vision tasks are covered by classification losses (cross-entropy) and regression losses (L1, L2, Huber), plus per-pixel or per-box versions of the two