{'fraction_non_alphanumeric': 0.029071652437047443, 'fraction_numerical': 0.014454771425483627, 'mean_word_length': 4.833412135539795, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Video-based assessment of intraoperative surgical skill

Purpose: The objective of this investigation is to provide a comprehensive analysis of state-of-the-art methods for video-based assessment of surgical skill in the operating room. Methods: Using a data set of 99 videos of capsulorhexis, a critical step in cataract surgery, we evaluate feature based methods previously developed for surgical skill assessment mostly under benchtop settings. In addition, we present and validate two deep learning methods that directly assess skill using RGB videos. In the first method, we predict instrument tips as keypoints, and learn surgical skill using temporal convolutional neural networks. In the second method, we propose a novel architecture for surgical skill assessment that includes a frame-wise encoder (2D convolutional neural network) followed by a temporal model (recurrent neural network), both of which are augmented by visual attention mechanisms. We report the area under the receiver operating characteristic curve, sensitivity, specificity, and predictive values with each method through 5-fold cross-validation. Results: For the task of binary skill classification (expert vs. novice), deep neural network based methods exhibit higher AUC than the classical spatiotemporal interest point based methods. The neural network approach using attention mechanisms also showed high sensitivity and specificity. Conclusion: Deep learning methods are necessary for video-based assessment of surgical skill in the operating room. Our findings of internal validity of a network using attention mechanisms to assess skill directly using RGB videos should be evaluated for external validity in other data sets.

Traditionally, surgical skill assessment was based upon direct observation of surgeons in the operating room (Vedula et al, 2017). But this method provides a subjective opinion of the assessing surgeon. As a result, the assessment is unreliable despite use of structured rating scales such as the objective structured assessment of surgical technical skill (OSATS) global rating scale. Unlike direct observation, video-based assessment enables asynchronous evaluation of surgeons' skill. In addition, video-based assessment can be used for providing surgeons with formative assessments, coaching surgeons, among other applications (Valanci-Aroesty et al, 2020;Pugh et al, 2020).
Currently, video-based assessment of surgical skill in the operating room is obtained either from ratings by peer surgeons or crowd raters (i.e., crowdsourcing) (Pugh et al, 2020). Self-assessment by surgeons is not accurate, particularly, among those with poor skill (Pandey et al, 2008). Crowd-sourced skill ratings correlate with expert ratings (Lendvay et al, 2015;Malpani et al, 2015;Powers et al, 2016), but some studies show low predictive value for the ratings (Aghdasi et al, 2015;Deal et al, 2017). Consequently, despite the efficiency with which skill ratings can be obtained with crowdsourcing, its role in routine assessments of surgical skill is not established. However, video-based assessment of surgical skill, either by peer surgeons or by crowd raters, is inherently subjective. Furthermore, video-based assessment by peers relies upon access to experienced raters. Thus, manual video-based assessment is a subjective and expensive approach to provide surgeons with skill assessments on a routine basis.
Surgical data science methods can address limitations of subjectivity and inefficiency in manual skill assessment through quantitative analysis of videos of the surgical field (Maier-Hein et al, 2017). The conventional approach to assess surgical skill using data was based upon instrument motion Ahmidi et al (2017). Although some methods to analyze surgical videos were developed, they were limited to the simulation setting and not adequately validated (Zia and Essa, 2018;Bettadapura et al, 2013;Zia et al, 2015;Sharma, 2014;Tao et al, 2012;Ahmidi et al, 2017). In fact, the majority of previous studies on surgical skill assessment using instrument motion or video data were limited to the simulation setting. Thus, despite their promise to address surgeons' need for efficient, reliable, and unbiased assessments of their skill, surgical data science methods to assess surgical skill in the operating room are not sufficiently developed.
Previously, we developed and evaluated a temporal convolutional neural network to assess skill using manually annotated instrument tips in video images (Kim et al, 2019). Our objective in this study is to develop and validate methods for assessment of surgical skill directly from videos of the surgical field. Using a dataset of 99 videos, we evaluated all existing algorithms to assess surgical skill with a uniform cross-validation setup and evaluation metrics. For skill assessment in the operating room using videos of the surgical field, to our knowledge, this dataset is the largest in the literature. The contributions of our work described in this paper are as follows: 1. An exhaustive evaluation of feature based methods to assess surgical skill in the operating room; 2. Evaluation of methods to directly analyze RGB videos to provide a surgical skill assessment; 3. A novel architecture for a deep learning method augmented with attention to assess surgical skill, towards explaining the predicted skill label / score.

Methods
In this section, we describe a comprehensive list of existing feature based approaches for surgical skill assessment considered in this work. Then, we present our tool detection based approach and a dual attention based approach for skill assessment.

Feature based approaches
We evaluate five approaches to obtain features from videos, which we then analyze with a linear support vector machine. The five approaches for feature extraction are described below.

Detectors (STIPs)
Following (Laptev, 2005), we use STIPs to identify regions in images that are key to developing useful feature representations. The video is convolved with a 3D Gaussian kernel to construct a 3x3x3 spatiotemporal second order moment matrix, which is composed of first order spatial and temporal derivatives averaged using a Gaussian weighing function. Gaussian smoothing is performed on this response function followed by non-maximal suppression.

Descriptors
We compute three different descriptors for each interest point detected using the approach described in Section 2.1.1: histogram of oriented gradients (HoG) to encode local spatial information in image patches (Dalal et al, 2006), histogram of optical flow (HoF) to describe localized flow in videos (Dalal et al, 2006), and motion boundary histograms (MBHs) to encode localized temporal information in X and Y components of the differential flow (Zia et al, 2016).

Features
Bag of Words (BoW) For BoW, we cluster descriptors of interest points in a video using a k-means algorithm to obtain a visual feature vocabulary, and use TF-IDF to compute the BoW feature (Robertson, 2004).
Augmented Bag of Words (Aug. BoW) The BoW feature lacks temporal information, which we find is important in assessing surgical skill. We first create a temporal vocabulary by classifying the time between interest points into N bins. We concatenate the visual and temporal vocabularies and compute n-grams. The n-grams are thus a sequence of events and sum of their times. This is a useful representation for surgical movements that take relatively longer periods of time and continue over a number of frames. We use TF-IDF to represent n-grams (Bettadapura et al, 2013).
Discrete Fourier Transform (DFT) / Discrete Cosine Transform (DCT) DFT and DCT extract motion information i.e. the frequencies of the different surgical action cluster categories [cite]. A transformation matrix or motion class matrix (MCM) is created from the learned clusters of the visual vocabulary using K-means, so that if a video has N frames, a KxN matrix is created that contains for each row i = 1,2, . . . , K, the counts of how many interest points in the nth frame belong to the cluster K. The DFT and DCT of this matrix are then calculated, where each entry in the calculated KxN matrix represents the nth frequency coefficient of the kth cluster. This matrix measures the repetitiveness of the different surgical actions in the videos. Since higher frequencies are a result of noisy or abrupt movements, the lowest D frequencies are used, and we get a KxD matrix. This matrix is flattened to get a K*D feature vector.

Sequential Motion Textures (SMT)
In SMT, spatiotemporal information is encoded in the form of gray level cooccurrence matrices (GLCMs) that are derived from frame kernel matrices of the MCM (Sharma, 2014). They represent the affinity of the elements of a matrix with respect to all the elements. The frame kernel matrices are obtained by splitting the MCM into time windows of specified width (W), which allows temporal information to be considered over a fixed time interval according to the length of the videos. This is followed by applying a radial basis frequency kernel and shifting the domain to grayscale. Texture patterns are then extracted from these matrices using GLCMs for different gray levels Ng, which encode both spatial relationships and motion dynamics in the surgical videos. After calculating the averaged and normalized GLCMs for the windows, 20 standard texture features are selected using sequential forward feature selection; this results in Wx20 features for each video (Marcano-Cedeno et al, 2010).
Approximate Entropy (ApEn) / Cross Approximate Entropy (XApEn) ApEn and XApEn are methods that construct entropy-based features that measure the amount of entropy in a given time-series input . Authors of  claim that entropy-based features help recognize predictable and regular patterns in time-series which in turn leads to better skill assessment from video-based descriptors and accelerometer data.
For ApEn, for each time series belonging to a motion class, it is dependent on the emdedding dimension m, radius r and time delay tau. Each time series is split into embedding factors (time windows) according to time delay, and then for each embedding factor the frequency of repeatable patterns is calculated from by summing up the Heaviside functions of the L-Infinity norm distance MCMs (PAPER). XApEn calculation is similar to ApEn, except that the the L-Infinity norm distance is calculated between embedding factors for time series for cluster pairs and is done for all the possible cluster pairs.

Tool detection approach for surgical skill from videos
There exists evidence that a machine can learn to recognize surgical skill from tool motion data (Kim et al, 2019) by learning a temporal convolutional neural network (TCN) on crowd sourced tool tip locations. Using a crowd sourcing approach, tool annotations can be obtained at scale to curate a large training corpus. However, an approach proposed in (Kim et al, 2019) requires the same level of annotation at test time which means that assessment is impossible for video samples without tool annotations. We address this limitation by learning to detect tool tips as keypoints of objects from video and analyze the predicted keypoints using a TCN (KP-TCN). This method thus allows us to accurately assess skill from video without requiring tool level annotation during inference.

Learning to detect surgical instrument tips
Given a trajectory of tool tip locations, Kim, et.al. (Kim et al, 2019) use a temporal convolutional neural network to model skill. In our pipeline, we include an additional stage to infer tool tip locations directly from images.
We model surgical tool tip locations as keypoints of objects. Let X = {x 1 , x 2 , . . . , x N } be a video with N images. We assume there exists annotations regarding tool locations y n = {p n 1 , . . . , p n K } for each frame x n where p n k ∈ R 2 is the pixel location of the k-th keypoint in frame n. Then, we wish to learn a keypoint detector F that minimizes the following objective for all available training videos with tool annotations: where d is a distance between the keypoints and q n k ∈ R 2 is the keypoint prediction given x n . In this work, we use a convolutional neural network based keypoint detector for F and train it in an end-to-end manner.

Temporal Convolutional Neural Networks
Given a trained tool tip localization network F, we use a temporal convolutional neural network (TCN) for skill assessment presented in (Kim et al, 2019) to predict skill from videos. Using F, we encode a video X = {x 1 , x 2 , . . . , x N } as a time-series of keypoint predictions Z such that: where z n = F(x n ) ∈ R 2K is the predicted pixel locations of K keypoints in frame x n .
Compared to trajectories of tool locations, (Kim et al, 2019) has demonstrated that first derivative information of tools (tool velocities) is a better representation for skill assessment. Hence, we calculate tool velocities by considering the difference in predicted keypoint locations between successive frames.
The final input to the TCN is represented as Z such that Z = {δz 1 , δz 2 , . . . , δz N } (3) where δz n = z n+1 − z n is the tool velocity at frame n.
We follow the TCN design proposed in Kim et al (2019) which stacks layers of a temporal convolution layer followed by batch normalization operator (CITE BN) and an activation functions (ReLU). For the l th layer of the TCN with F l 1-D convolutional filters, the output activation can be written as where h l is the output of the l-th layer, W l are the convolutional filter weights of the l th layer, σ(·) is a non-linearity (ReLU followed by batch-normalization operation) and * represents convolution. After the convolution operations, a global average pooling layer changes the size of the features in the temporal dimension to a fixed size, which is then fed into a linear layer for final classification. We train the TCN in an end-to-end manner using a standard cross entropy formulation.

Dual attention network for skill assessment from videos (ATT)
The TCN based approach assumes that the signal relevant to skill is embedded in the movements of the surgical instrument tip and learns to detect such patterns in an end-to-end manner using a convolutional neural network. In doing so, important contextual information such as visual changes in anatomy and instrument/anatomy interactions are omitted. In this section, we present an attention based method that performs skill assessment directly from RGB videos to address these issues. By using attention, the model implicitly attends to spatio-temporal regions of the video that is most relevant for the skill assessment task.
Our architecture includes a feature extractor and a LSTM module, both equipped with separate but dependent spatial and temporal attention mechanisms. Various past studies have shown the ability of attention to generate better context vectors as well as to localize the relevant parts of the input for the task (Bahdanau et al, 2014). We hypothesize that including attention in our model would enable us to localize time frames and locations in the video which might be useful for classification. Our detailed model architecture is presented below.

Video Representation
First, a ResNet encoder (He et al, 2016) extracts the features from a given sequence of RGB frames, and then a LSTM cell (Hochreiter and Schmidhuber, 1997) operates on those features to generate the final classification. We augment both the Resnet encoder and the LSTM Cell with attention (Xu et al, 2015), (Zhou et al, 2016).
For the spatial domain, we remove the head from the ResNet base, such that the model outputs D feature maps of size H × W . All the image frames are passed through this base network, and a feature vector is obtained. The output of the feature extractor is represented by is a spatial feature extracted from the spatial feature extractor and N is the number of frames in video.
Each of these frame features in turn consist of a D-dimensional positional activation map, which can be represented as where D is the dimension of the feature vector for each position in the image, and L = H × W is the number of positions in the image.

Spatial and Temporal Attention
After extraction, the features of each frame are sequentially passed through the LSTM cell. The hidden state of the LSTM cell from the previous frame is used to attend to the features of the current frame, using a 3 layer attention module.
The frame feature vectors F n are passed sequentially through the LSTM cell, and then both the hidden state of the LSTM cell and the frame feature vectors are used to compute the attention weights as follows where α ni are the positional attention weights, and f att is the spatial attention module, as described below.
where W f , W h and W c represent linear layers. Once the attention weights α ni are computed, the final context vector z n can be computed as The attention weighted frame encoding vectors so generated are then fed into a temporal attention mechanism. First, a soft alignment score is computed between the output features of all the frames and the last hidden state of the LSTM cell using matrix multiplication. Softmax operation is applied to these alignment scores, which are then used as attention weights to compute the attended feature vector from the LSTM outputs.
where z i is the spatial attention weighted frame encoding for frame i, M are the soft alignment scores, β are the temporal attention weights, H is the combined LSTM output for all frames, and r is the final temporal attention weighted encoding for the entire video.
Finally, a linear classification layer takes the attended feature encoding and generates the final classification. We use cross entropy loss and train the models for 1000 epochs with a step decay on plateau using stochastic gradient descent with an initial learning rate of 1e − 2.

Dataset
We used a dataset of 99 videos of capsulorhexis, which is a critical step in cataract surgery. The dataset is identical to that used in (Kim et al, 2019). The Johns Hopkins Medical Institutions Institutional Review Board approved this retrospective study. Each instance of capsulorhexis in the dataset was completely performed by one surgeon. A faculty surgeon operated in 28 instances and a trainee surgeon operated in 71 instances. Videos of the surgical field were captured directly from the operating microscope; therefore, the videos did not include information identifying the surgeon or the patient. We processed each video to a resolution of 640*480 at 59 frames per second.
One expert surgeon watched each video and assigned a rating for skill using the International Council of Ophthalmology's Ophthalmology Surgical Competency Assessment Rubric for phacoemulsification (ICO-OSCAR:phaco) (Golnik et al, 2013). ICO-OSCAR:phaco includes two items to assess skill for capsulorhexis corresponding to surgical two goals in this step -commencement of flap & follow-through (CF), and capsulorhexis formation and completion (RF). Each item is rated on a scale of 2-5.
We specified the ground truth in two ways. First, we specified a binary skill class label -expert / novice. Videos assigned a score of 5 on at least one item for capsulorhexis in ICO-OSCAR:phaco and at least a score of 4 on the other item were labeled expert; otherwise, the videos were labeled novice. Second, we specified a 3-class label for each item in ICO-OSCAR:phaco as a score of either 2 or 3, 4, or 5.
For cross-validation purposes, we randomly split the data into five folds to minimize total duration of videos and to ensure a similar distribution of expert and novice skill labels across the folds. Table 1 shows the distribution of videos in our dataset across the skill class labels.

Experiments
We performed two experiments -predicting a binary skill class (expert / novice), and predicting a score on each of the two items for capsulorhexis in ICO-OSCAR:phaco (i.e., 3-class label for CF and RF). We used the same five fold cross-validation folds in the data for both the experiments (Table 1). Holding each fold out at a time for testing, we 5 Binary Skill Class Expert 10 10 10 10 12 Novice 9 9 9 9 11 CF CF-2/3 4 1 3 4 2 CF-4 8 9 6 6 10 CF-5 7 9 10 9 11 RF RF-2/3 6 4 5 5 3 RF-4 3 6 6 6 12 RF-5 10 9 8 8 8 iteratively used one of the remaining four folds for validation and trained on the rest of the three folds. We used the model configuration and hyperparameters for which accuracy on the validation fold was highest.

Feature based approaches
To compute STIPs, we use windows of 6 seconds with a 2 second overlap on each side. The frame rate for input videos is 59 fps, resulting in 520 frames for each window. We use a 3x3x3 Gaussian kernel with spatial variance of 4 and temporal variance of 8 for the convolution. We use a Gaussian kernel with variance 1 to smooth the response function. The top 1000 STIPs are used for our experiments.
For HoGs, we extracted a 9x9x9 patch centered on each STIP, split it into 9 windows, and computed 8 gradient orientations resulting in a 72-dimensional feature vector. For HoFs, we used a 17x17x17 image patch centered on each STIP. We computed optical flow within the patch, and split it into 9 windows to compute 9 gradient orientations to obtain a 81-dimensional vector. For MBHs, we used 17x17 patches separately in the X and Y components of the optical flow that we split into 25 windows and compute 8 gradient orientations (HoGs). This gives a 400-dimensional vector (after concatenating the vector for X and Y components). We concatenated all three descriptors, resulting in a 513-dimensional vector, to compute features for each video.
For k-means in Aug. BoW, we evaluated K = 25, 50, and 100 and using Euclidean and Mahalanobis distance. We computed n-grams using interspersed, cumulative, or pyramid encoding, where n = 3 and 5. In interspersed encoding, the temporal information is the time between events (or cluster labels), and this is encoded in sequence of the cluster labels occurring in the videos. This is useful for short surgical movements that take small amounts of time and are independent in the frames of the videos. Cumulative encoding encodes temporal information over a (user specified) sequence of events, and sums this up. Pyramid encoding creates l-grams for all of the specified n-grams from 1 to n. This can be interpreted as breaking down surgical movements and representing them at different levels. We used 5 bins to create the temporal vocabulary, following previous recommendation (Bettadapura et al, 2013;Zia and Essa, 2018).
For DFT and DCT, the frequencies for each cluster time series in the MCM are calculated, and the 50 lowest frequencies are selected from each to ignore noisy frequencies. This gives a K * 50 vector for each of DFT and DCT, resulting in a 2xKx50 dimensional vector. The top 30 features are then selected using the SFFS feature selection method, yielding a final 30-dimensional frequency feature vector. SFFS works by evaluating the effectiveness of each individual feature using a classifier, and selecting the top n (specified by user) features.
For entropy-based methods, we combined features from ApEn and XApEn. The dimensionality of features for ApEn is r * K, and for XApEn is r * K * (K − 1)/2, where K is the number of clusters, and ApEn and XApEn features are concatenated to produce a single feature vector. We have τ fixed at 1 (according to (Zia and Essa, 2018)), and m taking values of 1 and 2. r coef f takes values 0.1, 0.15, 0.2, 0.25, where r = r coef f * σ where σ is the standard deviation of the time series.

Neural network approaches
All neural network based approaches are implemented using the PyTorch (Paszke et al, 2019) framework and trained using K80 GPUs.
For tool detection, we train the HR-Net (Sun et al, 2019) using tool tip annotations of (Kim et al, 2019). We use standard image augmentations during training which includes horizontal flip, shift-scale-rotate, brightness and Contrast adjustments. We follow the optimization proposed in (Sun et al, 2019) and use weighted focal loss (Lin et al, 2017) with a positive weight of 3 and 1-cycle learning rate schedule with an initial learning rate of 1e-2. We used the Adam optimizer for training.
For TCNs, we use an Adam (Kingma and Ba, 2014) optimizer with a learning rate of 1e-3 and models train for 50 epochs. Given a time-series of tool tip predictions, we learn to predict skill class in an end-to-end fashion using standard cross entropy loss.
To train the dual attention network, we sample video snippets of 64 frames, sampled with a stride of 4 frames from each video. The image frames are normalized, and flip and rotate data augmentations are applied. The models are trained for 100 epochs with Adam (Kingma and Ba, 2014) optimizer with an initial learning rate of 1e-2. We decrease the learning rate by a factor of 10 as validation loss plateaus. We again adopt a standard cross entropy loss.
At inference time using dual attention networks, a video is represented as clips of 64 frames sampled 4 frames apart to be consistent with training. The clips overlap by 32 frames. Predictions are made individually on all the clips and averaged to produce the final output.
We also evaluated a network trained with without attention (No ATT), using the same implementation described above for the dual attention network.

Statistical Analyses
To evaluate algorithm performance in each experiment, we computed the area under the receiver operating characteristic curve (AUC) as the primary metric, in addition to sensitivity, specificity, positive and negative predictive values (PPV, NPV), and accuracy (both micro-and macro-accuracy Kim et al (2019)). We used bootstrap to compute 95% confidence intervals (CI) for AUC and computed the Wilson interval for the remaining measures (Agresti, 2003). We used the method described in (Hand and Till, 2001) to estimate AUC and bootstrap to compute 95% CI for alogrithms predicting a score on each item for capsulorhexis in ICO-OSCAR:phaco.

Results
Feature based approaches For predicting an expert / novice label using feature based methods, Figure 1 shows receiver operating characteristic (ROC) curves and estimates of AUC. Of the 5 methods, the estimated AUC was highest for Aug. BoW. The 95% CIs show that the estimated AUC was consistent with the null value (0.5) for BoW and SMT. For BoW and Aug. BoW the specificity was higher than sensitivity, whereas for DT, SMT, and ApEn sensitivity was higher than specificity ( Figure 2 and Table 1 in Supplementary Material).
For predicting a 3-class label for CF and RF, estimates of AUC for all the feature based methods were consistent with the null value, although estimates of micro-and macro-accuracy, sensitivity, and specificity indicate that algorithm performance may have been affected by the class imbalance in our dataset (Tables 2 and 3

in Supplementary Material).
Deep learning methods For predicting an expert / novice label using deep learning methods, Figure 3 shows ROC curves and estimates of AUC. Attention mechanisms significantly improved algorithm performance. The attention-based network had high AUC, in addition to higher sensitivity and specificity than the other two deep learning methods (Figure 4). Although KP had similar AUC as the attention-based network, the sensitivity and specificity were lower for KP than the attention-based network.
For predicting a 3-class label for CF and RF using deep learning methods, estimates of AUC were lower than that for expert / novice label prediction (Table 2). In addition, these methods had higher sensitivity and lower specificity for labels indicating better skill, and lower sensitivity and higher specificity for labels indicating poor skill (Table 3). This observation, together with estimates of micro-and macro-accuracy suggest that performance of deep learning methods was susceptible to class imbalance in CF and RF in our dataset.

Discussion
In this study, we evaluated multiple conventional feature based methods and deep learning methods to assess surgical skill in the operating room using a common data set, experiment setup, and performance measures. Our findings show that deep learning methods perform better than the feature based methods in terms of AUC (Figures 1 and 3). Furthermore, a network using attention mechanisms had the most desirable performance measures for skill assessment directly using RGB videos of the surgical field. Even when compared with a network trained using precise manual annotations of instrument tips (Kim et al, 2019), we observed higher sensitivity (0.843 vs. 0.824) and specificity (0.75 vs. 0.71) with the attention-based network. These findings not only indicate that precise annotations of instrument motion may not be necessary but also that it is useful to analyze the entire context in the surgical field to assess skill instead of analyzing instrument motion alone. It appears that deep learning is the way forward to develop algorithms for video-based assessment of intraoperative surgical skill. Among the conventional feature based methods, Aug.BoW showed higher measures of performance. However, external validity of deep learning methods and Aug. BoW should be determined with data from multiple surgeons at different hospitals.
As the state-of-the art on algorithms for video-based assessment of surgical skill in the operating room, this work shows feasibility and evidence of internal validity. Past studies using videos to assess surgical skill were limited to the simulation setting (Zia and Essa, 2018;Ahmidi et al, 2017;Vedula et al, 2017). Most studies on algorithms for surgical skill assessment in the operating room used instrument motion (Vedula et al, 2017). It is clear that instrument motion is informative for surgical skill assessment. In fact, our prior work using surgical video relied upon manual annotation of instrument tips in the images (Kim et al, 2019). Our findings from analysis of predicted instrument tips (KP) in this study reinforce our prior observation that instrument motion in capsulorhexis can be used to discriminate surgical skill. However, performance of algorithms using predicted keypoints were lower than that obtained from using precise manual annotations (AUC 0.79 vs. 0.86) (Kim et al, 2019). While it is likely that larger data sets can improve accuracy in predicted keypoints, and subsequently in skill assessment, future research should consider methods to encode additional context in the surgical field that is not limited to instrument motion.
Among the feature based methods, Aug. BoW, a simple method to analyze overall temporal information, performed better than the other methods. This is to be anticipated because Aug. BoW involves encoding of overall temporal information either at a low-or high-level depending on the type of encoding. On the other hand, DT, SMT, and ApEn involve extracting specific types of temporal features. This specificity limits their utility in a complex real-world environment of the operating room as opposed to a controlled simulated environment in which these methods were developed (Zia and Essa, 2018;. Furthermore, large variances in estimates of measures of discrimination for these methods, observed in our study, indicate that more data may be necessary to learn a useful classifier with the high-dimensional features. This means that estimates of performance of the feature based methods in our study are likely a consequence of the classifier over-fitting to the features. Despite the possibility that larger data sets may result in more accurate feature based methods, there is little in our findings to suggest that they will generalize to other data sets and be useful for surgical skill assessment in the operating room. Moreover, deep learning methods may lead to more potent discriminative classifiers when larger data sets are available given their end-to-end training. Performance of algorithms for video-based assessment should be evaluated in the context of the intended application. Video-based assessment of surgical skill in the operating room has multiple applications, each with different stakes or consequences. Surgical skill is associated with patient outcomes, therefore, interventions to improve surgeons' skill can advance quality of care. Skill assessment is key to training surgeons. It supports deliberate practice, and provides summative evaluation at the end of rotations, at the end of each year of training, etc. Some high-stakes applications of surgical skill assessment include certification and re-certification of surgeons for independent practice, determination of operating privileges, and end of career decisions. Not all applications of video-based assessment of surgical skill require the same algorithm performance profile. For example, applications with significant consequences of a false positive, such as certification of surgeons, may require higher specificity (and NPV) than sensitivity (and PPV). In fact, deep learning algorithms in our study, if shown to be externally valid, may not have sufficient specificity for high-stakes assessments, but they may be useful for routine training curricula. Regardless of the application, to be useful for surgeons to acquire skill, algorithms for surgical skill assessment should be valid and feasible. Consequently, ideal algorithms for video-based surgical skill assessment capture relevant information in video images instead of extraneous patterns in the data. This is typically analyzed by evaluating algorithms in external data sets or different procedures. While generalizability to other surgical procedures is desirable, external validity in other data sets of the same procedure is essential. Such studies should consider not only validity but also feasibility in terms of robustness to heterogeneity in data sources or data collection protocols (e.g., video resolution), and use cases.
Our study has a few limitations, besides a limited amount of data, that provide directions for future research. Our analyses did not account for multiple videos from the same surgeons. For prediction of scores on individual assessment items, imbalance in distribution of groundtruth labels may have adversely affected algorithm performance. We did not analyze sensitivity of algorithm performance to video resolution. Capsulorhexis is performed through microscopic surgical actions, therefore, videos with a high resolution may enable analysis of granular data patterns. In terms of attention mechanisms for skill assessment, our investigation did not include an analysis of the validity and correctness of the learned attention maps. To utilize the learned attention maps for an interpretable assessment of skill and generation of actionable feedback for the surgeon, a qualitative analysis of the usability, feasibility, and correctness of attention maps must be provided. Though our approach uses attention maps to implicitly localize relevant parts of the video without verification, a structured analysis of the acquired attention maps is an interesting direction for future research.
Our work, and other research on algorithms for surgical skill assessment in the operating room, is constrained by nontechnical reasons. In particular, there are no known prespecified minimal benchmarks that performance of algorithms for intraoperative surgical skill assessment should achieve. Such benchmarks depend upon the application or use case for the algorithms. While regulatory agencies typically set these benchmarks for medical devices used in patient care, including software as a medical device, (Carroll and Richardson, 2016), it is up to the surgical community to specify them for algorithms for surgical skill assessment in the operating room. These benchmarks are necessary to evaluate the impact of false positive and false negative algorithm predictions in an appropriate context. It is unlikely for any method to always return the correct prediction; thus, understanding incorrect predictions in the context of their application can ensure identifying methods that are useful and avoid discarding methods altogether.

Conclusion
Deep learning methods are necessary for video-based assessment of surgical skill in the operating room. While our findings show internal validity of deep learning methods for this purpose in capsulorhexis, testing them in additional data sets is necessary to establish their external validity.
• Acknowledgments: Dr. Austin Reiter, Assistant Research Professor at Johns Hopkins University, mentored this work in its early stages.
• Funding: Drs. Vedula, Sikder, and Hager are supported by a grant from the National Institutes of Health, U.S.A.; NIHR01EY033065. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.