<s>
A	O
capsule	B-Algorithm
neural	I-Algorithm
network	I-Algorithm
(	O
CapsNet	O
)	O
is	O
a	O
machine	O
learning	O
system	O
that	O
is	O
a	O
type	O
of	O
artificial	B-Architecture
neural	I-Architecture
network	I-Architecture
(	O
ANN	O
)	O
that	O
can	O
be	O
used	O
to	O
better	O
model	O
hierarchical	O
relationships	O
.	O
</s>
<s>
The	O
idea	O
is	O
to	O
add	O
structures	O
called	O
“	O
capsules	O
”	O
to	O
a	O
convolutional	B-Architecture
neural	I-Architecture
network	I-Architecture
(	O
CNN	B-Architecture
)	O
,	O
and	O
to	O
reuse	O
output	O
from	O
several	O
of	O
those	O
capsules	O
to	O
form	O
more	O
stable	O
(	O
with	O
respect	O
to	O
various	O
perturbations	O
)	O
representations	O
for	O
higher	O
capsules	O
.	O
</s>
<s>
The	O
output	O
is	O
a	O
vector	O
consisting	O
of	O
the	O
probability	O
of	O
an	O
observation	O
,	O
and	O
a	O
pose	B-Architecture
for	I-Architecture
that	I-Architecture
observation	I-Architecture
.	O
</s>
<s>
This	O
vector	O
is	O
similar	O
to	O
what	O
is	O
done	O
for	O
example	O
when	O
doing	O
classification	O
with	O
localization	O
in	O
CNNs	B-Architecture
.	O
</s>
<s>
For	O
image	O
recognition	O
,	O
capsnets	O
exploit	O
the	O
fact	O
that	O
while	O
viewpoint	O
changes	O
have	O
nonlinear	O
effects	O
at	O
the	O
pixel	B-Algorithm
level	O
,	O
they	O
have	O
linear	O
effects	O
at	O
the	O
part/object	O
level	O
.	O
</s>
<s>
described	O
an	O
imaging	O
system	O
that	O
combined	O
segmentation	B-Algorithm
and	O
recognition	O
into	O
a	O
single	O
inference	O
process	O
using	O
parse	O
trees	O
.	O
</s>
<s>
That	O
system	O
proved	O
useful	O
on	O
the	O
MNIST	B-General_Concept
handwritten	O
digit	O
database	O
.	O
</s>
<s>
The	O
approach	O
was	O
claimed	O
to	O
reduce	O
error	O
rates	O
on	O
MNIST	B-General_Concept
and	O
to	O
reduce	O
training	O
set	O
sizes	O
.	O
</s>
<s>
Results	O
were	O
claimed	O
to	O
be	O
considerably	O
better	O
than	O
a	O
CNN	B-Architecture
on	O
highly	O
overlapped	O
digits	O
.	O
</s>
<s>
Equivariant	O
properties	O
such	O
as	O
a	O
spatial	O
relationship	O
are	O
captured	O
in	O
a	O
pose	B-Architecture
,	O
data	O
that	O
describes	O
an	O
object	O
's	O
translation	B-Algorithm
,	O
rotation	B-General_Concept
,	O
scale	O
and	O
reflection	O
.	O
</s>
<s>
Translation	B-Algorithm
is	O
a	O
change	O
in	O
location	O
in	O
one	O
or	O
more	O
dimensions	O
.	O
</s>
<s>
Rotation	B-General_Concept
is	O
a	O
change	O
in	O
orientation	O
.	O
</s>
<s>
Unsupervised	B-General_Concept
capsnets	O
learn	O
a	O
global	O
linear	O
manifold	O
between	O
an	O
object	O
and	O
its	O
pose	B-Architecture
as	O
a	O
matrix	O
of	O
weights	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
capsnets	O
can	O
identify	O
an	O
object	O
independent	O
of	O
its	O
pose	B-Architecture
,	O
rather	O
than	O
having	O
to	O
learn	O
to	O
recognize	O
the	O
object	O
while	O
including	O
its	O
spatial	O
relationships	O
as	O
part	O
of	O
the	O
object	O
.	O
</s>
<s>
In	O
capsnets	O
,	O
the	O
pose	B-Architecture
can	O
incorporate	O
properties	O
other	O
than	O
spatial	O
relationships	O
,	O
e.g.	O
,	O
color	O
(	O
cats	O
can	O
be	O
of	O
various	O
colors	O
)	O
.	O
</s>
<s>
Multiplying	O
the	O
object	O
by	O
the	O
manifold	O
poses	B-Architecture
the	O
object	O
(	O
for	O
an	O
object	O
,	O
in	O
space	O
)	O
.	O
</s>
<s>
Capsnets	O
reject	O
the	O
pooling	O
layer	O
strategy	O
of	O
conventional	O
CNNs	B-Architecture
that	O
reduces	O
the	O
amount	O
of	O
detail	O
to	O
be	O
processed	O
at	O
the	O
next	O
higher	O
layer	O
.	O
</s>
<s>
Artificial	B-Algorithm
neurons	I-Algorithm
traditionally	O
output	O
a	O
scalar	O
,	O
real-valued	O
activation	O
that	O
loosely	O
represents	O
the	O
probability	O
of	O
an	O
observation	O
.	O
</s>
<s>
A	O
cluster	O
causes	O
the	O
higher	O
capsule	O
to	O
output	O
a	O
high	O
probability	O
of	O
observation	O
that	O
an	O
entity	O
is	O
present	O
and	O
also	O
output	O
a	O
high-dimensional	O
(	O
20-50	O
+	O
)	O
pose	B-Architecture
.	O
</s>
<s>
This	O
is	O
similar	O
to	O
the	O
Hough	B-Algorithm
transform	I-Algorithm
,	O
the	O
RHT	B-Algorithm
and	O
RANSAC	B-Algorithm
from	O
classic	O
digital	B-Algorithm
image	I-Algorithm
processing	I-Algorithm
.	O
</s>
<s>
For	O
each	O
possible	O
parent	O
,	O
each	O
child	O
computes	O
a	O
prediction	O
vector	O
by	O
multiplying	O
its	O
output	O
by	O
a	O
weight	O
matrix	O
(	O
trained	O
by	O
backpropagation	B-Algorithm
)	O
.	O
</s>
<s>
The	O
pose	B-Architecture
of	O
the	O
parent	O
(	O
reflected	O
in	O
its	O
output	O
)	O
progressively	O
becomes	O
compatible	O
with	O
that	O
of	O
its	O
children	O
.	O
</s>
<s>
At	O
each	O
iteration	O
,	O
the	O
coefficients	O
are	O
adjusted	O
via	O
a	O
"	O
routing	O
"	O
softmax	B-Algorithm
so	O
that	O
they	O
continue	O
to	O
sum	O
to	O
1	O
(	O
to	O
express	O
the	O
probability	O
that	O
a	O
given	O
capsule	O
is	O
the	O
parent	O
of	O
a	O
given	O
child	O
.	O
)	O
</s>
<s>
Softmax	B-Algorithm
amplifies	O
larger	O
values	O
and	O
diminishes	O
smaller	O
values	O
beyond	O
their	O
proportion	O
of	O
the	O
total	O
.	O
</s>
<s>
The	O
pose	B-Architecture
vector	O
is	O
rotated	O
and	O
translated	O
by	O
a	O
matrix	O
into	O
a	O
vector	O
that	O
predicts	O
the	O
output	O
of	O
the	O
parent	O
capsule	O
.	O
</s>
<s>
The	O
coupling	O
coefficients	O
from	O
a	O
capsule	O
in	O
layer	O
to	O
all	O
capsules	O
in	O
layer	O
sum	O
to	O
one	O
,	O
and	O
are	O
defined	O
by	O
a	O
"	O
routing	B-Algorithm
softmax	I-Algorithm
"	O
.	O
</s>
<s>
At	O
line	O
8	O
,	O
the	O
softmax	B-Algorithm
function	I-Algorithm
can	O
be	O
replaced	O
by	O
any	O
type	O
of	O
winner-take-all	B-Algorithm
network	O
.	O
</s>
<s>
Learning	O
is	O
supervised	B-General_Concept
.	O
</s>
<s>
The	O
network	O
is	O
trained	O
by	O
minimizing	O
the	O
euclidean	O
distance	O
between	O
the	O
image	O
and	O
the	O
output	O
of	O
a	O
CNN	B-Architecture
that	O
reconstructs	O
the	O
input	O
from	O
the	O
output	O
of	O
the	O
terminal	O
capsules	O
.	O
</s>
<s>
To	O
allow	O
for	O
multiple	O
entities	O
,	O
a	O
separate	O
margin	B-Algorithm
loss	I-Algorithm
is	O
computed	O
for	O
each	O
capsule	O
.	O
</s>
<s>
The	O
final	O
activity	O
vector	O
is	O
then	O
used	O
to	O
reconstruct	O
the	O
input	O
image	O
via	O
a	O
CNN	B-Architecture
decoder	O
consisting	O
of	O
3	O
fully	O
connected	O
layers	O
.	O
</s>
<s>
The	O
reconstruction	O
minimizes	O
the	O
sum	O
of	O
squared	O
differences	O
between	O
the	O
outputs	O
of	O
the	O
logistic	O
units	O
and	O
the	O
pixel	B-Algorithm
intensities	O
.	O
</s>
<s>
This	O
reconstruction	O
loss	O
is	O
scaled	O
down	O
by	O
0.0005	O
so	O
that	O
it	O
does	O
not	O
dominate	O
the	O
margin	B-Algorithm
loss	I-Algorithm
during	O
training	O
.	O
</s>
<s>
For	O
the	O
28x28	O
pixel	B-Algorithm
MNIST	B-General_Concept
image	O
test	O
an	O
initial	O
256	O
9x9	O
pixel	B-Algorithm
convolutional	O
kernels	O
(	O
using	O
stride	O
1	O
and	O
rectified	O
linear	O
unit(ReLU )	O
activation	O
,	O
defining	O
20x20	O
receptive	O
fields	O
)	O
convert	O
the	O
pixel	B-Algorithm
input	O
into	O
1D	O
feature	O
activations	O
and	O
induce	O
nonlinearity	O
.	O
</s>
<s>
Capsule	O
activations	O
effectively	O
invert	O
the	O
graphics	O
rendering	O
process	O
,	O
going	O
from	O
pixels	B-Algorithm
to	O
features	O
.	O
</s>
<s>
All	O
neurons	O
in	O
the	O
larger	O
minicolumns	O
have	O
the	O
same	O
receptive	O
field	O
,	O
and	O
they	O
output	O
their	O
activations	O
as	O
action	B-Algorithm
potentials	I-Algorithm
or	O
spikes	B-Algorithm
.	O
</s>
<s>
CapsNets	O
are	O
claimed	O
to	O
have	O
four	O
major	O
conceptual	O
advantages	O
over	O
convolutional	B-Architecture
neural	I-Architecture
networks	I-Architecture
(	O
CNN	B-Architecture
)	O
:	O
</s>
<s>
Viewpoint	O
invariance	O
:	O
the	O
use	O
of	O
pose	B-Architecture
matrices	O
allows	O
capsule	O
networks	O
to	O
recognize	O
objects	O
regardless	O
of	O
the	O
perspective	O
from	O
which	O
they	O
are	O
viewed	O
.	O
</s>
<s>
Better	O
generalization	O
to	O
new	O
viewpoints	O
:	O
CNNs	B-Architecture
,	O
when	O
trained	O
to	O
understand	O
rotations	O
,	O
often	O
learn	O
that	O
an	O
object	O
can	O
be	O
viewed	O
similarly	O
from	O
several	O
different	O
rotations	O
.	O
</s>
<s>
However	O
,	O
capsule	O
networks	O
generalize	O
better	O
to	O
new	O
viewpoints	O
because	O
pose	B-Architecture
matrices	O
can	O
capture	O
these	O
characteristics	O
as	O
linear	O
transformations	O
.	O
</s>
<s>
Defense	O
against	O
white-box	O
adversarial	O
attacks	O
:	O
the	O
Fast	O
Gradient	O
Sign	O
Method	O
(	O
FGSM	O
)	O
is	O
a	O
typical	O
method	O
for	O
attacking	O
CNNs	B-Architecture
.	O
</s>
<s>
It	O
evaluates	O
the	O
gradient	O
of	O
each	O
pixel	B-Algorithm
against	O
the	O
loss	O
of	O
the	O
network	O
,	O
and	O
changes	O
each	O
pixel	B-Algorithm
by	O
at	O
most	O
epsilon	O
(	O
the	O
error	O
term	O
)	O
to	O
maximize	O
the	O
loss	O
.	O
</s>
<s>
Although	O
this	O
method	O
can	O
drop	O
the	O
accuracy	O
of	O
CNNs	B-Architecture
dramatically	O
(	O
e.g.	O
</s>
<s>
Purely	O
convolutional	O
nets	O
cannot	O
generalize	O
to	O
unlearned	O
viewpoints	O
(	O
other	O
than	O
translation	B-Algorithm
)	O
.	O
</s>
<s>
For	O
other	O
affine	B-Algorithm
transformations	I-Algorithm
,	O
either	O
feature	O
detectors	O
must	O
be	O
repeated	O
on	O
a	O
grid	O
that	O
grows	O
exponentially	O
with	O
the	O
number	O
of	O
transformation	O
dimensions	O
,	O
or	O
the	O
size	O
of	O
the	O
labelled	O
training	O
set	O
must	O
(	O
exponentially	O
)	O
expand	O
to	O
encompass	O
those	O
viewpoints	O
.	O
</s>
