Modeling 2 Flashcards
Object Detection
it detects objects in an image with bounding boxes
How does Object Detection work ?
with a single deep neural network
CNN with Single shot multibox
Detector (SDD) algorithm
- CNN can be VGG-16 or ResNet-50
how does Object Score provide confidence?
using a confidence score
how to train object detection?
i. train from scratch
ii. use pre-trained models based on ImageNet
Object Detection input?
RecordIO / image format (JPG, PNG)
for training images
JSON to provide metadata like bounding boxes and labels per image
Object Detection output
all instances of objects in the image with categories and confidence scores
Object Detection transfer learning mode
use pre-trained model for the base network weights, instead of random initial weights
how does Object Detection avoid over fitting?
flip
rescale
jitter
Object Detection hyperparameters
usual ones in a CNN
mini_batch_size
learning_rate
optimizer
- sgd, adam, rmsprop, adadelta
Object Detection instance types
GPU instances for training (honestly it’s the demanding CNN)
multi GPU multi Machine (scales up nicely)
ml. p2.xlarge
ml. p2.8xlarge
ml. p2.16xlarge
ml. p3.2xlarge
ml. p3.8clarge
ml. p3.16xlarge
for inference:
CPU or GPU
C5, M5, P2, P3
Image Classification
like Object detection but simpler
doesn’t tell you where objects are but gives you label for the image
Image Classification Input
Apache MXNet RecordIO
- not protobuf
- for interoperability with other deep learning frameworks
Raw jpg, png images
image format requires .lst files to associate
- image index
- class label
- path to image
augmented manifest image format enables pipe mode
what is pipe mode?
allows you to stream data from s3 instead of copy the data over
How does Image Classification works?
ResNet CNN
full training mode:
- network initialized with random weights
Transfer Learning mode:
- initialized with pre-trained weights
- top fully-connected layer is initialized with random weights
- network is fine-tuned with new training data
Default image specifications for Image Classification
224x224
3-channel
(imageNet’s dataset)
Image Classification hyperparameters
batch size
learning rate
optimizer
optimizer-specific parameters
- weight decay
- beta 1
- beta 2
- eps
- gamma
Image classification instance types
Multi-gpu multi-machine
GPU instance for training (p2,p3)
GPU or CPU for inferences (C4, p2, p3)
Semantic Segmentation
Pixel level object classification
not like object detection with bounding boxes
not like image classification with labels
Semantic Segmentation use cases
self-driving vehicles
medical imaging diagnosis
robot sensing
Semantic segmentation output
segmentation mask
Semantic Segmentation training
jpg, png
label maps to describe annotations
- for training and validation
augmented manifest image format supported for pipe mode
jpg images accepted for inference
Semantic Segmentation
MXNet Gluon and Gluon CV
Semantic Segmentation algorithms
Fully-Convolutional Network (FCN)
Pyramid Scene Parsing (PSP)
DeepLabV3
Choices of backbones for Semantic Segmentation
ResNet50
ResNet101
Both trained on ImageNet
Semantic Segmentation training from scratch or incremental
both are supported
Semantic Segmentation hyperparameters
epochs learning rate batch size optimizer algorithm backbone
Semantic Segmentation instance types
GPU only: P2, P3
Single Machine Only
ml. p2.xlarge
ml. p2.8xlarge
ml. p2.16xlarge
ml. p3.8xlarge
ml. p3.16xlarge
Inference instances for Semantic Segmentation
CPU C5, M5
GPU P2, P3
Random cut forest
anomaly detection
unsupervised
detect unexpected spikes in time series data
breaks in periodicity
unclassifiable data points
based on an algorithm developed by amazon
random cut forest output
assigns an anomaly score to each data point
random cut forest training input
RecordIO-protobuf or CSV
can use file or pipe mode on either
optional test channel for computing accuracy, precision, recall and F1 on labeled data
How does random cut forest work?
creates a forest of trees
where each tree is a partition of the training data
looks at expected change in complexity of the tree as a result of adding a point to it
how data is sampled in random cut forest ?
Randomly sampled and then trained
is it possible to use random cut forest in Kinesis Analytics?
yes it is. it can work ok streaming data too.