# Affinity-Point Graph Convolutional Network for 3D Point Cloud Analysis
## 3 Method
### Neighbor Selection Method  
The most popular neighbor selection method is k-NN. The core idea of the k-NN method is to traverse all points and then to select the neighbor according to the distance. A spherical neighbor is divided by the azimuth angle, the pitch angle, and the radius. The essence of these methods is to select a neighbor based on the Euclidean distance.  
Considering a graph constructed from a given point cloud \(\mathbf{P}=\{p_{1},p_{2},\ldots,p_{N}\}\in\mathbf{R}^{3}\), which is described as a mesh \(G=(\mathbf{V},E)\), where \(\mathbf{V}=\{v_{1},v_{2},\ldots,v_{N}\}\) is a set of vertices and \(E\subseteq|\mathbf{V}|\times|\mathbf{V}|\) is a set of edges. \(N\) is the number of vertices (points). The neighbor set of vertex \(p_{i}\) is denoted as \(N(i)=\left\{p_{i},p_{i,1},\ldots,p_{i,|N(i)|}\right\}\), where \(|N(i)|\) is the number of the neighbors of \(p_{i}\). It is worth noticing that this set contains itself. Let \(\mathbf{h}=\{h_{1},h_{2},\ldots,h_{N}\}\) be the set of input vertex features and \(h_{i}\in\mathbf{R}^{F}\) be the feature of \(p_{i}\), where \(F\) is the feature dimension.  
The proposed method is designed to learn a function \(\phi:\mathbf{R}^{3}\rightarrow\mathbf{R}^{1}\), which is used to measure the affinity between neighbors and the center point. First, the distance between neighbors is obtained as \(p_{ij}^{*}=p_{i}^{*}-p_{j}\), where \(p_{i}^{*}\in\mathbf{P}\) is the center point and \(p_{j}\in\mathbf{P}\) represents its neighbor. Then, the specific values are used to evaluate the affinity between the neighbor and its center, as follows:  
\[\alpha(i,j)=\phi\Big{(}p_{ij}^{*},w_{i}\Big{)} \tag{1}\]  
where \(w_{i}\in\mathbf{R}^{3}\) is a trainable weight vector of \(p_{i}^{*}\). \(\alpha(i,j)\) representing the affinity of \(p_{j}\) to \(p_{i}^{*}\).  
In this paper, the operation \(\phi:\mathbf{R}^{3}\rightarrow\mathbf{R}^{1}\) is defined by multiplication, so that Equation (1) can be written as follows:  
\[\alpha(i,j)=p_{ij}^{*}\mathbf{\omega}v_{i}^{T} \tag{2}\]  
where \(\alpha(i,j)\) is a constant.  
In addition, in order to deal with a neighborhood with different scales, the affinity value is normalized across all of the neighbors of vertex \(p_{i}^{*}\), as follows:  
\[\alpha^{\prime}(i,j)=\frac{\exp(\alpha(i,j))}{\sum_{l\in N(i)}\exp(\alpha(i,l ))} \tag{3}\]  
Thus, an affinity ranking for vertex \(p_{i}^{*}\) can be obtained and the top \(k\) points iswhere \(h^{\prime}\) is the final output feature. \(\Gamma\left(\alpha^{\prime}(i,j),\alpha^{\prime}(j,i),h_{j}\right)\) is used to obtain local information with vertex feature \(h_{j}\) and structural information with affinity information \(\alpha^{\prime}(i,j)\) and \(\alpha^{\prime}(j,i)\). \(\alpha^{\prime}(i,j)\) represents the information between vertices \(p_{i}^{*}\) and \(p_{j}\), while \(\alpha^{\prime}(j,i)\) represents the information between vertices \(p_{j}^{*}\) and \(p_{i}\). In detail, \(\Gamma(\bullet)\) is implemented with a shared multi-layer perceptron (MLP). After the MLP layers, a feature fusion method \(A\) and a nonlinear activator \(\sigma\) follow. To maintain permutation invariance of the point set, \(A\) is set as a symmetric function (such as max pooling) and \(\Gamma(\bullet)\) is shared over each neighbor.