$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
The CaDIS and SICS-105 datasets used in this study are publicly available and were originally collected with prior institutional review board approval and informed consent, as reported in their respective publications. This study involves only secondary analysis of fully anonymized data, and therefore, no additional ethical approval or informed consent was required.
The suggested model was designed to predict postoperative vitrectomy complications by exploiting spatiotemporal patterns from intraoperative microscopy videos. The pipeline comprises four major stages: preprocessing, segmentation, feature extraction, feature optimization, and classification, as shown in Figure 1.
The intraoperative assessment of the risk of postoperative complications is the study's prediction target. The model cannot forecast clinically verified postoperative events within a specific time window because the CaDIS and SICS-105 datasets lack longitudinal follow-up data. Rather, it uses intraoperative surgical patterns to infer the probability of possible problems. Operational definitions of "complication" in this context include irregular phase transitions, anomalous instrument–tissue interactions, and variations in surgical workflow associated with greater surgical complexity. To ensure interpretability and reliable evaluation, the prediction job is designed as a binary classification problem that classifies cases into low- and high-risk groups. Instead of serving as a direct clinical diagnostic system, this formulation allows the suggested framework to serve as an intraoperative decision-support tool.
Dataset Description:
The proposed model was evaluated on two datasets: dataset A (CaDIS, Cataract Dataset for Image Segmentation) and the SICS-105 (Small-Incision Cataract Surgery) dataset.
(i) CaDIS31: This dataset was developed for the task of segmentation in cataract surgery videos. This is introduced to complement the publicly available CATARACTS challenge dataset and thus aims to advance the development of DL schemes for the analysis of surgical videos. The dataset consists of 25 video recordings totaling 4,670 annotated frames, depicting several stages of cataract surgery (Supplementary Figure 1). Each frame is meticulously annotated, providing pixel-level labels needed for training and estimating the segmentation scheme. It serves as a benchmark for evaluating the DL model's performance on surgical videos.
(ii) SICS-105 (small-incision cataract surgery) dataset32: This dataset comprises 105 recordings performed by surgeons and annotated by four ophthalmologists over a 6-month period during 2023–2024, covering 20 phases (Supplementary Figure 2). The total video duration is 22 h and 39 min, with a resolution of 1920 × 1080 pixels (downsampled to 960 × 540) and 30 fps. An average video length is 12 minutes and 57 sec (σ=4:31 min) . A dataset is publicly accessible in the Zenodo repository at the URL: https://doi.org/10.5281/zenodo.13847781. Representative input samples are shown in Supplementary Figure 1 and Supplementary Figure 2. Although the CaDIS and SICS-105 datasets were originally designed for surgical phase recognition and segmentation in cataract surgery, there is limited information on postoperative vitrectomy complications. To address the lack of information on postoperative vitrectomy complications, we propose a set of proxy labels for risk information based on intraoperative visual patterns and events in the video sequence. The frames and video sequences in the datasets were annotated with three-level risk information (low, moderate, high) according to a set of heuristics inspired by clinical understanding, including instrument-tissue interaction complexity, surgical duration abnormalities, occlusion, instability, and abnormal motion. The proposed formulation does not use clinical outcomes as labels but rather treats them as proxy labels for risk information on potential postoperative complications.
Preprocessing using cGAN approach
Typically, raw frames are often degraded by illumination variation, blur, and specular artifacts. To address this, a conditional Generative Adversarial Network (cGAN) is used to enhance the video. Raw frames are the original, unprocessed frames extracted directly from intraoperative microscopy video recordings, prior to any enhancement or normalization. These frames typically contain artifacts such as illumination variability, motion blur, specular reflections, and noise arising from surgical instruments and camera movement. A generator restores clean frames while a discriminator enforces visual realism. The objective function that integrates pixel reconstruction, adversarial, and temporal consistency losses, ensuring artifact-free and stable sequences of video for further analysis.
A degraded frame It at time step t is the generator's input, while an improved frame Yt = G(It) is its output. Conditioned on the input It, the discriminator is trained to distinguish between the generated output and the ground truth clean frame Yt. The training objective incorporates several loss functions to guarantee high-quality reconstruction: (i) adversarial loss to enforce realism; (ii) pixel-wise reconstruction loss (L1 loss) to maintain intensity fidelity; (iii) perceptual loss to preserve structural consistency using deep feature representations; and (iv) temporal consistency loss to ensure smooth transitions across consecutive frames and prevent flickering artifacts.
To ensure high-quality input for feature extraction, intraoperative microscopy videos are initially enhanced using a cGAN. Each raw frame It* is considered a degraded observation of a clean frame . A generator G learns a mapping G(It) = It for restoring enhanced frames, whereas the discriminator D distinguishes between real and generated samples. A training objective integrates adversarial loss Ladv, , perceptual loss Lperc pixel-based reconstruction loss Ll1, and temporal consistency Ltemp.. This model suppresses blur, specular artifacts, and noise while maintaining temporal and structural coherence, yielding stable, artifact-free video sequences for downstream analysis. The formulation of GAN is expressed in Equations [1-6] of the Supplementary File 1.
Segmentation using Contour Adaptive Segmentation (CAS)
In this, segmentation is performed using a contour-adaptive segmentation model. This defines preliminary outlines for segmenting affected vitrectomy images in microscopy images, thus reducing the energy function, as shown in equations [7-12] in Supplementary file 1. The low energy value ensures precise representations and localized evaluation of regions at risk. This, in turn, allows precise segmentation of affected regions, which subsequently facilitates feature extraction in the subsequent section.
Feature Extraction using Dynamic spatiotemporal GCN(dGCN)
Once the preprocessing stage is complete, the next step is to extract discriminative spatiotemporal features. For this reason, a Graph Convolutional Network (GCN) is used, as it is effective at capturing structured dependencies. The adopted model comprises stacked GCN layers with non-linear activations that mitigate overfitting and address the gradient vanishing problem through a normalization mechanism. The GCN formulation relies on a first-order spectral approximation of graph convolutions, making it suitable for large-scale semi-supervised learning tasks. Moreover, the linearized representation simplifies optimization, thereby ensuring effective parameter learning. The operation of simplified GCN is expressed in Equations [13–15] of Supplementary File 1. When applied, GCN efficiently extracts higher-level structural representations from intraoperative video data. Subsequently, only the most relevant or appropriate features are thus retained over an optimization-aided selection mechanism, which is described in the subsequent section.
Feature Optimization using Adaptive Sunflower-based feature optimization (ASFO)
The Adaptive Sunflower Optimization Algorithm (ASFO) is an enhanced version of the Classical Sunflower Optimization Approach (SFOA). In the suggested model, this biologically driven process is mathematically modeled to address refinement and feature selection in a high-dimensional dataset. Specifically, this approach is tailored to improve convergence speed, balance exploration and exploitation to preserve solution diversity, and mitigate premature convergence. The mathematical formulation of ASFO is stated in Equations [16–21] of Supplementary File 1. This scheme accelerates convergence once solutions are near optimal. The detailed algorithm is provided in Supplementary File 1. In the proposed pipeline, ASFO is used to refine the feature vector after transformer-based fusion. The selected features are texture-based, color and intensity, morphological and structural, motion and temporal, high-dimensional, and attention-weighted region descriptors. The objective is to minimize the feature-relevance loss function, thereby selecting and weighting features that enhance classification accuracy by reducing redundancy.
Transformer-based classification head with spatiotemporal attention pooling
A transformer-based model is used to capture temporal dependencies across surgical video sequences. The model is configured with multi-head self-attention, positional encoding, and fully connected layers for final risk prediction. Hyperparameter optimization is performed using ASFO. The integrated pipeline combines preprocessing, feature extraction, optimization, and transformer-based classification to enable accurate surgical risk prediction.