You are on page 1of 42

Capsule Neural

Networks
By:

Vishal Purkuti

Aakash Khadka

Puskal Khadka

Harish Pandey
Content

Introduction
History
Capsules
Architecture
Routing by agreement
Introduction

Defitnition:

A Capsule Neural Network (CapsNet) is a machine learning system


that is a type of Artificial Neural Network (ANN) that can be used to
better model hierarchical relationships.
The idea is to add structures called “capsules” to a CNN, and to
reuse output from several of those capsules to form more
stable representations for higher capsules
Capsules
Capsules
Equivariance
Equivariance
Hierarchy of parts
CNN ?

▪ The name “convolutional neural network” indicates that the network


employs a mathematical operation called convolution
▪ Convolution is a specialized kind of linear operation.
▪ Convolutional networks are simply neural networks that use convolution
in place of general matrix multiplication
CNN
CNN VS capsnet
CNN
CNN

capsnet
History of Capsule Neural Network

Paper published “ImageNet


Classification with Deep
In 2000, Geoffery HInton Convolutional Neural
described an imaging Networks" by Geoffrey
system Hinton and his team

Capsule Neural Network Dynamic steering


started in 2012 mechanism was introduced
in 2017
Capsules

A capsule is a set of neurons that individually activate for various


properties of a type of object, such as position, size and hue.
Roles of Capsules

▪ Invert rendering process


▪ 2D to 3D abstraction
2D to 3D abstraction
2D to 3D abstraction
2D to 3D abstraction
2D to 3D abstraction
4 steps in caps
Overall process inside capsule
Architecture:

• A capsule network (CapsNet) contains an encoder and


a decoder. Together, it contain 6 layers. i will explain in detail
about encoder and decoder in next slide
• The three layers that create the encoder of a CapsNet are
the following:
1. Convolutional neural network
2. PrimaryCaps Network
3. DigitCaps Network
Now we use 9*9-256 kernels
Rectified Linear Unit

x = max(0, x)

Maintains Non-Linearity
Primary Caps

• Starts as normal Convolutional network


• From previous convolution we have 256 outputs
• so instead of 9*9 we use 9*9*256 kernel
• And this time our stride is 2
• Now we are looking for slightly more complex shapes from
the edges we found earlier.
32 decks with 8 cards each
deck

With a capsule we can store 8


values per location!
When looking at the shape below, what can you tell me about it? If you had to
tell someone else how to redraw it, and they couldn’t look at it, what would
you say?
Traditional CNN
DigitCaps

-After agreement, we end up with ten 16 dimensional vectors, one vector for each digit.

-The length of the vector is the confidence of the digit being found — the longer the better.
Reconstruction
Capsule
Routing by agreement

The layers communicate with each other using dynamic routing algorithm.
Routing by agreement is a paradigm or idea used by capsnet for dynamic routing.
Dynamic Routing Algorithm
Reference

https://www.freecodecamp.org/news/understanding-capsule-networks-ais-alluring-new-
architecture-bdb228173ddc/

https://en.wikipedia.org/wiki/Capsule_neural_network

https://papers.nips.cc/paper/6975-dynamic-routing-between-capsules.pdf

You might also like