SurgicalMamba: Reprogramming States for Accurate Real-Time Recognition of Surgical Stages

7 September 202635 views

The new two-way SSD model adds state rotation at chunk boundaries and adaptive decay at phase transitions to distinguish repeated scenes in long operations. The approach maintains low per-frame computational cost and achieves state-of-the-art accuracy on benchmarks, including Cholec80 and AutoLaparo.

SurgicalMamba: Reprogramming States for Accurate Real-Time Recognition of Surgical Stages

Why online phase recognition is a hard problem

An online system that tracks the progress of a surgery must output a label for the current stage on every new frame. It has no access to future frames: it can only rely on what it has already seen. At the same time, a surgery lasts for hours, and the cost of processing a single frame must not grow with each passing hour of the recording. Otherwise, the model will no longer be able to keep up in real time.

Formally, recurrent architectures based on SSD — structured state-space duality — fit this constraint. They carry the entire history into a hidden state, and the amount of computation per frame remains fixed. But the SSD layer has its own peculiarity: the transition within each head is defined by a single scalar. This scalar simultaneously determines both "where" the current frame lands in the state and how quickly information from the state is forgotten.

For video surgeries, this rigid coupling gets in the way. Visual patterns — the appearance of instruments, tissues, regions of interest — repeat across different stages. A new occurrence of an image is written over the old one, and as a result, two similar episodes differ only in how long ago they happened. The loss function does not give the model an explicit signal about when exactly the old content of the state has stopped being useful. In addition, the phases themselves vary greatly in length: some last seconds, others take up a noticeable part of the entire procedure, and visually the surgery may look almost unchanged.

State regramming and forgetfulness control

The authors of the work — Sukju Oh and Sukkyu Sun — propose the SurgicalMamba model to address this. Their solution is not to completely replace the recurrent layer, but to fix the behavior of the carried-over state.

The first mechanism is called state regramming. At the boundary of each processed chunk, the hidden vector is not simply passed forward but is rotated by an angle that depends on the content of the current chunk. Thanks to this, two similar fragments separated by another phase end up in different regions of the state space and stop overwriting each other. The model can distinguish them by context rather than only by age.

The second mechanism is modulation of decay at phase transitions. When the model detects a boundary between stages, it temporarily strengthens forgetting: the state is quickly cleared of information from the completed phase. Within the phase itself, decay remains slow so that context is preserved. The intensity of the clearing is tuned so that the model "survives" to the end of the longest phase and does not lose the needed context prematurely.

Importantly, both changes do not break the N-semiseparable structure of SSD, which means the previous complexity guarantee is preserved: O(d) per frame. The model remains light enough for streaming operation.

What the tests showed

On seven public benchmarks, SurgicalMamba achieves state-of-the-art accuracy. On the Cholec80 set, online accuracy reached 94.6%, and phase Jaccard — 82.7%. On AutoLaparo, the results are slightly lower but still notable: 89.5% and 68.9%, respectively. At the same time, on a single GPU, the model processes 312.88 frames per second — with a large margin for real time.

Phase Jaccard here matters more than plain accuracy: it checks how much the predicted phase intervals overlap with the ground truth. This is stricter about errors at boundaries, where systems usually make the most mistakes.

Interestingly, the mechanism works not only in surgery. If you add just the state rotation operation to a standard Mamba2, it improves the MQAR metric — the ability to extract several previously seen items from a long context. The improvement appears precisely where the recurrent state was the bottleneck. This suggests that state regramming solves a more general problem of recurrent models, not just the task of surgical phase recognition.

Frequently asked questions

SurgicalMamba: Reprogramming States for Accurate Real-Time Recognition of Surgical Stages