Estimating the 6D pose of a rigid object, i.e. rotation and translation in 3D space, is a core problem in computer vision and is crucial for applications such as robotic manipulation and augmented reality (AR). We focus on the setting of 6D object pose estimation of a rigid object from RGB images where the 3D textured mesh model of the object is known. Early attempts to this problem include direct pose regression using neural networks in an end-to-end fashion[posenet, posecnn]. Recently, 6D pose estimation methods that use object keypoints as intermediate representation have been successful and achieve leading performance on various benchmarks [6dof:kp, keypose, pvnet, hybridpose]. By definition, keypoints are 3D points attached to an object model and are usually a subset of the object surface points. In keypoint-based methods, 2D projections of 3D object keypoints or centers are first located on the image and then the 6D pose can be recovered from such 2D-3D correspondences by solving a Perspective-n-Point (PnP) problem.
There are mainly two types of methods for localizing 2D keypoints: heatmap-based [6dof:kp, keypose] and voting-based [posecnn, pvnet, hybridpose]
. Heatmap-based methods predict probability heatmaps of a keypoint over the image and localize it through an integral operation with the image coordinate map. Though heatmap-based method achieves strong performance on problems such as human pose estimation[integralnet], it is known to be vulnerable to occlusion, because the features of the occluder near the keypoint location can significantly affect the predicted probability map. In voting-based methods, the visible parts of the object hallucinate and vote for the 2D locations of the invisible keypoints [pvnet]. The training objectives of the votings are independent of the occluders. Therefore, compared to heatmap-based methods, voting-based methods are more robust to occlusions and achieve stronger performance on object pose estimation benchmarks where occlusions are important.
The voting schemes of existing methods are direction-based, i.e. every object pixel predicts the 2D direction to the keypoints and the keypoint hypotheses are the intersections of the direction votes [posecnn, pvnet, hybridpose]. Direction-based voting methods are built upon an important assumption: the angles between the voting directions are large enough so that the keypoint hypotheses can be reliably found by computing the intersections of voted directions. However, this assumption does not hold for long and thin objects where most voting directions concentrate in a small range and the keypoint hypotheses cannot be found or are extremely sensitive to noise in direction.
To address this problem, we propose a novel representation for object keypoint named Keypoint Distance Field (KDF). Defined as a 2D map of the same spatial size as the RGB image, the KDF is the function of 2D Euclidean distances to a certain projected keypoint. Given a perfect KDF, the 2D location of the projected keypoint can be easily recovered. Note that KDF is able to represent keypoints that are invisible or even outside the image field of view. Given keypoints, there are KDFs defined.
With the KDF representation, in this paper, we introduce a novel keypoint-based 6D object pose estimation framework named KDFNet. The core of KDFNet is a fully convolutional neural network (CNN) that predicts the KDFs of the object keypoints through per-pixel regression. To efficiently recover the 2D locations of the projected keypoints from the predicted KDFs, we propose a distance-based voting scheme. The voting hypotheses are generated through circle intersections where the centers of the circles are the pixel voters and the radii of the circles are the predicted keypoint distance values. The projected keypoints are the hypothesis with the maximum consensus of distance prediction among pixel voters. The core idea is illustrated in Figure 4.
We evaluated our framework on one of the most popular 6D pose estimation benchmarks, Occlusion LINEMOD [occlusion:linemod], and compare it against related baseline approaches. On Occlusion LINEMOD, our method achieves an accuracy of 50.3%, significantly outperforms related baselines such as [pvnet] and the current state-of-the-art HybridPose [hybridpose]. In addition, we evaluate the keypoint estimation of KDFNet on TOD [keypose], a stereo-RGB dataset for object pose estimation, and compare against previous stereo-RGB keypoint methods including KeyPose [keypose]. On TOD dataset, our method also achieves state-of-the-art results.
Ii Related Work
Learning Object Keypoints.
Many previous works have explored deep learning methods for localizing 3D keypoints of an object[keypointnet, 6dof:kp, keypose, pvn3d, kundu2018object] or a human [integralnet, monocular:3d:human:pose] from an RGB image to estimate their poses. The core of these methods is to predict the probability heatmap for the 2D keypoint and localizing it through integral with coordinate map. This idea is also used in 2D object detection where the corners of 2D object bounding boxes are formulated as keypoints and are localized through probability heatmaps [centernet, cornernet]. Besides heatmap, 2D direction field representation has also been proposed for localizing keypoints [pvnet, posecnn]. Our method also uses keypoint 2D location as a bridge to 6D object pose. We propose a novel distance field representation of keypoints and the associated voting scheme.
Object Pose Estimation The earliest attempts for object pose estimation used CNN to directly regress 6D pose [posenet, posecnn, ssd:6d]. Rough 2D bounding boxes of the objects may be predicted first to localize the objects more accurately [posecnn]. However, directly estimating the 6D poses using CNN assumes the neural network can implicitly remember the images of the object in all possible 6D poses which is difficult and prone to occlusion and background clutter. Instead, methods such as [dpod, pix2pose] leverages object coordinate maps as the dense 2D-3D correspondence representation for 6D pose. Compared to dense methods, keypoints are a more flexible representation and are used in [pvnet, hybridpose, keypose, kundu2018object]. Our pose estimation method is keypoint-based and predicts distance maps to localize the keypoints.
Voting for Understanding Objectness. Voting has also been used in 3D object detection where objectness can be inferred from voting consensus [votenet, implicit:shape:models, local:rgbd:patches, pose:hough:voting]. Specifically, direction-based voting methods have been adopted by previous works to robustly localize object centers [posecnn] or object keypoints [pvnet, pvn3d] on the images where the voting scores are based on the number of direction inliers. Instead of calculating the mean of predictions, voting-based methods find the maximum consensus among predictions. Therefore, voting-based methods are known to be robust to noise and occlusions. Our method also leverages voting for robustly detecting keypoints. Different from previous methods, our voting scheme is distance-based.
Given an RGB image of a rigid object, the goal of our framework is to predict the rotation and translation of the object. One of the popular approaches used in previous methods is pixel-wise direction voting of object keypoints. In this approach, every pixel votes for the direction to the keypoints and the intersections of the voted directions yield keypoint candidates whose voting scores are then evaluated based on the ratio of voter inliers. The candidate with the highest scores is decided as the keypoint estimate, and the object pose can be recovered from all keypoint estimates by solving PnP. The intuition behind this method is that given an object, the location of the invisible keypoint can be inferred from the visible parts [posecnn, pvnet, hybridpose]. Though this method is known to be robust to occlusion, it is built upon the assumption that the voting directions can reliably yield keypoint candidates regardless of the geometry of the objects. This assumption is not true. A counterexample is illustrated in Section IV and Figure 11.
To address this problem, we proposed a novel framework for estimating 6D pose of 3D objects from RGB input. The core of our method is a novel representation for object keypoint named Keypoint Distance Field (KDF). Inspired by recent works [keypose, pvnet], we first predict KDF to localize 2D keypoints through voting, then compute object 6D pose by solving a PnP problem. Figure 5 illustrates our framework. In this section, we will introduce the representation of KDF and describe the corresponding voting scheme. Then we present the implementation details of our approach.
Iii-a Representation of Keypoint Distance Field
Keypoint Distance Field (KDF) is specifically defined for each 2D projected keypoint. Suppose that the height and width of the input RGB image are and respectively and that the object has keypoints defined. KDF for the -th projected keypoint is a two-dimensional array of the same size as the input image. The element of the KDF located at stores the 2D Euclidean distance between the element and
Note that the KDF can still be defined even when is outside of the image. We use a fully convolutional neural network to regress . Inspired by previous work on 2D object detection [faster:rcnn], we adopt the following parameterization for regression
is a hyperparameter. The value of
is chosen to be close to the geometric mean of maximum and minimum possible distances so that the lower and upper bounds of parameterized distance are symmetric about zero, which is easier for the neural network to regress. For example, with aimage input, can be set to be .
Loss Function. To predict a set of continuous values, we can either regress the values directly or convert it to classification problems with multiple discretized values. Since the range of possible distance values is large even after parameterization, we choose to use direct regression for KDF prediction to avoid large discretization error. We use a standard soft loss function for parameterized distance
where is the ground truth KDF and is a threshold value. Note the loss function is the mean of all elements.
Objects with Symmetry. Symmetric objects can cause ambiguity among mutually equivalent rigid transforms. A group of keypoints placed on the object may thus be indistinguishable. Inspired by [keypose], to deal with objects with discrete symmetry, we define keypoints such that each keypoint is part of the symmetry permutation group and then apply a permutation loss during training. Suppose keypoints are mutually equivalent and the symmetric permutation of their indices is . Then the KDF regression loss under symmetric permutation is
where is the ground truth KDFs after applied with permutation on keypoints indices.
For objects with continuous symmetry such as cylinders, the symmetric permutation group is infinite. Therefore, Equation (4) cannot be used. Alternatively, we define keypoints on the rotation axis, and predicting at least two keypoints is sufficient for determining the 6D pose of the object with the ambiguity of the rotation.
Iii-B Distance-based Voting Scheme
In 2D heatmap-based methods [keypose, 6dof:kp], only the small image area that is close to a keypoint and has high probabilities can have an effect on the final predictions. Therefore, the prediction is affected by the pixels in that small area and suffers from occlusion. On the contrary, we apply a RANSAC-based voting scheme to take distance predictions from more pixels into account, so that occluded keypoints or even keypoints outside the image can be robustly handled.
The first step is to generate hypotheses of keypoint locations through sampling. For keypoint , we first determine the set of elements on the -th KDF map that will participate in the voting. From , we randomly sample three elements . For every , the set of hypothesized keypoint locations predicted by pixel is a circle whose center is and radius equals to — the predicted KDF value at . Given a perfect KDF, all three circles are supposed to intersect at one location. In practice, we find the best possible location(s) agreed by at least two of the three circles using the following procedure. Each pair of the three circles returns two intersections, but at most one intersection is valid as a keypoint hypothesis. The third circle is used to decide the valid hypothesis based on which intersection is closer to the third circle. Mathematically, suppose the two circles predicted by and intersects at and which can be obtained by jointly solving the following two quadratic equations
Then the valid hypothesis generated by and is given by
The other two valid hypotheses and can be obtained similarly. In total, there are three valid hypotheses generated. The above sampling and hypothesis generation is repeated for times to generate hypotheses for the -th keypoint. Next, all elements from vote for these hypotheses. The voting score of is the number of elements whose distance prediction error is within the threshold
where is the indicator function. Then the -th keypoint is determined as the hypothesis with the highest voting score , where . In this way, we find the location agreed by most of the voters within an error range. The above process is repeated for all KDFs to predict all keypoints.
Iii-C Overall Framework and Implementation
The KDF prediction CNN is instantiated by a segmentation network with ResNet [resnet]
as encoder backbone and additional up-convolution layers and skip connections as the decoder. The ResNet backbone is initialized with an ImageNet pre-trained model and then finetuned on 6D pose estimation datasets. During the training of KDF regression network, we randomly generate bounding box crops around the object to introduce more variations. Random photometric data augmentation is used during training. The overall architecture is illustrated in Figure5.
Though loss in Equation (3) is applied to all elements, to reduce regression error, one can choose to apply the loss only on elements within a certain keypoint distance during training if the image size is too large. In this case, the predicted KDF and the ground truth KDF will be different at large keypoint distances during inference, and a rough initial estimate of the object location from detection or segmentation is needed and in Equation (7) only includes elements within a certain keypoint distance. We will show in Section V-E that such training loss strategy does not affect the voting of the 2D keypoints. In practice, within a rough initial range of keypoint 2D location, we randomly sample 4,096 pixels as the set of voters . Among the voters, we sample 1,024 three tuples of pixels to generate 3,072 keypoint hypotheses whose voting scores are determined by all the sampled voters. Given the predicted 2D keypoint locations for each object, the 6D pose can be computed by solving a PnP problem.
|method||PVNet [pvnet]||KDFNet (ours)|
|GT mask keypoint occlusions||75.1||95.6|
Iv Direction-based vs. Distance-based Voting:
A Toy Experiment
The key difference between our method and previous works [posecnn, pvnet, hybridpose] is the predicted representation used in voting, i.e. keypoint distance vs. keypoint direction. In this section, we construct a toy synthetic dataset where previous direction-based voting methods fail in localizing the keypoints. Through this simple dataset, we show the drawbacks of direction-based representation and the advantage of our proposed KDF representation.
The object we use in the dataset is the 3D mesh model of a medical swab stick for COVID-19 testing, illustrated in Figure 11LABEL:sub@fig:toy:obj. The dataset consists of synthetically rendered images of the swab stick in various 6D poses. The translation part of the poses is the same for every image and the rotation part is uniformly randomly sampled. The backgrounds are all black. The dataset has 30,000 training and 3,000 validation images. The first column of Figure 11LABEL:sub@fig:toy:data illustrates two examples of images in our dataset. Semantic masks are provided for every image. We define four keypoints along the medical swab stick.
The baseline we compare our KDFNet against is PVNet [pvnet], a direction-based keypoint method. To fairly compare, we assume the voters of both PVNet and our KDFNet are the pixels that belong to the same masks. We test two types of masks: 1) ground truth object mask, and 2) ground truth object mask applied with additional small circular occlusions at keypoint locations. For evaluation metrics, we measure average 2D projection error which is described in more detail in Section V-B. The evaluation threshold is 1 pixel. The results are illustrated in Table I. Our model is not affected by occlusions on pixel voters. However, the performance of PVNet drops significantly.
We provide an explanation as follows. The geometry of the medical swab stick is long and thin, in which case most of the keypoint voting directions are close to being on the same line except for the small area around the keypoint. As illustrated in Figure 8, intersections cannot be robustly found from the voting directions if the small area near the keypoints is occluded. On the contrary, our model is based on distance voting and can still reliably locate the keypoints from circle intersection under occlusion. Through this extremely simple dataset, we show the drawbacks of direction-based keypoint voting methods and the advantage of distance-based voting adopted by our KDFNet.
In this section, we describe the details of our experiment settings in terms of the dataset, implementation details, and evaluation metrics. We then present the experiment results including ablation studies. Additionally, we provide visualizations on KDF and predicted 6D poses of objects.
V-a Dataset and Implementation
Occlusion LINEMOD [occlusion:linemod] is a standard benchmark for 6D object pose estimation. It contains videos of desktop objects in a cluttered scene. It is a subset of the LINEMOD dataset [linemod] that mainly focuses on objects under occlusion. Together with the annotated images, high-quality 3D scanned models of the objects are also provided. The test set of Occlusion LINEMOD consists of an image sequence of 1,214 frames, each annotated with the 6D poses of 8 objects from LINEMOD dataset. The data used to train our model are the same as [pvnet]: real images from LINEMOD and synthetically rendered images using the scanned 3D object models. We adopt the same object keypoint set as [pvnet], which are generated by Farthest Point Sampling (FPS) of the object 3D point set.
TOD Dataset [keypose] is a dataset for keypoint estimation of transparent objects. It consists of 48,000 stereo images from 600 stereo videos of 15 transparent objects placed on simple textured tabletops. Every stereo image is annotated with 3D keypoints. Together with the images, high-quality 3D scanned models of the objects are also provided. In TOD dataset, there are 2,880 training images and 320 test images for each object. Since the objects are transparent, we did not render additional synthetic images during training but adopt geometric and photometric data augmentations during training. Though TOD dataset was originally created for keypoint estimation only, it can still be used to train and evaluate the 6D poses of the objects. To this end, we select a subset of the objects in TOD that have at least three keypoints defined, i.e. the 7 mug categories, so that there are enough keypoints for recovering 6D poses.
V-B Evaluation Metrics
ADD(-S) Metrics. We use ADD [linemod] and ADD-S [posecnn] in our evaluation. When computing ADD distance, we transform the model point set by the predicted and the ground truth poses respectively, and compute the mean 3D Euclidean distance between the two point sets. Given an object with 3D model point set of , the ADD distance is calculated as
where and are the ground truth and estimated rotation, and and are the ground truth and estimated translation. For symmetric objects, ADD-S [posecnn] is used instead. When computing ADD-S distance, the 3D distances are calculated between the closest points
We use the following two evaluation metrics. (1) ADD(-S) accuracy: ADD(-S) accuracy measures the proportion of correct pose predictions. A pose prediction is considered correct if the ADD(-S) distance is less than the threshold of 10% of the model’s diameter. (2) ADD(-S) AUC: the area under ADD(-S) accuracy-threshold curve where the maximum threshold is set to 10cm. To compare with previous works, we use ADD(-S) accuracy on Occlusion LINEMOD datasets, and ADD accuracy and AUC on TOD dataset.
2D Projection Metric. When computing 2D projection error, we transform the model point set by the predicted and the ground truth poses respectively, and compute the mean 2D distance between the image projections of model points. Given the camera projection function , the 2D projection error is calculated as
A pose prediction is considered as correct if the distance is less than the threshold of 5 pixels. We use the 2D projection accuracy to evaluate Occlusion LINEMOD dataset.
V-C Experiment Results and Comparison
We train the KDFNet model on the LINEMOD dataset and rendered synthetic images. We evaluate and compare our model against previous baselines [posecnn, oberweger, pix2pose, pvnet, hybridpose] on Occlusion LINEMOD dataset. The results are illustrated in Table II. Among these baselines, the most relevant is PVNet [pvnet], a direction-based keypoint voting method which was also compared against in the toy experiment in Section IV. Our method achieves the best average ADD(-S) accuracy of 50.3% among all baselines while being the best on 5 of the 8 objects. In terms of 2D projection accuracy, our model also achieves the best among all baselines with an average of 66.5% while being the best on 6 of the 8 objects. In particular, our method outperforms PVNet [pvnet] by a margin of 9.5% in ADD(-S) accuracy and 5.6% in 2D projection accuracy, while also outperforming previous state-of-the-art HybridPose [hybridpose] by 2.8% in ADD(-S) accuracy.
Additionally, we train our model on TOD dataset [keypose] to predict the object keypoints in both stereo images and compare it against KeyPose [keypose]. KeyPose predicts object keypoints using heatmaps in both stereo images and the 6D object poses are computed by keypoint triangulation from stereo and pose fitting by solve an Orthogonal Procrustes problem. To evaluate KDFNet on TOD dataset, we follow the same procedure in [keypose] to recover 6D object pose from the predicted 2D keypoints in both stereo images. The results are illustrated in Table VI. Our method achieves state-of-the-art performance and surpasses [keypose]. Note that our leading margin is not as significant as on Occlusion LINEMOD dataset. An explanation is that TOD dataset did not include occlusion, therefore the proposed KDFNet cannot fully show its ability in dealing with occlusion compared to a heatmap-based method.
|metrics||ADD(-S) accuracy||2D projection|
|# of kps||8||12||16||20||8||12||16||20|
|metrics||ADD(-S) accuracy||2D projection|
|metrics||ADD(-S) accuracy||2D projection|
|# of hypotheses||48||192||768||3072||48||192||768||3072|
V-D Ablation Studies
We conduct ablation studies on Occlusion LINEMOD dataset in the following three aspects to help and validate the design choices of our architecture.
Number of Keypoints defined for the object. Intuitively, increase the number of keypoints will provide more information for the 2D-3D correspondences and yield better 6D pose estimates. In the ablation study, the value of varies from 8 to 20. The ablation results are illustrated in Table III. For most objects, the performance generally increases as the number of keypoints increases. The performance saturates at . which means localizing additional keypoints does not further improve the estimation of 2D-3D correspondence.
Pixel Threshold Value in Equation (7). We are interested in whether the pose estimation results are sensitive to the choice of . The ablation results are illustrated in Table IV. Though the threshold value varies in a wide range from 0.2 to 1.6, both metrics of ADD(-S) and 2D projection accuracy stay almost the same. This means the choice of the hyperparameter does not exert a significant effect on the performance as long as it is within a reasonable range, which shows the stability with respect to of our model during inference.
Number of Keypoint Hypothesis . We are interested in the number of keypoint hypotheses that are sufficient for finding good keypoint estimates. The ablation results are illustrated in Table V. Starting at , both metrics stay almost the same. This means with the good regression of KDF, a small number of keypoint hypotheses can cover keypoints that result in near-optimal predictions.
We visualize the KDF, voted 2D locations of the keypoints, and the estimated 6D poses on Occlusion LINEMOD dataset in Figure 48. The KDFs are visualized as a heatmap superimposed on the RGB images. Our framework can accurately localize keypoints even under occlusion. The predicted KDF and the ground truth KDF are different at large keypoint distances because we followed the training loss strategy in III-C and only train the model on elements that are within the keypoint distance of 64 pixels. As illustrated in Figure 48LABEL:sub@fig:viz:pred:1-LABEL:sub@fig:viz:pred:2, such difference does not affect the voting process and our framework can still localize keypoints on the image and estimate 6D poses accurately.
V-F Run Time Analysis.
We test KDFNet on a machine with an Intel i7-6850K 3.7GHz CPU, a GTX 1080 Ti GPU and Tensorflow 1.15. Given the input image of resolution ofand 192 keypoint hypotheses, the network inference and voting take 116ms and 24ms respectively, resulting in KDFNet running at 7 frames/sec.
In this work, we propose a novel method named KDFNet for 6D pose estimation from RGB images. Our method is based on the novel representation of Keypoint Distance Field (KDF). We also proposed a distance-based voting scheme to recover the 2D locations of keypoints from predicted distance fields in a RANSAC fashion. Experiment results show that KDFNet achieves state-of-the-art performance on Occlusion LINEMOD and TOD dataset.
As future work, we will investigate the extension of the proposed idea of distance field and voting to robotic perception problems in other scenarios or modalities, such as object detection [offboard:detection] in temporal [cpnet] and/or 3D data [meteornet, flownet3d].
This work is funded in part by JST AIP Acceleration, Grant Number JPMJCR20U1, Japan.
|method||KeyPose [keypose]||KDFNet (ours)|