Source-linked AI summary

Shifted Window Temporal Transformer for YOLO-Guided Phase Recognition in Laparoscopic Cholecystectomy Surgery

Sheekar Banerjee, Md. Shahabuddin, Md. Mahbub Hasan Akash, Nabilah, Mohammad Arafat Hussain

arXiv:2610.35005v1cs.CV

TL;DR

The paper addresses unstable surgical-phase transitions and separate workflow tasks by combining Swin and temporal modeling, YOLOv11s instrument localization, and causal smoothing. On Cholec80, it reports 92% phase accuracy and an instrument mAP@0.5 of 0.863.

  • Problem

    Similar consecutive frames can make phase transitions ambiguous, and phase recognition and instrument detection are often treated separately.

    Source: §1 · pp. 2–3
  • Method

    The framework combines a Swin Transformer and Temporal Transformer for phase recognition with YOLOv11s instrument localization and causal temporal smoothing.

    Source: §1 · p. 3, §4 · p. 10
  • Results

    92.0% accuracy outperformed CNN-based and temporal convolutional methods and was competitive with transformer methods; phase macro F1 was 0.86 and instrument mAP@0.5 was 0.863.

    Source: §3 · pp. 8–10
  • Takeaways & Limitations

    The results support integrated surgical workflow analysis through simultaneous phase recognition and instrument localization.

    Source: §3 · p. 9

    Testing covered only one benchmark dataset, and limited time-interval flexibility could impede long-distance procedural modeling.

    Source: §4.4 · p. 14

Abstract

from arXiv · show

Intelligent operating rooms require accurate awareness of surgical workflow for better intra-operative decisions, teamwork, and surgical documentation. Therefore, accurately recognizing surgical phase during surgery is crucial. However, previous artificial intelligence-based methods provide fluctuating predictions for the transitions, restricting their clinical use. To address this challenge, we propose a clinically meaningful framework that integrates a Swin Transformer and Temporal Transformer Encoder (TTE) for effective surgical phase recognition and a parallel YOLOv11s network for real-time surgical instrument localization. To avoid phase flickering and to produce stable workflow predictions, a causal temporal smoothing is applied. The proposed framework is tested on the Cholec80 dataset for the simultaneous recognition of the surgical phases and instruments. The overall phase recognition accuracy of this model was 92%, and the macro average F1-score was 0.86. This performance surpasses CNN based methods such as EndoNet (81.7%) and SV-RCNet (85.3%), as well as temporal convolutional and transformer-based approaches including TeCNO (88.6%), Trans-SVNet (90.9%), and LoViT (91.5%). Besides, the module of instrument detection achieved mAP@0.5 = 0.863. The reliability of the results is confirmed, obtaining a high recognition rate of the workflows, and a high accuracy of the localization of the instruments. The proposed framework can serve as a foundation for intelligent surgical assistance, enriching situation awareness, and potential robotic surgery applications. Code will be made publicly available at: https://github.com/ac005sheekar/LapChol-Surgery-Swin-Cholec80

1 Introduction

Automated workflow analysis needs to identify both surgical phases and instruments, but similar consecutive frames can make phase transitions ambiguous. This work combines spatial-temporal phase modeling, instrument localization, and causal smoothing in a unified framework.

  • Workflow analysis requires both phase recognition and instrument identification, while similar consecutive frames can make spatial-only phase predictions ambiguous and unstable.Source: §1 · p. 2
  • Frame-level CNNs miss long-term temporal relations, while CNN-LSTM and CNN-GRU models are limited by sequential processing.Source: §1 · p. 3
  • The identified gaps include separate treatment of phase and instrument tasks, underexplored Swin-temporal integration, class imbalance, and prediction instability.Source: §1 · p. 3
  • The framework combines a Swin Transformer and Temporal Transformer with YOLOv11s for concurrent phase recognition and real-time instrument localization.Source: §1 · pp. 3–4
  • A causal rolling-queue smoothing strategy targets temporal consistency at runtime, with Cholec80 experiments aimed at stable real-time workflow analysis.Source: §1 · pp. 3–4

2 Results

The framework was evaluated on the Cholec80 test split (Videos 61–80) for phase recognition and instrument localization. Results cover phase-level performance, confusion patterns, qualitative detections, and YOLOv11s detection metrics.

2.1 Qualitative Instrument Localization

  • Qualitative examples show YOLOv11s locating multiple instruments, including Bipolar, Specimen Bag, Grasper, Clipper, Hook, and Irrigator, across varied surgical scenes.The predicted boxes are described as similar to visible instruments across viewpoints, illumination conditions, occlusions, and surgical contexts.Source: §2.1 · p. 4, Figure 1 · p. 5

2.2 Surgical Phase Recognition

  • 0.95 and 0.94 were the highest phase F1-scores for CalotTriangleDissection and GallbladderDissection, while CleaningCoagulation scored 0.73.Lower performance in some phases is associated with class imbalance and visual similarity between neighboring stages.Source: §2.2 · p. 5, Table 1 · p. 6
  • 92% overall accuracy, macro F1-score 0.86, and weighted F1-score 0.92 were achieved across 47,625 test samples.The overall performance is summarized in Table 2.Source: §2.2 · p. 5, Table 2 · p. 6
  • 92.0% accuracy outperformed CNN-based methods and TeCNO, while remaining competitive with transformer-based approaches on Cholec80.The comparison uses a smaller test subset (Videos 61–80) than prior methods (Videos 41–80); prior methods were not directly re-implemented.Source: §2.2 · p. 6

2.3 Confusion Matrix Analysis

  • Strong diagonal dominance appears in the normalized confusion matrices, with most errors between neighboring phases sharing similar anatomy and instrument use.Per-class F1-scores are strongest for major dissection phases and lower for more difficult or less frequent phases.Source: §2.3 · p. 6, Figure 3 · p. 7, Figure 2 · p. 7

2.4 YOLOv11s Instrument Detection

  • 0.863 mAP@0.5 and 0.84 F1-score were achieved by the YOLOv11s detector; Clipper had the highest AP at 0.959 and Irrigator the lowest at 0.787.Precision reached 1.00 at confidence threshold 0.977 and recall reached 0.92 at threshold 0.000; validation losses stabilized after approximately 30 of 50 epochs, with mAP@0.5:0.95 approximately 0.50.Source: §2.4 · pp. 7–8, Figure 4 · p. 8

3 Discussion

On Cholec80, the framework combines phase recognition and instrument localization, with most phase errors between neighboring phases and weaker detection for tools affected by occlusion. Its reported performance supports integrated surgical video analysis, while the evaluation scope and need for broader clinical testing constrain deployment claims.

3 Discussion

  • The detector performs particularly well for the Clipper, while occlusion, smoke, and fluid interference affect the Irrigator more.A detection threshold of 0.266 yields an F1-score of 0.84.Source: §3 · pp. 8–9
  • Causal rolling-window smoothing reduces isolated frame-level phase fluctuations, improving temporal consistency.Source: §3 · p. 9
  • 92% phase recognition accuracy, macro F1-score 0.86, and instrument-detection mAP@0.5 of 0.863 demonstrate performance across both tasks on Cholec80.The detector also achieves an F1-score of 0.84.Source: §3 · pp. 8–9
  • The framework could support surgical-video indexing and postoperative workflow review, but clinical deployment requires testing across clinics, surgeons, and operating-room conditions.Source: §3 · pp. 9–10
  • The comparison reports 92.0% accuracy and a macro-averaged Jaccard index of 0.76, but evaluates Videos 61–80 against prior results from Videos 41–80.Prior methods’ published metrics are used; the authors describe the comparison as conservative.Source: Table 3 · p. 9, §3 · p. 10

4 Methods

The framework combines spatial and temporal modeling for phase recognition with instrument recognition and localization. It uses Cholec80 video clips, class-imbalance measures, and causal temporal smoothing for inference.

4.1 Dataset

  • Cholec80 provides 80 videos from 13 surgeons, annotated frame by frame for surgical phase and instrument presence; videos 1–40, 41–60, and 61–80 are split for training, validation, and testing.Uniform downsampling reduces the videos from 25 fps to 1 fps, and the video-level split prevents temporal data leakage.Source: §4.1 · p. 11

4.2 Video Preprocessing and Temporal Clip Construction

  • Input frames are resized to 224×224, converted from BGR to RGB, and organized into overlapping 12-frame clips to preserve temporal context.The temporal window stride is 8 frames and the clip stride is 5 frames.Source: §4.2 · pp. 11–12

4.3 Model Architecture

  • A shared Swin Transformer and Temporal Transformer Encoder support phase classification and instrument recognition, alongside a parallel YOLO detector for instrument localization.The detector processes full-resolution frames; the classification stream models spatial features and temporal relationships.Source: §4.3 · p. 12

4.4 Loss Function and Class Imbalance

  • The model jointly trains seven-class phase classification and seven-label multi-label instrument recognition, using focal loss and inverse-frequency sampling to address class imbalance.A causal FIFO queue of length 10 applies majority voting over recent phase predictions to reduce frame-level fluctuations without future frames.Source: §4.4 · pp. 12–13
  • The evaluation is limited to Cholec80; the authors recommend larger multi-center validation, and note that smoke, bleeding, occlusion, lens fogging, and rapid camera motion may reduce performance.They also report that visually similar adjacent phases and rare phases or instruments can remain difficult to recognize.Source: §4.4 · p. 14

Statements and Declarations

The declarations report the study’s funding and competing-interest status, data and code availability, and ethics status.

Funding

  • No funds, grants, or other support were received during manuscript preparation.Source: Funding · p. 15

Competing Interests

Data Availability

Code Availability

  • Code is to be made public upon acceptance, and a surgical-phase-recognition demonstration is also announced.Source: Code Availability · p. 15

Ethics Approval

  • Ethics approval is listed as not applicable because the study used a public dataset and involved no human participants or animals.Source: Ethics Approval · p. 15
Loading 2610.35005v1…