COBRA -- COnfidence score Based on shape Regression Analysis for method-independent quality assessment of object pose estimation from single images
Panagiotis Sapoutzoglou Georgios Giapitzakis Tzintanos George Terzakis Maria Pateraki






P. Sapoutzoglou et al.
COBRA

National Technical University of Athens, Athens, Greece 

{psapoutzoglou,ggiapitzakis,mpateraki}@mail.ntua.gr Institute of Communication & Computer Systems, Athens, Greece 
 
 george.terzakis@iccs.gr

COBRA - COnfidence score Based on shape Regression Analysis for method-independent quality assessment of object pose estimation from single images
    Panagiotis Sapoutzoglou1,2 Georgios Giapitzakis Tzintanos1 George Terzakis2 Maria Pateraki1,2
    April 29, 2024
==================================================================================================================================================




We present a generic algorithm for scoring pose estimation methods that rely on single image semantic analysis. The algorithm employs a lightweight putative shape representation using a combination of multiple Gaussian Processes. Each Gaussian Process (GP) yields distance normal distributions from multiple reference points in the object's coordinate system to its surface, thus providing a geometric evaluation framework for scoring predicted poses. Our confidence measure comprises the average mixture probability of pixel back-projections onto the shape template. In the reported experiments, we compare the accuracy of our GP based representation of objects versus the actual geometric models and demonstrate the ability of our method to capture the influence of outliers as opposed to the corresponding intrinsic measures that ship with the segmentation and pose estimation methods.







§ INTRODUCTION


The recovery of object pose from single images is a problem that arises in a variety of applications in robotics and computer vision and constitutes a topic of ongoing scrutiny. In the case of rigid objects, it allows the estimation of the object's 3D location and 3D orientation in the coordinate system of the camera, also referred to as the 6D object pose.With the recent developments in machine learning, neural network based solutions have demonstrated significant efficiency, particularly in terms of detecting the 6D pose of objects from a single image with respect to some latent representation of the corresponding templates, e.g. <cit.>.
Several works provide comprehensive reviews of such methods (e.g. <cit.>),  usually categorizing 6D object pose estimation according to the prior information, the number of views and the type of methods exploited. Drawing from the outcomes of the BOP Challenges <cit.>, it is notable that while deep learning methods exhibited inferior performance compared to classical methods in 2018, nowadays they dominate the field. Significant accuracy improvement was demonstrated between 2020 and 2023, with the average recall of the best performing method to increase from 0.69 in 2020 to 0.85 in 2023. Methods have evolved to exploit RGB and RGBD data, both appearance and geometric information, tackling the problem of multiple object instances in the scene, objects with weak textures and symmetries <cit.> and by generalizing to estimate the pose of unseen objects, addressing category-level 6d pose estimation in a fully <cit.> or a semi-supervised manner <cit.>. The evaluation of 6D pose estimation methods typically resides on an established offline procedure exploiting ground truth benchmark data and state of the art metrics. Though certain cases necessitate quantifying the uncertainty of the estimated 6D pose at runtime. The most prominent examples stem from robot grasping and manipulation tasks, in which perception-action loops are exploited.
The primary challenge lies in delivering an online confidence score for the estimated 6D object pose before initiating the robot action, thus preemptively filtering out less accurate poses that may result in unsuccessful grasps.
In this paper we address the aforementioned challenge for object pose methods estimated from a single image and with available 3D object models. An alternative lightweight 3D shape representation for the object is derived, modeled via mixtures of Gaussian Processes priors, and which is used to assess the likelihood of estimated 3D object points belonging to the surface of the object and derive a confidence metric during online execution. 




§ CONTRIBUTIONS

We introduce a consistent, method-independent confidence measure for pose estimates relying on shape discrepancy in the local object coordinate frame. The contribution of our method is two-fold.

    
  * It provides a consistent and unbiased measure of quality for the pose estimate by assessing the consistency of the back-projected image of the object against an accurate shape template.
    
  * It leverages multiple GP based priors to obtain “lightweight” shape representations from sparse samples of the target (object) surface with sufficient accuracy to accommodate. 



§ RELATED WORK


Related work focuses on the following areas: shape representation, 6D object pose evaluation and uncertainty estimation.



 §.§ Shape representation


The representation of 3D shapes is a fundamental problem for various applications in 3D computer vision, prompting the exploration of different methodologies to encode object geometry. Explicit 3D representations, such as point clouds, meshes, and voxels, offer the ability to represent complex and arbitrary object shapes and shape details with simplicity but with increasing surface complexity the amount of data (i.e, points or vertices/faces) and the computation cost increases. While meshes, in comparison to points, can capture topology, their quality is contingent upon factors like resolution and the underlying topology.
Implicit functions, encode shape priors and provide a continuous representation of shape, adept at handling complex topologies. With the advances in deep neural networks, learned shape representations have excelled and Farshian et al. <cit.> provide an extensive overview of related methods to date. These methods represent shape as either a learned feature vector, coupled with a trained decoder related to explicit representations such as point clouds <cit.>, meshes <cit.>, voxels 
 <cit.>, or represent shape with an implicit surface function.
Deep implicit functions utilize an input observation as a latent vector and train a neural network to estimate binary occupancy <cit.> or a signed-distance function <cit.> at a given query location in 3D space, or model radiance/appearance properties of an object as seen in NeRF-based approaches <cit.>. Deep implicit functions have gained popularity and significantly advanced the state of the art in 3D shape generation <cit.>, 3D shape completion <cit.>, 4D reconstruction <cit.>, and 3D shape correspondence <cit.>. Several extensions have been proposed, including learning separate implicit functions for shape parts <cit.> or integrating a deformation model for shape registration <cit.>.
While these methods generally provide compact shape representations with low dimensional latent vectors they encounter difficulties in representing the entirety of shapes, reconstructing details and generalizing to novel shape classes as often the implicit representation is hard to obtain due to the presence of noise and incomplete data points, while it is necessary to convert points and meshes to implicit distance fields. 

On the other hand explicit representations complicate their deployment in deep learning due to their irregular (i.e. meshes) or even unordered (i.e. point clouds) nature of data types and existing works are either restricted to small deviations from a 3D template or graph or small number of vertices/ points or simple convex shapes restricted to limited output quality <cit.>. 
Gaussian processes (GP) <cit.> is a promising modeling framework to encode information about object shape<cit.>. Objects can be represented as collections of points in space, which can be used as inputs to the GP model. These allow the specification of a prior distribution which can capture beliefs about the type of shapes, shape predictions and related uncertainty estimates of those predictions.  



 §.§ 6D pose evaluation and uncertainty estimation


The standard approach adopted in the literature  for evaluating solely the performance of 6D pose estimation methods is performed offline and relies on available benchmark ground truth data and state of the art metrics such as VSD, MSSD, MSPD, ADD <cit.> or 3-D IoU <cit.>.  When 6D pose estimation is exploited in actionable tasks, i.e. perception-to-action robotic tasks, such as grasping, the grasps success rates are commonly computed. The object(s) are randomly placed and the grasping task is performed a number of times to measure the number of successful grasps. Though when it comes to prune less accurate poses that may lead to unsuccessful grasping during runtime and prior to any robot action a confidence measure for the pose estimation can serve this purpose. Related works fall under the broader research area of uncertainty quantification in robotics, especially the specific type of predictive uncertainty which reflects the risk of certain pose estimation. The majority of works along this research strand aim to endow deep pose estimation models with the capability to directly assess and quantify the uncertainty of their own predictions by directly training the model to output a confidence score <cit.>. Though this set of approaches bears the challenge that the uncertainty is difficult to evaluate as the performance varies with respect to different input images, as there may be a large gap to the training data and ground truth data are unknown, therefore difficult to quantify. In principle they have the drawback of exhibiting limited robustness <cit.>, bias to overfitting yielding overconfident estimates <cit.> and a deviation with the true uncertainty is often observable, while they tend to be computationally expensive. The method of <cit.> exploits ensemble methods <cit.>, which in general tend to be more lightweight in terms of inference time. In <cit.> the problem is approached by an ensemble of different models with translational/rotational/ADD disagreement metrics and computing their average disagreement against one another as the uncertainty quantification. Although the method doesn’t require any modification of the training procedure or the model input, still inference time increases with the number of the different models used.  




§ METHOD



The core idea of our method is to use putative 3D representations of objects (henceforth referred to as “templates”) that we are anticipating our classifier to detect and subsequently predict their pose. These classifiers typically ship with measures of self-assessed confidence that provide some indication of quality for the estimated pose. However, these quality measures bear the inherent bias of the self-assessment process and can therefore be misleading for the back-end application. To eliminate this bias, we resort to the use of lightweight object templates to validate the geometric consistency of the estimated object pose. Put differently, we utilize the pose estimate to generate a partial 3D reconstruction of the detected object and establish a confidence score by assessing the deviations of the reconstructed points from the template surface.



 §.§ Shape representation with Gaussian processes



As discussed earlier in sec. <ref> 3D objects can be represented with pointclouds or meshes. With the former, large numbers of points are required, usually in the order of 100,000 or more, whereas the latter are significantly more lightweight, but with occasional loss of detail in surface regions represented by large polygons.
The shortcomings of these representations with respect to the task at hand, i.e., the comparison between the reconstructed object against a template shape pertain to storage and time complexity that such a comparison entails. In particular, where point clouds are concerned, to evaluate the distance of a given point from the surface would require nearest neighbor queries for a large number of points, which, in turn, requires a large storage (e.g., a KD-tree) of tightly spaced points. Similarly, for mesh representations, such a query would require the determination of the polygon nearest to the given point, thereby incurring substantial spatial search.



[][t]
    
    < g r a p h i c s >

    Parameterizing surface points P (green) as direction and distance (blue rays) w.r.t a reference point C (red) 
    





  §.§.§ Encoding 3D points with direction and distance.

To circumvent the aforementioned shortcomings, we resort to a functional representation of shape by means of a directional encoding from specially chosen reference points in the object's local coordinate frame. Consider a reference point C in the object's local frame and a given point P on the object's surface. We parametrize P-C in terms of its distance and direction from C (See Fig. <ref>) as follows:

    P-C(ϕ, θ,d )

where ϕ, θ are the spherical coordinates of P-C and d=‖P-C‖. Thus, if u(ϕ, θ)  ∈ℝ^3 is the bearing vector defined by the spherical coordinates ϕ and θ, we may obtain P as,

    P=d u(ϕ, θ) + C

The distance-direction parametrization of eqs. (<ref>), (<ref>), bears a two-fold benefit. For a given reference point, C, in the interior of an object represented by a closed surface, we may represent all or part of the surface as a collection of distances along every possible direction from C. Moreover, learning distances from directions is suitable for regression models.



  §.§.§ Predicting distance to object surface with Gaussian processes.


Consider an object with an exterior surface that comprises points reachable by means of ray-casting from a point, C, in the interior of the object. To fit this surface to a function, we model the random variables of distances from C to the surface along a given direction u(ϕ, θ), as a Gaussian process,

    d ∼𝒢𝒫(0, k),   s.t.   k : ([0, π]×[0, 2π])^2→ℝ

where k is the so-called covariance function mapping any two direction parameter vectors ψ=(ϕ, θ) and ψ^'=(ϕ^', θ^') to a real number, such that the Gram matrix K=[k(ψ_i, ψ_j)] is positive semi-definite (PSD) for any finite collection {ψ_1, …, ψ_n } of direction parameter vectors <cit.>. Different choices for the kernel k give rise to different Gaussian processes. 
The Rational Quadratic (RQ) kernel, known for its capacity to regulate the extent of multi-scale behavior, stands out as a more adaptive option when compared to the Radial Basis Function (RBF) kernel <cit.> and was found to work better in practice in our application: 


    k_RQ(ψ_i, ψ_j) = (1+d_ij^2/2α l^2)^-α,

where l > 0, α > 0 are hyperparameters and d_ij denotes the Euclidean distance, ‖ψ_i-ψ_j‖, between the orientation parameters. Perhaps a more suitable choice for d_ij would be the geodesic distance between the bearing vectors u(ψ_i), u(ψ_j), but that would lead to a non-PSD kernel function as shown in <cit.>, to which a  close valid alternative  would be the Euclidean distance, ‖u(ψ_i)- u(ψ_j)‖. 

For a sufficiently sized training set of n 3D points on the surface of the object, we may train the GP model to explicitly predict surface shape in terms of distance for given query directions from the point C.
Thus, via the GP prior, for a query direction parameter vector x∈ℝ^2, we can obtain a conditional distribution over the distance to the surface along the given direction, and a collection of surface (training) data, (Ψ, d)=( [ψ_1,…, ψ_M], [d_1, …, d_M]):

    q(d| x, C;(Ψ, d)) ∼𝒩(μ_d|x, σ^2_d|x)

where, 

    μ_d|x=K(x, Ψ)K(Ψ, Ψ)^-1d,   σ^2_d|x=k(x, x)-K(x, Ψ)K(Ψ, Ψ)^-1K(Ψ, x).

To discharge notation, we will henceforth omit the training data from the likelihood expression, q(d| x, C; (Ψ, d)), and simply use,  q(d| x, C) 





  §.§.§ Surface coverage with mixtures of distance likelihoods


It becomes evident that for objects with more complex shapes, a single GP model will not suffice, because there would exist rays emanating from the reference point that intercept the exterior surface of the object in multiple points (e.g., Fig. <ref>). To cope with this issue, we introduce multiple reference points which we distribute preferably in the interior of the object in a way that achieves coverage of the entire surface. Interior reference points ensure that every direction corresponds to a valid training sample. 
A good strategy of obtaining such reference points would be distance-based clustering such as k-means 
  <cit.> 
or expectation maximization (EM) <cit.>, because it will induce a surface partition that will comprise loosely convex patches that are fully reachable from the respective cluster centers via ray-casting.
For each of these reference points, a new GP prior is introduced, therefore the complete object surface is modeled by training multiple predictors of local surface patches with reference points at the cluster centers. 

Formally, the idea is to model the likelihood of a 3D point P belonging to the surface of the object o as a mixture of normal distributions derived from the corresponding GP priors with reference points at the cluster centers C_k,

    p(P|o)=∑_k=1^K p(P|C_k; o)π(C_k; o)

where we choose the likelihood p(P|C_k; o) to be the GP prior based normal distribution of eq. (<ref>), i.e.,

    p(P|C_k; o)=q(‖P-C_k‖ | x_P, C_k),

and x_P is the direction parameter vector of P with respect to the reference point C_k. Furthermore, the weighting probability π(C_k; o) is modeled as a softmax ratio based on the distance of P from the reference point C_k:

    π(C_k; o)=exp(-(P-C_k)^TQ_k(P-C_k))/∑_l=1^K exp(-(P-C_l)^TQ_l(P-C_l))

where Q_k is a covariance measure of the local space around the k-th cluster center (reference point) C_k [Provided by the EM algorithm, whereas in the case of k-means we use the identity.]. In practice, this means that we reconstruct a query point P by choosing the nearest center. This however can give rise to borderline errors in the assignment of query points to reference points. To cope with this problem, we impose inter-cluster overlap in the training (Fig. <ref>).







  §.§.§ Distance likelihood based on test data


The primary goal of our templating technique with multiple GP priors is to obtain a fairly accurate shape representation of the object in question in order to use it as a putative surface to which we compare the back-projections of pixels in the image of the detected object with the estimated pose. Thus, the accuracy of the representation is crucial for the validity of the confidence score. 

For our confidence computations, we choose in practice to employ a modified distance likelihood distribution,

    q̂(d| x, C;(Ψ, d)) ∼𝒩(μ_d|x, σ̂^2_d|x),

where, as in eq. (<ref>) the mean μ_d|x is the GP prediction. However, noticing that the GP model tends to underestimate the variance of certain data points, we opted to replace σ^2_d|x with an estimate, σ̂^2_d|x, derived from actual (test) data.




 §.§ Confidence scoring of pose estimates




The concept behind our confidence measure essentially relies on the discrepancy of the back-projections of classified pixels (belonging to a known object) from the corresponding object template surface via the estimated pose. Consider a classifier, trained to recognize objects from a pool set 𝒪, captured in images, and to map the corresponding pixels p_i (belonging to an object o∈𝒪) to 3D points P_i in the object's local coordinate frame. Also, let T∈𝒮ℰ(3) be the pose prediction of the object by the classifier. Our confidence measure is the average weighted maximum probability of the back-projected points P_i in eq. (<ref>) amongst all possible reference points

    𝒞(T;o) = ∑_i=1^N w_i ( k∈{1,…,K}maxq̂(P_i|C_k; o)),

where w_i is a weight (typically, a probability) that encapsulates the classifier's self-assessed confidence about the quality of the pose estimate; clearly, if such a measure is not provided, then we choose w_i=1/N.



  §.§.§ Associating confidence with absolute deviation in metric space


Since our confidence measure is an average probability by definition, we may obtain a link between a desired margin, δ, pertaining to the distance of a back-projected image points to the surface of the object. 
Thus, if, for each back-projected point P_i, the corresponding residual is bounded in absolute value by δ, then we may obtain a lower bound for average confidence (for a proof refer to Appendix <ref>),

    𝒞≥1/√(2π)δ^2∑_i=1^Nw_iσ̂_d|x(1-exp(-δ^2/2σ̂_d|x^2)),

where σ̂_d|x^2 is the estimated variance as per section <ref>. With eq. (<ref>) we are able to relate confidence values to a more tangible quantity such as distance.



§ RESULTS








Our experimentation has dual scope: a) To assess the effectiveness of the confidence score in identifying a good pose and, b) to demonstrate the efficiency of the template. For the latter, we use various models from the ShapeNet dataset as well as objects from an industrial workspace wherein accurate robotic grasping of objects is a key operational feature.




 §.§ Template accuracy, fidelity and comparative assessment


Table <ref> shows the quantitative comparison and evaluation of the shape representation task against DeepSDF for known 3D shapes for the three different categories of the ShapeNet dataset namely planes, chairs,  sofas. We employed 5 models from each of the mentioned categories to extract and assess the shape representation capabilities of the two methods using the Chamfer Distance (CD) for point cloud similarity. While, DeepSDF achieves better accuracy it is important to note that it is trained on the entire dataset of planes, chairs and sofas. 


Fig. <ref> illustrates reconstructions with our method and DeepSDF. Note that these are two intrinsically different methods. While DeepSDF excels in generalizing across different objects, our method is more adept in representing details of a specific object (Fig. <ref>). 
Clearly, the locations of the reference points may impact the fidelity of the template. Different approaches to determining these points might yield better results, particularly when dealing with complex objects. For instance, in the case of the chair depicted in Fig. <ref>, comparing results obtained from clustering-based estimation of reference points (cf. sect.  <ref>) with those manually defined, a more accurate shape representation is derived. In the same figure, the results of DeepSDF for the same object are contrasted affirming the loss of object details.



 §.§ Confidence as a measure of pose quality




To assess the ability of the derived confidence score to accurately reflect the quality of the pose we projected a set of 3D points from the object on the image for a known ground truth pose and thereafter, injected noise, ϵ, into these image points according to a Gaussian mixture,

    p(ϵ) = p(ϵ| o)π_o + p(ϵ|o)(1-π_o)

where π_o is the outlier probability and p(ϵ| o)∼𝒩(0, σ_o), p(ϵ|o)∼𝒩(0, σ_o) are the likelihood of noise for outliers and inliers respectively, with σ_o ≤ 2  pixels and σ_o > 10   pixels. For these experiments, Fig. <ref>(a) illustrates the relationship between confidence and noise whereas Fig. <ref>(b) illustrates how the choice of δ affects the confidence threshold and the acceptance of the estimated poses. A different depiction of the same trends is achieved with Fig. <ref>, where confidence drops with the declining accuracy of the back-projected 3D points. 

As part of our experimentation, we employed the confidence score in order to admit or reject poses estimated for objects captured in single images. We established a threshold based on eq. (<ref>) for a choice of δ = 2 mm. Fig. <ref> illustrates accepted (green) and rejected (red)  poses by superimposing the object model on the image based on the estimated pose.








§ CONCLUSION & FUTURE WORK

This paper puts forward a novel score for the quality of pose estimates of objects captured in images, based on geometric consistency with template shape. We also propose a method to build this template using Gaussian processes. Our results demonstrate that the representation is sufficiently accurate to facilitate the computation of a reliable confidence score that reflects the true quality of the estimated pose. In future work, we aim at endowing the shape representation algorithm with theoretical guarantees for full coverage of the object surface irrespective of shape complexity via learned mixtures models and fully automating the choice of reference points.

splncs04






§ LOWER BOUND FOR AVERAGE CONFIDENCE



Consider the formula for confidence as the average likelihood of distance from reference points,

    𝒞(T;o) = ∑_i=1^N w_i ( k∈{1,…,K}maxq̂(P_i|C_k; o)),

For brevity, let q^⋆_i ∼𝒩(μ_i^⋆, σ^⋆^2_i)  k∈{1,…,K}maxq̂(P_i|C_k; o) . Also, let e_i = ‖P_i-C_i^⋆‖ be the random variable of the difference between the GP prediction μ_i^⋆ and the actual distance of the query point from the reference point C_i^⋆ along the direction of the query point, P_i. Then, the density of e_i will be q^⋆ translated at the origin. 
We now wish to find the average confidence value for | e_i|<δ. We therefore integrate eq. (<ref>) from -δ to δ over e_i, i.e.,

    𝒞 = 1/2δ∫_-δ^δ∑_i=1^N w_i  q^⋆_i(P_i|C_i^⋆; o)  de_i = 1/2δ∑_i=1^N w_i ∫_-δ^δq^⋆_i(P_i|C_i^⋆; o)  de_i

We now consider the expression for the density q^⋆_i,

    q^⋆_i(P_i|C_i^⋆; o) = 1/√(2π)σ^⋆_iexp(-e_i^2/2σ^⋆^2_i)

Since we require that | e_i |< δ, it follows that,

    1 > sgn(e_i)·e_i/δ

combining the inequalities in eq. (<ref>) with eq. (<ref>), we get,

    exp(-e_i^2/2σ^⋆^2_i) ≥sgn(e_i)·e_i/δexp(-e_i^2/2σ^⋆^2_i)

Using eq. (<ref>) with eq. (<ref>), we obtain a lower bound of the integral,

    𝒞≥1/2√(2π)δ∑_i=1^N w_i σ^⋆_i(∫_-δ^0e_i/σ^⋆^2_iexp(-e_i^2/2σ^⋆^2_i)   de_i - ∫_0^δe_i/σ^⋆^2_iexp(-e_i^2/2σ^⋆^2_i)   de_i ) 
       𝒞≥1/√(2π)δ∑_i=1^N w_i σ^⋆_i∫_δ^0e_i/σ^⋆^2_iexp(-e_i^2/2σ^⋆^2_i)   de_i

Computing analytically the integral in eq. (<ref>) yields,

    𝒞≥1/√(2π)δ^2∑_i=1^Nw_i
    σ_i^⋆(1-exp(-δ^2/2σ^⋆^2_i))






§ CODE


Related code available at <https://github.com/pansap99/COBRA>

