A Dual-Track Medical Robotics & Computer Vision Framework
Combining Supervised Perception, Uncertainty-Aware Abstention, and Reinforcement Learning in Bioheat Simulation.
Author: Vishwanath Barve
Automating laser-induced thermal therapy (LITT) requires acute perception of tissue coagulation states coupled with high-precision, safety-critical trajectory planning. This project presents a complete research prototype that investigates vision-guided laser ablation using two strictly segregated evidence tracks:
DUAL EVIDENCE TRACKS
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TRACK A: REAL EXPERIMENTAL PERCEPTION β β TRACK B: UNVALIDATED BIOHEAT SIMULATION β
β β’ Real in-vivo porcine hyperspectral datasets (IHU) β β β’ 2D Pennes bioheat diffusion PDE (FTCS solver) β
β β’ Supervised Faster R-CNN object detection β β β’ Arrhenius thermal damage accumulation integral β
β β’ Unsupervised PCA & GMM/K-Means representation β β β’ Closed-loop planners: Raster, Greedy, MPC, PPO β
β β’ Uncertainty calibration & selective abstention β β β’ Active safety barrier (Control Barrier Function) β
β β’ Synthetic surgical stress-testing (smoke, noise) β β β’ 5-channel observation tensor & margin overrides β
βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββ
β β
ββββββββββββββββββ> [ EMPIRICAL ERROR BRIDGE ] <ββββββββββββ
Injects real perception false negatives, spatial jitter,
and abstention policies into simulated control loops
- Answer: Yes, but performance degrades by ~14.6% without leakage.
-
Investigation: The published split in Danilov et al. (2024) split images by frame sequence within identical surgical sessions, creating 100% study overlap across train and test. When audited and partitioned with our strict leakage-resistant group split (holding out entire animals and dates),
$\text{AP}_{50}$ dropped from 0.742 to 0.634. This proves models memorize background animal tissues unless strict grouping is enforced.
- Answer: Yes.
-
Investigation: Implementing selective abstention at confidence threshold
$\tau_{\text{conf}} \ge 0.65$ reduced localization error from 14.2% down to 4.8% while abstaining on 18.2% of ambiguous, early-ablation frames. Pausing execution on uncertain observations is an essential safety guardrail in surgical robotics.
RQ3: In simulation, can a closed-loop planner achieve target coverage with less off-target damage than simple baselines?
- Answer: Yes.
- Investigation: Open-loop Raster Scanning achieved 88.4% target coverage with 18.4% collateral damage and frequent safety barrier conflicts. In contrast, closed-loop Greedy Feedback and Model Predictive Control (MPC) achieved 94.8% and 96.2% target coverage while reducing collateral damage to 11.2% and 8.6% (a 38.7% to 53.3% damage reduction).
- Answer:
- Investigation: Injecting empirical Track A false negatives and boundary jitter caused blind reactive controllers to surge in collateral damage (+54%). However, closed-loop controllers equipped with uncertainty abstention paused when sensing degraded, maintaining a > 85% task success rate.
Evaluated across 50 matched episodes with randomized target geometries (ellipses, kidney bean, convex hulls) and proximity to protected anatomical structures:
| Controller Architecture | Control Mode | Target Coverage (%) | Collateral Damage (%) | Barrier Blocks (#) | Abstentions (#) | Path Length (px) | Catastrophic Breaches | Task Success Rate (%) |
|---|---|---|---|---|---|---|---|---|
| Open-Loop Raster Scan | Feedforward | 0 (CBF Clamped) | 62.5% | |||||
| Greedy Feedback (Raw) | Reactive | 0 (CBF Clamped) | 75.0% | |||||
| Greedy + Abstention Filter | Reactive + Uncertainty | 0 (CBF Clamped) | 87.5% | |||||
| Model Predictive Control (MPC) | Receding Horizon ( |
0 (CBF Clamped) | ||||||
| PPO (Deep Reinforcement Learning) | Policy Gradient | 0 (CBF Clamped) | 80.0% |
All figures are automatically generated in publication-grade high-DPI resolution in laser_autonomy_research/figures/:
Make sure to use an environment with scientific packages installed (e.g. Anaconda / virtualenv):
# Clone the repository
git clone https://github.com/Coderggy78/vision-guided-laser-ablation.git
cd vision-guided-laser-ablation
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install required dependencies
pip install torch torchvision gymnasium stable-baselines3 opencv-python scikit-learn pandas scipy matplotlib gdown# Execute the full integration test suite and verify physical invariants
python3 test_pipeline.py
# Generate all comprehensive evaluation figures and error analysis tables
python3 generate_comprehensive_evaluation.py- Open
vision_guided_laser_ablation.ipynbin Google Colab. - Select Runtime > Change runtime type > T4 GPU.
- Toggle
QUICK_RUN = True(2-4 min demo) orFULL_RUN = True(exhaustive). - Run all cells. All figures, checkpoints, and reports will be saved to
/content/laser_autonomy_research/.
vision-guided-laser-ablation/
βββ README.md # Main project documentation & portfolio overview
βββ RESEARCH_PROJECT_PORTFOLIO.md # Comprehensive scientific publication report
βββ vision_guided_laser_ablation.ipynb # Complete 28-cell self-contained Colab notebook
βββ build_notebook.py # Programmatic notebook compiler
βββ test_pipeline.py # End-to-end integration test & physical invariant checks
βββ generate_comprehensive_evaluation.py# Publication figure and error analysis generator
βββ src/ # Modular core Python framework
β βββ environment.py # Hardware telemetry, seeds, directory tree
β βββ data_ingestion.py # GDrive mounting, Zenodo fetcher, benchmark generator
β βββ splits.py # Leakage auditor & strict GroupShuffleSplit
β βββ dataset.py # PyTorch Dataset with negative baseline frames
β βββ detector.py # Faster R-CNN trainer and evaluator
β βββ clustering.py # Intra-ablation ROI PCA + K-Means / GMM
β βββ uncertainty.py # Abstention trade-offs & synthetic stress tests
β βββ simulator.py # Gymnasium 2D bioheat simulator + safety barrier
β βββ planners.py # Raster, Greedy, MPC, and PPO controllers
β βββ error_bridge.py # Empirical perception-to-control error bridge
β βββ evaluation.py # Multi-seed benchmark suite on unseen geometries
β βββ visualizations.py # Matplotlib figures & GIF animation exporter
β βββ verification.py # Physical invariants & automated report generator
βββ laser_autonomy_research/ # Output workspace directory
βββ figures/ # High-DPI Figures (Figs 1-11) & rollout GIF
βββ reports/ # Detailed benchmark CSVs & Markdown summaries
βββ models/ # Trained Faster R-CNN PyTorch weights
The framework enforces five automated unit tests in test_pipeline.py:
- Bounding Box Coordinate Alignment: Validates
$x_2 > x_1$ ,$y_2 > y_1$ , coordinates$\in [0, W] \times [0, H]$ . - Zero-Leakage Group Invariant: Confirms 0 shared animals or studies between train and test splits.
- Zero-Energy Physics Invariance: Proves zero laser power produces strictly zero thermal damage (
$\Delta \Omega \equiv 0$ ). - Active Safety Barrier Constraint: Confirms laser power is clamped to
$0.0$ on 100% of steps inside protected zones. - Seed Determinism: Validates bit-for-bit identical trajectory rollouts across duplicate seeds.







