# Refined Prior Guided Category-Level 6D Pose Estimation and Its Application on Robotic Grasping
## 3 Materials and Methods  
### Category Prior  
A category prior serves as the geometric representation of objects within a specific category. Randomly selecting the point cloud of a particular object to represent the entire category can negatively impact the results due to the issue of intra-class variation. For example, if the selected object significantly deviates from the average shape of the category, the training process of the deformation network may become unstable and difficult to converge. Computing an average point cloud for a given category is also challenging, as manually establishing pointwise correspondence between different point clouds is nearly impossible. However, it is important to note that objects within the same category typically share similar geometric features. For instance, a laptop generally consists of two flat rectangular prisms connected by a hinge, while a bottle is usually composed of two stacked cylinders of different sizes. Therefore, we still aim to use an average shape to represent a category. Following the approach of SPD [8], we utilize a neural network as an encoder to encode the point cloud of an object into an embedding and employ a simple neural network as a decoder to decode this embedding. The neural network is trained such that the decoded point cloud matches the input point cloud.  
Figure 1 illustrates the structure of the encoder and decoder used for the generation of category prior.  
We input the point cloud \(o_{i}^{j}\in\{o_{1}^{j},\dots,o_{n}^{j}\}\) of a given object into the encoder to obtain the embedding \(EM_{i}^{j}\) of the point cloud:  
\[EM_{i}^{j}=E(o_{i}^{j}), \tag{1}\]  
where \(E\) is the encoder, \(o_{i}^{j}\) is the point cloud of a given object, and \(EM_{i}^{j}\) is the embedding of the point cloud.  
We input \(EM_{i}^{j}\) into the decoder to obtain a new point cloud \(P_{i}^{j}\):  
\[P_{i}^{j}=D(EM_{i}^{j}), \tag{2}\]  
where \(p_{i}^{j}\) is the reconstructed point cloud, and \(D\) is the decoder.  
We aim for the input point cloud \(o_{i}^{j}\) and the reconstructed point cloud \(p_{i}^{j}\) to be as consistent as possible. To measure the distance between \(o_{i}^{j}\) and \(p_{i}^{j}\), we use the Chamfer Distance loss. Therefore, the loss function is defined as follows:  
\[CD(p_{i}^{j},o_{i}^{j})=\sum_{x\in p_{i}^{j}}\min_{y\in o_{i}^{j}}\|x-y\|_{2}^ {2}+\sum_{y\in o_{i}^{j}}\min_{x\in p_{i}^{j}}\|y-x\|_{2}^{2}. \tag{3}\]  
We input the point cloud \(o_{i}^{j}\in\{o_{1}^{j},\dots,o_{n}^{j}\}\) into the trained encoder to obtain \(EM_{i}^{j}\). This process is repeated for all point clouds belonging to the same category, yielding \(EM_{i}^{j},\dots,EM_{n}^{j}\)  
Figure 1: Illustration of structure of the encoder and decoder used for the generation of category prior.  
where \(n\) denotes the number of the objects in the category \(O^{j}\). Subsequently, these \(n\) embeddings are summed and averaged to obtain the category's average embedding \(EM^{j}\):  
\[EM^{j}=\frac{1}{n}\sum_{i}EM^{j}_{i}, \tag{4}\]  
where \(EM^{j}\) represents the average embedding of category \(O_{j}\).  
By using \(EM^{j}\) as the input to the trained decoder, we obtain the output \(p^{j}\), which can be regarded as the representation of the average shape for that category, i.e., the prior shape of the category. Figure 2 illustrates the derived category priors for bow, cup, bottle, laptop, camera, and can.