# Variable Rate Point Cloud Attribute Compression with Non-Local Attention Optimization
## 3 Point Cloud Attribute Variational Autoencoder
### General Framework  
Figure 1 illustrates the detailed proposed VAE architecture. It is established on a VAE structure [23], with non-local attention modules in main encoder-decoder pairs. As the geometric information has been assumed decoded, the coordinates \(\mathbf{\bar{C}}^{in}\) and \(\mathbf{\bar{C}}^{out}\) in Equation (2) have been already known in encoder and decoder. \(X\) and \(\bar{X}\) denote the feature part of the sparse tensor, which are the input attribute and the reconstructed output color attribute of the point cloud, respectively. Main encoder with quantization \(Q\) is used to generate quantized latent features \(\hat{Y}\) and main decoder decodes the features into the reconstructed point cloud. The main encoder consists of Sparse Convolutional (SConv) layers, followed Rectified Linear Unit (ReLU) activation layers and NLAMs. Note that the first convolutional layer has a kernel size of \(5\times 5\times 5\) to cover more occupied voxels and the left SConv layers have the kernel size of \(3\times 3\times 3\) for deep features aggregation. The first NLAM is placed at a relatively shallow layer to capture the correlations in lower-level feature map and the second NLAM is placed at the bottleneck layer to intelligently allocate more bits in more informative areas. The structure of the main decoder is the mirror inverse of that of the main encoder. The hyper encoder generates much smaller side information as hyperpriors \(\hat{Z}\). \(\hat{Z}\) are then processed through the hyper decoder to generate the mean and location parameters \((\mu,\sigma)\) of assumed conditional Laplacian distribution of \(\hat{Y}\). Quantization and entropy coding are used to connect the encoder and decoder. The uniform noise approximation [1] and rounding are used in the training and testing phases, respectively. Entropy coding and decoding are used to compress and decompress the quantized hyperpriors and quantized latent features, respectively. Ideally, we want to use as few bits as possible to represent \(\hat{Y}\) and \(\hat{Z}\) while minimizing the distortion measurement between \(X\) and \(\hat{X}\). More specifically, we wish to learn appropriate parameters of main encoder and decoder, and conditional entropy coding for better compression efficiency by minimizing the Lagrangian cost \(J=R_{\hat{Y}}+R_{\hat{Z}}+\lambda\cdot d\big{(}X,\hat{X}\big{)}\). Distortion \(d(,)\) between \(X\) and \(\hat{X}\) is measured by the expectation of mean squared error (MSE) in this study. \(\lambda\) is the factor that determines the rate-distortion trade-off. Bitrate \(R_{\hat{Y}}\) and \(R_{\hat{Z}}\) is estimated using the expected entropy of latent and hyperprior features. A fully factorized density model [1] is used to model the bit rate of \(\hat{Z}\),  
\[p_{\hat{Z}|\psi}(\hat{Z}\mid\psi)=\prod_{i}\bigg{(}p_{\hat{Z}_{i}|\psi^{(i)}} \Big{(}\psi^{(i)}\Big{)}*\mathcal{U}\bigg{(}-\frac{1}{2},\frac{1}{2}\bigg{)} \bigg{)}\big{)}(\hat{Z}_{i}) \tag{3}\]  
where the vectors \(\psi^{(i)}\) represent the parameters of each univariate distribution \(p_{\hat{Z}^{\prime}|\psi^{(i)}}\) (all these parameters are collectively denoted as \(\psi\)) and \(\mathcal{U}\bigg{(}-\frac{1}{2},\frac{1}{2}\bigg{)}\) means uniform distribution ranging from \(-\frac{1}{2}\) to \(\frac{1}{2}\). Conditioned on \(\hat{Z}\), a conditional Laplacian distribution is used to estimate the probability density function (p.d.f.) of \(\hat{Y}\),  
\[p_{\hat{Y}|\hat{Z}}(\hat{Y}\mid\hat{Z})=\prod_{i}\bigg{(}\mathcal{L}(\mu_{i}, \sigma_{i})*\mathcal{U}\bigg{(}-\frac{1}{2},\frac{1}{2}\bigg{)}\bigg{)}(\hat{ Y}_{i}) \tag{4}\]  
where the estimated mean and location parameters \((\mu_{i},\sigma_{i})\) of each element \(\hat{Y}_{i}\) are derived from \(\hat{Z}\).