34 min total

Deep Learning

CNN architectures

CNN architectures

LeNet-5

CNN architectures — diagram

Outputs 10 classes (digits 0-9)

Originally used sigmoid and tanh nonlinearities

32x32x1 input

60K parameters

AlexNet

CNN architectures — diagram

Trained using two GPUs

Included Local response normalization (LRN)

Softmax with 1,000 classes

60M parameters

VGG-16

CNN architectures — diagram

Called '16' because 16 weight layers in the network

  • 13 conv layers
  • 03 fully connected layers

138M parameters

ResNet

CNN architectures — diagram
CNN architectures — diagram
CNN architectures — diagram

Why residual networks work so well?

In plain deep networks performance tends to degrade with an increase in depth.

A ResNet adds "residual blocks," which include shortcut (skip) connections that bypass one or more layers.

"same" convolutions are often used to maintain the dimensions of feature map

For the residual connections to work, the dimensions of the input and output of the skip connection must match. Same convolutions are commonly used to preserve these dimensions. If dimensions don’t match, a linear transformation (like using the matrix Ws ) can be applied to match them

CNN architectures — diagram

1 × 1 convolutions

Aka 'Network in Network'

May seem like it merely multplys values by scalar, it is much more powerful

For a multi-channel images, 1x1xN convolution applies a unique scalar multiplication to each channel and can add non-linearity

CNN architectures — diagram

Inception network

CNN architectures — diagram
CNN architectures — diagram

Inception block

CNN architectures — diagram

Inception network:

Has softmax at intermediate steps and has many inception blocks

CNN architectures — diagram

MobileNet

Depthwise convolution

CNN architectures — diagram

Pointwise convolution

CNN architectures — diagram
CNN architectures — diagram

n′c denotes the number of output channels.

, for a 3x3 filter ,

MobileNetV2

CNN architectures — diagram

Introduces residual connections, allows better gradient flow during backpropagation

Expansion layer increases the dimensionality using 1x1 convolutions

Pointwise convolution reduces the dimensionality back to original termed as projection step

MobileNetV2 repeats bottleneck structure 17 times

Final layers involve pooling, fully connected layers and softmax for classification

Has lesser params than mobile net v1 ~ 4.2 million params

~ 3.5 million params

Accuracy is improved by 1.4%

EfficientNet

EfficientNet provides a method to automatically scale neural networks to fit the specific computational resources of a device. This is particularly useful when dealing with devices with varying computational capacities, like different mobile phones or edge devices.

Resolution(r)Refers to the input image size. Higher resolution can capture more details.
Depth (d)The number of layers in the network. More depth allows for capturing more complex features.
Width (w)The number of units in each layer. Wider layers can process more information simultaneously

Efficient net scales all three parameters simultaneously

Challenge is to determine optimal balance between three parameters to maximize performance with a computational budget

Efficientnet procides open-source tools to help determine the best scaling strategry based on avaliable computation budget

CNN architectures — diagram

Augmentation methods

  1. Mirroring
  2. Random cropping
  3. Rotation
  4. Shearing
  5. Local warping
  6. Color shifting using PCA

Tips for doing well on benchmarks/winning competitions

  1. Ensembling
    train several networks and average their outputs
  2. Multi crop at test time
    run classifier on multiple version and average results