# 3D Mesh Model Classification with a Capsule Network
## 3 3D Mesh Capsule Networks
### Mesh Capsule Networks  
The traditional capsule network first uses the convolutional layer for feature extraction, and then gradually integrates it into deeper features through the capsule layer and uses them for classification results. However, because the result of feature extraction in the previous article is a shallow feature, certain spatial information is retained, and contains less semantic information, so after the feature extraction module, a capsule composition layer is added to map the equation parameter feature vector output to the primary capsule layer. For the convolutional feature layer, each patch is represented as a 10 polynomial of dimensional parameters. Through three one-dimensional convolutions, the number of channels is continuously increased to extract features of higher dimensions, and at the same time, each convolution uses a normalization layer to speed up the training and convergence of the network. As shown in Figure 3, the primary capsule layer has \(N\) capsules, and each capsule has a dimension of \(d\). The capsule composition layer maps feature vectors to the primary capsule layer \(P\in R^{N,d}\), The capsules of each primary capsule layer are expressed as:  
\[p_{i}\{i=1,\cdots,p_{i}\in R^{d}\} \tag{7}\]  
As a measure of the significant degree of a vector feature, the capsule network is normalized by a compression function. The capsule value is mapped to the [0,1] range, so that the length of the capsule vector can represent the probability of this feature, while preserving the eigenvalues of each dimension in the vector. \[\mathrm{v}=\mathrm{squash(s)}=\frac{\|s\|^{2}}{1+\|s\|^{2}}\frac{s}{\|s\|} \tag{8}\]  
\(\boldsymbol{v}\) is the output vector of the capsule, and S is the input vector of the capsule. Therefore, in order to calculate the output of each primary capsule, the activation function is applied. \[u_{i}=squash(p_{i}) \tag{9}\]  
Among them \(u_{i}\in R^{d}\) is the output of primary capsule. Because the three-dimensional mesh model data set is different from the two-dimensional image, the size and size of each model are different in the input dimension, so an improvement has been made in the capsule network is changing the posture matrix \(W_{ij}\) between the bottom-level capsule and the high-level capsule in the network to the posture matrix \(W_{j}\) with shared weights The training parameters are reduced, and because the pose matrix is changed from M \(\times\) N to M \(\times\) 1, the network can adapt to the input of three-dimensional models of different sizes. After all input vectors are mapped through the same pose matrix, the clustering results are output. Its expression is as follows:  
\[\widehat{u_{ij}}=W_{j}^{p}u_{i} \tag{10}\]  
\(u_{i}\) is the output vector of the primary capsule layer, which is the pose matrix in the primary capsule layer, trained by the backpropagation algorithm. The input of the Mesh capsule layer is the weighted sum of all capsule prediction vectors \(u_{ij}\) in the primary capsule layer. \[s_{j}=\sum_{i}c_{ij}u_{ij} \tag{11}\]  
where \(c_{ij}\) is the coupling coefficient that determines the similarity between \(u_{j}\) and \(s_{j}\) in the dynamic routing algorithm. \[c_{ij}=\frac{\exp(b_{ij})}{\sum_{k}\exp(b_{ik})} \tag{12}\]The initial logarithm \(b_{ij}\) is the log prior probability that capsule \(i\) should be coupled with capsule \(j\). The dynamic routing algorithm of MeshCaps is the same as the routing algorithm in the original formula. MeshCaps is only applied to three-dimensional mesh classification, so the reconstruction module and reconstruction loss in the traditional capsule network are discarded in the training and prediction process, which reduces the complexity of the model and helps improve the training efficiency of the model.