{'fraction_non_alphanumeric': 0.041162861757387925, 'fraction_numerical': 0.009690514644899385, 'mean_word_length': 4.585080448561677, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Real-Time Constrained 6D Object-Pose Tracking of An In-Hand Suture Needle for Minimally Invasive Robotic Surgery

Autonomous suturing has been a long-sought-after goal for surgical robotics. Outside of staged environments, accurate localization of suture needles is a critical foundation for automating various suture needle manipulation tasks in the real world. When localizing a needle held by a gripper, previous work usually tracks them separately without considering their relationship. Because of the significant errors that can arise in the stereo-triangulation of objects and instruments, their reconstructions may often not be consistent. This can lead to unrealistic tool-needle grasp reconstructions that are infeasible. Instead, an obvious strategy to improve localization would be to leverage constraints that arise from contact, thereby constraining reconstructions of objects and instruments into a jointly feasible space. In this work, we consider feasible grasping constraints when tracking the 6D pose of an in-hand suture needle. We propose a reparameterization trick to define a new state space for describing a needle pose, where grasp constraints can be easily defined and satisfied. Our proposed state space and feasible grasping constraints are then incorporated into Bayesian filters for real-time needle localization. In the experiments, we show that our constrained methods outperform previous unconstrained/constrained tracking approaches and demonstrate the importance of incorporating feasible grasping constraints into automating suture needle manipulation tasks.


I. INTRODUCTION
Automating surgical procedures such as suturing has drawn increased interest within the robotics community during the past two decades [1]. The advantage of automation is that it relieves surgeons from time-consuming, tedious, and challenging tasks that often emerge in Minimally Invasive Surgeries [2]- [4]. One of the key components of achieving autonomous procedures is the accurate localization of surgical instruments in the surgical scene [5]- [7]. This localization ability serves as the foundation for automating various surgical tasks in previous work, including needle regrasping [8], [9], knot tying [10], [11], and blood suction [12].
A surgical scene often contains multiple surgical instruments, and previous studies localize them separately without considering their physical interactions [8], [9], [13]- [15]. This can lead to unrealistic environmental reconstruction when combining tracking results of different tools. For example, if a needle is held by a surgical manipulator, tracking them separately can result in the needle being in a non-feasible grasp configuration (e.g., in-collision or floating, as shown in Fig. 1). This can be a dangerous situation because dropping needles can result in damage to surrounding tissue and additional trauma with repetitive needle pickup. Therefore, in this work, we focus on considering the physical interactions between a suture needle and a surgical manipulator to ensure feasible results in real-time tracking of an in-hand suture needle. Real-time localization is necessary since, in practice, grasping a needle causes it to re-orient in the gripper, and further re-orientation or slippage can happen once the needle interacts with the environment.

A. Related Work
Current literature on suture needle localization mostly focuses on the features of a needle extracted from camera data and assumes the needle can be anywhere in the space. Several methods reconstruct the pose of a static needle by observing detected markers or learned segmentation [9], [13], [16]. Others have considered uncertainty in the features and motions of a needle and use Bayesian filters with different observation models to track its pose [14], [15], [17]. However, these methods do not consider the physical interactions between the needle and the environment and thus do not guarantee that the needle pose is feasible.
Some studies in suture needle localization consider the physical interactions between a surgical manipulator and a needle when the manipulator holds the needle. One way is to perform tracking and assume that the configuration between the needle and the manipulator tip is known and remains unchanged over time [18]. Then the robot Jacobian and joint-sensor readings are used to estimate the motions of the needle. However, getting to this known state is nontrivial, as grasping a needle itself is a non-deterministic action, and grasp pose is situation-dependent, such as during regrasping [8]. Thus, the work in [19] does not assume a known configuration of the needle held by an end-effector, and its motions are estimated by a tool-tracking method [7] that tracks the pose of the end-effector. These approaches take into account that the needle should move concurrently with the gripper when held by it. Nonetheless, they do not ensure that the suture needle pose lies inside the feasible grasping manifold of the gripper.
Tracking the poses of an in-hand needle is a constrained pose tracking problem, where the needle should always lie inside the feasible grasping manifold of the gripper. However, there is no unified approach to define a feasible grasping manifold since grippers and grasped objects can be in arbitrary shapes, making this task highly nonlinear. To incorporate constraints into nonlinear tracking problems, previous work follow two approaches: acceptance/rejection sampling [20] and optimization [21], [22]. Acceptance/rejection methods are known to reduce the diversity of the tracked pose [22] and require an excessive number of feasibility checks, making them not desirable for real-time tracking [23]. On the other hand, optimization methods project the estimated pose onto a feasible manifold. However, they require the manifold to be defined as equality or inequality constraints [22], [23], and describing the feasible grasping manifold in such a way would be highly nontrivial.

B. Contributions
In this work, we achieve state-of-the-art performance for real-time suture needle tracking in robotic surgery by incorporating grasping constraints. To this end, we present the following novel contributions: 1) the first approach to probabilistically track a suture needle in real-time with grasping constraints, 2) a state-space to describe a grasped suture needle for efficient sampling on the feasible grasping manifold, 3) and a comparison of Bayesian filter approaches that incorporate the grasping constraints.
The proposed methods are evaluated in both simulation and real-world environments. In simulation environments, we demonstrate that our proposed methods outperform other unconstrained/constrained tracking approaches. Moreover, we evaluate different tracking methods on the suture needle regrasping task [8], [9]. The results indicate that incorporating grasping constraints makes the regrasping policy more robust to noise in detections. In real-world environments, we use marker-less feature detections from a Deep Neural Network (DNN) as needle observations and reconstruct the tracked tool poses from ex-vivo images. An example is shown in Fig. 1. The results demonstrate that our constrained approach ensures a feasible estimated pose, and an unconstrained method can lead to unrealistic reconstructions.

A. Problem Formulation
We aim to solve the in-hand suture needle pose, s t , tracking problem probabilistically from a sequence of observations, o 0:t , which can be formulated as: where F t is the feasible grasping space, f (·) and h(·) are the motion and observation models with noise w t−1 and v t respectively, and a t−1 is the action applied to the suture needle.
In our task, F t in (1) is the feasible grasping manifold of the surgical manipulator that is holding a suture needle at time step t. Usually, a grasping manifold should consider two feasibility constraints: geometric and dynamic constraints. Geometric constraints include [24]: 1) The object's surface should be in contact with the gripper's surface, i.e., Surf ace(s t )∩Surf ace(e t ) = ∅, where e t is the state of the gripper at time step t.
2) The object should not penetrate with the gripper, i.e., Interior(s t ) ∩ Interior(e t ) = ∅. Dynamic constraints include that if there is no external force except gravity acting on both the object and the gripper, the linear and angular velocities of the object relative to the gripper should be 0. Hence, the feasible grasping manifold F t can be represented as LinearV elocity(s t , e t ) = 0 and AngularV elocity(s t , e t ) = 0}.
Due to the special design and property of surgical manipulators and suture needles, we can simplify the requirements of defining the feasible grasping manifold for an in-hand needle. More specifically, the dynamic constraints in (4) are ignored because (1) a suture needle is very light compared to the gripper, and (2) grippers for surgical manipulators are designed to increase the friction between themselves and the objects they are holding (e.g., Needle Drivers). Hence, Since the robot end-effector or the grasped object can have a complex shape, the feasible grasping manifold F t in (2) is difficult to define for the object pose, [b t q t ] , where b t ∈ R 3 is the position, and q t ∈ R 3 is the axis-angle orientation. The object pose, which is described in a global frame such as the camera frame or in the ego-centric end-effector frame, is often directly used as the state in (1) [14], [15], [17]- [19]. However, without a feasibility-checking library or a physical simulator, it is difficult to tell whether a pose state s p t = [b t q t ] belongs to F t . These libraries and simulators require the mesh files of the end-effectors and objects, and multiple proximity queries on geometric models can slow down tracking. Moreover, F t for the pose state is generally irregular, so randomly sampling a pose state from F t can take even more time.

B. Needle Pose Reparameterization
Instead of defining the state as the needle pose in the camera frame or in the end-effector frame, we propose a reparameterization trick that defines a new set of parameters, (α, w, u, v), to describe the pose of an in-hand suture needle in the end-effector frame. First, we introduce their intermediate parameters, (α, d, θ, φ), for the pose which was originally defined in our previous work [8]. This set of parameters provides a more intuitive understanding of how to describe the pose of a needle held by a gripper. The first parameter, α ∈ [ 1 2 π, 3 2 π] ⊆ R, indicates which point on the needle is grasped, and the other three parameters, Although the (α, d, θ φ)-parameter is intuitive, independently sampling for d, θ, and φ can lead to high biases when transforming from spherical coordinates to Cartesian space [25], which is where the suture needle pose is defined. Thus, the following change of variables is applied [26], [27]: Then a reparameterized state s r t can be represented as Reparameterizing the state of a suture needle as (α, w, u, v) has several benefits. First, the geometrically feasible space, G t in (3), has a concrete definition: As long as a state s r belongs to G, the needle is in contact with the gripper's surface and not in collision with the end-effector. Hence, s r is a geometrically feasible state. Second, the motion model, f (·) in (1), for a (α, w, u, v)-Pose-state average -state average Fig. 2: Average of two pose-states and two (α, w, u, v)states. A direct average of two pose-states can lead to an infeasible needle state. However, the direct weighted sum of two (α, w, u, v)-states is still feasible since the feasible grasping manifold for (α, w, u, v)-states is convex.
state becomes very simple: where a r t = [a t,α a t,w a t,u a t,v ] ∈ R 4 is the variation applied to s r t , and w r t ∈ R 4 is the motion noise. This simple form ensures feasible outputs from the motion model while requiring no time-consuming post-processing, such as rejection sampling or optimization. Finally, the geometrically feasible space, G, when using (α, w, u, v)-state, is the shape of a hyperrectangle, so it is a convex space. The convexity of G enables the direct weighted sum of multiple tracked state candidates to also be feasible, which is important when computing averages. Meanwhile, for pose-states, the feasible space is usually non-convex due to complex gripper and object shapes in the 3D space, and the weighted average of multiple poses can be infeasible. Fig. 2 shows an example of averaging two pose-states and two (α, w, u, v)-states. The former results in a floating needle, whereas the latter remains feasible grasping.
Mappings between a (α, w, u, v)-parameter and its corresponding needle pose in the camera frame, p c n = [b c n q c n ] , are necessary since the observations of the needle are from the images taken by the camera. The steps to transform from (α, w, u, v) to p c n are summarized as follows: 1) Transform (w, u, v) to (d, θ, φ) using the inverse of (5).
2) Transform (α, d, θ, φ) to p n e and p c n using the methods described in [8], where p n e = [b n e q n e ] is the pose of the end-effector in the needle frame. Transforming from p c n to (α, w, u, v) requires some properties of an in-hand suture needle. First, we list the steps of this transformation as follows: where H(·) ∈ SE(3) is the homogeneous transform from position and orientation vectors. To obtain p n g in the second step, we use the following property of an in-hand suture needle: If a needle is stably grasped by a surgical manipulator, the y-axis of the end-effector frame will pass through the needle's grasped point. An example can be observed in Figure 3. This property allows us to calculate p n g by b n g = b n e + βR n e,y , where β = − ([0 0 1]b n e ) / [0 0 1]R n e,y .
The coefficient β ∈ R in (11) is obtained by finding the intersection between R n e,y and the xy-plane of the needle frame, where R n e,y ∈ R 3 is the y-axis of the end-effector frame in the needle frame. With p n g , α can be calculated by where b n g,x ∈ R and b n g,y ∈ R are the x-and y-coordinates of b n g [8]. To obtain (d, θ, φ) in the third step, we first calculate Then the (d, θ, φ) -parameters become [8] Finally, (w, u, v) in the fourth step can be calculated by (5).

C. Bayesian Filter with Feasibility Constraints
Bayesian filtering is applied to solve (1) with the (α, w, u, v)-state representation, which is easy to sample and constrain on G. Due to the nonlinearity in the observation  Initialization: Upon initialization of the filters, a set of discrete states S r such that S r = {s r 1 , . . . , s r n |s r i ∈ G, ∀i ∈ {1, . . . , n}} is collected. We sample directly in our proposed (α, w, u, v)-state space U(·, ·) is the uniform distribution. The initialization is done in lines 1 and 2 of Algorithm 1.
Motion Model: The motion model is with zero-mean Gaussian noise since a grasped suture needle is not expected to move largely inside a gripper. Therefore, the motion model's probability distribution is Observation Model: The observation model is our previously proposed Points Matching to Ellipse Observation Model [19] which can be applied to any pixel detections of a suture needle. Note that the observation model requires the pose-state, s p t = [b c n q c n ] , as the input since the detections are from an image. For more details on the observation model, see [19]. In Algorithm 1, the observation model is applied in lines 11-13, where σ 2 o ∈ R is the variance of the observation model. Additional steps for PF, such as resampling particles, are detailed in Lines 14-19.
Output: To get a mean result from the HF and PF algorithms, the weighted average of the discrete states is computed as shown in line 20 in Algorithm 1. Note that s r t is still feasible since G is a convex space.

A. Tracking Experiments in Simulation
We first evaluate our proposed constrained in-hand suture needle pose tracking algorithms in a CoppeliaSim environment. The simulation environmental settings are similar to the ones in [19], where a surgical manipulator holds a radius of 5.4mm suture needle. A stereo camera is set up to capture images with a size of 256 × 256, and five needle points are extracted from each image as the detections. Each detected point is disturbed by a noise sampled from N (0, Σ n ), where Σ n ∈ R 2×2 is a diagonal matrix with each diagonal element being σ 2 n . Each experiment is repeated for 20 trials, and each trial contains 100 time steps.
We compare the following state definitions for an in-hand suture needle and tracking algorithms: 1) Unconstrained pose-state, PF (PF) [18], [19]: naive PF with pose-states, and the needle motions are set to be the same as that of the end-effector. 2) Constrained pose-state by rejection sampling, HF (cHFrj) [29]: constrained HF with feasible states precollected by rejection sampling. 3) Constrained pose-state by rejection sampling, PF (cPFrj) [20]: constrained PF with rejection sampling applied to the outputs of the motion model. For all algorithms, we use the state-of-the-art Points Matching to Ellipse Observation Model for needle detections [19]. Each algorithm is run with 2000 particles or pre-collected states. We use the following two equations to calculate the positional and orientational errors of a tracked needle pose: where · is the ground truth obtained in the simulator. Fig. 4 shows the pose errors of tracking an in-hand suture needle while moving the end-effector. Although Bayesian filters with rejection sampling consider the feasible grasping constraints, their tracking errors are larger than other methods, even than the unconstrained one. This is because the feasible grasping manifold for pose-states is too irregular and difficult to sample uniformly from. With such an irregular space, the states sampled from it usually lack diversity since some states are easier to be sampled than others. Moreover, it requires lots of samples and feasibility checks to obtain enough feasible states. The average run time of cPFrj, which runs the rejection sampling process online, is 3.6 seconds per image frame, whereas other methods take 0.15 seconds per image frame.
Tracking an in-hand needle with our reparameterized (α, w, u, v)-states achieves the lowest pose errors. Sampling from the feasible grasping manifold of (α, w, u, v)-states is much easier and requires no feasibility checks. Hence, both tracking errors and run time can be much lower than rejection-sampling-based methods. In addition, our proposed methods consider the physical interactions between the gripper and the needle. Therefore, when the environmental noise increases, the tracking errors of our methods remain low compared to the unconstrained method. Finally, the performance of cPFrp is better than cHFrp since PF allows online adjustment of the tracked state candidates. This adjustment moves those candidates closer to the real state.

B. Automated Suture Needle Regrasping
To demonstrate the importance of integrating grasping constraints into suture needle tracking, we compare the unconstrained PF and our proposed cPFrp methods on the suture needle regrasping task [8] in the simulation environment. In these experiments, we add noise not only to needle detections but also to the detected end-effector poses. The positional noise of end-effector poses is sampled from N (0, Σ e,p ), where Σ e,p ∈ R 3×3 is a diagonal matrix with each diagonal element being σ 2 e,p . The orientational noise of the end-effector pose is θ e [0 1 0] , where θ e ∈ R is sampled from N (0, σ 2 e,o ). Each experiment is run for 30 trials. Table I shows the regrasping success rate of PF and cPFrp under different environmental noise. PF barely shows any success when more noise is added to detected endeffector poses. On the other hand, cPFrp succeeds in multiple regrasping trials under the same condition. These results suggest that when automating suture needle manipulation tasks, it is essential to consider the relationship between the needle and the gripper that is interacting with it.

C. Tracking Experiments in Real World
We evaluate PF and our cPFrp methods on ex-vivo datasets and demonstrate the tool reconstruction results. The suture needles tested are with radii 7mm and 11.5mm, and the algorithms are run with 2000 particles. In the ex-vivo datasets, a needle is grasped by a Large Needle Driver (LND) installed on a Patient Side Manipulator (PSM) arm of the da Vinci Research Kit (dVRK) [30]. dVRK's stereo endoscopic camera, which is 1080p and runs with 30 fps, is used to capture images for end-effector and needle detections. The endeffector poses are tracked by our previous method [7], and the markerless needle detections are obtained by DeepLab-Cut [31], the state-of-the-art keypoint detector. Figure 1 and 5 show the top and side views of tool reconstruction. From the top views, the results of both the unconstrained and constrained methods align well with the raw images. However, the side views clearly show their differences. The unconstrained method can lead to the reconstructed needle floating in the air or in collision with the gripper. Also, the inaccuracy mainly happens when reconstructing the depths of a needle from the camera. This is because the detections of a needle with different depths do not show many differences in the endoscopic images. Therefore, without integrating the feasibility constraints into needle tracking, the unconstrained method is likely to estimate a needle pose with inaccurate depth.
Our proposed constrained method ensures the needle pose is always feasible given the estimated end-effector pose. Note that although there can be noise in end-effector poses, the reconstructed relative pose between the needle and the endeffector is accurate for our constrained method. In Table I, we show that the accuracy of this relative pose is more crucial in automating suture needle manipulation tasks.

IV. DISCUSSION AND CONCLUSION
In this work, we propose approaches to incorporate feasible grasping constraints into real-time localizing the 6D pose of an in-hand suture needle. We define a novel state space for the 6D pose of a needle. This state space allows efficient sampling from the feasible grasping manifold, which requires no feasibility checks with external software. We incorporate the proposed state space and feasible grasping constraints into Bayesian filters for real-time needle pose tracking and demonstrate that our constrained approaches outperform previous ones. Our methods focus on tracking the relative poses between the needle and the gripper holding it and rely more on the end-effector poses. However, a surgical manipulator can be tracked accurately by previous methods [7], and we show in our experiments that accurately tracking the relative poses is more crucial in successfully automating suture needle manipulation tasks.