<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Robot. AI</journal-id>
<journal-title>Frontiers in Robotics and AI</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Robot. AI</abbrev-journal-title>
<issn pub-type="epub">2296-9144</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/frobt.2019.00086</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Robotics and AI</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Combining Differential Kinematics and Optical Flow for Automatic Labeling of Continuum Robots in Minimally Invasive Surgery</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name><surname>Rosa</surname> <given-names>Beno&#x000EE;t</given-names></name>
<xref ref-type="corresp" rid="c001"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/698404/overview"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Bordoux</surname> <given-names>Valentin</given-names></name>
</contrib>
<contrib contrib-type="author">
<name><surname>Nageotte</surname> <given-names>Florent</given-names></name>
<uri xlink:href="http://loop.frontiersin.org/people/777293/overview"/>
</contrib>
</contrib-group>
<aff><institution>ICube, CNRS, University of Strasbourg, INSA</institution>, <addr-line>Strasbourg</addr-line>, <country>France</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Kaspar Althoefer, Queen Mary University of London, United Kingdom</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Qiang Zhan, Beihang University, China; Sanja Dogramadzi, University of the West of England, United Kingdom</p></fn>
<corresp id="c001">&#x0002A;Correspondence: Beno&#x000EE;t Rosa <email>b.rosa&#x00040;unistra.fr</email></corresp>
<fn fn-type="other" id="fn001"><p>This article was submitted to Biomedical Robotics, a section of the journal Frontiers in Robotics and AI</p></fn></author-notes>
<pub-date pub-type="epub">
<day>06</day>
<month>09</month>
<year>2019</year>
</pub-date>
<pub-date pub-type="collection">
<year>2019</year>
</pub-date>
<volume>6</volume>
<elocation-id>86</elocation-id>
<history>
<date date-type="received">
<day>05</day>
<month>03</month>
<year>2019</year>
</date>
<date date-type="accepted">
<day>26</day>
<month>08</month>
<year>2019</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2019 Rosa, Bordoux and Nageotte.</copyright-statement>
<copyright-year>2019</copyright-year>
<copyright-holder>Rosa, Bordoux and Nageotte</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license>
</permissions>
<abstract><p>The segmentation of continuum robots in medical images can be of interest for analyzing surgical procedures or for controlling them. However, the automatic segmentation of continuous and flexible shapes is not an easy task. On one hand conventional approaches are not adapted to the specificities of these instruments, such as imprecise kinematic models, and on the other hand techniques based on deep-learning showed interesting capabilities but need many manually labeled images. In this article we propose a novel approach for segmenting continuum robots on endoscopic images, which requires no prior on the instrument visual appearance and no manual annotation of images. The method relies on the use of the combination of kinematic models and differential kinematic models of the robot and the analysis of optical flow in the images. A cost function aggregating information from the acquired image, from optical flow and from robot encoders is optimized using particle swarm optimization and provides estimated parameters of the pose of the continuum instrument and a mask defining the instrument in the image. In addition a temporal consistency is assessed in order to improve stochastic optimization and reject outliers. The proposed approach has been tested for the robotic instruments of a flexible endoscopy platform both for benchtop acquisitions and an <italic>in vivo</italic> video. The results show the ability of the technique to correctly segment the instruments without a prior, and in challenging conditions. The obtained segmentation can be used for several applications, for instance for providing automatic labels for machine learning techniques.</p></abstract>
<kwd-group>
<kwd>minimally invasive surgery</kwd>
<kwd>continuum robots</kwd>
<kwd>computer vision</kwd>
<kwd>optical flow</kwd>
<kwd>automatic labeling</kwd>
</kwd-group>
<contract-num rid="cn001">ANR-11-LABX-0004</contract-num>
<contract-num rid="cn001">ANR-18-CE19-0012-01</contract-num>
<contract-num rid="cn002">ITMO Plan CANCER ROBOT</contract-num>
<contract-sponsor id="cn001">Agence Nationale de la Recherche<named-content content-type="fundref-id">10.13039/501100001665</named-content></contract-sponsor>
<contract-sponsor id="cn002">Institut National de la Sant&#x000E9; et de la Recherche M&#x000E9;dicale<named-content content-type="fundref-id">10.13039/501100001677</named-content></contract-sponsor>
<counts>
<fig-count count="13"/>
<table-count count="1"/>
<equation-count count="14"/>
<ref-count count="51"/>
<page-count count="17"/>
<word-count count="12310"/>
</counts>
</article-meta>
</front>
<body>
<sec sec-type="intro" id="s1">
<title>1. Introduction</title>
<p>Continuum robots, contrarily to industrial robots, do not present a succession of joints and rigid links. Instead, a continuously curving, flexible structure is used, in conjunction with actuators that govern its shape. Most of them are tubular in shape, which presents significant advantages for minimally invasive surgery (Burgner-Kahrs et al., <xref ref-type="bibr" rid="B7">2015</xref>). Examples of applications include surgical specialties as wide as endovascular and cardiac surgery (Vasilyev et al., <xref ref-type="bibr" rid="B45">2015</xref>; Devreker et al., <xref ref-type="bibr" rid="B13">2016</xref>), gastroenterology (Berthet-Rayne et al., <xref ref-type="bibr" rid="B2">2018</xref>; Garbin et al., <xref ref-type="bibr" rid="B18">2018</xref>; Zorn et al., <xref ref-type="bibr" rid="B51">2018</xref>), neurosurgery (Swaney et al., <xref ref-type="bibr" rid="B41">2015</xref>), or fetal surgery (Dwyer et al., <xref ref-type="bibr" rid="B17">2017</xref>).</p>
<p>Continuum robots are difficult to model mainly because they use miniature embedded actuation systems. This creates slack, friction, or various nonlinear phenomena which limit the accuracy of existing models (Burgner-Kahrs et al., <xref ref-type="bibr" rid="B7">2015</xref>). Moreover, interactions with the environment impose external forces on the continuum robot. State of the art mechanical models allow computing the robot shape under external loads. Such approaches, however, require integrating sensors in the body of the robot in order to estimate either positions/orientations or interaction forces with the environment (Kim et al., <xref ref-type="bibr" rid="B24">2014</xref>; Mahoney et al., <xref ref-type="bibr" rid="B26">2016</xref>; Shi et al., <xref ref-type="bibr" rid="B38">2017</xref>). Depending on the kind of actuation and size constraints, this is not always possible, and generally not an easy task. Moreover, integrating new sensors in a robot is costly, and requires redesigning existing and available systems.</p>
<p>Surgical vision techniques have been developed as a solution for tracking surgical/continuum instruments and estimating their shape. Vision is especially appealing for endoscopic settings, because a video camera is usually included in the surgical setup, which provides visual guidance to the surgeon. As a result, many works have attempted to segment robotic instruments in endoscopic images. Marker-based solutions have shown promising results for both tool segmentation and 3D pose estimation from 2D images (Cabras et al., <xref ref-type="bibr" rid="B8">2017</xref>). Those approaches, however, modify the instrument body to integrate some markers, thus requiring new developments (such as choice of materials, analysis of cleaning process,&#x02026;) for <italic>in vivo</italic> use. In order to detect instruments in endoscopic images using marker-less techniques, several approaches make use of color information from the instrument (Doignon et al., <xref ref-type="bibr" rid="B15">2005</xref>), or restrict the search space using constraints related to the medical setup, such as a rigid instrument passing through a trocar in laparoscopy (Voros et al., <xref ref-type="bibr" rid="B46">2007</xref>). Those approaches are however not directly applicable to continuum robots, and/or require human intervention for an initialization step (Pezzementi et al., <xref ref-type="bibr" rid="B31">2009</xref>). In parallel, marker-less approaches using machine learning for pixel-wise instrument segmentation have been developed (Bouget et al., <xref ref-type="bibr" rid="B4">2017</xref>; Bodenstedt et al., <xref ref-type="bibr" rid="B3">2018</xref>). Typically, a training set composed of endoscopic images is manually labeled by an expert, an algorithm learns the links between the labels and some visual features and generalizes them to other surgeries. Such approaches have shown promising results for segmentation as well as for 3D pose estimation (Allan et al., <xref ref-type="bibr" rid="B1">2018</xref>).</p>
<p>With the recent uptake of Deep Neural Networks in the Surgical Vision community, interest has grown toward reduced data approaches, i.e., approaches that require less data for training. Transfer learning has been shown to be effective to fine-tune a network using a reduced set of surgery-specific images (Garc&#x00301;&#x00131;a-Peraza-Herrera et al., <xref ref-type="bibr" rid="B19">2016</xref>). Other approaches using weakly supervised learning (Vardazaryan et al., <xref ref-type="bibr" rid="B44">2018</xref>) or partly unlabeled datasets (Ross et al., <xref ref-type="bibr" rid="B37">2018</xref>) have shown promising results, but some level of manual annotation made by an expert is still required. In order to use fully unsupervised learning, automatic labeling approaches have been developed. These methods are usually based on object saliency detection (Yang et al., <xref ref-type="bibr" rid="B49">2013</xref>; Cheng et al., <xref ref-type="bibr" rid="B10">2015</xref>; Cho et al., <xref ref-type="bibr" rid="B11">2015</xref>). Usually, assumptions are made about what makes an object appear salient, e.g., local contrast differences or a prominent position in the image. Other methods assume that the foreground objects have more complex motions that the background (Stretcu and Leordeanu, <xref ref-type="bibr" rid="B39">2015</xref>). This approach, which extracts information from motion by performing a global principal component analysis of the video sequence is partly related to our work, in the sense that motion is a key element. Nevertheless, as can be seen on <xref ref-type="fig" rid="F1">Figure 1</xref>, the application of the techniques proposed in Stretcu and Leordeanu (<xref ref-type="bibr" rid="B39">2015</xref>) does not provide satisfactory segmentations even when tuned to the problem at hand. The probable reason is that in <italic>in vivo</italic> gastroenterology videos the background exhibits complex motions due to physiological motion and interaction of the instruments with the tissues. Therefore, specific tools are needed for handling these videos.</p>
<fig id="F1" position="float">
<label>Figure 1</label>
<caption><p><bold>(Left)</bold> Last image of a 50 images sequence (5s) where the right instrument is moving. <bold>(Right)</bold> Segmentation provided by VideoPCA (Stretcu and Leordeanu, <xref ref-type="bibr" rid="B39">2015</xref>). The salient part of the instrument near the tip is well extracted but a large part of the background is also considered as foreground. Moreover, despite the motion of the instrument, the shaft of the instrument is not considered as foreground.</p></caption>
<graphic xlink:href="frobt-06-00086-g0001.tif"/>
</fig>
<p>Instead of focusing on a pure vision-based approach, this paper makes use of an information which is rarely used in surgical vision: the robot kinematics. As explained before, mechanical models for continuum robots are inaccurate and error-prone. They can nevertheless be combined with image data for enhancing the quality of pose estimation (Tran et al., <xref ref-type="bibr" rid="B42">2017</xref>; Vandini et al., <xref ref-type="bibr" rid="B43">2017</xref>) or tracking (Pezzementi et al., <xref ref-type="bibr" rid="B31">2009</xref>; Reiter et al., <xref ref-type="bibr" rid="B35">2014</xref>). Similarly to approaches purely based on images, current methods making use of kinematic data typically build over image segmentation techniques, using either machine learning methods (with hand-labeled images) or manual initialization. In this paper, we propose a novel method, which makes use of robot forward and differential kinematics, together with optical flow methods, in order to produce pixel-wise image labels. The method is fully automatic, and does not require any human intervention for labeling the data. One key element of using differential kinematics is that in specific cases it is less affected by nonlinearities than the forward kinematic model. Let us consider, for instance, a continuum robot with a single bending section actuated with cables. One of the main contributors to nonlinearities is friction (Do et al., <xref ref-type="bibr" rid="B14">2015</xref>; Ha et al., <xref ref-type="bibr" rid="B20">2018</xref>), which is most important when the actuator changes direction (see <xref ref-type="fig" rid="F2">Figure 2</xref>). At those moments, the speed computed by the model may be non-zero, while the actual robot speed will be zero due to friction. The difference between the model-predicted and actual robot speed will be integrated over time, leading to large position errors in the kinematic model. Outside of those moments, however, the differential kinematic model will be correct, while the forward kinematics may keep a large error due to previously integrated errors. This behavior is illustrated in <xref ref-type="fig" rid="F2">Figure 2</xref> by the case of the robot considered for experimental validation in this study. The curves for the model-predicted (straight line) and actual link between the position of the motor driving the instrument bending and the distal bending angle do not superimpose well, with large errors of up to 20&#x000B0;, whereas the slopes of the curves, which are linked to the differential kinematics, are quite similar as long as the considered configuration is far away from a change of direction for the motor (low slope areas inside the hysteresis). This effect is more complex when considering multi-DOF continuum robots, but the validity of the differential kinematic model can nevertheless be considered better far away from direction changes in the motor input.</p>
<fig id="F2" position="float">
<label>Figure 2</label>
<caption><p>Typical relations between proximal motor position and distal angle for the cable-actuated bending DOF of the STRAS robot (Zorn et al., <xref ref-type="bibr" rid="B51">2018</xref>). The straight line shows the theoretic model relation, while the hysteretical curves show the actual relation for a given configuration of the passive shaft of the robot. Different colors correspond to different ranges of motor motions and highlight the complex behavior of this joint. The actual relation also changes when the shape of the shaft is modified.</p></caption>
<graphic xlink:href="frobt-06-00086-g0002.tif"/>
</fig>
<p>The paper is organized as follows: first, section 2 describes the technical foundations of the method. Then, the proposed method is described in depth in section 3. Sections 4, 5, respectively, present the experimental validation conditions and the results, and section 6 concludes the paper.</p>
</sec>
<sec id="s2">
<title>2. Differential Kinematics and Optical Flow</title>
<p>This section presents the theoretical foundations needed for presenting the method in the next section. General results concerning forward and differential kinematics of continuum robots are presented, as well as how they can be used for generating virtual optical flow images.</p>
<sec>
<title>2.1. Continuum Robot Kinematics</title>
<p>Let us consider the model of a continuum inextensible robot as a function <italic>g</italic>(<italic>q, s</italic>) &#x02208; <italic>SE</italic>(3), which is a homogeneous transformation function describing the position and orientation of the robot central line for given joint variables <italic>q</italic> &#x02208; &#x0211D;<sup><italic>n</italic></sup> and an arc-length <italic>s</italic> &#x02208; [0, <italic>L</italic>], L being the total length of the robot. <italic>x</italic>(<italic>s</italic>) &#x02208; &#x0211D;<sup>3</sup> is the translational part of <italic>g</italic>, i.e., the position of the robot centerline at an arc-length <italic>s</italic>. <italic>g</italic> and <italic>x</italic> are defined in the robot base frame <italic>r</italic>.</p>
<p>Various methods are available in the literature to compute the robot forward kinematics, either by direct computation if constant curvature can be assumed (Webster and Jones, <xref ref-type="bibr" rid="B47">2010</xref>), or using iterative schemes and Cosserat rod theory for more complex cases (Dupont et al., <xref ref-type="bibr" rid="B16">2010</xref>; Burgner-Kahrs et al., <xref ref-type="bibr" rid="B7">2015</xref>). Once the forward kinematics has been obtained, the differential kinematics represented by the Jacobian <italic>J</italic>(<italic>q, s</italic>) can be obtained either analytically or by using the finite differences method :</p>
<disp-formula id="E1"><label>(1)</label><mml:math id="M1"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>J</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mtable style="text-align:axis;" equalrows="false" columnlines="none none none none none none none none none" equalcolumns="false" class="array"><mml:mtr><mml:mtd><mml:mfrac><mml:mrow><mml:mi>&#x02202;</mml:mi><mml:mi>g</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>q</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>&#x022EE;</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mfrac><mml:mrow><mml:mi>&#x02202;</mml:mi><mml:mi>g</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>&#x02202;</mml:mi><mml:msub><mml:mrow><mml:mi>q</mml:mi></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Like the forward kinematics, the Jacobian matrix depends both on the current joint configuration <italic>q</italic> and on the considered arc-length <italic>s</italic> of the robot. For a known (small) time step, one can compute the robot displacement &#x01E8B; for any point <italic>s</italic> along the robot centerline by using <inline-formula><mml:math id="M2"><mml:mi>&#x01E8B;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mi>J</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>q</mml:mi></mml:mrow><mml:mo>&#x022C5;</mml:mo></mml:mover></mml:math></inline-formula>.</p>
<p>In this paper, without loss of generality, we consider the case depicted in <xref ref-type="fig" rid="F3">Figure 3</xref>, where a cable-actuated robot is inserted in an endoscope (Zorn et al., <xref ref-type="bibr" rid="B51">2018</xref>). In this case, the joint variables <italic>q</italic> are the insertion length of the robot in the channel, the differential length of the two antagonist cables used for bending the robot, and the rotation of the robot base around the axis of the channel. Using the formalism presented in Webster and Jones (<xref ref-type="bibr" rid="B47">2010</xref>), together with robot specific properties (i.e., diameter and length of the actuated and passive sections), one can compute the robot forward and differential kinematics analytically for any joint position <italic>q</italic>. Details about the kinematic model equations of the considered robot are available in <xref ref-type="supplementary-material" rid="SM1">Appendix</xref>.</p>
<fig id="F3" position="float">
<label>Figure 3</label>
<caption><p>Schematic describing the general situation, where a continuum robot is in the field of view (FOV) of an endoscopic camera. <italic>P</italic>(<italic>s</italic>) is the projection of the centerline of the robot at arc-length <italic>s</italic> onto the image plane.</p></caption>
<graphic xlink:href="frobt-06-00086-g0003.tif"/>
</fig>
<p>Let us further introduce the vector &#x003B4; &#x02208; &#x0211D;<sup><italic>n</italic></sup>, which can be added to <italic>q</italic> in order to change the robot pose. &#x003B4; will be used in the following of this paper as a corrective vector on <italic>q</italic>, which will be optimized in order to extract relevant pixel-wise labels of the tool. As such, the positions <italic>q</italic> and <italic>dq</italic> (or <inline-formula><mml:math id="M3"><mml:mover accent="true"><mml:mrow><mml:mi>q</mml:mi></mml:mrow><mml:mo>&#x022C5;</mml:mo></mml:mover></mml:math></inline-formula>) always correspond to the nominal values.</p>
<p>Finally, let us note that in the following we are only interested about 3D positions and linear velocity. The Jacobian matrix <italic>J</italic> is therefore reduced to a 3 &#x000D7; 3 matrix, expressed in the robot base frame.</p>
</sec>
<sec>
<title>2.2. Optical Flow</title>
<p>Optical flow refers to a set of computer vision methods, which have been developed to infer the displacement between two images. Classical methods are typically keypoint-based, thus only providing the flow in regions of the image with sufficient texture. Densification methods based on various criteria have been proposed in the literature to solve this problem (Wedel and Cremers, <xref ref-type="bibr" rid="B48">2011</xref>). Recently, deep learning approaches have shown promising results for fast and accurate dense optical flow estimation (Ilg et al., <xref ref-type="bibr" rid="B23">2017</xref>). Interestingly, such approaches can learn from 3D rendered scenes, for which an accurate ground truth optical flow is known, and generalize well to other types of video images.</p>
<p>In this paper, we use the state of the art FlowNet2.0 algorithm (Ilg et al., <xref ref-type="bibr" rid="B23">2017</xref>), which can compute dense flow maps in a few hundred milliseconds given a pair of input images. An example with <italic>in vivo</italic> endoscopic images is shown on <xref ref-type="fig" rid="F4">Figure 4</xref>. For all flow values considered later on, we use the magnitude-direction model, where the magnitude represents the norm of the flow vector while the direction represents the angle of the flow vector w.r.t. a horizontal reference vector. For visual display of the optical flows, we use the HSV color space, where the direction is mapped to the hue H, the magnitude to the value V, and the saturation is set to the maximum for enhanced visualization. In the following of the paper, optical flow images obtained using the FlowNet2.0 algorithm are noted <inline-formula><mml:math id="M4"><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula>.</p>
<fig id="F4" position="float">
<label>Figure 4</label>
<caption><p>Two examples (one per row) of optical flow estimation on <italic>in vivo</italic> endoscopic images. <bold>(A)</bold> First image; <bold>(B)</bold> Second image; <bold>(C)</bold> Zoom on differential image; <bold>(D)</bold> FlowNet2 output flow map.</p></caption>
<graphic xlink:href="frobt-06-00086-g0004.tif"/>
</fig>
</sec>
<sec>
<title>2.3. Virtual Optical Flow Rendering</title>
<p>In order to put the robot differential kinematics in relation with the optical flow <inline-formula><mml:math id="M5"><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula>, we introduce the notion of virtual optical flow maps. Let us consider a time instance <italic>t</italic>, at which the robot joint values <italic>q</italic>(<italic>t</italic>) are known. As described above, one can compute the forward kinematics of the robot <italic>g</italic>(<italic>q</italic>(<italic>t</italic>), <italic>s</italic>), as well as the Jacobian matrix at any point along the robot shaft, <italic>J</italic>(<italic>q</italic>(<italic>t</italic>), <italic>s</italic>) (in the following the dependency to <italic>t</italic> is omitted for clarity). Moreover, let us consider that the endoscopic camera is calibrated with intrinsic parameters <italic>K</italic>, and that radial distortions are compensated. The hand-eye calibration from the camera base frame to the robot base frame, given by the homogeneous matrix <inline-formula><mml:math id="M6"><mml:msubsup><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi></mml:mrow></mml:msubsup></mml:math></inline-formula> or equivalently rotation <inline-formula><mml:math id="M7"><mml:msubsup><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi></mml:mrow></mml:msubsup></mml:math></inline-formula> and translation <inline-formula><mml:math id="M8"><mml:msubsup><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi></mml:mrow></mml:msubsup></mml:math></inline-formula>, is considered as known.</p>
<p>From the above-described situation, one can first project the robot in the estimated pose onto the image. For any point of arc-length <italic>s</italic> &#x02208; [0, <italic>L</italic>], one can obtain the projected position on the image plane <italic>P</italic>(<italic>s</italic>) by computing:</p>
<disp-formula id="E2"><label>(2)</label><mml:math id="M9"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mtable><mml:mtr><mml:mtd><mml:mi>X</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi>Y</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi>Z</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msubsup><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi></mml:mrow></mml:msubsup><mml:mtext>&#x000A0;</mml:mtext><mml:mi>g</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:msubsup><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi></mml:mrow></mml:msubsup></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="E3"><label>(3)</label><mml:math id="M10"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi><mml:mi>o</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mi>K</mml:mi><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mtable><mml:mtr><mml:mtd><mml:mfrac><mml:mrow><mml:mi>X</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>Z</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mfrac><mml:mrow><mml:mi>Y</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>Z</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn>1</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p><italic>P</italic><sub><italic>c</italic></sub>(<italic>s</italic>) represents the 3D position of the robot centerline at arc-length <italic>s</italic> expressed in the camera frame, and <italic>P</italic><sub><italic>hom</italic></sub>(<italic>s</italic>) is the projection in the image in homogeneous coordinates. Coordinates of <italic>P</italic>(<italic>s</italic>) in pixels in the image are the first two rows of <italic>P</italic><sub><italic>hom</italic></sub>(<italic>s</italic>). By considering that the diameters of the different parts of the robot are known by design, the whole robot shape can be rendered on the image plane, obtaining a binary image mask <inline-formula><mml:math id="M11"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula>, as shown on <xref ref-type="fig" rid="F3">Figure 3</xref>.</p>
<p>One can use a similar principle for generating virtual optical flow images. The overall idea is to populate the mask <inline-formula><mml:math id="M12"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> with the projections of the local 3D speed values onto the image plane. This is done by discretizing the central-line and, for each of the obtained discrete values, by assigning the projection of the centerline speed <italic>v</italic>(<italic>s</italic>) to the local area of the mask around point <italic>P</italic>(<italic>s</italic>). <italic>v</italic>(<italic>s</italic>) is obtained as:</p>
<disp-formula id="E4"><label>(4)</label><mml:math id="M13"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>v</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>J</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msubsup><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi></mml:mrow></mml:msubsup><mml:mtext>&#x000A0;</mml:mtext><mml:mi>J</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mi>d</mml:mi><mml:mi>q</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="E5"><label>(5)</label><mml:math id="M14"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">with&#x000A0;</mml:mtext><mml:msub><mml:mrow><mml:mi>J</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>:</mml:mo><mml:mn>2</mml:mn><mml:mo>,</mml:mo><mml:mn>1</mml:mn><mml:mo>:</mml:mo><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mtable style="text-align:axis;" equalrows="false" columnlines="none none" equalcolumns="false" class="array"><mml:mtr><mml:mtd><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>Z</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mtd><mml:mtd><mml:mn>0</mml:mn></mml:mtd><mml:mtd><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mi>X</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>Z</mml:mi><mml:msup><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn>0</mml:mn></mml:mtd><mml:mtd><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>Z</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mtd><mml:mtd><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mi>Y</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>Z</mml:mi><mml:msup><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p><italic>J</italic><sub><italic>im</italic></sub>(<italic>P</italic><sub><italic>c</italic></sub>(<italic>s</italic>)) is the so-called image Jacobian, which relates the 3D velocity of a physical point to the apparent 2D velocity of its projection in the image plane. This computation assumes that time-steps are small enough for the Jacobian-based computation to be valid. The resulting image is called <inline-formula><mml:math id="M15"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula><sup><italic>v</italic></sup>.</p>
<p>A few properties of the virtual optical flow map are worth noting. First, the flow magnitude is set to 0 outside of <inline-formula><mml:math id="M16"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula>. This is because the robot kinematics does not provide any information allowing us to infer the speed values for the environment (the organs and tissues).</p>
<p>Second, the obtained virtual flow map will depend on both the robot pose <italic>g</italic>(<italic>q, s</italic>) and on <italic>dq</italic>. Joint values <italic>q</italic> will typically be obtained from sensors placed on the different motors driving the robot joints. <italic>dq</italic> can then be obtained by differentiation of <italic>q</italic> at time <italic>t</italic>, such as <italic>dq</italic>(<italic>t</italic>) &#x0003D; <italic>q</italic>(<italic>t</italic> &#x0002B; <italic>dt</italic>) &#x02212; <italic>q</italic>(<italic>t</italic>). If we now apply a corrective vector &#x003B4; on <italic>q</italic> (see definition of &#x003B4; in section 2.1), the robot shape equation will then be described by <italic>g</italic>(<italic>q</italic> &#x0002B; &#x003B4;, <italic>s</italic>), affecting the pose of the robot and therefore the mask <inline-formula><mml:math id="M17"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> (top-right on <xref ref-type="fig" rid="F5">Figure 5</xref>). Moreover, the robot Jacobian will also be affected, which means the flow <italic>values</italic> in <italic>F</italic><sup><italic>v</italic></sup> will also change, as illustrated on <xref ref-type="fig" rid="F5">Figure 5</xref> (bottom row).</p>
<fig id="F5" position="float">
<label>Figure 5</label>
<caption><p>Example of projected mask <inline-formula><mml:math id="M18"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> (top row) and virtual optical flow maps <inline-formula><mml:math id="M19"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula><sup><italic>v</italic></sup> (bottom row). <bold>(Left)</bold> Output of the kinematic model for a given <italic>q</italic> and <italic>dq</italic>. <bold>(Right)</bold> Output of the model for <italic>q</italic> &#x0002B; &#x003B4; and the same <italic>dq</italic>.</p></caption>
<graphic xlink:href="frobt-06-00086-g0005.tif"/>
</fig>
</sec>
</sec>
<sec id="s3">
<title>3. Optimization-Based Automatic Labeling</title>
<p>This section presents the optimization-based approach which was developed for automatic labeling of continuum robots in endoscopic images. The proposed method uses the tools described in section 2 in an iterative optimization scheme, in order to infer the mask <inline-formula><mml:math id="M20"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> that best fits with the continuum robot in the images.</p>
<sec>
<title>3.1. Optimization</title>
<p>This subsection describes the actual optimization routine applied on each processed image. The overall workflow of the optimization is depicted on <xref ref-type="fig" rid="F6">Figure 6</xref>. First, the dense optical flow <inline-formula><mml:math id="M21"><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula> is computed by using two consecutive images in the video sequence. Second, the nominal robot pose parameters <italic>q</italic> and the value of <italic>dq</italic> are extracted from sensors at the motors side, as described above. Finally, the iterative optimization process is started. The optimizer iterates on the variable &#x003B4; defined in the previous subsection, in order to minimize a cost function <italic>f</italic>. The cost function and optimization algorithm are described in the following subsections.</p>
<fig id="F6" position="float">
<label>Figure 6</label>
<caption><p>Schematic describing the optimization workflow. The dashed box outlines the Particle Swarm Optimization process.</p></caption>
<graphic xlink:href="frobt-06-00086-g0006.tif"/>
</fig>
<sec>
<title>3.1.1. Cost Function</title>
<p>We define the cost function as a sum of four terms (all terms depend on &#x003B4; but the dependence is omitted in the following for clarity):</p>
<disp-formula id="E6"><label>(6)</label><mml:math id="M22"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>f</mml:mi><mml:mo>=</mml:mo><mml:mi>&#x003B1;</mml:mi><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>i</mml:mi><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003B2;</mml:mi><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003B3;</mml:mi><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>q</mml:mi></mml:mrow></mml:msub></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p><italic>f</italic><sub><italic>direct</italic></sub> is a direct comparison of optical flow values between the estimated and virtual optical flow. It is defined as the normalized average of the direction and magnitude differences between <inline-formula><mml:math id="M23"><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula> and <inline-formula><mml:math id="M24"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula><sup><italic>v</italic></sup>:</p>
<disp-formula id="E7"><label>(7)</label><mml:math id="M25"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>i</mml:mi><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:munderover></mml:mstyle><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>C</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mfrac><mml:mrow><mml:mstyle displaystyle="true"><mml:msub><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:msub></mml:mstyle><mml:mo stretchy="false">|</mml:mo><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>-</mml:mo><mml:msup><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mrow><mml:mi>v</mml:mi></mml:mrow></mml:msup><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo stretchy="false">|</mml:mo><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mstyle displaystyle="true"><mml:msub><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:msub></mml:mstyle><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where <italic>x, y</italic> are pixel indices, and <italic>i</italic> represents the third dimension of the optical flow maps, 0 for direction and 1 for magnitude values [e.g., <inline-formula><mml:math id="M26"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula><sup><italic>v</italic></sup>(<italic>x, y</italic>, 0) is the virtual optical flow direction at pixels x,y]. <italic>C</italic><sub><italic>i</italic></sub> are normalization terms set at the maximum possible values of the directions differences (180&#x000B0;, which is the maximal angular difference due to circular wrapping) and magnitude, respectively. This ensures that <italic>f</italic><sub><italic>direct</italic></sub> values are always between 0 and 1.</p>
<p><italic>f</italic><sub><italic>h</italic>1</sub> compares histograms of flow between the inside and outside of the current robot mask. The intuition behind this term of the cost function is that the robotic arm should move independently from the environment (which, in surgical situations, moves following complex physiological motion patterns). Therefore, histograms of flow values should be uncorrelated if the projected mask <inline-formula><mml:math id="M27"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> is well-aligned with the robot in the image. On the contrary, if the mask partially overlaps with the environment, flow values inside and outside the mask will both contain values of speeds from the environment and from the robot, and will thus be correlated. In order to express this as a cost function, let us consider the mask <inline-formula><mml:math id="M28"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> obtained by projection of the robot shape on the image. The mask can be enlarged by performing a morphological opening operation with a structuring element <italic>e</italic>. We define <inline-formula><mml:math id="M29"><mml:mi mathvariant='-tex-caligraphic'>N</mml:mi></mml:math></inline-formula> &#x0003D; <inline-formula><mml:math id="M30"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula>&#x02295; <italic>e</italic> &#x02212; <inline-formula><mml:math id="M31"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula>, which covers an area around the original mask <inline-formula><mml:math id="M32"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> (i.e., a contour). We then compute the histogram of flow values in the regions defined by <inline-formula><mml:math id="M33"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M34"><mml:mi mathvariant='-tex-caligraphic'>N</mml:mi></mml:math></inline-formula>. For a given flow image <inline-formula><mml:math id="M35"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula>, the histogram <italic>p</italic><sub><inline-formula><mml:math id="M35a"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula></sub> is obtained in three steps. First, the directional part of <inline-formula><mml:math id="M36"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula> is quantized into <italic>N</italic> bins, yielding an array <italic>B</italic> with the bin values and a 2D array <inline-formula><mml:math id="M37"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula><sub><italic>d</italic></sub> containing the quantized orientation values. The histogram can then be computed in two steps :</p>
<disp-formula id="E8"><label>(8)</label><mml:math id="M38"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:munder></mml:mstyle><mml:msubsup><mml:mrow><mml:mi>&#x003B4;</mml:mi></mml:mrow><mml:mrow><mml:mi>B</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:msubsup><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="E9"><label>(9)</label><mml:math id="M39"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mstyle displaystyle="true"><mml:msub><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:msub></mml:mstyle><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where <italic>i</italic> is the bin number, and &#x003B4; is the Kronecker symbol. The histograms computed this way are normalized flow direction histograms weighted by the flow magnitude (Equation 8). The weighting gives more importance to local flow directions which are associated with a large magnitude. This allows to attenuate the impact of directions which are ill-defined when the magnitude approaches zero. The histograms are then subsequently normalized (Equation 9). In order to compute <italic>f</italic><sub><italic>h</italic>1</sub> we calculate the flow histograms inside and outside the robot mask, i.e., <inline-formula><mml:math id="M40"><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover><mml:mo>&#x02299;</mml:mo><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> and <inline-formula><mml:math id="M41"><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover><mml:mo>&#x02299;</mml:mo><mml:mi mathvariant='-tex-caligraphic'>N</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, where &#x02299; is an element-wise multiplication operator. Since the histograms are normalized, they can be compared using standard probability density comparison metrics. In this work, we chose the Jensen-Shannon distance. The Jensen-Shannon distance is defined as the square root of the Jensen-Shannon divergence, which is itself defined as the symmetric version of the Kullback-Leibler (KL) divergence (Cha, <xref ref-type="bibr" rid="B9">2007</xref>) :</p>
<disp-formula id="E10"><label>(10)</label><mml:math id="M42"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mtext>JS</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msqrt><mml:mrow><mml:mfrac><mml:mrow><mml:mi>K</mml:mi><mml:mi>L</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mfrac><mml:mrow><mml:mi>a</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>K</mml:mi><mml:mi>L</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mfrac><mml:mrow><mml:mi>a</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac></mml:mrow></mml:msqrt><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Compared to the KL divergence, it is symmetric, bounded between 0 and 1, and satisfies the triangle inequality. In our case, since we aim at minimizing the correlation between histograms of flows inside and outside the robot mask, the cost function <italic>f</italic><sub><italic>h</italic>1</sub> is defined as:</p>
<disp-formula id="E11"><label>(11)</label><mml:math id="M43"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mtext>JS</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover><mml:mo>&#x02299;</mml:mo><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover><mml:mo>&#x02299;</mml:mo><mml:mi mathvariant='-tex-caligraphic'>N</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p><italic>f</italic><sub><italic>h</italic>2</sub> is similar to <italic>f</italic><sub><italic>h</italic>1</sub> in the sense that it also compares histograms between the masks <inline-formula><mml:math id="M44"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M45"><mml:mi mathvariant='-tex-caligraphic'>N</mml:mi></mml:math></inline-formula>. It does, however, directly compare color histograms from the source image. The underlying assumption is that the background is more or less visually uniform, and likely visually different from the robot appearance. Therefore, for computing <italic>f</italic><sub><italic>h</italic>2</sub> we compare inside and outside histograms using simple color features. Taking the input image <inline-formula><mml:math id="M46"><mml:mi mathvariant='-tex-caligraphic'>I</mml:mi></mml:math></inline-formula> and the mask <inline-formula><mml:math id="M47"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> as input, we start by representing the image in the HSL color space. HSL is similar to the well-know HSV space, except that Luminance replaces the Value. Luminance is a weighted sum of the R, G, and B components using factors representative of the human perception, so that <italic>L</italic> &#x0003D; 0.2125<italic>R</italic> &#x0002B; 0.7154<italic>G</italic> &#x0002B; 0.0721<italic>B</italic>, and is therefore closer to human light intensity perception than the simple Value (Plataniotis and Venetsanopoulos, <xref ref-type="bibr" rid="B32">2000</xref>). The Jensen-Shannon distance is computed for each of the components of the HSL representation using the same process as for <italic>f</italic><sub><italic>h</italic>1</sub>. We define <italic>f</italic><sub><italic>X</italic></sub> &#x0003D; 1 &#x02212; JS(<italic>p</italic><sub><italic>X</italic>&#x02299;<inline-formula><mml:math id="M46b"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula></sub>, <italic>p</italic><sub><italic>X</italic>&#x02299;<inline-formula><mml:math id="M46a"><mml:mi mathvariant='-tex-caligraphic'>N</mml:mi></mml:math></inline-formula></sub>), where <italic>X</italic> stands for H,S, or L. <italic>f</italic><sub><italic>h</italic>2</sub> is then expressed as:</p>
<disp-formula id="E12"><label>(12)</label><mml:math id="M48"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mroot><mml:mrow><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>L</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mn>3</mml:mn></mml:mrow></mml:mroot></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Finally, the last term of the cost function, <italic>f</italic><sub><italic>q</italic></sub>, is a penalization term on the pose parameters themselves. It is defined as :</p>
<disp-formula id="E13"><label>(13)</label><mml:math id="M49"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>q</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo>&#x003BB;</mml:mo><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>i</mml:mi><mml:mi>m</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>&#x003B4;</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:munderover></mml:mstyle><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x0002B;</mml:mo><mml:mi>e</mml:mi><mml:mi>x</mml:mi><mml:mi>p</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>a</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003B4;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:msub><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x0002B;</mml:mo><mml:mi>e</mml:mi><mml:mi>x</mml:mi><mml:mi>p</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>a</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B4;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0002B;</mml:mo><mml:msub><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where &#x003BB;, <italic>a</italic><sub><italic>i</italic></sub> and <italic>b</italic><sub><italic>i</italic></sub> are constants. This function allows penalizing large deviations &#x003B4;. If <italic>a</italic> is chosen large enough, the function is almost flat and with very low values when all components &#x003B4;<sub><italic>i</italic></sub> &#x02208; [&#x02212;<italic>b</italic><sub><italic>i</italic></sub>, <italic>b</italic><sub><italic>i</italic></sub>], while quickly (and smoothly) reaching value &#x003BB; as one component of &#x003B4; approaches one of the bounds. Specific values of <italic>a</italic> and <italic>b</italic><sub><italic>i</italic></sub> must be chosen depending on the allowed pose parameters variations, which can themselves be linked to the estimated errors bounds in the mechanical model. Any &#x003BB; &#x0226B; 1 is acceptable, since <italic>f</italic><sub><italic>direct</italic></sub>, <italic>f</italic><sub><italic>h</italic>1</sub> and <italic>f</italic><sub><italic>h</italic>2</sub> are all bounded by [0, 1].</p>
</sec>
<sec>
<title>3.1.2. Optimization Algorithm</title>
<p>The above-defined cost-function is a sum of four terms, which involve local computations (which is mainly due to the fact that <inline-formula><mml:math id="M50"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula><sup><italic>v</italic></sup> only contains informations inside the projected mask <inline-formula><mml:math id="M51"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula>). Therefore, it cannot be assumed to be either smooth or convex. For this reason, we chose a global stochastic optimization algorithm, Particle Swarm Optimization (PSO) (Poli et al., <xref ref-type="bibr" rid="B33">2007</xref>). PSO generates a number <italic>N</italic> of candidate solutions by random sampling of the search space, and makes those so-called particles evolve over time, based on simple formulae governing their position and velocity. The algorithm makes little assumptions about the problem to be optimized, and does not require computing the gradient of the cost-function, which makes it well-suited for global optimization of potentially non-smooth functions. Moreover, within an iteration, cost function evaluations for each particle are totally independent, which makes the algorithm parallelizable (Mussi et al., <xref ref-type="bibr" rid="B28">2011</xref>). Finally, PSO can return the overall minimum as well as the values and cost function evaluations for each independent particle. As we will see in the next subsection, this property is interesting in our context.</p>
</sec>
</sec>
<sec>
<title>3.2. After Optimization: Enforcing Local Consistency</title>
<p>Since the PSO algorithm is stochastic, it does not guarantee convergence to the true minimum. Moreover, the cost function is based on some assumptions which may be violated. This is especially the case for the hypothesis on the independence of optical flows between the instrument and the environment, which underlies the histogram comparison term <italic>f</italic><sub><italic>h</italic>1</sub>. For instance, the optical flow may be misestimated, or parts of the background may temporarily move in synchrony with the robotic instrument. In these cases, the optimization minimum may not correspond to the actual pose parameters of the instrument.</p>
<p>In order to detect and filter out those false convergences, we introduce some metrics meant to assess the consistency between successive optimization results. Let us note <italic>R</italic>(<italic>t</italic>) &#x0003D; {(&#x003B4;<sub><italic>j</italic></sub>(<italic>t</italic>), <italic>f</italic>(&#x003B4;<sub><italic>j</italic></sub>(<italic>t</italic>)), <italic>j</italic> &#x02208; [1, <italic>N</italic>]} the output of the PSO algorithm after convergence, at time instance <italic>t</italic>. This set represents the positions of the <italic>N</italic> particles after evolving through the PSO algorithm, with their associated cost function values. The overall minimum is <italic>f</italic><sub><italic>min</italic></sub>(<italic>t</italic>) &#x0003D; argmin<sub><italic>j</italic></sub><italic>f</italic>(&#x003B4;<sub><italic>j</italic></sub>(<italic>t</italic>)).</p>
<p>In order to enforce local temporal consistency, we compare sets of results at successive time instances. Let us note those time instances <italic>t</italic><sub>1</sub> and <italic>t</italic><sub>2</sub>. After independent optimization using the above-described algorithm, the respective result sets are <italic>R</italic>(<italic>t</italic><sub>1</sub>) and <italic>R</italic>(<italic>t</italic><sub>2</sub>).</p>
<p>Let us note <italic>T</italic> &#x0003D; <italic>g</italic>(<italic>q</italic>(<italic>t</italic>), <italic>L</italic>) and <italic>T</italic><sub><italic>o</italic></sub> &#x0003D; <italic>g</italic>(<italic>q</italic>(<italic>t</italic>) &#x0002B; &#x003B4;, <italic>L</italic>) with <italic>t</italic> &#x02208; {<italic>t</italic><sub>1</sub>, <italic>t</italic><sub>2</sub>}. <italic>T</italic> and <italic>T</italic><sub><italic>o</italic></sub> are homogeneous transformations from the robot base to the tip before and after correction with a vector &#x003B4;, respectively. The relative tip pose correction can then be computed as <inline-formula><mml:math id="M52"><mml:mi>d</mml:mi><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msup><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>. The translational part of <italic>dT</italic> is noted <italic>dV</italic>. This vector represents the tip displacement created by applying the correction &#x003B4;, and expressed in the initial tip frame of the robot. It is dependent on both the considered frame (time <italic>t</italic>), as well as on the value of &#x003B4;. Its full notation is thus <italic>dV</italic>(<italic>t</italic>, &#x003B4;)</p>
<p>Finally, we define the tip local distance <italic>D</italic>(<italic>i, j</italic>) as :</p>
<disp-formula id="E14"><label>(14)</label><mml:math id="M53"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>D</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mi>d</mml:mi><mml:mi>V</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B4;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>-</mml:mo><mml:mi>d</mml:mi><mml:mi>V</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x003B4;</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where <italic>i</italic> and <italic>j</italic> are indices of elements in <italic>R</italic>(<italic>t</italic><sub>1</sub>) and <italic>R</italic>(<italic>t</italic><sub>2</sub>). Large values of <italic>D</italic>(<italic>i, j</italic>) indicate an important change of estimated offsets of the pose parameters between images at <italic>t</italic><sub>1</sub> and <italic>t</italic><sub>2</sub>. The distance <italic>D</italic>(<italic>i, j</italic>) is better suited for estimating closeness of results than directly comparing values of &#x003B4; because it is in the task space, therefore less sensitive to kinematic singularities which may arise (for instance, if the robotic arm is straight, any rotation of the arm leads to the same pose, and the PSO may output many particles with low cost values but with very different rotation values).</p>
<p>The algorithm for local temporal consistency check can be described the following way:</p>
<list list-type="bullet">
<list-item><p>Initialization: sort the elements of <italic>R</italic>(<italic>t</italic><sub>1</sub>) and <italic>R</italic>(<italic>t</italic><sub>2</sub>) according to their cost function values. The elements with lower costs are set as first elements: (&#x003B4;<sub>1</sub>(<italic>t</italic><sub>1</sub>), <italic>f</italic><sub>1</sub>(<italic>t</italic><sub>1</sub>)) and (&#x003B4;<sub>1</sub>(<italic>t</italic><sub>2</sub>), <italic>f</italic><sub>1</sub>(<italic>t</italic><sub>2</sub>))</p></list-item>
<list-item><p>Compute <italic>D</italic> &#x0003D; <italic>D</italic>(1, 1) and <inline-formula><mml:math id="M54"><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi><mml:mstyle class="text"><mml:mtext>_</mml:mtext></mml:mstyle><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>f</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msqrt><mml:mrow><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi><mml:mn>2</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:msqrt></mml:math></inline-formula></p></list-item>
<list-item><p>For (<italic>i, j</italic>) in [1, <italic>N</italic>]<sup>2</sup>:</p>
<list list-type="bullet">
<list-item><p>Compute <italic>D</italic>(<italic>i, j</italic>) and <inline-formula><mml:math id="M55"><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msqrt><mml:mrow><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi><mml:mn>2</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:msqrt></mml:math></inline-formula></p></list-item>
<list-item><p>If <italic>D</italic>(<italic>i, j</italic>) &#x0003C; <italic>D</italic> and <italic>f</italic><sub><italic>c</italic></sub>(<italic>i, j</italic>) &#x0003C; 2<italic>f</italic><sub><italic>c</italic>_<italic>ref</italic></sub> set <italic>D</italic> &#x0003D; <italic>D</italic>(<italic>i, j</italic>)</p></list-item>
</list></list-item>
</list>
<p>At the end of the process, the couple of particles from both optimization outputs having the closest <italic>D</italic> distance, as well as a pooled cost function <italic>f</italic><sub><italic>c</italic></sub> low enough (&#x0003C; 2<italic>f</italic><sub><italic>c</italic>_<italic>ref</italic></sub>) is selected. The selected particle from <italic>R</italic>(<italic>t</italic><sub>1</sub>) is the result of the optimization after consistency check. The particle from <italic>R</italic>(<italic>t</italic><sub>2</sub>) is not used as the information from the second image is redundant with the information obtained from the first image. Note that during the iterations <italic>f</italic><sub><italic>c</italic>_<italic>ref</italic></sub> is never reset. This is done in order to select a <italic>good enough</italic> couple of particles (i.e., with a pooled cost function <italic>f</italic><sub><italic>c</italic></sub> close to the minimum value), while having consistent &#x003B4; corrections.</p>
</sec>
</sec>
<sec id="s4">
<title>4. Experimental Validation</title>
<p>This section presents the experimental validation details, the robotic system used, the implementation details, as well as the various testing conditions.</p>
<sec>
<title>4.1. System and Images</title>
<p>This study makes use of the STRAS robotic arm. STRAS is a flexible endoscopy robot designed for complex endoluminal operations such as Endoscopic Submucosal Dissection (De Donno et al., <xref ref-type="bibr" rid="B12">2013</xref>; Zorn et al., <xref ref-type="bibr" rid="B51">2018</xref>). The robot arms are 3.5 mm diameter flexible cable-actuated instruments. Each arm has 3&#x000B0; of freedom controlled by independent motors: the insertion of the instrument in the channel, the rotation of the instrument along its own shaft, and the bending of the tip. The motors encoders are used to compute the joint variables <italic>q</italic>, which in turn can be used for computing the forward and differential kinematics, as detailed in <xref ref-type="supplementary-material" rid="SM1">Appendix</xref>.</p>
<p>During the operation of the robot, the surgeon sends commands through a dedicated user interface to teleoperate the robot, while using the images from the endoscopic camera for guidance. This system has a fixed focal, and therefore camera calibration can be performed in the lab and remain valid during <italic>in vivo</italic> use. We used standard calibration procedures from Zhang (<xref ref-type="bibr" rid="B50">2000</xref>) for obtaining the camera calibration matrix <italic>K</italic> as well as the distortion parameters (5 parameters distortion model). Images are distortion-corrected in real-time using the OpenCV library, therefore points in the 3D space can be projected on the distortion-corrected image using the calibration matrix <italic>K</italic>.</p>
<p>In order to project 3D points from the robot model onto the images, the hand-eye calibration matrix <inline-formula><mml:math id="M56"><mml:msubsup><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi></mml:mrow></mml:msubsup></mml:math></inline-formula> is also required. In this work, since the flexible arms pass through the working channel of the endoscope, we set <inline-formula><mml:math id="M57"><mml:msubsup><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi></mml:mrow></mml:msubsup></mml:math></inline-formula> to its nominal value using the CAD model of the endoscope. While this is not exact &#x02013;especially in the case where the robot tip is very close or very far from the exit of the working channel, as shown in Cabras et al. (<xref ref-type="bibr" rid="B8">2017</xref>), it was considered sufficient in this study. It would be possible to also optimize parameters of the hand-eye transformation at the cost of adding a few more optimization variables, but this was left out of the scope of the present paper. In fact, the uncertainty of the hand-eye calibration is often partly compensated by the offset &#x003B4;, leading to a good 2D projection of the tool onto the image plane. Further research will consider optimizing the hand-eye calibration parameters in the future, especially for full 3D pose estimation of the robot.</p>
<p>To validate the proposed algorithm, we acquired two different datasets (see <xref ref-type="fig" rid="F7">Figure 7</xref>). The first one was generated on the benchtop, by teleoperating the robot in front (and in interaction with) a plastic model of the human digestive anatomy (1,000 images, 100 s long). This model was manually moved by an operator in all directions during the robot teleoperation in order to simulate physiological movements. Displacements obtained in the images are complex because the model features 3D shapes.</p>
<fig id="F7" position="float">
<label>Figure 7</label>
<caption><p><bold>(Left)</bold> View of the tip of the STRAS robot, showing the endoscopic camera, the deploying working channels, and the flexible robotic arms. <bold>(Right)</bold> Sample images from the lab (top row) and <italic>in vivo</italic> (bottom row) datasets, featuring robot and environment movement, as well as tool/tissue interaction. Note that the visual appearances of the instruments are significantly different between both sets.</p></caption>
<graphic xlink:href="frobt-06-00086-g0007.tif"/>
</fig>
<p>The second dataset (2,000 images, 200 s long) was obtained during an <italic>in vivo</italic> experiment in a porcine model. The surgeon performs an actual colorectal Endoscopic Submucosal Dissection by teleoperating the STRAS robot. The study protocol for this experiment was approved by the Institutional Ethical Committee on Animal Experimentation (ICOMETH No.38.2011.01.018). Animals were managed in accordance with French laws for animal use and care as well as with the European Community Council directive no. 2010/63/EU. Images feature smoke, tissue cutting, and specular reflections. The dataset is particularly challenging because images were not acquired at the beginning of the surgery. The instrument is almost always in interaction with the tissues, which increases errors in the kinematic models due to external forces and wrenches imposed on the instrument. Note that this dataset features two robotic arms which were used during the surgery, but only the kinematic information from the right arm was used.</p>
</sec>
<sec>
<title>4.2. Implementation Details</title>
<p>The proposed algorithm was implemented in Python, using tools from OpenCV (Bradski, <xref ref-type="bibr" rid="B5">2000</xref>) and numpy (Oliphant, <xref ref-type="bibr" rid="B30">2007</xref>) for images and arrays manipulations, respectively. Optical flow was computed using the publicly available Tensorflow GPU code from the authors of the algorithm (Ilg et al., <xref ref-type="bibr" rid="B23">2017</xref>) and the full pre-trained FlowNet2 model. Both video and optical flow images have a resolution of 760 &#x000D7; 570 pixels, and the motors encoders outputs and video images were synchronized with a time step <italic>dt</italic> &#x0003D; 100 ms.</p>
<p>Particle Swarm Optimization was implemented in python using a combination of the pyswarm library (Lee, <xref ref-type="bibr" rid="B25">2014</xref>) and pathOS for multiprocessing support (McKerns et al., <xref ref-type="bibr" rid="B27">2011</xref>). The algorithm was setup using different sizes of the swarm <italic>N</italic> and different iterations numbers <italic>i</italic>. Other parameters of the PSO algorithm, <italic>&#x003D5;</italic><sub><italic>p</italic></sub> and <italic>&#x003D5;</italic><sub><italic>g</italic></sub>, which are scaling factors determining the evolution of the particles at each iteration (how far away from the particle and swarm&#x00027;s best known position, respectively; Poli et al., <xref ref-type="bibr" rid="B33">2007</xref>) were set to their default value of 0.5. Finally, after the consistency check, the final result obtained was considered of poor quality and therefore discarded if it did not satisfy the following constraints: <italic>f</italic><sub>1</sub>(<italic>t</italic><sub>1</sub>) &#x0003C; 0.4 and <italic>f</italic><sub>1</sub>(<italic>t</italic><sub>2</sub>) &#x0003C; 0.4 and <italic>D</italic> &#x0003C; 2<italic>mm</italic>. These thresholds have been set to be conservative and reject most incorrect/inconsistent results. Further research is needed to determine optimal values.</p>
<p>For the cost function, &#x003B1;, &#x003B2;, and &#x003B3; were, respectively, set to 0.1, 0.25, and 0.5. Those values were chosen in an <italic>ad-hoc</italic> fashion based on the relative scale exhibited by the different terms on the considered pilot images, so as to confer to them the same relative importance in the cost function. For computing <italic>h</italic><sub>1</sub> and <italic>h</italic><sub>2</sub>, 10 successive dilations with a 5 pixels wide rectangular structuring element <italic>e</italic> were performed. <italic>f</italic><sub><italic>q</italic></sub>(&#x003B4;) was computed with &#x003BB; &#x0003D; 10, <italic>a</italic> &#x0003D; 200, and <italic>b</italic> set in such a way that the search space is bounded by &#x000B1;35&#x000B0; for the bending angle at the tip of the robot and the rotation angle, and &#x000B1;5 mm for the robot insertion in the channel. These values were chosen larger than the observed hystereses effects on each joint (see on <xref ref-type="fig" rid="F2">Figure 2</xref> for bending), in order to take into account potential errors originating from robotic homing positions, hand-eye calibration errors, or from external forces applied on the instrument.</p>
<p>The algorithm was run on a Intel Xeon processor with 20 cores in order to take advantage of the multiprocessing implementation of PSO. FlowNet was run on a Nvidia 1080GT GPU. Average runtime of the full optimization routine for one pair of images was between 9 and 15 s depending on the parameters of the PSO algorithm. This is at least one or two orders of magnitude too slow for online use of the algorithm. However, this is mostly due to the multiple array initialization/manipulation routines used in the cost function evaluation, which is in turn called a large number of times during the optimization process. A careful, optimized C&#x0002B;&#x0002B; implementation, or a parallel implementation using Cuda on a GPU may provide significant speedups.</p>
</sec>
<sec>
<title>4.3. Metrics and Evaluation</title>
<p>In order to evaluate the output of the algorithm, images were manually annotated in the form of binary masks. In total, 394 images were manually annotated in the benchtop dataset, and 359 in the <italic>in vivo</italic> dataset. Using those binary masks as ground truth, masks <inline-formula><mml:math id="M58"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> generated by the kinematic model after applying the optimized correction &#x003B4; were then compared using the Precision, Recall, and Intersection over Union (IoU) metrics.</p>
<p>In order to fully characterize the algorithm using the above-defined metrics, several parameters were explored.</p>
<sec>
<title>4.3.1. Sampling Strategy</title>
<p>Since the overall optimization runs in 9 to 15 s, it is unlikely that we will be able, even with important code optimization, to make it run in real time. This is, however, not an important problem since successive images are redundant in content and therefore only a few images should be used for generating high quality labels for subsequent classifier training. In other words, we need to sample images from the dataset. We evaluated two sampling strategies. The first one, which we call <italic>S</italic><sub><italic>rand</italic></sub>, is a completely random sampling strategy. The second one, which we call <italic>S</italic><sub><italic>sel</italic></sub> is based on the joint angles input. Since nonlinearities in the robot kinematics are more likely to appear at direction changes (see <xref ref-type="fig" rid="F2">Figure 2</xref>), we select images which are sufficiently far from those direction changes. Practically, <italic>q</italic> is differentiated in order to obtain <inline-formula><mml:math id="M59"><mml:mover accent="true"><mml:mrow><mml:mi>q</mml:mi></mml:mrow><mml:mo>&#x022C5;</mml:mo></mml:mover></mml:math></inline-formula>. To remove local sensor noise, smoothing is performed using the standard 3rd order Savizky-Golay algorithm. A simple detection of sign changes in the last 500 ms is then performed (zero being considered as a sign change). One should note that this method only uses information obtained from <italic>before</italic> the current timepoint, and is thus usable in real-time settings.</p>
<p>Finally, promising images from the previously selected images are kept if:
<list list-type="bullet">
<list-item><p>The projection of the robot tip at the nominal pose and shape provided by <italic>g</italic>(<italic>q, L</italic>) is not close to the borders of the image, and</p></list-item>
<list-item><p>If the robot speed at the nominal tip position, projected in the image plane, is above a certain threshold.</p></list-item>
</list></p>
<p>These conditions are used to avoid situations where the robot is actually outside the field of view because of modeling errors, or where the real optical flow is very low due to projection conditions (typically when the velocity of the robot is aligned with the line of view). Practically, we use a window of 3/4 of the image size for the first condition, and 2 pixels of robot optical flow speed magnitude for the second condition.</p>
<p>For fairness of evaluation, the two sampling strategies should present the same number of images. <italic>S</italic><sub><italic>sel</italic></sub> being the most restrictive, it was applied to the beginning of the video (the first 2 min for the <italic>in vivo</italic> case, the first minute for the benchtop case), thus providing 33 selected images for the <italic>in vivo</italic> dataset and 36 images for the benchtop dataset. The same number of images was then extracted using random sampling on the same part of the videos.</p>
</sec>
<sec>
<title>4.3.2. Optimization and Consistency Check</title>
<p>Another parameter which may influence the results is the application or not of the consistency check. In order to test our hypothesis that our optimization algorithm is effective and that our proposed consistency check procedure helps filtering out bad results, we considered three different test cases. <italic>O</italic><sub><italic>no</italic></sub> represents the results obtained on a given test using the uncorrected kinematic model, i.e., with &#x003B4; &#x0003D; [0, 0, 0]. <italic>O</italic><sub><italic>optim</italic></sub> represents the case were the optimization algorithm is run on a single image, without performing the consistency check. Finally, <italic>O</italic><sub><italic>optim</italic>&#x0002B;<italic>cc</italic></sub> represents the case were the full algorithm is run, performing the optimization on two consecutive images in order to apply our consistency check procedure.</p>
</sec>
<sec>
<title>4.3.3. PSO Parameters and Randomness</title>
<p>As explained above, we use the PSO algorithm for exploring the space efficiently and in a parallelized fashion, while converging to a low cost function value. Three sets of couples of number of particles <italic>N</italic> and number of iterations <italic>i</italic> were tested. The nominal case <italic>N</italic> &#x0003D; 100; <italic>i</italic> &#x0003D; 10 represents a good balance between a large exploration of the search space and a reduced number of iterations for speed. We compared the obtained results against <italic>N</italic> &#x0003D; 50; <italic>i</italic> &#x0003D; 20 and <italic>N</italic> &#x0003D; 200; <italic>i</italic> &#x0003D; 5. The product <italic>N</italic> &#x000D7; <italic>i</italic> is kept constant in an effort to call the cost function evaluation a fixed number of times and therefore maintain similar computation times.</p>
<p>Furthermore, for the nominal case, we also evaluated the effect of the random component of the algorithm by running it three times with different random seeds.</p>
</sec>
</sec>
</sec>
<sec sec-type="results" id="s5">
<title>5. Results</title>
<p>This section presents the experimental results obtained with the proposed algorithm. Different effects and situations as detailed in section 4 are explored in order to fully characterize the performance of the algorithm.</p>
<sec>
<title>5.1. Qualitative Results</title>
<p><xref ref-type="fig" rid="F8">Figures 8</xref>, <xref ref-type="fig" rid="F9">9</xref> present examples of optimization results obtained on both datasets (more examples provided in the <xref ref-type="supplementary-material" rid="SM1">Supplementary Material</xref>). <xref ref-type="fig" rid="F8">Figure 8</xref> features many examples where the optimized mask <inline-formula><mml:math id="M60"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> almost perfectly matches with the contours of the instrument in the image, despite challenging conditions such as a very smooth optical flow around the instrument contour, and parts of the instrument looking very similar to its immediate surroundings [especially for the <italic>in vivo</italic> case, where the blue dye used during the surgical operation (Methylene blue) was very similar to the blueish hue of the instrument tip].</p>
<fig id="F8" position="float">
<label>Figure 8</label>
<caption><p>Examples of correct results obtained with our optimization algorithm. First two rows feature examples from the <italic>in vivo</italic> dataset, while the last two rows feature examples from the benchtop dataset. The columns are organized as follows, from left to right: Endoscopic image, with contours of the mask <inline-formula><mml:math id="M61"><mml:mi mathvariant='-tex-caligraphic'>M</mml:mi></mml:math></inline-formula> before (green) and after (purple) optimization; Optical flow image <inline-formula><mml:math id="M62"><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula> with the same superimposed contours; Virtual optical flow image <inline-formula><mml:math id="M63"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula><sup><italic>v</italic></sup> before optimization; Virtual optical flow image <inline-formula><mml:math id="M64"><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:math></inline-formula><sup><italic>v</italic></sup> after optimization.</p></caption>
<graphic xlink:href="frobt-06-00086-g0008.tif"/>
</fig>
<fig id="F9" position="float">
<label>Figure 9</label>
<caption><p>Examples of incorrect results obtained with our optimization algorithm. <bold>(Top)</bold> Incorrect extraction of the instrument tip. <bold>(Middle)</bold> Bad convergence due to a badly estimated <inline-formula><mml:math id="M65"><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula>. <bold>(Bottom)</bold> Incorrect estimation due to hand-eye calibration errors. Columns are the same as in <xref ref-type="fig" rid="F8">Figure 8</xref>.</p></caption>
<graphic xlink:href="frobt-06-00086-g0009.tif"/>
</fig>
<p><xref ref-type="fig" rid="F9">Figure 9</xref> features a few examples of incorrect results after optimization. The top row shows a situation where the instrument tip has a quite different aspect from the rest of the instrument (in this case, the grasper has a metallic aspect while the body is covered by a black sheath). In this particular case, the image similarity metric <italic>f</italic><sub><italic>h</italic>2</sub> in the cost function biased the search toward this result. The second row shows an example where optical flow estimations were made difficult by tool-tissue interactions as well as shadows from the instrument. As a result, the flow image <inline-formula><mml:math id="M66"><mml:mover accent="true"><mml:mrow><mml:mi mathvariant='-tex-caligraphic'>F</mml:mi></mml:mrow><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula> features a greenish area which is much larger than the tool area, making the flow similarity metrics <italic>f</italic><sub><italic>direct</italic></sub> and <italic>f</italic><sub><italic>h</italic>1</sub> less specific. Finally, the bottom row on <xref ref-type="fig" rid="F9">Figure 9</xref> shows an example of incorrect result due to hand-eye calibration errors. Hand-eye calibration errors cannot always be compensated by modifying the robot pose parameters, especially when the robotic arms gets very far or very close from the camera. In the latter case, shown on <xref ref-type="fig" rid="F9">Figure 9</xref> in the bottom row, projection errors due to incorrect hand-eye calibration are amplified because the object is closer from the camera (i.e., a slight change of 3D position implies a large projection error in the image plane). For the presented case, errors are such that the corrections &#x003B4; which could provide a qualitatively correct result are outside of the search space. As a result, the algorithm converges to a totally different pose. Note, however, that these results show optimizations performed on a single image; some of the incorrect results may be rejected by the consistency check.</p>
</sec>
<sec>
<title>5.2. Validation of the Cost Function</title>
<p>In order to evaluate the effectiveness of the proposed cost function independently of the convergence algorithm used, we looked at how the values of the cost function correlate with the Precision, Recall, and IoU metrics. For all the selected images in both datasets (with <italic>S</italic><sub><italic>rand</italic></sub> or <italic>S</italic><sub><italic>sel</italic></sub>), we performed random modifications of &#x003B4; around the nominal pose parameters <italic>q</italic>, and evaluated both the cost function and the corresponding Precision, Recall, and IoU. The results are a large sets of cost function evaluations, for various images coming from two datasets, in a variety of situations.</p>
<p>Spearman rank order correlation was used for estimating the correlation between the cost function and the metrics, since no linear correlation could be assumed <italic>a priori</italic>. The result is a high negative correlation of the cost function values with the considered metrics, with values of &#x02212;0.67, &#x02212;0.58, and &#x02212;0.68 for correlation of f with the Precision, Recall and IoU metrics, respectively. This is illustrated on <xref ref-type="fig" rid="F10">Figure 10</xref>, which shows the 95% confidence intervals after a 5-order polynomial fitting of the performance metrics with respect to the evaluation function. As can be seen from both <xref ref-type="fig" rid="F10">Figure 10</xref> and the Spearman rank correlation values, a diminution of the cost function is correlated with a positive variation of the metrics. Since all metrics represent best performance when they tend to 1, this shows the overall good performance of the proposed cost function.</p>
<fig id="F10" position="float">
<label>Figure 10</label>
<caption><p>Ninety five percent confidence interval for a 5-order polynomial fitting of the performance metrics (Precision, Recall, and IoU) as a function of the evaluation function.</p></caption>
<graphic xlink:href="frobt-06-00086-g0010.tif"/>
</fig>
</sec>
<sec>
<title>5.3. Optimization Results</title>
<p><xref ref-type="fig" rid="F11">Figure 11</xref> presents results obtained with the proposed algorithm for the nominal case (<italic>N</italic> &#x0003D; 100 and <italic>i</italic> &#x0003D; 10), on the benchtop and the <italic>in vivo</italic> datasets. A few observations can be made from these graphs. First, the raw kinematic model appears to provide poor quality outputs. This is all the more true on the <italic>in vivo</italic> dataset, which features ample tool-tissue interactions. Second, the optimization appears to provide a net increase in all metrics values (which was expected given results from section 5.2), while the consistency check gives an additional improvement to those values, especially in the <italic>in vivo</italic> case.</p>
<fig id="F11" position="float">
<label>Figure 11</label>
<caption><p>Boxplots showing the evaluation metrics for <italic>N</italic> &#x0003D; 100; <italic>i</italic> &#x0003D; 10. <bold>(Top)</bold> <italic>In vivo</italic> dataset; <bold>(Bottom)</bold> Benchtop dataset.</p></caption>
<graphic xlink:href="frobt-06-00086-g0011.tif"/>
</fig>
<p>In order to quantitatively confirm these observations, we used statistical tests. After assessing the normality of the data, we performed a two-factor ANOVA. Factor <italic>S</italic> was the sampling strategy (<italic>S</italic><sub><italic>rand</italic></sub> or <italic>S</italic><sub><italic>sel</italic></sub>), and factor <italic>O</italic> was the optimization type (<italic>O</italic><sub><italic>no</italic></sub>, <italic>O</italic><sub><italic>optim</italic></sub>, and <italic>O</italic><sub><italic>optim</italic>&#x0002B;<italic>cc</italic></sub>). The effect of each factor was assessed. When statistical significance was found, <italic>post-hoc</italic> testing was performed using independent <italic>t</italic>-tests, with a Holm-Bonferroni correction in order to account for multiple testing. Finally, the size of the effect was also evaluated using the &#x003C9;<sup>2</sup> effect size measure (Ialongo, <xref ref-type="bibr" rid="B21">2016</xref>).</p>
<p>On the <italic>in vivo</italic> dataset, the image sampling strategy <italic>S</italic> was found to have a significant influence on the results (<italic>p</italic> &#x0003C; 0.001 for all metrics), with a small effect size (&#x003C9;<sup>2</sup> &#x02243; 0.08 in all cases). Actually, one can see on <xref ref-type="fig" rid="F11">Figure 11</xref> that the metrics are slightly higher when using the image selection process than when using pure random sampling even for the unoptimized cases. The optimization type <italic>O</italic> was also highly significant for all metrics, with much larger effect sizes (see <xref ref-type="table" rid="T1">Table 1</xref>). <italic>Post-hoc</italic> testing confirmed that the optimization brings a clear improvement to the results, with both <italic>O</italic><sub><italic>optim</italic></sub> and <italic>O</italic><sub><italic>optim</italic>&#x0002B;<italic>cc</italic></sub> giving better results (i.e., higher metrics values on average), with high statistical significance (<italic>p</italic> &#x0003C; 0.001) when compared to the results obtained with <italic>O</italic><sub><italic>no</italic></sub>. Although a clear trend can be seen on <xref ref-type="fig" rid="F11">Figure 11</xref>, the consistency check did not provide a statistically significant improvement when combined with the image selection <italic>S</italic><sub><italic>sel</italic></sub> (<italic>p</italic> &#x0003E; 0.05 for the comparison of <italic>O</italic><sub><italic>optim</italic></sub> and <italic>O</italic><sub><italic>optim</italic>&#x0002B;<italic>cc</italic></sub> for the Precision, Recall, and IoU). When used with the random sampling strategy <italic>S</italic><sub><italic>rand</italic></sub>, however, the consistency check brought higher Precision (<italic>p</italic> &#x0003C; 0.01) and IoU (<italic>p</italic> &#x0003C; 0.05) values. These results show that if the image selection procedure fails (for instance, if the kinematic model is too disturbed by tool-tissue interaction, or if no good images can be selected due to numerous direction changes in the motor input), the consistency check will help filtering out low quality optimization results.</p>
<table-wrap position="float" id="T1">
<label>Table 1</label>
<caption><p>Summary of ANOVA results and effect size for optimization type factor <italic>O</italic>, for the considered metrics and the three sets of parameters for the PSO.</p></caption>
<table frame="hsides" rules="groups">
<thead>
<tr>
<th valign="top" align="center" colspan="7" style="border-bottom: thin solid #000000;"><italic><bold>In vivo</bold></italic> <bold>dataset</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td/>
<td valign="top" align="center" colspan="2" style="border-bottom: thin solid #000000;"><bold>N &#x0003D; 50</bold></td>
<td valign="top" align="center" colspan="2" style="border-bottom: thin solid #000000;"><bold>N &#x0003D; 100</bold></td>
<td valign="top" align="center" colspan="2" style="border-bottom: thin solid #000000;"><bold>N &#x0003D; 200</bold></td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td/>
<td valign="top" align="center"><italic><bold>p</bold></italic><bold>-value</bold></td>
<td valign="top" align="center"><bold>&#x003C9;</bold><sup><bold>2</bold></sup></td>
<td valign="top" align="center"><italic><bold>p</bold></italic><bold>-value</bold></td>
<td valign="top" align="center"><bold>&#x003C9;</bold><sup><bold>2</bold></sup></td>
<td valign="top" align="center"><italic><bold>p</bold></italic><bold>-value</bold></td>
<td valign="top" align="center"><bold>&#x003C9;</bold><sup><bold>2</bold></sup></td>
</tr>
<tr>
<td valign="top" align="left">Precision</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.27</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.32</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.43</td>
</tr>
<tr>
<td valign="top" align="left">Recall</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.35</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.38</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;4</sup></td>
<td valign="top" align="center">0.40</td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td valign="top" align="left">IoU</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.34</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.43</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.51</td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td valign="top" align="center" colspan="7"><bold>Benchtop dataset</bold></td>
</tr>
<tr>
<td/>
<td valign="top" align="center" colspan="2" style="border-bottom: thin solid #000000;"><bold>N &#x0003D; 50</bold></td>
<td valign="top" align="center" colspan="2" style="border-bottom: thin solid #000000;"><bold>N &#x0003D; 100</bold></td>
<td valign="top" align="center" colspan="2" style="border-bottom: thin solid #000000;"><bold>N &#x0003D; 200</bold></td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td/>
<td valign="top" align="center"><italic><bold>p</bold></italic><bold>-value</bold></td>
<td valign="top" align="center"><bold>&#x003C9;</bold><sup><bold>2</bold></sup></td>
<td valign="top" align="center"><italic><bold>p</bold></italic><bold>-value</bold></td>
<td valign="top" align="center"><bold>&#x003C9;</bold><sup><bold>2</bold></sup></td>
<td valign="top" align="center"><italic><bold>p</bold></italic><bold>-value</bold></td>
<td valign="top" align="center"><bold>&#x003C9;</bold><sup><bold>2</bold></sup></td>
</tr>
<tr>
<td valign="top" align="left">Precision</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.22</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.32</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.42</td>
</tr>
<tr>
<td valign="top" align="left">Recall</td>
<td valign="top" align="center">0.03</td>
<td valign="top" align="center">0.04</td>
<td valign="top" align="center">0.1</td>
<td valign="top" align="center">0.02</td>
<td valign="top" align="center">0.001</td>
<td valign="top" align="center">0.07</td>
</tr>
<tr>
<td valign="top" align="left">IoU</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.21</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.24</td>
<td valign="top" align="center">&#x0003C; 10<sup>&#x02212;5</sup></td>
<td valign="top" align="center">0.33</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>Results obtained on the benchtop dataset are less contrasted. One can see on <xref ref-type="fig" rid="F11">Figure 11</xref> that the image selection procedure <italic>S</italic><sub><italic>sel</italic></sub> has little effect on the metrics, which is confirmed by the ANOVA results: for the factor <italic>S</italic>, <italic>p</italic>-values are &#x0003E; 0.5 for all metrics, with a negative &#x003C9;<sup>2</sup> effect size (note that a negative effect size does not reflect a negative effect on the results, see Okada, <xref ref-type="bibr" rid="B29">2017</xref> for details). Actually, one can note that the results without optimization (<italic>O</italic><sub><italic>no</italic></sub>) are much better than on the <italic>in vivo</italic> case. This is due to the fact that, although the robot was teleoperated, movements are overall smoother in this dataset, and tool-tissue interaction is not as intensive as in the <italic>in vivo</italic> case. These combined facts make the uncorrected kinematic model generally more correct than in the <italic>in vivo</italic> case, making the image selection procedure less critical for obtaining good results. On the other hand, the optimization factor provided statistically significant increases for the Precision and IoU metrics, with rather large effect sizes (see <xref ref-type="table" rid="T1">Table 1</xref>). For those metrics, <italic>post-hoc</italic> testing showed that both <italic>O</italic><sub><italic>optim</italic></sub> and <italic>O</italic><sub><italic>optim</italic>&#x0002B;<italic>cc</italic></sub> gave better results (i.e., higher metrics values on average), with high statistical significance (<italic>p</italic> &#x0003C; 0.001) when compared to the results obtained without optimization (<italic>O</italic><sub><italic>no</italic></sub>), when used with either <italic>S</italic><sub><italic>sel</italic></sub> or <italic>S</italic><sub><italic>rand</italic></sub>. The effect of the consistency check was not found to be significant when comparing <italic>O</italic><sub><italic>optim</italic></sub> and <italic>O</italic><sub><italic>optim</italic>&#x0002B;<italic>cc</italic></sub> with <italic>post-hoc</italic> testing. In fact, in this dataset, ample movement of the robot arm, combined with ample and constant movement of the background, make the flow images <inline-formula><mml:math id="M67"><mml:mover accent="true"><mml:mrow><mml:mi>F</mml:mi></mml:mrow><mml:mo>^</mml:mo></mml:mover></mml:math></inline-formula> easier to estimate for the FlowNet algorithm. The smoother motion also makes the differential kinematics less erroneous. Those two combined factors reduce the effect of the consistency check although a small trend toward an increase of Precision and IoU can be observed on <xref ref-type="fig" rid="F11">Figure 11</xref>.</p>
<p>Another interesting effect can be seen from <xref ref-type="table" rid="T1">Table 1</xref>: the increase of the PSO parameters <italic>N</italic> seems to increase the effect of the optimization (effect size of the optimization type factor <italic>O</italic> in the ANOVA). As it is illustrated on <xref ref-type="fig" rid="F12">Figure 12</xref>, the resulting swarms at the end of optimization seem to all converge to the same result, but with a higher density of low cost-function particles in the case <italic>N</italic> &#x0003D; 200; <italic>i</italic> &#x0003D; 5, leading perhaps to better results in this case. This result should however be weighed against the average optimization time per image. As explained in section 4.3.3, the product <italic>N</italic> &#x000D7; <italic>i</italic> was kept constant in order to obtain similar computation times for all cases. In practice, the optimization times obtained per images (average &#x000B1; standard deviation) are:</p>
<list list-type="bullet">
<list-item><p>9.3 &#x000B1; 3.8 seconds for <italic>N</italic> &#x0003D; 50; <italic>i</italic> &#x0003D; 20</p></list-item>
<list-item><p>12.2 &#x000B1; 4.4 seconds for <italic>N</italic> &#x0003D; 100; <italic>i</italic> &#x0003D; 10</p></list-item>
<list-item><p>15.8 &#x000B1; 4.3 seconds for <italic>N</italic> &#x0003D; 200; <italic>i</italic> &#x0003D; 5</p></list-item>
</list>
<fig id="F12" position="float">
<label>Figure 12</label>
<caption><p>3D scatter plots representing the position of the swarm particles in the search space at the end of the optimization (on a single image, without consistency check), for the different PSO parameters. The colors represent associated cost function values. <bold>(Top)</bold> <italic>In vivo</italic> dataset; <bold>(Bottom)</bold> Benchtop dataset. The three axes are the three components of &#x003B4;: the bending curvature [<italic>m</italic><sup>&#x02212;1</sup>], the robot rotation [<italic>rad</italic>], and the robot insertion [<italic>mm</italic>].</p></caption>
<graphic xlink:href="frobt-06-00086-g0012.tif"/>
</fig>
<p>It can be observed that increasing the total number of particles also increases the computation time, even though the number of iterations is reduced. In fact, the product <italic>N</italic> &#x000D7; <italic>i</italic> gives the total <italic>maximum</italic> number of cost function evaluations. When a smaller swarm is used with an increased number of iterations, the particles will likely converge before the prescribed total number of iterations, causing the PSO algorithm to terminate with a lower number of cost function evaluations. In our case, the <italic>N</italic> &#x0003D; 50; <italic>i</italic> &#x0003D; 20 case provides a 60% speedup over the <italic>N</italic> &#x0003D; 200; <italic>i</italic> &#x0003D; 5 case. The case <italic>N</italic> &#x0003D; 100; <italic>i</italic> &#x0003D; 10 represents a good compromise between an increased effect size of the optimization (see <xref ref-type="table" rid="T1">Table 1</xref>) and a reduced overall computational time.</p>
<p>Finally, the influence of the stochastic essence of the PSO algorithm was assessed by running the algorithm multiple times on the same images with different random seeds. An example of optimization results is shown on <xref ref-type="fig" rid="F13">Figure 13</xref>. The general trend is the same as the case presented on <xref ref-type="fig" rid="F11">Figure 11</xref>. For the non-optimized case <italic>O</italic><sub><italic>no</italic></sub>, one can note that the randomly selected images perform poorly in this case (especially for the <italic>in vivo</italic> case), which is a byproduct of the random sampling. The <italic>S</italic><sub><italic>sel</italic></sub> case is perfectly identical to the case presented on <xref ref-type="fig" rid="F11">Figure 11</xref>, since the image selection procedure does not feature any random component. Results obtained with optimization, with or without the consistency check, are not statistically significantly different between the results presented on <xref ref-type="fig" rid="F13">Figure 13</xref> and the ones presented on <xref ref-type="fig" rid="F11">Figure 11</xref> (<italic>p</italic> &#x0003E; 0.05 for all combinations of <italic>S</italic><sub><italic>rand</italic></sub> and <italic>S</italic><sub><italic>sel</italic></sub> on one hand, and of <italic>O</italic><sub><italic>optim</italic></sub> and <italic>O</italic><sub><italic>optim</italic>&#x0002B;<italic>cc</italic></sub> on the other hand). These results show that our proposed algorithm is only marginally affected by the stochastic components in the PSO algorithm.</p>
<fig id="F13" position="float">
<label>Figure 13</label>
<caption><p>Boxplots showing the evaluation metrics for <italic>N</italic> &#x0003D; 100; <italic>i</italic> &#x0003D; 10. <bold>(Top)</bold> <italic>In vivo</italic> dataset; <bold>(Bottom)</bold> Benchtop dataset. The random seed used is different from the one in <xref ref-type="fig" rid="F11">Figure 11</xref>.</p></caption>
<graphic xlink:href="frobt-06-00086-g0013.tif"/>
</fig>
</sec>
</sec>
<sec id="s6">
<title>6. Discussion and Conclusion</title>
<p>In this paper, we presented a novel method for automatic labeling of robotic instruments in endoscopic images. The proposed method is compatible with both rigid-body tools (e.g., robotic laparoscopy tools) and continuum robots (e.g., flexible endoscopy tools), provided that joint values can be obtained, and that a kinematic model of the robot is available. Indeed, the proposed algorithm makes use of the robot&#x00027;s forward and differential kinematics, together with image and optical flow measurements, in order to optimize a cost function over the robot pose parameters. The resulting mask of the robot shape projected on the image gives a pixel-wise binary classification of the robot in the endoscopic image. A consistency check procedure after the optimization was also proposed in order to reject outliers. The proposed algorithm is particularly interesting in two aspects. First, no human intervention is required, in opposition to the tedious process of manual image annotation and labeling. Second, the use of optical flow makes the overall algorithm independent of the visual aspect of the robot. This point is particularly important since the aspect of both the instrument and the environment may change during the surgery, for instance due to smoke or changing lighting conditions.</p>
<p>Validation was performed using a flexible robotic endoscopy platform, with cable-actuated flexible endoscopic tools. Images were acquired in a benchtop setting with phantoms of the human digestive system, and in an <italic>in vivo</italic> setting during a colorectal Endoscopic Submucosal Dissection performed on a porcine model. The parameters of the algorithm were extensively studied in order to characterize the behavior and performance of the algorithm. Results show that the proposed algorithm is robust, and allows providing good quality labels in challenging conditions.</p>
<p>Nevertheless, the study has limitations which should be acknowledged. First, the labels obtained using our method have a reasonably good quality, with an IoU reaching high levels especially in the <italic>in vivo</italic> images. Perfect labels are however not obtained, for various reasons related to incorrect optimization results not being rejected by the consistency check, or incorrect kinematic model assumptions (in our study we used the constant curvature assumption, which is an approximation). The obtained noisy labels could be combined with approaches robust to label noise, for instance random forests using bootstrap aggregating (Breiman, <xref ref-type="bibr" rid="B6">1996</xref>), or more recent neural network-based approaches (Reed et al., <xref ref-type="bibr" rid="B34">2014</xref>). A future, related direction of work could be to run our algorithm on various <italic>in vivo</italic> datasets, in order to be able to infer the average noise distribution in the labels obtained, in combination with approaches such as (Sukhbaatar and Fergus, <xref ref-type="bibr" rid="B40">2014</xref>).</p>
<p>Another limitation to the present study is the fact that validation was performed on a limited number of images. This is in part due to the inherent difficulty and ethical questions raised when organizing multiple experiments on animal models. The limited number of images is however not really a problem for the intended use of our algorithm. In fact, the main interesting use of the algorithm could be for online classifier training, during a given surgery. In this use case, labels would be extracted on the fly as the surgery evolves, in order to train or fine-tune a classifier for segmenting the tool. Extracting a few, relevant and high quality labels using our approach would, in this case be required to train a surgery-specific classifier. Having only a few labeled examples usually causes the classifier to overfit on the training data, which would not be a problem in this case since it would be highly correlated to the data used for subsequent inference queries. In this context, lightweight classifiers such as the ones used in Garc&#x00301;&#x00131;a-Peraza-Herrera et al. (<xref ref-type="bibr" rid="B19">2016</xref>); Rocha et al. (<xref ref-type="bibr" rid="B36">2019</xref>) could be interesting to use. It should be noted that this use case requires being able to run our algorithm substantially faster than in the present study, which we believe is achievable thanks to careful code optimization.</p>
<p>Finally, several other aspect of the algorithm may also be improved in order to produce higher quality results. The consistency check procedure could be made more robust by considering more than two consecutive images, for instance in a Bayesian Recursive Filtering approach (e.g., using a particle filter) provided, once again, that the optimization time can be reduced. Another interesting future line of work could be to consider the uncertainty in the optical flow estimates in the cost function as a weight, using for instance an approach such as (Ilg et al., <xref ref-type="bibr" rid="B22">2018</xref>). Finally, we will investigate how full pose estimation could be achieved by combining the above-mentioned techniques as well as adding the hand-eye calibration parameters in the optimization variables. This last point is especially challenging since 3D pose estimation is hard to retrieve from 2D images, but we believe that the information added by the differential kinematics on one hand and the optical flow on the other hand could help reduce this uncertainty.</p>
</sec>
<sec sec-type="data-availability" id="s7">
<title>Data Availability</title>
<p>The datasets generated for this study are available on request to the corresponding author.</p>
</sec>
<sec id="s8">
<title>Ethics Statement</title>
<p>The study protocol for this experiment was approved by the Institutional Ethical Committee on Animal Experimentation (ICOMETH No. 38.2011.01.018). Animals were managed in accordance with French laws for animal use and care as well as with the European Community Council directive no. 2010/63/EU.</p>
</sec>
<sec id="s9">
<title>Author Contributions</title>
<p>BR, VB, and FN contributed to the design of the algorithms and their implementation, acquired the experimental data, and edited the manuscript. BR and FN generated the experimental results and prepared the manuscript and the figures.</p>
<sec>
<title>Conflict of Interest Statement</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
</sec>
</body>
<back>
<ack><p>The authors thank the IRCAD (Institut de Recherche sur les Cancers de l&#x00027;Appareil Digestif), Strasbourg, France, for the possibility to realize <italic>in vivo</italic> experiments with the STRAS robot. The authors also thank the IRIS platform of the ICube Laboratory for its support during the benchtop experiments.</p>
</ack>
<sec sec-type="supplementary-material" id="s10">
<title>Supplementary Material</title>
<p>The Supplementary Material for this article can be found online at: <ext-link ext-link-type="uri" xlink:href="https://www.frontiersin.org/articles/10.3389/frobt.2019.00086/full#supplementary-material">https://www.frontiersin.org/articles/10.3389/frobt.2019.00086/full#supplementary-material</ext-link></p>
<p>A Zip archive is attached to this publication as supplementary material. It includes 29 exemples of optimization results in the format of TIFF images, for both datasets. A text readme is included, which explains the data format and contents in details.</p>
<supplementary-material xlink:href="Presentation_1.pdf" id="SM1" mimetype="application/pdf" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<supplementary-material xlink:href="Data_Sheet_1.ZIP" id="SM2" mimetype="application/zip" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</sec>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Allan</surname> <given-names>M.</given-names></name> <name><surname>Ourselin</surname> <given-names>S.</given-names></name> <name><surname>Hawkes</surname> <given-names>D. J.</given-names></name> <name><surname>Kelly</surname> <given-names>J. D.</given-names></name> <name><surname>Stoyanov</surname> <given-names>D.</given-names></name></person-group> (<year>2018</year>). <article-title>3D pose estimation of articulated instruments in robotic minimally invasive surgery</article-title>. <source>IEEE Trans. Med. Imaging</source> <volume>37</volume>, <fpage>1204</fpage>&#x02013;<lpage>1213</lpage>. <pub-id pub-id-type="doi">10.1109/TMI.2018.2794439</pub-id></citation></ref>
<ref id="B2">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Berthet-Rayne</surname> <given-names>P.</given-names></name> <name><surname>Gras</surname> <given-names>G.</given-names></name> <name><surname>Leibrandt</surname> <given-names>K.</given-names></name> <name><surname>Wisanuvej</surname> <given-names>P.</given-names></name> <name><surname>Schmitz</surname> <given-names>A.</given-names></name> <name><surname>Seneci</surname> <given-names>C. A.</given-names></name> <etal/></person-group>. (<year>2018</year>). <article-title>The i2 snake robotic platform for endoscopic surgery</article-title>. <source>Ann. Biomed. Eng.</source> <volume>46</volume>, <fpage>1663</fpage>&#x02013;<lpage>1675</lpage>. <pub-id pub-id-type="doi">10.1007/s10439-018-2066-y</pub-id></citation></ref>
<ref id="B3">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bodenstedt</surname> <given-names>S.</given-names></name> <name><surname>Allan</surname> <given-names>M.</given-names></name> <name><surname>Agustinos</surname> <given-names>A.</given-names></name> <name><surname>Du</surname> <given-names>X.</given-names></name> <name><surname>Garcia-Peraza-Herrera</surname> <given-names>L.</given-names></name> <name><surname>Kenngott</surname> <given-names>H.</given-names></name> <etal/></person-group>. (<year>2018</year>). <article-title>Comparative evaluation of instrument segmentation and tracking methods in minimally invasive surgery</article-title>. <source>arXiv</source> arXiv:<fpage>1805</fpage>.<lpage>02475</lpage>.</citation></ref>
<ref id="B4">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bouget</surname> <given-names>D.</given-names></name> <name><surname>Allan</surname> <given-names>M.</given-names></name> <name><surname>Stoyanov</surname> <given-names>D.</given-names></name> <name><surname>Jannin</surname> <given-names>P.</given-names></name></person-group> (<year>2017</year>). <article-title>Vision-based and marker-less surgical tool detection and tracking: a review of the literature</article-title>. <source>Med. Image Anal.</source> <volume>35</volume>, <fpage>633</fpage>&#x02013;<lpage>654</lpage>. <pub-id pub-id-type="doi">10.1016/j.media.2016.09.003</pub-id><pub-id pub-id-type="pmid">27744253</pub-id></citation></ref>
<ref id="B5">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bradski</surname> <given-names>G.</given-names></name></person-group> (<year>2000</year>). <source>The OpenCV Library</source>. Dr. Dobb&#x00027;s Journal of Software Tools.</citation></ref>
<ref id="B6">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Breiman</surname> <given-names>L.</given-names></name></person-group> (<year>1996</year>). <article-title>Bagging predictors</article-title>. <source>Mach. Learn.</source> <volume>24</volume>, <fpage>123</fpage>&#x02013;<lpage>140</lpage>.</citation></ref>
<ref id="B7">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Burgner-Kahrs</surname> <given-names>J.</given-names></name> <name><surname>Rucker</surname> <given-names>D. C.</given-names></name> <name><surname>Choset</surname> <given-names>H.</given-names></name></person-group> (<year>2015</year>). <article-title>Continuum robots for medical applications: a survey</article-title>. <source>IEEE Trans. Robot.</source> <volume>31</volume>, <fpage>1261</fpage>&#x02013;<lpage>1280</lpage>. <pub-id pub-id-type="doi">10.1109/TRO.2015.2489500</pub-id></citation></ref>
<ref id="B8">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Cabras</surname> <given-names>P.</given-names></name> <name><surname>Nageotte</surname> <given-names>F.</given-names></name> <name><surname>Zanne</surname> <given-names>P.</given-names></name> <name><surname>Doignon</surname> <given-names>C.</given-names></name></person-group> (<year>2017</year>). <article-title>An adaptive and fully automatic method for estimating the 3D position of bendable instruments using endoscopic images</article-title>. <source>Int. J. Med. Robot. Comput. Assist. Surg.</source> <volume>13</volume>:<fpage>e1812</fpage>. <pub-id pub-id-type="doi">10.1002/rcs.1812</pub-id><pub-id pub-id-type="pmid">28387448</pub-id></citation></ref>
<ref id="B9">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Cha</surname> <given-names>S.-H.</given-names></name></person-group> (<year>2007</year>). <article-title>Comprehensive survey on distance/similarity measures between probability density functions</article-title>, in <source>International Journal of Mathematical Models and Methods in Applied Sciences, Vol. 1</source> (<publisher-loc>Victoria, BC</publisher-loc>: <publisher-name>North Atlantic University Union</publisher-name>), <fpage>300</fpage>&#x02013;<lpage>307</lpage>.</citation></ref>
<ref id="B10">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Cheng</surname> <given-names>M.-M.</given-names></name> <name><surname>Mitra</surname> <given-names>N. J.</given-names></name> <name><surname>Huang</surname> <given-names>X.</given-names></name> <name><surname>Torr</surname> <given-names>P. H.</given-names></name> <name><surname>Hu</surname> <given-names>S.-M.</given-names></name></person-group> (<year>2015</year>). <article-title>Global contrast based salient region detection</article-title>. <source>IEEE Transact. Patt. Anal. Mach. Intell.</source> <volume>37</volume>, <fpage>569</fpage>&#x02013;<lpage>582</lpage>. <pub-id pub-id-type="doi">10.1109/TPAMI.2014.2345401</pub-id><pub-id pub-id-type="pmid">26353262</pub-id></citation></ref>
<ref id="B11">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Cho</surname> <given-names>M.</given-names></name> <name><surname>Kwak</surname> <given-names>S.</given-names></name> <name><surname>Schmid</surname> <given-names>C.</given-names></name> <name><surname>Ponce</surname> <given-names>J.</given-names></name></person-group> (<year>2015</year>). <article-title>Unsupervised object discovery and localization in the wild: Part-based matching with bottom-up region proposalsm</article-title>, in <source>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</source> (<publisher-loc>Boston, MA</publisher-loc>).</citation></ref>
<ref id="B12">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>De Donno</surname> <given-names>A.</given-names></name> <name><surname>Zorn</surname> <given-names>L.</given-names></name> <name><surname>Zanne</surname> <given-names>P.</given-names></name> <name><surname>Nageotte</surname> <given-names>F.</given-names></name> <name><surname>de Mathelin</surname> <given-names>M.</given-names></name></person-group> (<year>2013</year>). <article-title>Introducing stras: a new flexible robotic system for minimally invasive surgery</article-title>, in <source>2013 IEEE International Conference on Robotics and Automation (ICRA)</source> (<publisher-loc>Karlsruhe</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>1213</fpage>&#x02013;<lpage>1220</lpage>.</citation></ref>
<ref id="B13">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Devreker</surname> <given-names>A.</given-names></name> <name><surname>Tran</surname> <given-names>P. T.</given-names></name> <name><surname>Rosa</surname> <given-names>B.</given-names></name> <name><surname>De Praetere</surname> <given-names>H.</given-names></name> <name><surname>H&#x000E4;ni</surname> <given-names>N.</given-names></name> <name><surname>Famaey</surname> <given-names>N.</given-names></name> <etal/></person-group>. (<year>2016</year>). <article-title>Intuitive control strategies for teleoperation of active catheters in endovascular surgery</article-title>. <source>J. Med. Robot. Res.</source> <volume>1</volume>:<fpage>1640012</fpage>. <pub-id pub-id-type="doi">10.1142/S2424905X16400122</pub-id></citation></ref>
<ref id="B14">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Do</surname> <given-names>T.</given-names></name> <name><surname>Tjahjowidodo</surname> <given-names>T.</given-names></name> <name><surname>Lau</surname> <given-names>M.</given-names></name> <name><surname>Phee</surname> <given-names>S.</given-names></name></person-group> (<year>2015</year>). <article-title>Nonlinear friction modelling and compensation control of hysteresis phenomena for a pair of tendon-sheath actuated surgical robots</article-title>. <source>Mech. Syst. Signal Process.</source> <volume>60</volume>, <fpage>770</fpage>&#x02013;<lpage>784</lpage>. <pub-id pub-id-type="doi">10.1016/j.ymssp.2015.01.001</pub-id></citation></ref>
<ref id="B15">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Doignon</surname> <given-names>C.</given-names></name> <name><surname>Graebling</surname> <given-names>P.</given-names></name> <name><surname>de Mathelin</surname> <given-names>M.</given-names></name></person-group> (<year>2005</year>). <article-title>Real-time segmentation of surgical instruments inside the abdominal cavity using a joint hue saturation color feature</article-title>. <source>Real Time Imag.</source> <volume>11</volume>, <fpage>429</fpage>&#x02013;<lpage>442</lpage>. <pub-id pub-id-type="doi">10.1016/j.rti.2005.06.008</pub-id></citation></ref>
<ref id="B16">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Dupont</surname> <given-names>P. E.</given-names></name> <name><surname>Lock</surname> <given-names>J.</given-names></name> <name><surname>Itkowitz</surname> <given-names>B.</given-names></name> <name><surname>Butler</surname> <given-names>E.</given-names></name></person-group> (<year>2010</year>). <article-title>Design and control of concentric-tube robots</article-title>. <source>IEEE Trans. Robot.</source> <volume>26</volume>, <fpage>209</fpage>&#x02013;<lpage>225</lpage>. <pub-id pub-id-type="doi">10.1109/TRO.2009.2035740</pub-id><pub-id pub-id-type="pmid">21258648</pub-id></citation></ref>
<ref id="B17">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Dwyer</surname> <given-names>G.</given-names></name> <name><surname>Chadebecq</surname> <given-names>F.</given-names></name> <name><surname>Tella Amo</surname> <given-names>M.</given-names></name> <name><surname>Bergeles</surname> <given-names>C.</given-names></name> <name><surname>Maneas</surname> <given-names>E.</given-names></name> <name><surname>Pawar</surname> <given-names>V.</given-names></name> <etal/></person-group>. (<year>2017</year>). <article-title>A continuum robot and control interface for surgical assist in fetoscopic interventions</article-title>. <source>IEEE Robot. Automat. Lett.</source> <volume>2</volume>, <fpage>1656</fpage>&#x02013;<lpage>1663</lpage>. <pub-id pub-id-type="doi">10.1109/LRA.2017.2679902</pub-id><pub-id pub-id-type="pmid">28680967</pub-id></citation></ref>
<ref id="B18">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Garbin</surname> <given-names>N.</given-names></name> <name><surname>Wang</surname> <given-names>L.</given-names></name> <name><surname>Chandler</surname> <given-names>J. H.</given-names></name> <name><surname>Obstein</surname> <given-names>K. L.</given-names></name> <name><surname>Simaan</surname> <given-names>N.</given-names></name> <name><surname>Valdastri</surname> <given-names>P.</given-names></name></person-group> (<year>2018</year>). <article-title>Dual-continuum design approach for intuitive and low-cost upper gastrointestinal endoscopy</article-title>. <source>IEEE Trans. Biomed. Eng.</source> <volume>66</volume>, <fpage>1963</fpage>&#x02013;<lpage>1974</lpage>. <pub-id pub-id-type="doi">10.1109/TBME.2018.2881717</pub-id></citation></ref>
<ref id="B19">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Garc&#x000ED;a-Peraza-Herrera</surname> <given-names>L. C.</given-names></name> <name><surname>Li</surname> <given-names>W.</given-names></name> <name><surname>Gruijthuijsen</surname> <given-names>C.</given-names></name> <name><surname>Devreker</surname> <given-names>A.</given-names></name> <name><surname>Attilakos</surname> <given-names>G.</given-names></name> <name><surname>Deprest</surname> <given-names>J.</given-names></name> <etal/></person-group>. (<year>2016</year>). <article-title>Real-time segmentation of non-rigid surgical tools based on deep learning and tracking</article-title>, in <source>International Workshop on Computer-Assisted and Robotic Endoscopy, MICCAI 2016</source> (<publisher-loc>Athens</publisher-loc>: <publisher-name>Springer</publisher-name>), <fpage>84</fpage>&#x02013;<lpage>95</lpage>.</citation></ref>
<ref id="B20">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ha</surname> <given-names>J.</given-names></name> <name><surname>Fagogenis</surname> <given-names>G.</given-names></name> <name><surname>Dupont</surname> <given-names>P. E.</given-names></name></person-group> (<year>2018</year>). <article-title>Modeling tube clearance and bounding the effect of friction in concentric tube robot kinematics</article-title>. <source>IEEE Trans. Robot</source>. <volume>35</volume>, <fpage>353</fpage>&#x02013;<lpage>370</lpage>. <pub-id pub-id-type="doi">10.1109/TRO.2018.2878906</pub-id><pub-id pub-id-type="pmid">30976208</pub-id></citation></ref>
<ref id="B21">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ialongo</surname> <given-names>C.</given-names></name></person-group> (<year>2016</year>). <article-title>Understanding the effect size and its measures</article-title>. <source>Biochem. Med.</source> <volume>26</volume>, <fpage>150</fpage>&#x02013;<lpage>163</lpage>. <pub-id pub-id-type="doi">10.11613/BM.2016.015</pub-id><pub-id pub-id-type="pmid">27346958</pub-id></citation></ref>
<ref id="B22">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Ilg</surname> <given-names>E.</given-names></name> <name><surname>Cicek</surname> <given-names>O.</given-names></name> <name><surname>Galesso</surname> <given-names>S.</given-names></name> <name><surname>Klein</surname> <given-names>A.</given-names></name> <name><surname>Makansi</surname> <given-names>O.</given-names></name> <name><surname>Hutter</surname> <given-names>F.</given-names></name> <name><surname>Brox</surname> <given-names>T.</given-names></name></person-group> (<year>2018</year>). <article-title>Uncertainty estimates and multi-hypotheses networks for optical flow</article-title>, in <source>Proceedings of the European Conference on Computer Vision (ECCV)</source> (<publisher-loc>Munich</publisher-loc>), <fpage>652</fpage>&#x02013;<lpage>667</lpage>.</citation></ref>
<ref id="B23">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Ilg</surname> <given-names>E.</given-names></name> <name><surname>Mayer</surname> <given-names>N.</given-names></name> <name><surname>Saikia</surname> <given-names>T.</given-names></name> <name><surname>Keuper</surname> <given-names>M.</given-names></name> <name><surname>Dosovitskiy</surname> <given-names>A.</given-names></name> <name><surname>Brox</surname> <given-names>T.</given-names></name></person-group> (<year>2017</year>). <article-title>FlowNet 2.0: evolution of optical flow estimation with deep networks</article-title>, in <source>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</source> (<publisher-loc>Hawaii</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>1647</fpage>&#x02013;<lpage>1655</lpage>.</citation></ref>
<ref id="B24">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Kim</surname> <given-names>B.</given-names></name> <name><surname>Ha</surname> <given-names>J.</given-names></name> <name><surname>Park</surname> <given-names>F. C.</given-names></name> <name><surname>Dupont</surname> <given-names>P. E.</given-names></name></person-group> (<year>2014</year>). <article-title>Optimizing curvature sensor placement for fast, accurate shape sensing of continuum robots</article-title>, in <source>2014 IEEE International Conference on Robotics and Automation (ICRA)</source> (<publisher-loc>Hong Kong</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>5374</fpage>&#x02013;<lpage>5379</lpage>.</citation></ref>
<ref id="B25">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Lee</surname> <given-names>A.</given-names></name></person-group> (<year>2014</year>). <source>Pyswarm: Particle Swarm Optimization (pso) With Constraint Support</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="https://pythonhosted.org/pyswarm/">https://pythonhosted.org/pyswarm/</ext-link> (accessed January 22, 2019).</citation></ref>
<ref id="B26">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Mahoney</surname> <given-names>A. W.</given-names></name> <name><surname>Bruns</surname> <given-names>T. L.</given-names></name> <name><surname>Swaney</surname> <given-names>P. J.</given-names></name> <name><surname>Webster</surname> <given-names>R. J.</given-names></name></person-group> (<year>2016</year>). <article-title>&#x0201C;On the inseparable nature of sensor selection, sensor placement, and state estimation for continuum robots or &#x0201C;where to put your sensors and how to use them.&#x0201D;</article-title> in <source>2016 IEEE International Conference on Robotics and Automation (ICRA)</source> (<publisher-loc>Stockholm</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>4472</fpage>&#x02013;<lpage>4478</lpage>.</citation></ref>
<ref id="B27">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>McKerns</surname> <given-names>M. M.</given-names></name> <name><surname>Strand</surname> <given-names>L.</given-names></name> <name><surname>Sullivan</surname> <given-names>T.</given-names></name> <name><surname>Fang</surname> <given-names>A.</given-names></name> <name><surname>Aivazis</surname> <given-names>M. A.</given-names></name></person-group> (<year>2011</year>). <article-title>Building a framework for predictive science</article-title>, in <source>Proceedings of the 10th Python in Science Conference</source>, eds <person-group person-group-type="editor"><name><surname>van der Walt</surname> <given-names>S.</given-names></name> <name><surname>Millman</surname> <given-names>J.</given-names></name></person-group> (<publisher-loc>Austin, TX</publisher-loc>: <publisher-name>Scipy Project</publisher-name>), <fpage>67</fpage>&#x02013;<lpage>78</lpage>.</citation></ref>
<ref id="B28">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Mussi</surname> <given-names>L.</given-names></name> <name><surname>Daolio</surname> <given-names>F.</given-names></name> <name><surname>Cagnoni</surname> <given-names>S.</given-names></name></person-group> (<year>2011</year>). <article-title>Evaluation of parallel particle swarm optimization algorithms within the cuda&#x02122; architecture</article-title>. <source>Inform. Sci.</source> <volume>181</volume>, <fpage>4642</fpage>&#x02013;<lpage>4657</lpage>. <pub-id pub-id-type="doi">10.1016/j.ins.2010.08.045</pub-id></citation></ref>
<ref id="B29">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Okada</surname> <given-names>K.</given-names></name></person-group> (<year>2017</year>). <article-title>Negative estimate of variance-accounted-for effect size: how often it is obtained, and what happens if it is treated as zero</article-title>. <source>Behav. Res. Methods</source> <volume>49</volume>, <fpage>979</fpage>&#x02013;<lpage>987</lpage>. <pub-id pub-id-type="doi">10.3758/s13428-016-0760-y</pub-id><pub-id pub-id-type="pmid">27334468</pub-id></citation></ref>
<ref id="B30">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Oliphant</surname> <given-names>T. E.</given-names></name></person-group> (<year>2007</year>). <article-title>Python for scientific computing</article-title>. <source>Comput. Sci. Eng.</source> <volume>9</volume>, <fpage>10</fpage>&#x02013;<lpage>20</lpage>. <pub-id pub-id-type="doi">10.1109/MCSE.2007.58</pub-id></citation></ref>
<ref id="B31">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Pezzementi</surname> <given-names>Z.</given-names></name> <name><surname>Voros</surname> <given-names>S.</given-names></name> <name><surname>Hager</surname> <given-names>G. D.</given-names></name></person-group> (<year>2009</year>). <article-title>Articulated object tracking by rendering consistent appearance parts</article-title>, in <source>ICRA&#x00027;09. IEEE International Conference on Robotics and Automation, 2009</source> (<publisher-loc>Kobe</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>3940</fpage>&#x02013;<lpage>3947</lpage>.</citation></ref>
<ref id="B32">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Plataniotis</surname> <given-names>K.</given-names></name> <name><surname>Venetsanopoulos</surname> <given-names>A. N.</given-names></name></person-group> (<year>2000</year>). <source>Color Image Processing and Applications</source>. <publisher-loc>Berlin, Heidelberg</publisher-loc>: <publisher-name>Springer-Verlag</publisher-name>.</citation></ref>
<ref id="B33">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Poli</surname> <given-names>R.</given-names></name> <name><surname>Kennedy</surname> <given-names>J.</given-names></name> <name><surname>Blackwell</surname> <given-names>T.</given-names></name></person-group> (<year>2007</year>). <article-title>Particle swarm optimization</article-title>. <source>Swarm Intell.</source> <volume>1</volume>, <fpage>33</fpage>&#x02013;<lpage>57</lpage>. <pub-id pub-id-type="doi">10.1007/s11721-007-0002-0</pub-id></citation></ref>
<ref id="B34">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Reed</surname> <given-names>S.</given-names></name> <name><surname>Lee</surname> <given-names>H.</given-names></name> <name><surname>Anguelov</surname> <given-names>D.</given-names></name> <name><surname>Szegedy</surname> <given-names>C.</given-names></name> <name><surname>Erhan</surname> <given-names>D.</given-names></name> <name><surname>Rabinovich</surname> <given-names>A.</given-names></name></person-group> (<year>2014</year>). <article-title>Training deep neural networks on noisy labels with bootstrapping</article-title>. <source>arXiv</source> arXiv:<fpage>1412</fpage>.<lpage>6596</lpage>.</citation></ref>
<ref id="B35">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Reiter</surname> <given-names>A.</given-names></name> <name><surname>Allen</surname> <given-names>P. K.</given-names></name> <name><surname>Zhao</surname> <given-names>T.</given-names></name></person-group> (<year>2014</year>). <article-title>Appearance learning for 3D tracking of robotic surgical tools</article-title>. <source>Int. J. Robot. Res.</source> <volume>33</volume>, <fpage>342</fpage>&#x02013;<lpage>356</lpage>. <pub-id pub-id-type="doi">10.1177/0278364913507796</pub-id></citation></ref>
<ref id="B36">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Rocha</surname> <given-names>C. d. C.</given-names></name> <name><surname>Padoy</surname> <given-names>N.</given-names></name> <name><surname>Rosa</surname> <given-names>B.</given-names></name></person-group> (<year>2019</year>). <article-title>Self-supervised surgical tool segmentation using kinematic information</article-title>. <source>arXiv</source> arXiv:<fpage>1902</fpage>.<lpage>04810</lpage>. <pub-id pub-id-type="doi">10.1109/ICRA.2019.8794334</pub-id></citation></ref>
<ref id="B37">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ross</surname> <given-names>T.</given-names></name> <name><surname>Zimmerer</surname> <given-names>D.</given-names></name> <name><surname>Vemuri</surname> <given-names>A.</given-names></name> <name><surname>Isensee</surname> <given-names>F.</given-names></name> <name><surname>Wiesenfarth</surname> <given-names>M.</given-names></name> <name><surname>Bodenstedt</surname> <given-names>S.</given-names></name> <etal/></person-group>. (<year>2018</year>). <article-title>Exploiting the potential of unlabeled endoscopic video data with self-supervised learning</article-title>. <source>Int. J. Comput. Assist. Radiol. Surg.</source> <volume>13</volume>, <fpage>925</fpage>&#x02013;<lpage>933</lpage>. <pub-id pub-id-type="doi">10.1007/s11548-018-1772-0</pub-id><pub-id pub-id-type="pmid">29704196</pub-id></citation></ref>
<ref id="B38">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Shi</surname> <given-names>C.</given-names></name> <name><surname>Luo</surname> <given-names>X.</given-names></name> <name><surname>Qi</surname> <given-names>P.</given-names></name> <name><surname>Li</surname> <given-names>T.</given-names></name> <name><surname>Song</surname> <given-names>S.</given-names></name> <name><surname>Najdovski</surname> <given-names>Z.</given-names></name> <etal/></person-group>. (<year>2017</year>). <article-title>Shape sensing techniques for continuum robots in minimally invasive surgery: a survey</article-title>. <source>IEEE Trans. Biomed. Eng.</source> <volume>64</volume>, <fpage>1665</fpage>&#x02013;<lpage>1678</lpage>. <pub-id pub-id-type="doi">10.1109/TBME.2016.2622361</pub-id><pub-id pub-id-type="pmid">27810796</pub-id></citation></ref>
<ref id="B39">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Stretcu</surname> <given-names>O.</given-names></name> <name><surname>Leordeanu</surname> <given-names>M.</given-names></name></person-group> (<year>2015</year>). <article-title>Multiple frames matching for object discovery in video</article-title>, in <source>Proceedings of the British Machine Vision Conference (BMVC)</source> (<publisher-loc>Swansea</publisher-loc>), <fpage>186.1</fpage>&#x02013;<lpage>186.12</lpage>.</citation></ref>
<ref id="B40">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sukhbaatar</surname> <given-names>S.</given-names></name> <name><surname>Fergus</surname> <given-names>R.</given-names></name></person-group> (<year>2014</year>). <article-title>Learning from noisy labels with deep neural networks</article-title>. <source>arXiv</source> arXiv:<fpage>1406</fpage>.<lpage>2080</lpage>.</citation></ref>
<ref id="B41">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Swaney</surname> <given-names>P. J.</given-names></name> <name><surname>Gilbert</surname> <given-names>H. B.</given-names></name> <name><surname>Webster</surname> <given-names>R. J.</given-names> <suffix>III</suffix></name> <name><surname>Russell</surname> <given-names>P. T.</given-names> <suffix>III</suffix></name> <name><surname>Weaver</surname> <given-names>K. D.</given-names></name></person-group> (<year>2015</year>). <article-title>Endonasal skull base tumor removal using concentric tube continuum robots: a phantom study</article-title>. <source>J. Neurol. Surg. Part B Skull Base</source> <volume>76</volume>:<fpage>145</fpage>. <pub-id pub-id-type="doi">10.1055/s-0035-1546613</pub-id><pub-id pub-id-type="pmid">27054057</pub-id></citation></ref>
<ref id="B42">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Tran</surname> <given-names>P. T.</given-names></name> <name><surname>Chang</surname> <given-names>P.-L.</given-names></name> <name><surname>De Praetere</surname> <given-names>H.</given-names></name> <name><surname>Maes</surname> <given-names>J.</given-names></name> <name><surname>Reynaerts</surname> <given-names>D.</given-names></name> <name><surname>Sloten</surname> <given-names>J. V.</given-names></name> <etal/></person-group>. (<year>2017</year>). <article-title>3D catheter shape reconstruction using electromagnetic and image sensors</article-title>. <source>J. Med. Robot. Res.</source> <volume>2</volume>:<fpage>1740009</fpage>. <pub-id pub-id-type="doi">10.1142/S2424905X17400098</pub-id></citation></ref>
<ref id="B43">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Vandini</surname> <given-names>A.</given-names></name> <name><surname>Bergeles</surname> <given-names>C.</given-names></name> <name><surname>Glocker</surname> <given-names>B.</given-names></name> <name><surname>Giataganas</surname> <given-names>P.</given-names></name> <name><surname>Yang</surname> <given-names>G.-Z.</given-names></name></person-group> (<year>2017</year>). <article-title>Unified tracking and shape estimation for concentric tube robots</article-title>. <source>IEEE Trans. Robot.</source> <volume>33</volume>, <fpage>901</fpage>&#x02013;<lpage>915</lpage>. <pub-id pub-id-type="doi">10.1109/TRO.2017.2690977</pub-id></citation></ref>
<ref id="B44">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Vardazaryan</surname> <given-names>A.</given-names></name> <name><surname>Mutter</surname> <given-names>D.</given-names></name> <name><surname>Marescaux</surname> <given-names>J.</given-names></name> <name><surname>Padoy</surname> <given-names>N.</given-names></name></person-group> (<year>2018</year>). <article-title>Weakly-supervised learning for tool localization in laparoscopic videos</article-title>. <source>arXiv</source> arXiv:<fpage>1806</fpage>.<lpage>05573</lpage>. <pub-id pub-id-type="doi">10.1007/978-3-030-01364-6-19</pub-id></citation></ref>
<ref id="B45">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Vasilyev</surname> <given-names>N. V.</given-names></name> <name><surname>Gosline</surname> <given-names>A. H.</given-names></name> <name><surname>Veeramani</surname> <given-names>A.</given-names></name> <name><surname>Wu</surname> <given-names>M. T.</given-names></name> <name><surname>Schmitz</surname> <given-names>G. P.</given-names></name> <name><surname>Chen</surname> <given-names>R. T.</given-names></name> <etal/></person-group>. (<year>2015</year>). <article-title>Tissue removal inside the beating heart using a robotically delivered metal mems tool</article-title>. <source>Int. J. Robot. Res.</source> <volume>34</volume>, <fpage>236</fpage>&#x02013;<lpage>247</lpage>. <pub-id pub-id-type="doi">10.1177/0278364914543671</pub-id></citation></ref>
<ref id="B46">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Voros</surname> <given-names>S.</given-names></name> <name><surname>Long</surname> <given-names>J.-A.</given-names></name> <name><surname>Cinquin</surname> <given-names>P.</given-names></name></person-group> (<year>2007</year>). <article-title>Automatic detection of instruments in laparoscopic images: a first step towards high-level command of robotic endoscopic holders</article-title>. <source>Int. J. Robot. Res.</source> <volume>26</volume>, <fpage>1173</fpage>&#x02013;<lpage>1190</lpage>. <pub-id pub-id-type="doi">10.1177/0278364907083395</pub-id></citation></ref>
<ref id="B47">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Webster</surname> <given-names>R. J.</given-names></name> <name><surname>Jones</surname> <given-names>B. A.</given-names></name></person-group> (<year>2010</year>). <article-title>Design and kinematic modeling of constant curvature continuum robots: a review</article-title>. <source>Int. J. Robot. Res.</source> <volume>29</volume>, <fpage>1661</fpage>&#x02013;<lpage>1683</lpage>. <pub-id pub-id-type="doi">10.1177/0278364910368147</pub-id></citation></ref>
<ref id="B48">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Wedel</surname> <given-names>A.</given-names></name> <name><surname>Cremers</surname> <given-names>D.</given-names></name></person-group> (<year>2011</year>). <source>Stereo Scene Flow for 3D Motion Analysis</source>. <publisher-loc>Berlin, Heidelberg</publisher-loc>: <publisher-name>Springer-Verlag</publisher-name>. <pub-id pub-id-type="doi">10.1007/978-0-85729-965-9</pub-id></citation></ref>
<ref id="B49">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Yang</surname> <given-names>C.</given-names></name> <name><surname>Zhang</surname> <given-names>L.</given-names></name> <name><surname>Lu</surname> <given-names>H.</given-names></name> <name><surname>Ruan</surname> <given-names>X.</given-names></name> <name><surname>Yang</surname> <given-names>M.-H.</given-names></name></person-group> (<year>2013</year>). <article-title>Saliency detection via graph-based manifold ranking</article-title>, in <source>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</source> (<publisher-loc>Columbus, OH</publisher-loc>), <fpage>3166</fpage>&#x02013;<lpage>3173</lpage>. <pub-id pub-id-type="doi">10.1109/CVPR.2013.407</pub-id><pub-id pub-id-type="pmid">28113655</pub-id></citation></ref>
<ref id="B50">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhang</surname> <given-names>Z.</given-names></name></person-group> (<year>2000</year>). <article-title>A flexible new technique for camera calibration</article-title>. <source>IEEE Trans. Patt. Anal. Mach. Intell.</source> <volume>22</volume>, <fpage>1330</fpage>&#x02013;<lpage>1334</lpage>. <pub-id pub-id-type="doi">10.1109/34.88871822</pub-id></citation></ref>
<ref id="B51">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zorn</surname> <given-names>L.</given-names></name> <name><surname>Nageotte</surname> <given-names>F.</given-names></name> <name><surname>Zanne</surname> <given-names>P.</given-names></name> <name><surname>Legner</surname> <given-names>A.</given-names></name> <name><surname>Dallemagne</surname> <given-names>B.</given-names></name> <name><surname>Marescaux</surname> <given-names>J.</given-names></name> <etal/></person-group>. (<year>2018</year>). <article-title>A novel telemanipulated robotic assistant for surgical endoscopy: preclinical application to ESD</article-title>. <source>IEEE Trans. Biomed. Eng.</source> <volume>65</volume>, <fpage>797</fpage>&#x02013;<lpage>808</lpage>. <pub-id pub-id-type="doi">10.1109/TBME.2017.2720739</pub-id><pub-id pub-id-type="pmid">28678698</pub-id></citation></ref>
</ref-list>
<fn-group>
<fn fn-type="financial-disclosure"><p><bold>Funding.</bold> This work was supported by a grant from ITMO Cancer in the framework of Plan Cancer under the project named ROBOT; by French state funds managed by the ANR within the Investissements d&#x00027;Avenir program under the ANR-11-LABX-0004 (Labex CAMI); and by ANR under grant ANR-18-CE19-0012-01 (MACROS project).</p>
</fn>
</fn-group>
</back>
</article>