Inspiration

Simulation software doesn't prepare surgeons enough. During surgery, many accidents happen and most software doesn't take into consideration what happens when something bad happens. Many companies create this software for the money and don't take accountability for the actual practice young surgeons need. The good VR surgery simulators also cost like $50k+, so most residents still get a lot of their reps on real patients.

What it does

We created a mechanism which replicates what an actual surgery is meant to feel like. We used a Meta Oculus Quest 2 to immerse yourself in the experience, and we had a camera connected to a Raspberry Pi 5 inside the box, so as you moved the tools in our replicated gallbladder, you could see the tools moving inside what looks like a real gallbladder surgery on the Oculus.

To replicate the gall bladder in real life, we used a ziploc baggy full of water to represent the gall bladder, and sponge, straws, cling wrap, etc. to represent the organs around it. The tools are literally chopsticks.

Then the AI part:

  • The video: every frame from the box gets redrawn as real laparoscopic surgery (wet liver, gallbladder with blood vessels, metal graspers) by FLUX.2 Klein running on an NVIDIA H100, about 0.3 seconds a frame. Your chopsticks stay exactly where they are, they just look like real instruments.
  • The director: NVIDIA Nemotron Nano 12B VL watches the same camera feed and runs the case. Nobody prompts it. It looks at each frame, figures out what each instrument is touching, and then calls tools: start_bleed, escalate_bleed, start_bile_leak, bp_drop, staff_say, mark_controlled... So if you poke the gallbladder, it starts bleeding, anesthesia calls out that the blood pressure is dropping, and the attending tells you to apply pressure. Hold steady pressure and it gets marked controlled.
  • Every tool call is checked against a fixed tool list and the case rules (cooldowns, no duplicate lines, can't "control" a bleed you didn't actually hold pressure on), then sent to the VR headset and the video model.
  • The dashboard shows everything live: the raw box camera, what the surgeon sees, what Nemotron sees and thinks, every tool call with its arguments and where it got sent, the patient's vitals, and the H100 being shared between the two models.

How we built it

The Module 3 camera connected to the Raspberry Pi streams the video (MJPEG over Tailscale) to an H100 we rented on Brev.

  • Restyle: FLUX.2 Klein 4B image-to-image with a long prompt that maps each prop to anatomy (green bag -> gallbladder, blue sponge -> liver, orange straw -> cystic duct, chopsticks -> graspers). We cache the prompt embeddings and only ever process the newest frame so it never lags behind.
  • Nemotron: Nemotron Nano 12B VL (FP8) served with vLLM on the same GPU. An observer step returns structured JSON about each instrument, a rules engine handles timing and vitals, and the director step picks tools from a JSON schema tool catalog.
  • VR: a three.js / WebXR operating room for the Quest with a patient, OR team, vitals monitor and the AI feed on the laparoscope monitor. A Node server is the event bus (WebSockets) between Nemotron, the video and the headset.
  • Dashboard: plain HTML/JS fed by the director's trace and live nvidia-smi stats from the GPU.

Challenges we ran into

Honestly the hardest part was figuring out what Nemotron was even good for. Nemotron Nano is a small model. It's fast, but it's kinda dumb. It can't plan a whole surgery, it can't do long reasoning, and if you give it too much freedom it goes off the rails. That's the main reason it took us so long to find a use case for it. Stuff we actually saw it do:

  • say both sticks were poking the gallbladder with 0.9 confidence when they weren't really touching it
  • try to escalate_bleed again and again even after it got rejected
  • have anesthesia call out a blood pressure of 30/20 out of nowhere
  • try to mark_controlled a bleed when nobody had held pressure at all

What finally worked was giving it a really small job it's actually good at: look at one frame, say what each stick is touching, and pick from a short fixed list of tools. A rules engine checks every call (cooldowns, no repeated lines, you can't "control" a bleed you didn't hold pressure on), so when it's dumb nothing bad happens, and when it's right the surgery reacts. Small and fast turned out to be what you want for something that has to watch live video and make lots of little calls, not one big smart answer.

We ran into many challenges including translating the movement from the camera to an animation on the laptop. We first tried tracking the sticks and animating 3D tools, then switched to having AI restyle the real camera feed, which looked way better.

  • Getting the restyle to keep the instruments where they really are. When we gave the model a reference image it copied the reference layout and ignored our sticks, so we went text-only.
  • The model kept drawing extra instruments (it turned the straws into tools), so we had to prompt it for exactly two.
  • Fitting two models on one GPU. Nemotron is fast on its own, but Klein uses most of the H100, so in our setup Nemotron takes a few seconds per decision.
  • We dropped the camera and the Pi fell off Wi-Fi mid-hackathon lol.

Accomplishments that we're proud of

  • A cardboard box and chopsticks actually look like a real lap chole in the headset.
  • Nemotron making real decisions from video by itself, not just answering a prompt.
  • The whole thing runs live end to end, camera to GPU to headset.

What we learned

  • Image models are fast enough now to restyle live video, if you pick a small model and only process the newest frame.
  • A small fast model like Nemotron Nano is great if you keep its job tiny and put guardrails around it. Don't ask it to be smart, ask it lots of small questions.
  • The video and the decisions need to be separate loops, so the picture never waits on the model.
  • Hardware is always the thing that breaks.

What's next for LapSim

  • Instrumented trocars (sensors on the ports) so the tool tracking doesn't depend on the camera.
  • Pumps in the box so the gallbladder physically bleeds when Nemotron says so.
  • A debrief/score at the end of each case from Nemotron's log.
  • Testing it with actual surgical residents.

Built With

Share this project:

Updates

Submission history