1 of 66

CSE 5524: �Object detection and segmentation

1

2 of 66

Homework and quiz plan

  • HW 3: (10%)
    • Release: 3/18
    • Due: 4/1

  • HW 4: (10 – 20%)
    • Release: 4/1
    • Due 1: 4/15
    • Due 2: 4/22

  • Quiz: 4% coming soon

3 of 66

Final project (20 – 30%)

  • Team forming:
    • 2 – 3 students: same expectation

  • Tentative plan:
    • Team forming: 2/28
    • Project sketch: 3/7 (2%) – 1 page at most: what you plan to do, who your teammates are. Figures are OK to be added.
    • Project proposal: 3/20 (3%)
    • Project presentation: 4/22 & 4/23 (10%)
    • Project report & code release: 4/25 (15%)

4 of 66

Project first glance

  • Pre-defined tasks:

    • Reproducing existing algorithms
    • Benchmarking existing algorithms
    • Reproducing examples in the textbook

  • Self-defined “research” tasks:
    • Need approval
    • Need justification

5 of 66

Today

  • CNN recap
  • Semantic segmentation
  • Object detection

5

6 of 66

Convolutional neural networks (CNN) for detection

6

7 of 66

Convolutional neural networks (CNN)

7

Shared weights

Vectorization + FC layers

Max pooling + down-sampling

  • Remove redundancy
  • Translation-invariant
  • Enlarge receptive filed

8 of 66

Receptive field

8

Linear receptive field

Exponential receptive field

(with pooling + down-sampling)

9 of 66

Layers of feature maps (representations)

9

What does a large response at each layer/channel mean?

10 of 66

Short summary

A general architecture of CNN or visual transformers involves

  • Multiple layers of computations + nonlinearity + (pooling + striding)
  • These result in a (final) feature map
  • The map goes through FC layers (MLP)
  • Usually, we keep the network till the feature map

10

11 of 66

Popular CNN architectures

  • Encoder, decoder

11

12 of 66

Popular CNN architectures

  • Encoder + decoder for segmentation

12

13 of 66

Popular CNN architectures

  • U-Net: Encoder + decoder + skip links

13

14 of 66

Today

  • CNN recap
  • Semantic segmentation
  • Object detection

14

15 of 66

Exemplar computer vision tasks

[C. Rieke, 2019]

16 of 66

Exemplar computer vision tasks

Retrieval, representation learning

Image generation

Vision and language

Neural Radiance Fields (NeRF)

17 of 66

Object-centric vs. scene-centric images

17

Object-centric images:

  • contain a single class of objects
  • The object size is usually large
  • The background is simple

Scene-centric images:

  • contain multiple classes of objects
  • The object sizes can vary
  • The background is challenging
  • Objects may be occluded

ImageNet [image-level label]:

  • 1K classes (~1M images)
  • 21K classes (~14M images)

MSCOCO [instance segment]:

  • 82 classes (~0.3M images)

18 of 66

Classification on object-centric images

  • Single object class (not multi-label cases)

  • Properties to capture:
  • Translation invariant
  • Rotation invariant (left-right flip)
  • Scale invariant

car

elephant

19 of 66

Representative 2D recognition tasks

  • “Same” input: images

  • “Different” outputs:
  • A C-dim class probability vector
  • A set of bounding boxes, each with box location and class probability
  • An W x H x C feature map
  • A combination of b) and c)

  • “Different” labeled training data

19

Dog

Cat

Horse

Sheep

W

H

a)

c)

b)

d)

20 of 66

Object- vs. scene centric images

20

MSCOCO [scene-centric]:

  • Instance-level label
  • 82 classes (~0.3M images)

ImageNet [object-centric]:

  • Image-level class label
  • 1K classes (~1M images)
  • 21K classes (~14M images)

21 of 66

Object- vs. scene centric images

  • Object-centric images usually contain a single class of objects.
  • Object frequency and semantic cues in different kinds of images can be different!

21

22 of 66

Semantic segmentation

  • Every “pixel” to have a class label

  • Properties:
  • High-resolution output
  • Context
  • Localization
  • Multi-scale

22

23 of 66

New architecture?

23

Single spatial output!

24 of 66

Fully-convolutional network (FCN)

24

CNN

Feature map

Vector after vectorization

Dog

Cat

Boat

Bird

Matrix multiplication, inner product

25 of 66

Fully-convolutional network (FCN)

25

CNN

Dog

Cat

Boat

Bird

Each row = a Conv filter

Feature map

26 of 66

Fully-convolutional network (FCN)

26

[Long et al., Fully Convolutional Networks for Semantic Segmentation, CVPR 2015]

27 of 66

Up-sampling

27

Interpolation

Deconvolution

28 of 66

Fully-convolutional network (FCN)

28

Help localization

Help

context + semantics

[Long et al., Fully Convolutional Networks for Semantic Segmentation, CVPR 2015]

29 of 66

U-Net

29

Help localization

Help

context + semantics

[Ronneberger et al., U-Net: Convolutional Networks for Biomedical Image Segmentation, MICCAI 2015]

30 of 66

U-Net (aka, Hourglass network)

30

31 of 66

Dilated (Atrous) convolution

Exponential receptive field:�w/o down-sampling + up-sampling

w/ same # of parameters to learn

32 of 66

CRF to improve localization

  • DeepLab

32

CRF: similar and nearby pixels have the same class label

[Chen et al., DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs, PAMI 2017]

33 of 66

Atrous Spatial Pyramid Pooling (ASPP)�for multi-scale features

33

34 of 66

Example results

34

[Nirkin et al., HyperSeg, 2021]

Ground truth

[Zhao et al., Pyramid scene parsing network, 2017]

35 of 66

Today

  • CNN recap
  • Semantic segmentation
  • Object detection

35

36 of 66

Object detection

  • Properties:

  • Labels + bounding boxes
  • Localization
  • Multi-scale
  • Context
  • “Undetermined” numbers

36

[class, u-center, v-center, width, height]

37 of 66

Naïve way

  • Sliding window
  • Time consuming
  • What size?

37

ResNet classifier

38 of 66

R-CNN

  • Objectness proposal
  • CNN classifier
  • Box refinement

38

[Girshick et al., Rich feature hierarchies for accurate object detection and semantic segmentation, CVPR 2014]

39 of 66

Selective search for proposal generation

  • Step 1:
    • Not deep learning
    • super-pixel-based segmentation

  • Step 2:
    • Recursively combine similar regions into larger ones

  • Step 3:
    • Boxes fitting

39

[Stanford CS 231b]

40 of 66

R-CNN

40

[Girshick et al., Rich feature hierarchies for accurate object detection and semantic segmentation, CVPR 2014]

[Girshick, CVPR 2019 tutorial]

41 of 66

R-CNN

  • Box regression:
  • (du, dv)
  • (dw, dh)

By offset = MLP(feature)

41

Proposal

Ground truth

42 of 66

R-CNN

  • Problems:
  • Slow: every proposal needs to go through a “full” CNN
  • Mis-detection: the proposal algorithm is not trained together

42

43 of 66

Fast R-CNN

43

ROI pooling

[Girshick, CVPR 2019 tutorial]

[Girshick, Fast R-CNN, ICCV 2015]

44 of 66

ROI pooling vs. ROI align

44

ROI Align

ROI Pooling

Making features extracted from different proposals the same size!

45 of 66

Faster R-CNN

45

ROI pooling

[Girshick, CVPR 2019 tutorial]

[Ren et al., Faster r-cnn: Towards real-time object detection with region proposal networks, NIPS 2015]

46 of 66

How to develop RPN�(region proposal network)?

46

5 * 8 * K * (2 + 4)

[Ren et al., 2015]

Ground truth

Anchor

47 of 66

What do we learn from RPN?

  • “How to encode your labeled data so that your CNN can learn from them and predict them” is important!

  • Inference: predict these “values” and accordingly transfer them to bounding boxes!

47

48 of 66

Questions?

49 of 66

How to deal with object sizes?

49

[Lin et al., Feature Pyramid Networks for Object Detection, CVPR 2017]

50 of 66

Mask R-CNN

50

[Girshick, CVPR 2019 tutorial]

[He et al., Mask r-cnn, ICCV 2017]

51 of 66

Mask R-CNN: for instance segmentation

51

CNN: convolutional neural network

RPN: region proposal network

Bulldozer: 80%

Bus: 15%

Motorcycle: 5%

52 of 66

2-stage vs. 1-stage detectors

  • Other names: single-shot, single-pass, … (e.g., YOLO, SSD)
  • Difference: no ROI pooling/align

52

[Redmon et al., 2016]

2-stage detector

1-stage detector

53 of 66

Exemplar 1-stage detectors

53

[Liu et al., 2016]

SSD

YOLO

[Redmon et al., 2016]

54 of 66

Exemplar 1-stage detectors (Retina Net)

54

[Lin et al., 2017]

55 of 66

2-stage vs. 1-stage detectors

  • Pros for 1-stage:
    • Faster!

  • Cons for 1-stage:
    • Too many negative locations; scale

55

[Redmon et al., 2016]

56 of 66

Inference: choose few from many

  • Non-Maximum Suppression (NMS)

56

[Pictures from “towards data science” post]

57 of 66

Example results

57

[Zhang, et al., 2021]

58 of 66

New approach to object detection

  • DEtection Transformer [Nicolas Carion et al.]

59 of 66

New approach to object detection

  • DEtection Transformer [Nicolas Carion et al.]

60 of 66

Key names

  • Tsung-Yi Lin
  • Ross Girshick
  • Kaiming He
  • Piotr Dollar

61 of 66

Take home

  • Good tutorials online:
    • CVPR 2017-2022, ECCV 2018-2020, ICCV 2017-2021 [search tutorial or workshop]
    • ICML/NeurIPS/ICLR 2018-2021 [search tutorial or workshop]

  • Good framework:
    • PyTorch: Torchvision
    • PyTorch: Detectron2

  • Good source code:
    • Papers with code: https://paperswithcode.com/

61

62 of 66

LiDAR-based 3D perception

63 of 66

LiDAR-based 3D perception

63

[Source: Graham Murdoch/Popular Science]

LiDAR:

  • Light Detection and Ranging sensor
  • accurate 3D point clouds of the environment

64 of 66

LiDAR-based 3D perception

You can view the LiDAR point clouds from different angles

64

Frontal view

Bird’s-eye view (BEV)

65 of 66

Two major ways to process LiDAR point clouds

  • Point-wise processing
    • PointNet [Qi et al., 2017]
    • PointNet++ [Qi et al., 2017]
    • PointRCNN [Shi et al., 2019]

  • Voxel-based processing: turn points into a tensor (e.g., W x D x H x F)
    • PointPillars [Lang et al., 2019]
    • VoxelNet [Zhou et al., 2017]
    • PIXOR [Liang et al., 2018]

65

66 of 66

Voxel-based processing + 3D object detectors

  • Occupation (PIXOR): 3D points as a 3D occupation tensor from bird’s-eye-view

66

[Yang et al., PIXOR: Real-time 3D Object Detection from Point Clouds, 2019]

height

depth

Left-right