# 3D Mesh Model Classification with a Capsule Network
## 3 3D Mesh Capsule Networks
### Local Shape Feature Extraction  
We try to apply a more concise and light weight feature extraction method to the network model. Given a three-dimensional deformation target mesh model \(M\), The local surface window of the 3D mesh model is defined as taking the vertex of the mesh model as the center of the window, using breadth-first search to get the front \(K\)-\(1\) Neighbor vertices, the selected vertex and the edge between the vertices form a connected local mesh surface, that is, a local surface window \(M_{win}(v_{i})=\left\{V_{win}^{v_{i}},E_{win}^{v_{i}}\right\}\), where:  
\[V_{win}^{v}=\left\{v_{j}\big{|}\left(x_{j},y_{j},z_{j}\right)\right\},j=1,2, \ldots K \tag{1}\]  
Figure 3: Network framework. \[E_{win}=\{(v_{a},v_{b})|v_{a},v_{b}eV_{win}\} \tag{2}\]  
\(K\) is the size of the convolution template window. For the selection of the k value, multiple sets of experiments have been carried out, and the best k value is 152, that is, the size of the convolution window is 152. In order to avoid the influence of rigid transformation and nonrigid transformation, a local coordinate system is established in the window and the absolute coordinates of the vertices in the window are converted to the coordinate representation in the local coordinate system. Considering that the local surface in the window is relatively simple, the local coordinates in the window the system uses high-order polynomial equations to describe its shape, such as Formula (3):  
\[M_{win}=(v|F(v_{x},v_{y},v_{z},v_{d}|\overrightarrow{\theta})=0) \tag{3}\]  
where \(F\) is a continuous function used to describe the shape of the local grid window. \(\overrightarrow{\theta}\) is the parameter representation function of the grid. \(v_{x}\), \(v_{y}\) and \(v_{z}\) are the coordinates of the vertices in the window in the local coordinate system. During the experiment, it was found that when the local window size is set very small, the grid shape is basically the same, and when \(K\) increases, the grid in the window becomes more complicated. Only the local m coordinate information of the vertex, \(v_{x}\), \(v_{y}\), \(v_{z}\) is not enough to describe the grid shape. Therefore, we want to introduce the geodesic distance to improve the expression of a polynomial function. However, the calculation of the geodesic distance is a time-consuming operation, which affects the performance of the entire network, so the block distance \(v_{d}\) is used as an approximate expression of the geodesic distance. \[v_{d}=|x-x_{m}|+|y-y_{m}|+|z-z_{m}| \tag{4}\]  
Among them, the block distance of a point \((x,y,z)\) in the convolution window is expressed as the block distance between the point and the center point \((x_{m},y_{m},z_{m})\) of the surface unit. For a grid window, assuming the relative coordinates of the vertices in the window \(v_{c}=\left(v_{x},v_{y},v_{z},v_{d}\right)\), the window fitting function is as Formula (5):  
\[ \begin{array}{rl}F(v_{c}|\overrightarrow{\theta})=z&-\left(\theta_{0}+ \theta_{1}*x+\theta_{2}*y+\theta_{3}*d\right.\\ &+\theta_{4}*x^{2}+\theta_{5}*y^{2}+\theta_{6}*d^{2}\\ &+\theta_{7}*xy+\theta_{8}*xd+\theta_{9}*yd)\end{array}  \tag{5}\]  
The window fitting function \(F(v^{c}|\overrightarrow{\theta})=0\), which is a continuous function used to describe the shape of the local window. Encode the local triangle set information, describe the local shape of the patch, and capture the shape transformation of the grid window. \(\overrightarrow{\theta}\) is the parameter representation of the grid. Where \(x\), \(y\), \(z\), \(d\) represent \(v_{x}\), \(v_{y}\), \(v_{z}\), \(v_{d}\), \(v_{z}\) is the \(z\) in the formula, which is the \(z\)-axis coordinate of the point on the grid, which is used to measure the fitting error. The entire function F after fitting can be used as an approximate representation of the local grid. The surface fitting results are shown in Figure 4. The blue scatter plot represents the distribution of vertices in the grid window, and the red surface represents the result of fitting using a polynomial function.