Original: M ATRIX CAPSULES WITH EM ROUTING
Revised: M ATRIX CAPSULES WITH EM ROUTING

Original: A BSTRACT
Revised: A BSTRACT

Original: A capsule is a group of neurons whose outputs represent different properties of the same entity.
Revised: A capsule is a group of neurons whose outputs represent different properties of the same entity.

Original: Each layer in a capsule network contains many capsules.
Revised: Each layer in a capsule network contains many capsules.

Original: We describe a version of capsules in which each capsule has a logistic unit to represent the presence of an entity and a 4x4 matrix which could learn to represent the relationship between that entity and the viewer (the pose).
Revised: We describe a version of capsules in which each capsule has a logistic unit to represent the presence of an entity and a 4x4 matrix which could learn to represent the relationship between that entity and the viewer (the pose).

Original: A capsule in one layer votes for the pose matrix of many different capsules in the layer above by multiplying its own pose matrix by trainable viewpoint-invariant transformation matrices that could learn to represent part-whole relationships.
Revised: A capsule in one layer votes for the pose matrix of many different capsules in the layer above by multiplying its own pose matrix by trainable viewpoint-invariant transformation matrices that could learn to represent part-whole relationships.

Original: Each of these votes is weighted by an assignment coefﬁcient.
Revised: Each of these votes is weighted by an assignment coefﬁcient.

Original: These coefﬁcients are iteratively updated for each image using the Expectation-Maximization algorithm such that the output of each capsule is routed to a capsule in the layer above that receives a cluster of similar votes.
Revised: These coefﬁcients are iteratively updated for each image using the Expectation-Maximization algorithm such that the output of each capsule is routed to a capsule in the layer above that receives a cluster of similar votes.

Original: The transformation matrices are trained discriminatively by backpropagating through the unrolled iterations of EM between each pair of adjacent capsule layers.
Revised: The transformation matrices are trained discriminatively by backpropagating through the unrolled iterations of EM between each pair of adjacent capsule layers.

Original: On the smallNORB benchmark, capsules reduce the number of test errors by 45% compared to the state-of-the-art.
Revised: On the smallNORB benchmark, capsules reduce the number of test errors by 45% compared to the state-of-the-art.

Original: Capsules also show far more resistance to white box adversarial attacks than our baseline convolutional neural network.
Revised: Capsules also show far more resistance to white box adversarial attacks than our baseline convolutional neural network.

Original:  I NTRODUCTION
Revised:  I NTRODUCTION

Original: Convolutional neural nets are based on the simple fact that a vision system needs to use the same knowledge at all locations in the image.
Revised: Convolutional neural nets are based on the simple fact that a vision system needs to use the same knowledge at all locations in the image.

Original: This is achieved by tying the weights of feature detectors so that features learned at one location are available at other locations.
Revised: This is achieved by tying the weights of feature detectors so that features learned at one location are available at other locations.

Original: Convolutional capsules extend the sharing of knowledge across locations to include knowledge about the part-whole relationships that characterize a familiar shape.
Revised: Convolutional capsules extend the sharing of knowledge across locations to include knowledge about the part-whole relationships that characterize a familiar shape.

Original: Viewpoint changes have complicated effects on pixel intensities but simple, linear effects on the pose matrix that represents the relationship between an object or object-part and the viewer.
Revised: Viewpoint changes have complicated effects on pixel intensities but simple, linear effects on the pose matrix that represents the relationship between an object or object-part and the viewer.

Original: The aim of capsules is to make good use of this underlying linearity, both for dealing with viewpoint variations and for improving segmentation decisions.
Revised: The aim of capsules is to make good use of this underlying linearity, both for dealing with viewpoint variations and for improving segmentation decisions.

Original: Capsules use high-dimensional coincidence ﬁltering: a familiar object can be detected by looking for agreement between votes for its pose matrix.
Revised: Capsules use high-dimensional coincidence ﬁltering: a familiar object can be detected by looking for agreement between votes for its pose matrix.

Original: These votes come from parts that have already been detected.
Revised: These votes come from parts that have already been detected.

Original: A part produces a vote by multiplying its own pose matrix by a learned transformation matrix that represents the viewpoint invariant relationship between the part and the whole.
Revised: A part produces a vote by multiplying its own pose matrix by a learned transformation matrix that represents the viewpoint invariant relationship between the part and the whole.

Original: As the viewpoint changes, the pose matrices of the parts and the whole will change in a coordinated way so that any agreement between votes from different parts will persist.
Revised: As the viewpoint changes, the pose matrices of the parts and the whole will change in a coordinated way so that any agreement between votes from different parts will persist.

Original: Finding tight clusters of high-dimensional votes that agree in a mist of irrelevant votes is one way of solving the problem of assigning parts to wholes.
Revised: Finding tight clusters of high-dimensional votes that agree in a mist of irrelevant votes is one way of solving the problem of assigning parts to wholes.

Original: This is non-trivial because we cannot grid the high-dimensional pose space in the way the low-dimensional translation space is gridded to facilitate convolutions.
Revised: This is non-trivial because we cannot grid the high-dimensional pose space in the way the low-dimensional translation space is gridded to facilitate convolutions.

Original: To solve this challenge, we use a fast iterative process called “routingby-agreement” that updates the probability with which a part is assigned to a whole based on the proximity of the vote coming from that part to the votes coming from other parts that are assigned to that whole.
Revised: To solve this challenge, we use a fast iterative process called “routingby-agreement” that updates the probability with which a part is assigned to a whole based on the proximity of the vote coming from that part to the votes coming from other parts that are assigned to that whole.

Original: This is a powerful segmentation principle that allows knowledge of familiar shapes to derive segmentation, rather than just using low-level cues such as proximity or agreement in color or velocity.
Revised: This is a powerful segmentation principle that allows knowledge of familiar shapes to derive segmentation, rather than just using low-level cues such as proximity or agreement in color or velocity.

Original: An important difference between capsules and standard neural nets is that the activation of a capsule is based on a comparison between multiple incoming pose predictions whereas in a standard neural net it is based on a comparison between a single incoming activity vector and a learned weight vector.
Revised: An important difference between capsules and standard neural nets is that the activation of a capsule is based on a comparison between multiple incoming pose predictions whereas in a standard neural net it is based on a comparison between a single incoming activity vector and a learned weight vector.

Original:  H OW CAPSULES WORK
Revised:  H OW CAPSULES WORK

Original: Neural nets typically use simple non-linearities in which a non-linear function is applied to the scalar output of a linear ﬁlter.
Revised: Neural nets typically use simple non-linearities in which a non-linear function is applied to the scalar output of a linear ﬁlter.

Original: They may also use softmax non-linearities that convert a whole vector of logits into a vector of probabilities.
Revised: They may also use softmax non-linearities that convert a whole vector of logits into a vector of probabilities.

Original: Capsules use a much more complicated non-linearity that converts the whole set of activation probabilities and poses of the capsules in one layer into the activation probabilities and poses of capsules in the next layer.
Revised: Capsules use a much more complicated non-linearity that converts the whole set of activation probabilities and poses of the capsules in one layer into the activation probabilities and poses of capsules in the next layer.

Original: A capsule network consists of several layers of capsules.
Revised: A capsule network consists of several layers of capsules.

Original: The set of capsules in layer L is denoted as Ω L .
Revised: The set of capsules in layer L is denoted as Ω L .

Original: Each capsule has a 4x4 pose matrix, M , and an activation probability, a .
Revised: Each capsule has a 4x4 pose matrix, M , and an activation probability, a .

Original: These are like the activities in a standard neural net: they depend on the current input and are not stored.
Revised: These are like the activities in a standard neural net: they depend on the current input and are not stored.

Original: In between each capsule i in layer L and each capsule j in layer L + 1 is a 4x4 trainable transformation matrix,
Revised: In between each capsule i in layer L and each capsule j in layer L + 1 is a 4x4 trainable transformation matrix,

Original: W ij .
Revised: W ij .

Original: These W ij s (and two learned biases per capsule) are the only stored parameters and they are learned discriminatively.
Revised: These W ij s (and two learned biases per capsule) are the only stored parameters and they are learned discriminatively.

Original: The pose matrix of capsule i is transformed by W ij to cast a vote
Revised: The pose matrix of capsule i is transformed by W ij to cast a vote

Original: V ij =
Revised: V ij =

Original: M i W ij for the pose matrix of capsule j .
Revised: M i W ij for the pose matrix of capsule j .

Original: The poses and activations of all the capsules in layer
Revised: The poses and activations of all the capsules in layer

Original: L + 1 are calculated by using a non-linear routing procedure which gets as input V ij and a i for all i ∈ Ω L , j ∈ Ω L +1 .
Revised: L + 1 are calculated by using a non-linear routing procedure which gets as input V ij and a i for all i ∈ Ω L , j ∈ Ω L +1 .

Original: The non-linear procedure is a version of the Expectation-Maximization procedure.
Revised: The non-linear procedure is a version of the Expectation-Maximization procedure.

Original: It iteratively adjusts the means, variances, and activation probabilities of the capsules in layer L + 1 and the assignment probabilities between all i ∈ Ω L , j ∈ Ω L +1 .
Revised: It iteratively adjusts the means, variances, and activation probabilities of the capsules in layer L + 1 and the assignment probabilities between all i ∈ Ω L , j ∈ Ω L +1 .

Original: In appendix 1, we give a gentle intuitive introduction to routing-by-agreement and describe in detail how it relates to the EM algorithm for ﬁtting a mixture of Gaussians.
Revised: In appendix 1, we give a gentle intuitive introduction to routing-by-agreement and describe in detail how it relates to the EM algorithm for ﬁtting a mixture of Gaussians.

Original:  U SING EM FOR ROUTING - BY - AGREEMENT
Revised:  U SING EM FOR ROUTING - BY - AGREEMENT

Original: Let us suppose that we have already decided on the poses and activation probabilities of all the capsules in a layer and we now want to decide which capsules to activate in the layer above and how to assign each active lower-level capsule to one active higher-level capsule.
Revised: Let us suppose that we have already decided on the poses and activation probabilities of all the capsules in a layer and we now want to decide which capsules to activate in the layer above and how to assign each active lower-level capsule to one active higher-level capsule.

Original: Each capsule in the higher-layer corresponds to a Gaussian and the pose of each active capsule in the lower-layer (converted to a vector) corresponds to a data-point (or a fraction of a data-point if the capsule is partially active).
Revised: Each capsule in the higher-layer corresponds to a Gaussian and the pose of each active capsule in the lower-layer (converted to a vector) corresponds to a data-point (or a fraction of a data-point if the capsule is partially active).

Original: Using the minimum description length principle we have a choice when deciding whether or not to activate a higher-level capsule.
Revised: Using the minimum description length principle we have a choice when deciding whether or not to activate a higher-level capsule.

Original: Choice 0 : if we do not activate it, we must pay a ﬁxed cost of − β u per data-point for describing the poses of all the lower-level capsules that are assigned to the higher-level capsule.
Revised: Choice 0 : if we do not activate it, we must pay a ﬁxed cost of − β u per data-point for describing the poses of all the lower-level capsules that are assigned to the higher-level capsule.

Original: This cost is the negative log probability density of the data-point under an improper uniform prior.
Revised: This cost is the negative log probability density of the data-point under an improper uniform prior.

Original: For fractional assignments we pay that fraction of the ﬁxed cost.
Revised: For fractional assignments we pay that fraction of the ﬁxed cost.

Original: Choice 1 : if we do activate the higher-level capsule we must pay a ﬁxed cost of − β a for coding its mean and variance and the fact that it is active and then pay additional costs, pro-rated by the assignment probabilities, for describing the discrepancies between the lower-level means and the values predicted for them when the mean of the higher-level capsule is used to predict them via the inverse of the transformation matrix.
Revised: Choice 1 : if we do activate the higher-level capsule we must pay a ﬁxed cost of − β a for coding its mean and variance and the fact that it is active and then pay additional costs, pro-rated by the assignment probabilities, for describing the discrepancies between the lower-level means and the values predicted for them when the mean of the higher-level capsule is used to predict them via the inverse of the transformation matrix.

Original: A much simpler way to compute the cost of describing a datapoint is to use the negative log probability density of that datapoint’s vote under the Gaussian distribution ﬁtted by whatever higher-level capsule it gets assigned to.
Revised: A much simpler way to compute the cost of describing a datapoint is to use the negative log probability density of that datapoint’s vote under the Gaussian distribution ﬁtted by whatever higher-level capsule it gets assigned to.

Original: This is incorrect for reasons explained in appendix 1, but we use it because it requires much less computation (also explained in the appendix).
Revised: This is incorrect for reasons explained in appendix 1, but we use it because it requires much less computation (also explained in the appendix).

Original: The difference in cost between choice 0 and choice 1, is then put through the logistic function on each iteration to determine the higher-level capsule’s activation probability.
Revised: The difference in cost between choice 0 and choice 1, is then put through the logistic function on each iteration to determine the higher-level capsule’s activation probability.

Original: Appendix 1 explains why the logistic is the correct function to use.
Revised: Appendix 1 explains why the logistic is the correct function to use.

Original: Using our efﬁcient approximation for choice 1 above, the incremental cost of explaining a whole data-point i by using an active capsule j that has an axis-aligned covariance matrix is simply the sum over all dimensions of the cost of explaining each dimension, h , of the vote V ij .
Revised: Using our efﬁcient approximation for choice 1 above, the incremental cost of explaining a whole data-point i by using an active capsule j that has an axis-aligned covariance matrix is simply the sum over all dimensions of the cost of explaining each dimension, h , of the vote V ij .

Original: This is simply − ln
Revised: This is simply − ln

Original: ( P h i | j ) where P h i | j is the probability density of the h th component of the vectorized vote V ij under j ’s Gaussian model for dimension h which has variance ( σ hj ) 2 and mean µ hj where µ j is the vectorized version of j ’s pose matrix M j .
Revised: ( P h i | j ) where P h i | j is the probability density of the h th component of the vectorized vote V ij under j ’s Gaussian model for dimension h which has variance ( σ hj ) 2 and mean µ hj where µ j is the vectorized version of j ’s pose matrix M j .

Original: [Equation]
Revised: [Equation]

Original: Summing over all lower-level capsules for a single dimension, h , of j we get:
Revised: Summing over all lower-level capsules for a single dimension, h , of j we get:

Original: [Equation]
Revised: [Equation]

Original: where (cid:80) i r ij is the amount of data assigned to j and V hij is the value on dimension h of V ij .
Revised: where (cid:80) i r ij is the amount of data assigned to j and V hij is the value on dimension h of V ij .

Original: Turningon capsule j increases the description length for the means of the lower-level capsules assigned to j from − β u per lower-level capsule to − β a plus the sum of the cost over all dimensions so we deﬁne the activation function of capsule j to be:
Revised: Turningon capsule j increases the description length for the means of the lower-level capsules assigned to j from − β u per lower-level capsule to − β a plus the sum of the cost over all dimensions so we deﬁne the activation function of capsule j to be:

Original: [Equation]
Revised: [Equation]

Original: where β a is the same for all capsules and λ is an inverse temperature parameter.
Revised: where β a is the same for all capsules and λ is an inverse temperature parameter.

Original: We learn β a and β u discriminatively and set a ﬁxed schedule for λ as a hyper-parameter.
Revised: We learn β a and β u discriminatively and set a ﬁxed schedule for λ as a hyper-parameter.

Original: For ﬁnalizing the pose parameters and activations of the capsules in layer L + 1 we run the EM algorithm for few iterations (normally 3 ) after the pose parameters and activations have already been ﬁnalized in layer L .
Revised: For ﬁnalizing the pose parameters and activations of the capsules in layer L + 1 we run the EM algorithm for few iterations (normally 3 ) after the pose parameters and activations have already been ﬁnalized in layer L .

Original: The non-linearity implemented by a whole capsule layer is a form of cluster ﬁnding using the EM algorithm, so we call it EM Routing .
Revised: The non-linearity implemented by a whole capsule layer is a form of cluster ﬁnding using the EM algorithm, so we call it EM Routing .

Original: Procedure given the activations and votes of capsules in layer L
Revised: Procedure given the activations and votes of capsules in layer L

Original: V hij is the h th dimension of the vote from capsule i with activation a i in layer L to capsule j in layer L + 1 .
Revised: V hij is the h th dimension of the vote from capsule i with activation a i in layer L to capsule j in layer L + 1 .

Original: β a , β u are learned discriminatively and the inverse temperature λ increases at each iteration with a ﬁxed schedule.
Revised: β a , β u are learned discriminatively and the inverse temperature λ increases at each iteration with a ﬁxed schedule.

Original: 1: procedure EM R OUTING ( a , V ) 2: ∀
Revised: 1: procedure EM R OUTING ( a , V ) 2: ∀

Original: i ∈ Ω L , j ∈ Ω L +1 : R ij ← 1 / | Ω L +1 | 3: for t iterations do 4: ∀ j ∈ Ω L +1 :
Revised: i ∈ Ω L , j ∈ Ω L +1 : R ij ← 1 / | Ω L +1 | 3: for t iterations do 4: ∀ j ∈ Ω L +1 :

Original: M-
Revised: M-

Original: STEP ( a , R , V , j ) 5: ∀ i ∈
Revised: STEP ( a , R , V , j ) 5: ∀ i ∈

Original: Ω L : E- STEP ( µ , σ , a , V , i ) return a , M 1: procedure
Revised: Ω L : E- STEP ( µ , σ , a , V , i ) return a , M 1: procedure

Original: M-
Revised: M-

Original: STEP ( a , R , V , j ) (cid:46) for one higher-level capsule, j 2: ∀
Revised: STEP ( a , R , V , j ) (cid:46) for one higher-level capsule, j 2: ∀

Original: i
Revised: i

Original: [Table]
Revised: [Table]

Original: a i 3:
Revised: a i 3:

Original: [Table] [Table]
Revised: [Table] [Table]

Original: i )
Revised: i )

Original: [Table]
Revised: [Table]

Original:  T HE C APSULES A RCHITECTURE
Revised:  T HE C APSULES A RCHITECTURE

Original: The general architecture of our model is shown in Fig.
Revised: The general architecture of our model is shown in Fig.

Original: The model starts with a 5x5 convolutional layer with 32 channels (A=32) and a stride of 2 with a ReLU non-linearity.
Revised: The model starts with a 5x5 convolutional layer with 32 channels (A=32) and a stride of 2 with a ReLU non-linearity.

Original: All the other layers are capsule layers starting with the primary capsule layer.
Revised: All the other layers are capsule layers starting with the primary capsule layer.

Original: The 4x4 pose of each of the B=32 primary capsule types is a learned linear transformation of the output of all the lower-layer ReLUs centered at that location.
Revised: The 4x4 pose of each of the B=32 primary capsule types is a learned linear transformation of the output of all the lower-layer ReLUs centered at that location.

Original: The activations of the primary capsules are produced by applying the sigmoid function to the weighted sums of the same set of lower-layer ReLUs.
Revised: The activations of the primary capsules are produced by applying the sigmoid function to the weighted sums of the same set of lower-layer ReLUs.

Original: The primary capsules are followed by two 3x3 convolutional capsule layers (K=3), each withcapsule types (C=D=32) with strides of 2 and one, respectively.
Revised: The primary capsules are followed by two 3x3 convolutional capsule layers (K=3), each withcapsule types (C=D=32) with strides of 2 and one, respectively.

Original: The last layer of convolutional capsules is connected to the ﬁnal capsule layer which has one capsule per output class.
Revised: The last layer of convolutional capsules is connected to the ﬁnal capsule layer which has one capsule per output class.

Original: When connecting the last convolutional capsule layer to the ﬁnal layer we do not want to throw away information about the location of the convolutional capsules but we also want to make use of the fact that all capsules of the same type are extracting the same entity at different positions.
Revised: When connecting the last convolutional capsule layer to the ﬁnal layer we do not want to throw away information about the location of the convolutional capsules but we also want to make use of the fact that all capsules of the same type are extracting the same entity at different positions.

Original: We therefore share the transformation matrices between different positions of the same capsule type and add the scaled coordinate (row, column) of the center of the receptive ﬁeld of each capsule to the ﬁrst two elements of the right-hand column of its vote matrix.
Revised: We therefore share the transformation matrices between different positions of the same capsule type and add the scaled coordinate (row, column) of the center of the receptive ﬁeld of each capsule to the ﬁrst two elements of the right-hand column of its vote matrix.

Original: We refer to this technique as Coordinate
Revised: We refer to this technique as Coordinate

Original: Addition.
Revised: Addition.

Original: This should encourage the shared ﬁnal transformations to produce values for those two elements that represent the ﬁne position of the entity relative to the center of the capsule’s receptive ﬁeld.
Revised: This should encourage the shared ﬁnal transformations to produce values for those two elements that represent the ﬁne position of the entity relative to the center of the capsule’s receptive ﬁeld.

Original: The routing procedure is used between each adjacent pair of capsule layers.
Revised: The routing procedure is used between each adjacent pair of capsule layers.

Original: For convolutional capsules, each capsule in layer L + 1 sends feedback only to capsules within its receptive ﬁeld in layer
Revised: For convolutional capsules, each capsule in layer L + 1 sends feedback only to capsules within its receptive ﬁeld in layer

Original: L .
Revised: L .

Original: Therefore each convolutional instance of a capsule in layer L receives at most kernel size X kernel size feedback from each capsule type in layer L + 1 .
Revised: Therefore each convolutional instance of a capsule in layer L receives at most kernel size X kernel size feedback from each capsule type in layer L + 1 .

Original: The instances closer to the border of the image receive fewer feedbacks with corner ones receiving only one feedback per capsule type in layer L + 1 .
Revised: The instances closer to the border of the image receive fewer feedbacks with corner ones receiving only one feedback per capsule type in layer L + 1 .

Original: 4. S PREAD L OSS
Revised: 4. S PREAD L OSS

Original: In order to make the training less sensitive to the initialization and hyper-parameters of the model, we use “spread loss” to directly maximize the gap between the activation of the target class ( a t ) and the activation of the other classes.
Revised: In order to make the training less sensitive to the initialization and hyper-parameters of the model, we use “spread loss” to directly maximize the gap between the activation of the target class ( a t ) and the activation of the other classes.

Original: If the activation of a wrong class, a i , is closer than the margin, m , to a t then it is penalized by the squared distance to the margin:
Revised: If the activation of a wrong class, a i , is closer than the margin, m , to a t then it is penalized by the squared distance to the margin:

Original: [Equation]
Revised: [Equation]

Original: By starting with a small margin of 0 . 2 and linearly increasing it during training to 0 .
Revised: By starting with a small margin of 0 . 2 and linearly increasing it during training to 0 .

Original: 9 , we avoid dead capsules in the earlier layers.
Revised: 9 , we avoid dead capsules in the earlier layers.

Original: Spread loss is equivalent to squared Hinge loss with m = 1 .
Revised: Spread loss is equivalent to squared Hinge loss with m = 1 .

Original: Guermeur & Monfrini (2011) studies a variant of this loss in the context of multi class SVMs.
Revised: Guermeur & Monfrini (2011) studies a variant of this loss in the context of multi class SVMs.

Original:  E XPERIMENTS
Revised:  E XPERIMENTS

Original: The smallNORB dataset (LeCun et al.
Revised: The smallNORB dataset (LeCun et al.

Original: (2004)) has gray-level stereo images of 5 classes of toys: airplanes, cars, trucks, humans and animals.
Revised: (2004)) has gray-level stereo images of 5 classes of toys: airplanes, cars, trucks, humans and animals.

Original: There are 10 physical instances of each class which are painted matte green.
Revised: There are 10 physical instances of each class which are painted matte green.

Original: 5 physical instances of a class are selected for the training data and the otherfor the test data.
Revised: 5 physical instances of a class are selected for the training data and the otherfor the test data.

Original: Every individual toy is pictured at 18 different azimuths (0-340), 9 elevations and 6 lighting conditions, so the training and test sets each contain 24,300 stereo pairs of 96x96 images.
Revised: Every individual toy is pictured at 18 different azimuths (0-340), 9 elevations and 6 lighting conditions, so the training and test sets each contain 24,300 stereo pairs of 96x96 images.

Original: We selected smallNORB as a benchmark for developing our capsules system because it is carefully designed to be a pure shape recognition task that is not confounded by context and color, but it is much closer to natural images than MNIST.
Revised: We selected smallNORB as a benchmark for developing our capsules system because it is carefully designed to be a pure shape recognition task that is not confounded by context and color, but it is much closer to natural images than MNIST.

Original: [Table]
Revised: [Table]

Original: CNN of Cires¸an et al.
Revised: CNN of Cires¸an et al.

Original: (2011) with extra input images
Revised: (2011) with extra input images

Original: [Table]
Revised: [Table]

Original: Our Best model (third row), with multiple crops during testing
Revised: Our Best model (third row), with multiple crops during testing

Original: [Table]
Revised: [Table]

Original: We downsample smallNORB to 48 × 48 pixels and normalize each image to have zero mean and unit variance.
Revised: We downsample smallNORB to 48 × 48 pixels and normalize each image to have zero mean and unit variance.

Original: During training, we randomly crop 32 × 32 patches and add random brightness and contrast to the cropped images.
Revised: During training, we randomly crop 32 × 32 patches and add random brightness and contrast to the cropped images.

Original: During test, we crop a 32 × 32 patch from the center of the image and achieve 1 . 8 % test error on smallNORB.
Revised: During test, we crop a 32 × 32 patch from the center of the image and achieve 1 . 8 % test error on smallNORB.

Original: If we average the class activations over multiple crops at test time we achieve 1 . 4% .
Revised: If we average the class activations over multiple crops at test time we achieve 1 . 4% .

Original: The best reported result on smallNORB without using meta data is 2 .
Revised: The best reported result on smallNORB without using meta data is 2 .

Original: 56% (Cires¸an et al.
Revised: 56% (Cires¸an et al.

Original: To achieve this, they added two additional stereo pairs of input images that are created by using an on-center off-surround ﬁlter and an off-center on-surround ﬁlter.
Revised: To achieve this, they added two additional stereo pairs of input images that are created by using an on-center off-surround ﬁlter and an off-center on-surround ﬁlter.

Original: They also applied afﬁne distortions to the images.
Revised: They also applied afﬁne distortions to the images.

Original: Our work also beats the Sabour et al.
Revised: Our work also beats the Sabour et al.

Original: (2017) capsule work which achieves 2 .
Revised: (2017) capsule work which achieves 2 .

Original: 7% on smallNORB.
Revised: 7% on smallNORB.

Original: We also tested our model on NORB which is a jittered version of smallNORB with added background and we achieved a 2 . 6% error rate which is on par with the state-of-the-art of 2 .
Revised: We also tested our model on NORB which is a jittered version of smallNORB with added background and we achieved a 2 . 6% error rate which is on par with the state-of-the-art of 2 .

Original: 7% (Ciresan et al.
Revised: 7% (Ciresan et al.

Original: As the baseline for our experiments on generalization to novel viewpoints we train a CNN which has two convolutional layers with 32 and 64 channels respectively.
Revised: As the baseline for our experiments on generalization to novel viewpoints we train a CNN which has two convolutional layers with 32 and 64 channels respectively.

Original: Both layers have a kernel size of 5 and a stride of 1 with a 2 × 2 max pooling.
Revised: Both layers have a kernel size of 5 and a stride of 1 with a 2 × 2 max pooling.

Original: The third layer is a 1024 unit fully connected layer with dropout and connects to the 5-way softmax output layer.
Revised: The third layer is a 1024 unit fully connected layer with dropout and connects to the 5-way softmax output layer.

Original: All hidden units use the ReLU non-linearity.
Revised: All hidden units use the ReLU non-linearity.

Original: We use the same image preparation for the CNN baseline as described above for the capsule network.
Revised: We use the same image preparation for the CNN baseline as described above for the capsule network.

Original: Our baseline CNN was the result of an extensive hyperparameter search over ﬁlter sizes, numbers of channels and learning rates.
Revised: Our baseline CNN was the result of an extensive hyperparameter search over ﬁlter sizes, numbers of channels and learning rates.

Original: The CNN baseline achieves 5 .
Revised: The CNN baseline achieves 5 .

Original: 2% test error rate on smallNORB and has 4.2M parameters.
Revised: 2% test error rate on smallNORB and has 4.2M parameters.

Original: We deduce that the Cires¸an et al.
Revised: We deduce that the Cires¸an et al.

Original: (2011) network has 2.7M parameters.
Revised: (2011) network has 2.7M parameters.

Original: By using small matrix multiplies, we reduced the number of parameters by a factor of 15 to 310K compared with our baseline CNN (and a factor of 9 w.r.t Cires¸an et al.
Revised: By using small matrix multiplies, we reduced the number of parameters by a factor of 15 to 310K compared with our baseline CNN (and a factor of 9 w.r.t Cires¸an et al.

Original: A smaller capsule network of A = 64 , B = 8 , C =
Revised: A smaller capsule network of A = 64 , B = 8 , C =

Original: D = 16 with only 68K trainable parameters achieves 2 .
Revised: D = 16 with only 68K trainable parameters achieves 2 .

Original: 2% test error rate which also beats the prior state-of-the-art.
Revised: 2% test error rate which also beats the prior state-of-the-art.

Original: Fig.
Revised: Fig.

Original: 2 shows how EM routing adjusts the vote assignments and the capsule means to ﬁnd the tight clusters in the votes.
Revised: 2 shows how EM routing adjusts the vote assignments and the capsule means to ﬁnd the tight clusters in the votes.

Original: The histograms show the distribution of vote distances to the mean (pose) of each class capsule during routing iterations.
Revised: The histograms show the distribution of vote distances to the mean (pose) of each class capsule during routing iterations.

Original: At the ﬁrst iteration, votes are distributed equally between 5 ﬁnal layer capsules.
Revised: At the ﬁrst iteration, votes are distributed equally between 5 ﬁnal layer capsules.

Original: Therefore, all capsules receive votes closer than 0 .
Revised: Therefore, all capsules receive votes closer than 0 .

Original: 05 to their calculated mean.
Revised: 05 to their calculated mean.

Original: In the second iteration, the assignment probability for agreeing votes increases.
Revised: In the second iteration, the assignment probability for agreeing votes increases.

Original: Therefore, most of the votes are assigned to the detected clusters, the animal and human class in the middle row, and the other capsules only receive scattered votes which are further than 0 .
Revised: Therefore, most of the votes are assigned to the detected clusters, the animal and human class in the middle row, and the other capsules only receive scattered votes which are further than 0 .

Original: from the calculated mean.
Revised: from the calculated mean.

Original: The zoomed-out version of Fig.
Revised: The zoomed-out version of Fig.

Original: 2 in the Appendix shows the full distribution of vote distances at each routing iteration.
Revised: 2 in the Appendix shows the full distribution of vote distances at each routing iteration.

Original: Instead of using our MDL-derived capsule activation term which computes a separate activation probability per capsule, we could view the capsule activations like the mixing proportions in a mixture of Gaussians and set them to be proportional to the sum of the assignment probabilities of a capsule and to sum to 1 over all the capsules in a layer.
Revised: Instead of using our MDL-derived capsule activation term which computes a separate activation probability per capsule, we could view the capsule activations like the mixing proportions in a mixture of Gaussians and set them to be proportional to the sum of the assignment probabilities of a capsule and to sum to 1 over all the capsules in a layer.

Original: This increases the test error rate on
Revised: This increases the test error rate on

Original: [Table]
Revised: [Table]

Original: smallNORB to 4 .
Revised: smallNORB to 4 .

Original: Tab. 1 summarizes the effects of the number of routing iterations, the type of loss, and the use of matrices rather than vectors for the poses.
Revised: Tab. 1 summarizes the effects of the number of routing iterations, the type of loss, and the use of matrices rather than vectors for the poses.

Original: The same capsules architecture as Fig.
Revised: The same capsules architecture as Fig.

Original: 1 achieves 0 .
Revised: 1 achieves 0 .

Original: 44% test error rate on MNIST.
Revised: 44% test error rate on MNIST.

Original: If the number of channels in the ﬁrst hidden layer is increased to 256, it achieves 11 .
Revised: If the number of channels in the ﬁrst hidden layer is increased to 256, it achieves 11 .

Original: 9% test error rate on Cifar (Krizhevsky & Hinton (2009)).
Revised: 9% test error rate on Cifar (Krizhevsky & Hinton (2009)).

Original: 5. G ENERALIZATION TO NOVEL VIEWPOINTS
Revised: 5. G ENERALIZATION TO NOVEL VIEWPOINTS

Original: A more severe test of generalization is to use a limited range of viewpoints for training and to test on a much wider range.
Revised: A more severe test of generalization is to use a limited range of viewpoints for training and to test on a much wider range.

Original: We trained both our convolutional baseline and our capsule model on one-third of the training data containing azimuths of (300, 320, 340, 0, 20, 40) and tested on the two-thirds of the test data that contained azimuths from 60 to 280.
Revised: We trained both our convolutional baseline and our capsule model on one-third of the training data containing azimuths of (300, 320, 340, 0, 20, 40) and tested on the two-thirds of the test data that contained azimuths from 60 to 280.

Original: In a separate experiment, we trained on thesmaller elevations and tested on the 6 larger elevations.
Revised: In a separate experiment, we trained on thesmaller elevations and tested on the 6 larger elevations.

Original: It is hard to decide if the capsules model is better at generalizing to novel viewpoints because it achieves better test accuracy on all viewpoints.
Revised: It is hard to decide if the capsules model is better at generalizing to novel viewpoints because it achieves better test accuracy on all viewpoints.

Original: To eliminate this confounding factor, we stopped training the capsule model when its performance matched the baseline CNN on the third of the test set that used the training viewpoints.
Revised: To eliminate this confounding factor, we stopped training the capsule model when its performance matched the baseline CNN on the third of the test set that used the training viewpoints.

Original: Then, we compared these matched models on the twothirds of the test set with novel viewpoints.
Revised: Then, we compared these matched models on the twothirds of the test set with novel viewpoints.

Original: Results in Tab. 2 show that compared with the baseline
Revised: Results in Tab. 2 show that compared with the baseline

Original: CNN capsules with matched performance on familiar viewpoints reduce the test error rate on novel viewpoints by about 30% for both novel azimuths and novel elevations.
Revised: CNN capsules with matched performance on familiar viewpoints reduce the test error rate on novel viewpoints by about 30% for both novel azimuths and novel elevations.

Original:  A DVERSARIAL R OBUSTNESS
Revised:  A DVERSARIAL R OBUSTNESS

Original: There is growing interest in the vulnerability of neural networks to adversarial examples; inputs that have been slightly changed by an attacker to trick a neural net classiﬁer into making the wrong classiﬁcation.
Revised: There is growing interest in the vulnerability of neural networks to adversarial examples; inputs that have been slightly changed by an attacker to trick a neural net classiﬁer into making the wrong classiﬁcation.

Original: These inputs can be created in a variety of ways, but straightforward strategies such as
Revised: These inputs can be created in a variety of ways, but straightforward strategies such as

Original: FGSM (Goodfellow et al.
Revised: FGSM (Goodfellow et al.

Original: (2014)) have been shown to drastically decrease accuracy in convolutional neural networks on image classiﬁcation tasks.
Revised: (2014)) have been shown to drastically decrease accuracy in convolutional neural networks on image classiﬁcation tasks.

Original: We compare our capsule model and a traditional convolutional model on their ability to withstand such attacks.
Revised: We compare our capsule model and a traditional convolutional model on their ability to withstand such attacks.

Original: FGSM computes the gradient of the loss w.r.t.
Revised: FGSM computes the gradient of the loss w.r.t.

Original: each pixel intensity and then changes the pixel intensity by a ﬁxed amount (cid:15) in the direction that increases the loss.
Revised: each pixel intensity and then changes the pixel intensity by a ﬁxed amount (cid:15) in the direction that increases the loss.

Original: So the changes only depend on the sign of the gradient at each pixel.
Revised: So the changes only depend on the sign of the gradient at each pixel.

Original: This can be extended to a targeted attack by updating the input to maximize the classiﬁcation probability of a particular wrong class.
Revised: This can be extended to a targeted attack by updating the input to maximize the classiﬁcation probability of a particular wrong class.

Original: We generated adversarial attacks using FGSM because it has only one hyper-parameter and it is easy to compare models that have very different gradient magnitudes.
Revised: We generated adversarial attacks using FGSM because it has only one hyper-parameter and it is easy to compare models that have very different gradient magnitudes.

Original: To test the robustness of our model, we generated adversarial images from the test set using a fully trained model.
Revised: To test the robustness of our model, we generated adversarial images from the test set using a fully trained model.

Original: We then reported the accuracy of the model on these images.
Revised: We then reported the accuracy of the model on these images.

Original: We found that our model is signiﬁcantly less vulnerable to both general and targeted FGSM adversarial attacks; a small (cid:15) can be used to reduce a convolutional model’s accuracy much more than an equivalent (cid:15) can on the capsule model (Fig. 3).
Revised: We found that our model is signiﬁcantly less vulnerable to both general and targeted FGSM adversarial attacks; a small (cid:15) can be used to reduce a convolutional model’s accuracy much more than an equivalent (cid:15) can on the capsule model (Fig. 3).

Original: It should also be noted that the capsule model’s accuracy after the untargeted attack never drops below chance ( 20% ) whereas the convolutional model’s accuracy is reduced to signiﬁcantly below chance with an (cid:15) as small as 0 . 2 .
Revised: It should also be noted that the capsule model’s accuracy after the untargeted attack never drops below chance ( 20% ) whereas the convolutional model’s accuracy is reduced to signiﬁcantly below chance with an (cid:15) as small as 0 . 2 .

Original: We also tested our model on the slightly more sophisticated adversarial attack of the Basic Iterative
Revised: We also tested our model on the slightly more sophisticated adversarial attack of the Basic Iterative

Original: Method (Kurakin et al.
Revised: Method (Kurakin et al.

Original: (2016)), which is simply the aforementioned attack except it takes multiple smaller steps when creating the adversarial image.
Revised: (2016)), which is simply the aforementioned attack except it takes multiple smaller steps when creating the adversarial image.

Original: Here too we ﬁnd that our model is much more robust to the attack than the traditional convolutional model.
Revised: Here too we ﬁnd that our model is much more robust to the attack than the traditional convolutional model.

Original: It has been shown that some robustness to adversarial attacks in models can be due to simple numerical instability in the calculation of the gradient Brendel & Bethge (2017).
Revised: It has been shown that some robustness to adversarial attacks in models can be due to simple numerical instability in the calculation of the gradient Brendel & Bethge (2017).

Original: To ensure that this was not the sole cause of our model’s robustness, we calculated the percentage of zero values in the gradient with respect to the image in the capsule model and found it to be smaller than that of the
Revised: To ensure that this was not the sole cause of our model’s robustness, we calculated the percentage of zero values in the gradient with respect to the image in the capsule model and found it to be smaller than that of the

Original: CNN.
Revised: CNN.

Original: Furthermore, the capsule gradients, although smaller that those of the CNN, are only smaller by 2 orders of magnitude, as opposed to 16 orders of magnitude seen in Brendel & Bethge (2017)’s work.
Revised: Furthermore, the capsule gradients, although smaller that those of the CNN, are only smaller by 2 orders of magnitude, as opposed to 16 orders of magnitude seen in Brendel & Bethge (2017)’s work.

Original: Finally we tested our model’s robustness to black box attacks by generating adversarial examples with a CNN and testing them on both our capsule model and a different CNN.
Revised: Finally we tested our model’s robustness to black box attacks by generating adversarial examples with a CNN and testing them on both our capsule model and a different CNN.

Original: We found that the capsule model did not perform noticeably better at this task than the CNN.
Revised: We found that the capsule model did not perform noticeably better at this task than the CNN.

Original:  R ELATED WORK
Revised:  R ELATED WORK

Original: Among the multiple recent attempts at improving the ability of neural networks to deal with viewpoint variations, there are two main streams.
Revised: Among the multiple recent attempts at improving the ability of neural networks to deal with viewpoint variations, there are two main streams.

Original: One stream attempts to achieve viewpoint invariance and the other aims for viewpoint equivariance.
Revised: One stream attempts to achieve viewpoint invariance and the other aims for viewpoint equivariance.

Original: The work presented by Jaderberg et al. (2015)), Spatial Transformer Networks, seeks viewpoint invariance by changing the sampling of CNNs according to a selection of afﬁne transformations.
Revised: The work presented by Jaderberg et al. (2015)), Spatial Transformer Networks, seeks viewpoint invariance by changing the sampling of CNNs according to a selection of afﬁne transformations.

Original: De Brabandere et al.
Revised: De Brabandere et al.

Original: (2016) extends spatial transformer networks where the ﬁlters are adapted during inference depending on the input.
Revised: (2016) extends spatial transformer networks where the ﬁlters are adapted during inference depending on the input.

Original: They generate different ﬁlters for each locality in the feature map rather than applying the same transformation to all ﬁlters.
Revised: They generate different ﬁlters for each locality in the feature map rather than applying the same transformation to all ﬁlters.

Original: Their approach is a step toward input covariance detection from traditional pattern matching frameworks like standard CNNs (LeCun et al.
Revised: Their approach is a step toward input covariance detection from traditional pattern matching frameworks like standard CNNs (LeCun et al.

Original: Dai et al.
Revised: Dai et al.

Original: (2017) improves upon spatial transformer networks by generalizing the sampling method of ﬁlters.
Revised: (2017) improves upon spatial transformer networks by generalizing the sampling method of ﬁlters.

Original: Our work differs substantially in that a unit is not activated based on the matching score with a ﬁlter (either ﬁxed or dynamically changing during inference).
Revised: Our work differs substantially in that a unit is not activated based on the matching score with a ﬁlter (either ﬁxed or dynamically changing during inference).

Original: In our case, a capsule is activated only if the transformed poses coming from the layer below match each other.
Revised: In our case, a capsule is activated only if the transformed poses coming from the layer below match each other.

Original: This is a more effective way to capture covariance and leads to models with many fewer parameters that generalize better.
Revised: This is a more effective way to capture covariance and leads to models with many fewer parameters that generalize better.

Original: The success of CNNs has motivated many researchers to extend the translational equivariance built in to CNNs to include rotational equivariance (Cohen & Welling (2016), Dieleman et al.
Revised: The success of CNNs has motivated many researchers to extend the translational equivariance built in to CNNs to include rotational equivariance (Cohen & Welling (2016), Dieleman et al.

Original: Oyallon & Mallat (2015)).
Revised: Oyallon & Mallat (2015)).

Original: The recent approach in Harmonic Networks (Worrall et al.
Revised: The recent approach in Harmonic Networks (Worrall et al.

Original: (2017)) achieves rotation equivariant feature maps by using circular harmonic ﬁlters and returning both the maximal response and orientation using complex numbers.
Revised: (2017)) achieves rotation equivariant feature maps by using circular harmonic ﬁlters and returning both the maximal response and orientation using complex numbers.

Original: This shares the basic representational idea of capsules: By assuming that there is only one instance of the entity at a location, we can use several different numbers to represent its properties.
Revised: This shares the basic representational idea of capsules: By assuming that there is only one instance of the entity at a location, we can use several different numbers to represent its properties.

Original: They use a ﬁxed number of streams of rotation orders.
Revised: They use a ﬁxed number of streams of rotation orders.

Original: By enforcing the equality of the sum of rotation orders along any path, they achieve patch-wise rotation equivariance.
Revised: By enforcing the equality of the sum of rotation orders along any path, they achieve patch-wise rotation equivariance.

Original: This approach is more parameter-efﬁcient than data augmentation approaches, duplicating feature maps, or duplicating ﬁlters (Fasel & Gatica-Perez (2006), Laptev et al.
Revised: This approach is more parameter-efﬁcient than data augmentation approaches, duplicating feature maps, or duplicating ﬁlters (Fasel & Gatica-Perez (2006), Laptev et al.

Original: Our approach encodes general viewpoint equivariance rather than only afﬁne 2D rotations.
Revised: Our approach encodes general viewpoint equivariance rather than only afﬁne 2D rotations.

Original: Symmetry networks (Gens & Domingos (2014)) use iterative Lucas-Kanade optimization to ﬁnd poses that are supported by the most low-level features.
Revised: Symmetry networks (Gens & Domingos (2014)) use iterative Lucas-Kanade optimization to ﬁnd poses that are supported by the most low-level features.

Original: Their key weakness is that the iterative algorithm always starts at the same pose, rather than the mean of the bottom-up votes.
Revised: Their key weakness is that the iterative algorithm always starts at the same pose, rather than the mean of the bottom-up votes.

Original: Lenc & Vedaldi (2016) proposes a feature detection mechanism (DetNet) that is equivariant to afﬁne transformations.
Revised: Lenc & Vedaldi (2016) proposes a feature detection mechanism (DetNet) that is equivariant to afﬁne transformations.

Original: DetNet is designed to detect the same points in the image under different viewpoint variations.
Revised: DetNet is designed to detect the same points in the image under different viewpoint variations.

Original: This effort is orthogonal to our work but DetNet might be a good way to implement the de-rendering ﬁrst-stage that activates the layer of primary capsules.
Revised: This effort is orthogonal to our work but DetNet might be a good way to implement the de-rendering ﬁrst-stage that activates the layer of primary capsules.

Original: Our routing algorithm can be seen as an attention mechanism.
Revised: Our routing algorithm can be seen as an attention mechanism.

Original: In this view, it is related to the work of
Revised: In this view, it is related to the work of

Original: Gregor et al.
Revised: Gregor et al.

Original: (2015), where they improved the decoder performance in a generative model by using
Revised: (2015), where they improved the decoder performance in a generative model by using

Original: Gaussian kernels to attend to different parts of the feature map generated by the encoder.
Revised: Gaussian kernels to attend to different parts of the feature map generated by the encoder.

Original: Vaswani et al.
Revised: Vaswani et al.

Original: (2017) uses a softmax attention mechanism to match parts of the query sequence to parts of the input sequence for the translation task and when generating an encoding for the query.
Revised: (2017) uses a softmax attention mechanism to match parts of the query sequence to parts of the input sequence for the translation task and when generating an encoding for the query.

Original: They show improvement upon previous translation efforts using recurrent architectures.
Revised: They show improvement upon previous translation efforts using recurrent architectures.

Original: Our algorithm has attention in the opposite direction.
Revised: Our algorithm has attention in the opposite direction.

Original: The competition is not between the lower-level capsules that a higher-level capsule might attend to.
Revised: The competition is not between the lower-level capsules that a higher-level capsule might attend to.

Original: It is between the higher-level capsules that a lower-level capsule might send its vote to.
Revised: It is between the higher-level capsules that a lower-level capsule might send its vote to.

Original: 7. P REVIOUS WORK ON CAPSULES
Revised: 7. P REVIOUS WORK ON CAPSULES

Original: Hinton et al.
Revised: Hinton et al.

Original: (2011) used a transformation matrix in a transforming autoencoder that learned to transform a stereo pair of images into a stereo pair from a slightly different viewpoint.
Revised: (2011) used a transformation matrix in a transforming autoencoder that learned to transform a stereo pair of images into a stereo pair from a slightly different viewpoint.

Original: However, that system requires the transformation matrix to be supplied externally.
Revised: However, that system requires the transformation matrix to be supplied externally.

Original: More recently, routing-byagreement was shown to be effective for segmenting highly overlapping digits (Sabour et al.
Revised: More recently, routing-byagreement was shown to be effective for segmenting highly overlapping digits (Sabour et al.

Original: , but that system has several deﬁciencies that we have overcome in this paper:
Revised: , but that system has several deﬁciencies that we have overcome in this paper:

Original: It uses the length of the pose vector to represent the probability that the entity represented by a capsule is present.
Revised: It uses the length of the pose vector to represent the probability that the entity represented by a capsule is present.

Original: To keep the length less than 1, requires an unprincipled non-linearity and this prevents the existence of any sensible objective function that is minimized by the iterative routing procedure.
Revised: To keep the length less than 1, requires an unprincipled non-linearity and this prevents the existence of any sensible objective function that is minimized by the iterative routing procedure.

Original: It uses the cosine of the angle between two pose vectors to measure their agreement.
Revised: It uses the cosine of the angle between two pose vectors to measure their agreement.

Original: Unlike the negative log variance of a Gaussian cluster, the cosine saturates at 1 , which makes it insensitive to the difference between a quite good agreement and a very good agreement.
Revised: Unlike the negative log variance of a Gaussian cluster, the cosine saturates at 1 , which makes it insensitive to the difference between a quite good agreement and a very good agreement.

Original: It uses a vector of length n rather than a matrix with n elements to represent a pose, so its transformation matrices have n 2 parameters rather than just n .
Revised: It uses a vector of length n rather than a matrix with n elements to represent a pose, so its transformation matrices have n 2 parameters rather than just n .

Original:  C ONCLUSION
Revised:  C ONCLUSION

Original: Building on the work of Sabour et al.
Revised: Building on the work of Sabour et al.

Original: (2017), we have proposed a new type of capsule system in which each capsule has a logistic unit to represent the presence of an entity and a 4x4 pose matrix to represent the pose of that entity.
Revised: (2017), we have proposed a new type of capsule system in which each capsule has a logistic unit to represent the presence of an entity and a 4x4 pose matrix to represent the pose of that entity.

Original: We also introduced a new iterative routing procedure between capsule layers, based on the EM algorithm, which allows the output of each lower-level capsule to be routed to a capsule in the layer above in such a way that active capsules receive a cluster of similar pose votes.
Revised: We also introduced a new iterative routing procedure between capsule layers, based on the EM algorithm, which allows the output of each lower-level capsule to be routed to a capsule in the layer above in such a way that active capsules receive a cluster of similar pose votes.

Original: This new system achieves signiﬁcantly better accuracy on the smallNORB data set than the state-of-the-art CNN, reducing the number of errors by 45%.
Revised: This new system achieves signiﬁcantly better accuracy on the smallNORB data set than the state-of-the-art CNN, reducing the number of errors by 45%.

Original: We have also shown it to be signiﬁcantly more robust to white box adversarial attacks than a baseline CNN.
Revised: We have also shown it to be signiﬁcantly more robust to white box adversarial attacks than a baseline CNN.

Original: SmallNORB is an ideal data-set for developing new shape-recognition models precisely because it lacks many of the additional features of images in the wild.
Revised: SmallNORB is an ideal data-set for developing new shape-recognition models precisely because it lacks many of the additional features of images in the wild.

Original: Now that our capsules model works well on NORB, we plan to implement an efﬁcient version to test much larger models on much larger data-sets such as ImageNet.
Revised: Now that our capsules model works well on NORB, we plan to implement an efﬁcient version to test much larger models on much larger data-sets such as ImageNet.

Revised: ACKNOWLEDGMENTS Thanks to Robert Gens, Eric Langlois, Taco Cohen and anonymous commentators for helpful discussions and to everyone who made TensorFlow.

Original: A A PPENDIX 1: A N INTUITIVE EXPLANATION OF THE COST FUNCTION THAT IS MINIMIZED DURING DYNAMIC ROUTING
Revised: A A PPENDIX 1: A N INTUITIVE EXPLANATION OF THE COST FUNCTION THAT IS MINIMIZED DURING DYNAMIC ROUTING

Original: Dynamic routing is performed between two adjacent layers of capsules.
Revised: Dynamic routing is performed between two adjacent layers of capsules.

Original: We will refer to these layers as the higher-level and the lower-level.
Revised: We will refer to these layers as the higher-level and the lower-level.

Original: We complete the routing between one pair of layers before starting the routing between the next pair of layers.
Revised: We complete the routing between one pair of layers before starting the routing between the next pair of layers.

Original: The routing process has a strong resemblance to ﬁtting a mixture of Gaussians using EM, where the higher-level capsules play the role of the
Revised: The routing process has a strong resemblance to ﬁtting a mixture of Gaussians using EM, where the higher-level capsules play the role of the

Original: Gaussians and the means of the activated lower-level capsules for a single input image play the role of the datapoints.
Revised: Gaussians and the means of the activated lower-level capsules for a single input image play the role of the datapoints.

Original: We start by explaining the cost function that is minimized when using the EM procedure to ﬁt a mixture of Gaussians.
Revised: We start by explaining the cost function that is minimized when using the EM procedure to ﬁt a mixture of Gaussians.

Original: We then derive our dynamic routing procedure by making two modiﬁcations to the procedure for ﬁtting a mixture of Gaussians.
Revised: We then derive our dynamic routing procedure by making two modiﬁcations to the procedure for ﬁtting a mixture of Gaussians.

Original: A. T HE COST FUNCTION FOR FITTING A MIXTURE OF G AUSSIANS
Revised: A. T HE COST FUNCTION FOR FITTING A MIXTURE OF G AUSSIANS

Original: The EM algorithm for ﬁtting a mixture of Gaussians alternates between an E-step and an M-step.
Revised: The EM algorithm for ﬁtting a mixture of Gaussians alternates between an E-step and an M-step.

Original: The E-step is used to determine, for each datapoint, the probability with which it is assigned to each of the Gaussians.
Revised: The E-step is used to determine, for each datapoint, the probability with which it is assigned to each of the Gaussians.

Original: These assignment probabilities act as weights and the M-step for each Gaussian consists of ﬁnding the mean of these weighted datapoints and the variance about that mean.
Revised: These assignment probabilities act as weights and the M-step for each Gaussian consists of ﬁnding the mean of these weighted datapoints and the variance about that mean.

Original: If we are also ﬁtting mixing proportions for each Gaussian, they are set to the fraction of the data assigned to the Gaussian.
Revised: If we are also ﬁtting mixing proportions for each Gaussian, they are set to the fraction of the data assigned to the Gaussian.

Original: The M-step holds the assignment probabilities constant and adjusts each Gaussian to maximize the sum of the weighted log probabilities that the Gaussian would generate the datapoints assigned to it.
Revised: The M-step holds the assignment probabilities constant and adjusts each Gaussian to maximize the sum of the weighted log probabilities that the Gaussian would generate the datapoints assigned to it.

Original: The negative log probability density of a datapoint under a Gaussian can be treated like the energy of a physical system and the M-step is minimizing the expected energy where the expectations are taken using the assignment probabilities.
Revised: The negative log probability density of a datapoint under a Gaussian can be treated like the energy of a physical system and the M-step is minimizing the expected energy where the expectations are taken using the assignment probabilities.

Original: The E-step adjusts the assignment probabilities for each datapoint to minimize a quantity called “free energy” which is the expected energy minus the entropy.
Revised: The E-step adjusts the assignment probabilities for each datapoint to minimize a quantity called “free energy” which is the expected energy minus the entropy.

Original: We can minimize the expected energy by assigning each datapoint with probabilty 1 to whichever Gaussian gives it the lowest energy ( i. e. the highest probability density).
Revised: We can minimize the expected energy by assigning each datapoint with probabilty 1 to whichever Gaussian gives it the lowest energy ( i. e. the highest probability density).

Original: We can maximize the entropy by assigning each datapoint with equal probability to every Gaussian ignoring the energy.
Revised: We can maximize the entropy by assigning each datapoint with equal probability to every Gaussian ignoring the energy.

Original: The best trade-off is to make the assignment probabilities be proportional to exp ( − E ) .
Revised: The best trade-off is to make the assignment probabilities be proportional to exp ( − E ) .

Original: This is known as the Boltzmann distribution in physics or the posterior distribution in statistics.
Revised: This is known as the Boltzmann distribution in physics or the posterior distribution in statistics.

Original: Since the E-step minimizes the free energy w.r.t.
Revised: Since the E-step minimizes the free energy w.r.t.

Original: the assignment distribution and the M-step leaves the entropy term unchanged and minimizes the expected energy w.r.t.
Revised: the assignment distribution and the M-step leaves the entropy term unchanged and minimizes the expected energy w.r.t.

Original: the parameters of the Gaussians, the free energy is an objective function for both steps.
Revised: the parameters of the Gaussians, the free energy is an objective function for both steps.

Original: The softmax function computes the distribution that minimizes free energy when the logits are viewed as negative energies.
Revised: The softmax function computes the distribution that minimizes free energy when the logits are viewed as negative energies.

Original: So when we use a softmax in our routing procedure to recompute assignment probabilities we are minimizing a free energy.
Revised: So when we use a softmax in our routing procedure to recompute assignment probabilities we are minimizing a free energy.

Original: When we reﬁt the Gaussian model of each capsule we are minimizing the same free energy provided the logits of the softmax are based on the same energies as are optimized when reﬁtting the Gaussians.
Revised: When we reﬁt the Gaussian model of each capsule we are minimizing the same free energy provided the logits of the softmax are based on the same energies as are optimized when reﬁtting the Gaussians.

Original: The energies we use are the negative log probabilities of the votes coming from a lower-level capsule under the Gaussian model of a higher-level capsule.
Revised: The energies we use are the negative log probabilities of the votes coming from a lower-level capsule under the Gaussian model of a higher-level capsule.

Original: These are not the correct energies for maximizing the log probability of the data (see the discussion of determinants below) but this does not matter for convergence so long as we use the same energies for ﬁtting the Gaussians and for revising the assignment probabilities.
Revised: These are not the correct energies for maximizing the log probability of the data (see the discussion of determinants below) but this does not matter for convergence so long as we use the same energies for ﬁtting the Gaussians and for revising the assignment probabilities.

Original: The objective function minimizes Eq. 4 which consists of:
Revised: The objective function minimizes Eq. 4 which consists of:

Original: • MDL cost − β a scaled by the probability of presence of capsules in layer L + 1 ( a j , j ∈ Ω L +1 ).
Revised: • MDL cost − β a scaled by the probability of presence of capsules in layer L + 1 ( a j , j ∈ Ω L +1 ).

Original: • Negative entropy of activations a j , j ∈ Ω L +1 .
Revised: • Negative entropy of activations a j , j ∈ Ω L +1 .

Original: • The expected energy minimized in M-step: sum of the weighted log probabilities ( cost hj ).
Revised: • The expected energy minimized in M-step: sum of the weighted log probabilities ( cost hj ).

Original: • Negative entropy of routing softmax assignments ( R ij ) scaled by the probability of presence of the datapoint ( a i ,
Revised: • Negative entropy of routing softmax assignments ( R ij ) scaled by the probability of presence of the datapoint ( a i ,

Original: i ∈
Revised: i ∈

Original: Ω L ).
Revised: Ω L ).

Original: (cid:88) j ∈ Ω L + a j ( − β a )+ a j ln ( a j )+(1 − a j ) ln
Revised: (cid:88) j ∈ Ω L + a j ( − β a )+ a j ln ( a j )+(1 − a j ) ln

Original: 1 − a j )+ (cid:88)
Revised: 1 − a j )+ (cid:88)

Original: h cost hj + β u (cid:88)
Revised: h cost hj + β u (cid:88)

Original: i ∈
Revised: i ∈

Original: Ω L r ij + (cid:88)
Revised: Ω L r ij + (cid:88)

Original: i ∈
Revised: i ∈

Original: Ω L a i ∗ r ij ∗ ln ( r ij ) (4)
Revised: Ω L a i ∗ r ij ∗ ln ( r ij ) (4)

Original: A. M ODIFICATION 1: M IXTURES OF TRANSFORMING G AUSSIANS
Revised: A. M ODIFICATION 1: M IXTURES OF TRANSFORMING G AUSSIANS

Original: In a standard mixture of Gaussians, each Gaussian only has a subset of the datapoints assigned to it but all of the Gaussians see the same data.
Revised: In a standard mixture of Gaussians, each Gaussian only has a subset of the datapoints assigned to it but all of the Gaussians see the same data.

Original: If we view the capsules in the higher-layer as the
Revised: If we view the capsules in the higher-layer as the

Original: Gaussians and the means of the active capsules in the lower-layer as the dataset, each Gaussian sees a dataset in which the datapoints have been transformed by transformation matrices and these matrices are different for different Gaussians.
Revised: Gaussians and the means of the active capsules in the lower-layer as the dataset, each Gaussian sees a dataset in which the datapoints have been transformed by transformation matrices and these matrices are different for different Gaussians.

Original: For one higher-level capsule, two transformed datapoints may be close together and for another higher-level capsule the same two datapoints may be transformed into points that are far apart.
Revised: For one higher-level capsule, two transformed datapoints may be close together and for another higher-level capsule the same two datapoints may be transformed into points that are far apart.

Original: Every Gaussian has a different view of the data.
Revised: Every Gaussian has a different view of the data.

Original: This is a far more effective way to break symmetry than simply initializing the Gaussians with different means and it generally leads to much faster convergence.
Revised: This is a far more effective way to break symmetry than simply initializing the Gaussians with different means and it generally leads to much faster convergence.

Original: If the ﬁtting procedure is allowed to modify the transformation matrices, there is a trivial solution in which the transformation matrices all collapse to zero and the transformed data points are all identical.
Revised: If the ﬁtting procedure is allowed to modify the transformation matrices, there is a trivial solution in which the transformation matrices all collapse to zero and the transformed data points are all identical.

Original: We avoid this problem by learning the transformation matrices discriminatively in an outer loop and we restrict the dynamic routing to modifying the means and variances of the Gaussians and the probabilities with which the datapoints are assigned to the Gaussians.
Revised: We avoid this problem by learning the transformation matrices discriminatively in an outer loop and we restrict the dynamic routing to modifying the means and variances of the Gaussians and the probabilities with which the datapoints are assigned to the Gaussians.

Original: There is a more subtle version of the collapse problem that arises when different transformation matrices have different determinants.
Revised: There is a more subtle version of the collapse problem that arises when different transformation matrices have different determinants.

Original: Suppose that the datapoints in a particular subset are transformed into a cluster of points in the pose space of higher-level capsule j and they are transformed into a different but equally tight cluster of points in the pose space of higher-level capsule k .
Revised: Suppose that the datapoints in a particular subset are transformed into a cluster of points in the pose space of higher-level capsule j and they are transformed into a different but equally tight cluster of points in the pose space of higher-level capsule k .

Original: It may seem that j and k provide equally good models of this subset of the datapoints, but this is not correct from a generative modeling perspective.
Revised: It may seem that j and k provide equally good models of this subset of the datapoints, but this is not correct from a generative modeling perspective.

Original: If the transformation matrices that map the datapoints into the pose space used by capsule j have bigger determinants, then j provides a better model.
Revised: If the transformation matrices that map the datapoints into the pose space used by capsule j have bigger determinants, then j provides a better model.

Original: This is because the probability density of a point in the pose space of a lower-level capsule gets diluted by the determinant of the relevant transformation matrix when it is mapped to the pose of a higherlevel capsule.
Revised: This is because the probability density of a point in the pose space of a lower-level capsule gets diluted by the determinant of the relevant transformation matrix when it is mapped to the pose of a higherlevel capsule.

Original: This would be a serious issue if we wanted to learn the transformation matrices by maximizing the probability of the observed datapoints, but we are learning the transformation matrices discriminatively so it does not matter.
Revised: This would be a serious issue if we wanted to learn the transformation matrices by maximizing the probability of the observed datapoints, but we are learning the transformation matrices discriminatively so it does not matter.

Original: It does, however, mean that when the dynamic routing maximizes the probability of the transformed datapoints it cannot be viewed as also maximizing the probability of the untransformed points.
Revised: It does, however, mean that when the dynamic routing maximizes the probability of the transformed datapoints it cannot be viewed as also maximizing the probability of the untransformed points.

Original: The obvious way to avoid the determinant issue is to take the mean in pose space of a higher-level capsule and to map this mean back into the pose space of each lower-level capsule using the inverses of the transformation matrices.
Revised: The obvious way to avoid the determinant issue is to take the mean in pose space of a higher-level capsule and to map this mean back into the pose space of each lower-level capsule using the inverses of the transformation matrices.

Original: A mean in a higher-level pose space will generally map to different points in the pose spaces of different lower-level capsules because the pose of a whole will generally make different predictions for the poses of the different parts of that whole.
Revised: A mean in a higher-level pose space will generally map to different points in the pose spaces of different lower-level capsules because the pose of a whole will generally make different predictions for the poses of the different parts of that whole.

Original: If we use the lowerlevel pose space when measuring the misﬁt between the actual pose of a lower-level capsule and the top-down prediction of that pose obtained by applying the inverse transformation matrix to the mean of the higher-level capsule, the collapse problem disappears and we can base decisions about routing on a fair comparison of how well two different top-down predictions ﬁt the actual pose of the lower-level capsule.
Revised: If we use the lowerlevel pose space when measuring the misﬁt between the actual pose of a lower-level capsule and the top-down prediction of that pose obtained by applying the inverse transformation matrix to the mean of the higher-level capsule, the collapse problem disappears and we can base decisions about routing on a fair comparison of how well two different top-down predictions ﬁt the actual pose of the lower-level capsule.

Original: We do not use this correct method for two reasons.
Revised: We do not use this correct method for two reasons.

Original: First, it involves inverting the transformation matrices.
Revised: First, it involves inverting the transformation matrices.

Original: Second, it requires a new multiplication by the inverse transformation matrices every time the higher-level mean is modiﬁed during the dynamic routing.
Revised: Second, it requires a new multiplication by the inverse transformation matrices every time the higher-level mean is modiﬁed during the dynamic routing.

Original: By measuring misﬁts in the higher-level pose space we avoid matrix inversions and, more importantly, we avoid having to multiply by the inverses in each iteration of the dynamic routing.
Revised: By measuring misﬁts in the higher-level pose space we avoid matrix inversions and, more importantly, we avoid having to multiply by the inverses in each iteration of the dynamic routing.

Original: This allows us to do many iterations of dynamic routing for the same computational cost as one forward propagation through the transformation matrices.
Revised: This allows us to do many iterations of dynamic routing for the same computational cost as one forward propagation through the transformation matrices.

Original: A. 
Revised: A.

Original: [Equation]
Revised: [Equation]

Original: In a standard mixture of Gaussians, the modiﬁable parameters are the means, (co)variances, and mixing proportions and the only thing that distinguishes different Gaussians is the values of these parameters.
Revised: In a standard mixture of Gaussians, the modiﬁable parameters are the means, (co)variances, and mixing proportions and the only thing that distinguishes different Gaussians is the values of these parameters.

Original: In a mixture of transforming Gaussians, however, Gaussians also differ in the transformation matrices they use.
Revised: In a mixture of transforming Gaussians, however, Gaussians also differ in the transformation matrices they use.

Original: If these transformation matrices are ﬁxed during the ﬁtting of the other parameters, it makes sense to have a large set of transforming Gaussians available but to only use the small subset of them that have appropriate transformation matrices for explaining the data at hand.
Revised: If these transformation matrices are ﬁxed during the ﬁtting of the other parameters, it makes sense to have a large set of transforming Gaussians available but to only use the small subset of them that have appropriate transformation matrices for explaining the data at hand.

Original: Fitting to a dataset will then involve deciding which of the transforming Gaussians should be “switched on”.
Revised: Fitting to a dataset will then involve deciding which of the transforming Gaussians should be “switched on”.

Original: We therefore give each transforming Gaussian an additional activation parameter which is its probability of being switched on for the current dataset.
Revised: We therefore give each transforming Gaussian an additional activation parameter which is its probability of being switched on for the current dataset.

Original: The activation parameters are not mixing proportions because they do not sum to 1 .
Revised: The activation parameters are not mixing proportions because they do not sum to 1 .

Original: To set the activation probability for a particular higher-level capsule, j , we compare the description lengths of two different ways of coding the poses of the activated lower-level capsules assigned to j by the routing, as described in section 3.
Revised: To set the activation probability for a particular higher-level capsule, j , we compare the description lengths of two different ways of coding the poses of the activated lower-level capsules assigned to j by the routing, as described in section 3.

Original: “Description length” is just another term for energy.
Revised: “Description length” is just another term for energy.

Original: The difference in the two description lengths (in nats) is put through a logistic function to determine the activation probability of capsule j .
Revised: The difference in the two description lengths (in nats) is put through a logistic function to determine the activation probability of capsule j .

Original: The logistic function computes the distribution ( p, 1 − p ) that minimizes free energy when the difference in the energies of the two alternatives is the argument of the logistic function.
Revised: The logistic function computes the distribution ( p, 1 − p ) that minimizes free energy when the difference in the energies of the two alternatives is the argument of the logistic function.

Original: The energies we use for determining the activation probabilities are the same energies as we use for ﬁtting the Gaussians and computing the assignment probabilities.
Revised: The energies we use for determining the activation probabilities are the same energies as we use for ﬁtting the Gaussians and computing the assignment probabilities.

Original: So all three steps minimize the same free energy but with respect to different parameters for each step.
Revised: So all three steps minimize the same free energy but with respect to different parameters for each step.

Original: In some of the explanations above we have implicitly assumed that the lower-level capsules have activities of 1 or 0 and the assignment probabilities computed during the dynamic routing are alsoor 0.
Revised: In some of the explanations above we have implicitly assumed that the lower-level capsules have activities of 1 or 0 and the assignment probabilities computed during the dynamic routing are alsoor 0.

Original: In fact, these numbers are both probabilities and we use the product of these two probabilities as a multiplier on both the baseline description length of each lower-level mean and its alternative description length obtained by making use of the Gaussian ﬁtted by a higher-level capsule.
Revised: In fact, these numbers are both probabilities and we use the product of these two probabilities as a multiplier on both the baseline description length of each lower-level mean and its alternative description length obtained by making use of the Gaussian ﬁtted by a higher-level capsule.

Original: B S UPPLEMENTARY FIGURES
Revised: B S UPPLEMENTARY FIGURES

Original: [Figure] [Figure]
Revised: [Figure] [Figure]

Original: [Figure] [Figure]
Revised: [Figure] [Figure]