A Real-Time Region Tracking Algorithm Tailored to Endoscopic Video with Open-Source Implementation

Jonathan P. Epperlein, Sergiy ZhukarXiv 2022 · DOI

Abstract

Researchers at IBM Research Europe have developed a real-time, open-source algorithm specifically designed to track regions of interest (ROIs) in endoscopic video. By aggregating optical flow data using a simple median-based approach, the tool successfully compensates for tissue deformation and camera movement, outperforming standard "off-the-shelf" trackers in speed and reliability for medical applications.

Introduction

In clinical endoscopy—particularly when using fluorescent tracers like Indocyanine Green (ICG) to monitor blood flow—researchers need to analyze how light intensity changes over time in specific patches of tissue. However, tracking these patches is a significant challenge: the camera is handheld, the tissue is constantly deforming, and surgical tools or reflections frequently obscure the view.

Most computer vision "object trackers" are designed to follow distinct items (like a car or a pedestrian) against a background. In endoscopy, the ROI is often just a patch of pink tissue that looks exactly like the surrounding tissue. Standard trackers look for "objectness" (edges and unique features) that simply doesn't exist here, leading to poor performance. Furthermore, many specialized medical tracking algorithms are not open-source, leaving researchers to either track motion manually or write complex code from scratch.

The algorithm tracks multiple regions of interest (ROIs) across sequential frames of endoscopic video, despite the lack of distinct features in the tissue.

Methods

The proposed tracking method is based on Optical Flow, specifically utilizing the DISflow (Dense Inverse Search) algorithm due to its balance of speed and precision. Instead of trying to "recognize" the ROI in every frame, the algorithm calculates how every pixel in the image moves from frame $t$ to frame $t+1$.

To move the ROI box, the authors evaluated two aggregation strategies:

  1. Median Flow: The algorithm takes the median of all motion vectors within the ROI. This approach is highly robust to outliers; for example, if a surgical tool briefly passes through the box, the "erroneous" motion of the tool is ignored in favor of the underlying tissue movement.
  2. Affine Flow: This version fits an affine function to the flow field, allowing the ROI to scale (grow or shrink) as the camera moves closer or further away, while still maintaining its rectangular shape.

Experimental Evaluation

Because obtaining "ground truth" for moving tissue in live surgery is nearly impossible, the authors created a robust synthetic evaluation pipeline. They used 108 initial frames extracted from 17 liver laparoscopies and 37 colonoscopies. They then applied 50 random projective transforms (simulating rotation, scaling, and shearing) to these frames to create synthetic videos where the "true" location of the tissue is mathematically known. Random saturated regions were added to simulate bright reflections (specularities) common in endoscopic footage, resulting in a dataset of 48,600 video frames.

Key Results

The authors compared their algorithm against seven popular trackers in the OpenCV library, including CSRT, KCF, and the standard MedianFlow implementation.

Performance comparison of the proposed median and affine trackers against standard OpenCV implementations. The proposed median tracker offers a superior balance of accuracy (Jaccard Index) and speed (Average FPS).
  • Accuracy: The proposed median flow tracker maintained a Jaccard index (Intersection-over-Union) of 0.85 for 75% of all frames, making it the clear winner among real-time capable algorithms.
  • Speed: It maintains high frame rates suitable for real-time use. While the CSRT tracker showed slightly better resilience to rotation, it was 10 times slower than the proposed method, making it impractical for live clinical workflows.
  • Robustness: The median-based aggregation performed better than the more complex affine model. While the affine model should theoretically handle scaling better, the median approach was more stable in the face of the chaotic motion found in surgery.

Discussion and Limitations

The paper highlights that standard trackers (like KCF or TLD) fail because they try to build a model of what the ROI looks like. In endoscopy, the ROI's appearance changes constantly due to lighting and deformation, but its motion is usually consistent with the surrounding tissue. By using the median of the optical flow, the algorithm effectively filters out the noise of reflections and transient occlusions.

Despite its performance, several limitations remain:

  • No Re-acquisition: If an ROI leaves the frame or is completely obscured for too long, the tracker cannot "find" it again.
  • Drift: Over long periods (e.g., >15 minutes), small errors in optical flow can accumulate, causing the box to slowly drift away from the target tissue.
  • Lack of Self-Supervision: The current version doesn't "know" when it has failed. Future work involves a forward-backward error check to allow the algorithm to flag its own uncertainty.

The implementation is provided as an open-source Python tool, significantly lowering the barrier for medical researchers.

Summary updated

BibTeX
@misc{epperlein2022real,
  author = {Jonathan P. Epperlein and Sergiy Zhuk},
  title = {{A Real-Time Region Tracking Algorithm Tailored to Endoscopic Video with Open-Source Implementation}},
  year = {2022},
  eprint = {2203.08858},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.08858},
}
Figure