Code for 'Keep Your Eye on the Best: Contrastive Regression Transformer for Skill Assessment in Robotic Surgery', published in IEEE Robotics and Automation Letters (RA-L), February, 2023.
git clone https://github.com/anastadimi/Contra-Sformer.gitContra-Sformer is a video-based framework for automated skill assessment in robotic surgery, comparing test videos against reference videos representing optimal surgical execution. It combines ResNet-18 spatial feature extraction with temporal convolutional networks and an action-aware transformer to generate contrastive features that capture performance differences. The system achieves Spearman correlation scores of 0.65-0.89 on the JIGSAWS dataset across knot tying, needle passing, and suturing tasks. It identifies suboptimal execution and errors without explicit error annotations, enabling targeted feedback for surgical trainees during real-time assessment.
Set up the conda environment using the provided env.yml file. Download the ResNet-18 extracted features and cross-validation splits from the provided links. Run the experiment.py script specifying the surgical task (knot_tying, needle_passing, or suturing) and validation scheme (loso, louo, or 4fold).
Automated evaluation of surgical resident performance during training
Real-time feedback generation for robotic surgery trainees
Objective skill assessment across multiple surgical tasks
Error detection and localization in robot-assisted procedures
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/anastadimi/Contra-SformerCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
I need help implementing the Contra-Sformer model from the IEEE RA-L paper 'Keep Your Eye on the Best: Contrastive Regression Transformer for Skill Assessment in Robotic Surgery'. I'm working with [DATA] from [COMPANY]'s [INDUSTRY] robotic surgery platform. Can you provide a step-by-step guide to implement this model for skill assessment?
# Contra-Sformer Implementation Guide
## Step 1: Data Preparation
- Collect robotic surgery data from [COMPANY]'s platform
- Ensure data includes kinematic, visual, and expert feedback streams
- Preprocess data to match Contra-Sformer input requirements
## Step 2: Model Architecture
```python
class ContraSformer(nn.Module):
def __init__(self, input_dim, hidden_dim, num_heads, num_layers):
super().__init__()
self.encoder = TransformerEncoder(...)
self.contrastive_head = nn.Linear(...)
self.regression_head = nn.Linear(...)
```
## Step 3: Training
- Use contrastive loss for skill assessment
- Combine with regression loss for performance metrics
- Implement early stopping based on validation performance
## Step 4: Deployment
- Deploy model to [COMPANY]'s robotic surgery platform
- Set up real-time skill assessment pipeline
- Implement feedback loop for continuous improvementYour one-stop shop for church and ministry supplies.
Ensure accessibility compliance with real-time contrast ratio calculations and palette generation.
Automate your browser workflows effortlessly
IronCalc is a spreadsheet engine and ecosystem
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan