# An Efficient Bidirectional Point Pyramid Attention Network for 3D Point Cloud Completion
## 3 Methods
### Mixed Attention Module  
Because of its ability to select features, the attention mechanism has been applied in a series of tasks, such as machine translation, object recognition, visual question answering and so on [21; 22]. Recent studies showed that the attention mechanism has been widely used in 3D shape completion. [PERSON] et al. [23] proposed a skip-attention network (SA-NET) for point cloud completion tasks, and designed a skipping-attention mechanism to effectively utilize the local structural details of a point cloud. [PERSON] et al. [24] presented a novel model called PoinTr for point cloud completion that fully uses an encoder-decoder architecture with the adapted transformer blocks. Inspired by squeeze-and-excitation networks (SENets) [25] that adaptively recalibrate channelwise feature responses, we adopted channelwise and pointwise attention in our encoder-decoder architecture to conquer the problem of point cloud completion. The structure of the mixed attention module is illustrated in Figure 3.  
Channelwise attention: Given a point feature matrix \(\mathrm{z}\) with the size of \(\mathrm{C}\times\mathrm{L}\), we applied channelwise average pooling to obtain a global feature vector with the size of \(\mathrm{C}\times\mathrm{1}\). Then, we operated two fully connected (FC) layers around ReLU activation units. The layers were able to fully capture channelwise dependencies.  
\[\mathrm{CA}=\mathrm{F}(\mathrm{z},\mathrm{W})=\mathrm{W}_{2}\delta(\mathrm{W}_ {1}\mathrm{pool}(\mathrm{z})) \tag{1}\]  
where the pool denotes the global average pooling, \(\mathrm{W}_{1}\in\mathbb{R}^{\mathrm{C}/16\times\mathrm{C}}\) and \(\mathrm{W}_{2}\in\mathbb{R}^{\mathrm{C}\times\mathrm{C}/16}\) denote parameters in the two FC layers, and \(\delta\) refers to the ReLU activation units. \(\mathrm{CA}\in\mathbb{R}^{\mathrm{C}\times\mathrm{1}}\) is the channelwise attention of \(\mathrm{z}\).  
Pointwise attention: Similar to the strategy for predicting the channelwise attention for a point feature matrix \(\mathrm{z}\in\mathbb{R}^{\mathrm{C}\times\mathrm{L}}\), a pointwise average pooling operation was performed to aggregate the pointwise feature vector with the size of \(\mathrm{1}\times\mathrm{L}\). Then, we computed \(\mathrm{PA}=\mathrm{F}^{\prime}\big{(}\mathrm{z},\mathrm{W}^{\prime}\big{)}= \mathrm{W}^{\prime}_{2}\delta\big{(}\mathrm{W}^{\prime}_{1}\mathrm{pool}( \mathrm{z})\big{)}\). The weight parameters of two fully connected layers are \(\mathrm{W}^{\prime}_{1}\in\mathbb{R}^{\mathrm{L}/16\times\mathrm{L}}\) and \(\mathrm{W}^{\prime}_{2}\in\mathbb{R}^{\mathrm{L}\times\mathrm{L}/16}\). \(\mathrm{PA}\in\mathbb{R}^{1\times\mathrm{L}}\) is the pointwise attention of \(\mathrm{z}\).  
Figure 3: (a) Diagram and (b) schema of the mixed attention module.  
Lastly, the output feature vector \(\widetilde{\mathbf{z}}\) of the mixed attention module was obtained by weighting the feature z with CA and PA as follows. Using the sigmoid function \(\sigma\), the attention matrix was normalized to [0,1].  
\[\widetilde{\mathbf{z}}=\sigma(\text{CA}\times\text{PA})\times\mathbf{z}+\mathbf{z} \tag{2}\]  
Through the operations above, the feature representation \(\widetilde{\mathbf{z}}\) could learn discrimination and robust representation for point clouds.