A method, apparatus, system, and storage medium for phase stability identification and rollback correction of surgical videos.

CN122574751APending Publication Date: 2026-08-14CHONGQING FUDIMAI DIGITAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0009]针对现有技术中所存在的不足,本发明提供了一种用于手术视频的阶段稳定识别与回退修正方法、装置、系统及存储介质,其解决了现有技术中存在的以下问题:手术视频阶段识别结果在时间维度上跳变频繁、稳定性差;在发生错误阶段切换后缺乏有效的自动回退纠错机制,导致系统陷入正向死锁;以及在追求识别稳定性的同时难以兼顾实时响应灵敏度,造成灵敏度与延迟之间的深度失衡

Benefits of technology

[0052]第一,实现了识别灵敏度与稳定性的平衡,通过高置信路径与中置信约束路径的双路径分级设计,对单帧预测证据的强度进行差异化响应。高置信路径采用较短的计数值阈值,确保在模型输出明确指向下一阶段时能够快速触发跳转,避免传统固定决策跨度导致的时序滞后问题。中置信约束路径采用较长的计数值阈值,并引入判别差异度进行精细化过滤,在中置信场景下通过饱和递减操作步进式衰减计数值而非盲目清零,在抑制电刀烟雾、器械快速掠过等短时高频噪声的同时,保留了不稳定趋势的历史证据。上述非对称设计使得系统无需大幅拉长判定窗口即可实现抗干扰效果,有效控制了识别延迟,满足了术中高危操作的即时响应需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122574751A_ABST
    Figure CN122574751A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, system, and storage medium for stage stability identification and backtracking correction in surgical videos. The method includes: acquiring the predicted probability distribution of candidate stages in video frames; extracting the first predicted probability of a first candidate stage and the second predicted probability of a second candidate stage; calculating the difference between the two as a discrimination difference degree; determining whether the first candidate stage is the next adjacent stage of the current stable stage; if so, generating a stage advancement trigger signal by performing dual-path hierarchical integration accumulation based on the probability threshold range of the first predicted probability; performing global stability verification on the trigger signal based on the average discrimination difference degree; entering a doubt state when the first candidate stage is a preceding stage and the average predicted probability of the current stage is lower than a doubt threshold; and calculating the backtracking percentage in the doubt state, performing stage backtracking if the percentage reaches the threshold. This invention achieves a balance between sensitivity and stability in surgical stage identification, and possesses automatic error correction and anti-oscillation capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and intelligent surgical navigation technology, and in particular to a method, apparatus, system and storage medium for stage stability recognition and rollback correction of surgical videos. Background Technology

[0002] With the continuous development of minimally invasive surgery, endoscopic surgery, and robot-assisted surgery, stage recognition based on surgical videos has gradually become a core supporting technology for intraoperative process management, surgeon behavior analysis, collaborative control of automated equipment, and digital twin surgical scenario driving. By determining the stage of the surgical process in real time or near real time, key timing reference signals can be provided for intraoperative navigation prompts, scene switching control, and postoperative data analysis.

[0003] In existing technologies, surgical stage identification typically relies on deep learning models that analyze surgical video images. These models may employ convolutional neural networks, temporal modeling networks, or attention-based mechanisms to classify and infer single-frame images or short time series, thereby outputting corresponding surgical stage predictions. In practical applications, these models often perform linear inference frame-by-frame or within fixed time windows, directly using the predicted category obtained from each inference as the determination of the current surgical stage.

[0004] However, in real surgical scenarios, factors such as changes in lighting conditions, smoke obstruction, instrument obstruction, and rapid changes in perspective can cause short-term fluctuations in the model's stage prediction results. This leads to frequent switching of stage labels between adjacent time points, thus affecting the stability of stage identification results in the time dimension. This problem is particularly pronounced near the boundaries of surgical stages, easily resulting in premature stage predictions or stage jumps.

[0005] Furthermore, when a model consistently outputs predictions with low confidence or systematic bias over a period of time, existing methods generally lack mechanisms to identify and handle such abnormal intervals. Once an erroneous stage switch occurs, it is often difficult to revert to a reasonable stage in a timely manner, thereby affecting the stability and reliability of subsequent intraoperative navigation prompts, augmented reality scene switching, or digital twin model-driven processes.

[0006] To address the stability issues of stage identification results, existing technologies attempt to introduce temporal constraints. For example, Chinese patent CN112818959A discloses a surgical procedure identification method, device, system, and computer-readable storage medium, the core of which lies in using historical stage sequences to perform conditional probability filtering on the current prediction.

[0007] While the aforementioned approaches have made some progress in smoothing random noise, they still suffer from the following significant drawbacks when dealing with linear surgical procedures with strict order: First, existing technologies typically employ a fixed decision span. To suppress long-term interference caused by factors such as smoke, the time span needs to be increased, directly leading to severe temporal lag in the identification results and failing to meet the immediate response requirements for high-risk intraoperative procedures. Second, surgical procedures have strong path dependence. Existing smoothing mechanisms are mostly unidirectional progressive designs. Once the model prematurely jumps to an erroneous stage due to systematic bias, the system will immediately fall into a deadlock state. Due to the lack of an effective logical rollback mechanism, even when high-confidence corrective evidence is subsequently observed, automatic state reset or logical self-healing cannot be achieved. Third, traditional methods only focus on the absolute value of the highest classification probability, ignoring the discriminative difference between the first and second candidate stages. At the ambiguous edge of stage switching, this lack of measurement makes it impossible for the system to distinguish between two different physical states: high-confidence and clear versus high-confidence but ambiguous, thus inducing unexpected stage oscillations.

[0008] Therefore, without significantly increasing system latency and computational complexity, how to stabilize the recognition results of surgical video stages, suppress erroneous switching caused by short-term noise, and achieve automatic backoff correction when the prediction results are continuously abnormal, thereby achieving a balance between real-time performance and stability, has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0009] To address the shortcomings of existing technologies, this invention provides a method, apparatus, system, and storage medium for stage stability recognition and rollback correction of surgical videos. It solves the following problems in existing technologies: the stage recognition results of surgical videos change frequently and have poor stability in the time dimension; there is a lack of an effective automatic rollback error correction mechanism after an erroneous stage switch, which leads to the system falling into a positive deadlock; and it is difficult to balance recognition stability with real-time response sensitivity, resulting in a deep imbalance between sensitivity and latency.

[0010] According to an embodiment of the present invention, a method for stage stability identification and backtracking correction of surgical videos includes the following steps:

[0011] S1. Obtain the surgical video stream, obtain the predicted probability distribution of the current video frame for each candidate stage through the preset stage recognition model, determine the first candidate stage with the highest probability and its first predicted probability, the second candidate stage with the second highest probability and its second predicted probability, calculate the difference between the first predicted probability and the second predicted probability, and obtain the discrimination difference degree.

[0012] S2. Determine whether the first candidate stage is the next adjacent stage of the current stable stage; if so, perform hierarchical integration accumulation through high confidence path and medium confidence constraint path according to the probability threshold interval of the first predicted probability; when the accumulated integral of any path reaches the preset number threshold of the corresponding level, generate a stage advance trigger signal.

[0013] S3. Perform a global stability check on the stage advance trigger signal based on the average discrimination difference within the time domain sliding window. When the average discrimination difference is not lower than the preset smoothing threshold, the check passes and the current stable stage is updated. If the check fails, the current stable stage is maintained.

[0014] S4. Monitor the persistence confidence of the current stable stage. When the first candidate stage is any stage earlier than the current stable stage, and the average prediction probability of the current stable stage within the time-domain sliding window is lower than the preset doubt threshold, the system switches from the stable state to the doubt state.

[0015] S5. In the state of suspicion, if the proportion of supported frames of the previous adjacent stage of the current stable stage within the sliding window is not less than a preset proportion threshold, then stage rollback is executed, the current stable stage is rolled back to the previous adjacent stage, and a global cache collaborative reset is triggered simultaneously. All stage forward trigger signals and stage rollback trigger signals are blocked within the preset protection time, and no stage switching operation is performed.

[0016] S6. Convert the current stable phase into a control signal and output it to an external surgical aid device.

[0017] Preferably, in step S2, the hierarchical integration accumulation through the high-confidence path and the medium-confidence constraint path specifically involves:

[0018] High-confidence path: When the first predicted probability is not lower than the first preset probability threshold, perform an accumulation operation on the first cumulative integral value: Otherwise, the first accumulated score will be cleared to zero.

[0019] Medium confidence constraint path: When the first predicted probability is not lower than the second preset probability threshold, but is lower than the first preset probability threshold, the second cumulative integral value is updated according to the comparison result of the discrimination difference degree and the preset difference threshold.

[0020] If the discrimination difference is not lower than the preset difference threshold, then the second cumulative integral value is incremented: ;

[0021] If the discrimination difference is lower than the preset difference threshold, then a saturation reduction operation is performed on the second cumulative integral value: ;

[0022] When the first predicted probability is lower than the second preset probability threshold, the second cumulative integral value is cleared to zero;

[0023] Among them, C1(t), C1(t-1) and C2(t-1) are the values ​​of the first and second cumulative integrals in the current frame, respectively, and the values ​​of the first and second cumulative integrals in the previous frame, respectively. This is the preset upper limit for the second cumulative score.

[0024] Preferably, in step S3, the global stability check of the stage advance trigger signal is performed only when the average discrimination difference within the time-domain sliding window is not lower than a preset smoothing threshold, and the check condition is to satisfy any of the following sub-conditions:

[0025] If the first accumulated points value reaches the corresponding first preset number of times threshold.

[0026] Alternatively, the second cumulative score reaches the corresponding second preset number of times threshold;

[0027] Otherwise, if the verification fails, the stage advance trigger signal is locked and the current stable stage is maintained.

[0028] Preferably, in step S4, the average predicted probability of the current stable phase within the time-domain sliding window is the cumulative survival confidence, calculated using the following formula:

[0029] ;

[0030] in, To accumulate the survival confidence, L is the length of the time-domain sliding window. This represents the predicted probability of the current stable phase corresponding to the i-th frame forward from the current time.

[0031] When the accumulated confidence level is lower than the preset doubt threshold, the system switches from a stable state to a doubt state.

[0032] Preferably, when the system is in a state of suspicion, if it detects that the first candidate stage of the current frame has reverted to the current stable stage, and the average prediction probability of the current stable stage within the time-domain sliding window rises above the preset suspicion threshold, then the system exits the state of suspicion, returns to the stable state, and resumes the execution of the hierarchical integral accumulation.

[0033] Preferably, in step S5, the percentage of frames is determined in the following way:

[0034] Count the number of frames that simultaneously meet the following two conditions within the time-domain sliding window. The first candidate stage is the stage adjacent to the previous stable stage, and the first predicted probability of the frame is not lower than the first preset probability threshold.

[0035] Calculate the rollback percentage Where L is the length of the time-domain sliding window;

[0036] when If the preceding adjacent stage is not earlier than the system's preset reference start stage, then the execution stage rollback occurs; wherein, This is a preset ratio threshold.

[0037] Preferably, the synchronous triggering of global cache collaborative reset in step S5 further includes:

[0038] Clear all accumulated points and empty the historical data within the time-domain sliding window to prevent phase oscillations caused by residual historical data;

[0039] After the preset protection period ends, resume the graded integral accumulation in step S2.

[0040] On the other hand, according to embodiments of the present invention, a device for stage stability recognition and rollback correction of surgical videos is also provided, comprising:

[0041] The discrimination difference calculation unit is used to obtain the prediction probability distribution of each candidate stage corresponding to the current video frame, determine the first candidate stage with the highest probability and its first prediction probability, the second candidate stage with the second highest probability and its second prediction probability, calculate the difference between the first prediction probability and the second prediction probability, and obtain the discrimination difference degree.

[0042] The dual-path integral counter unit is used to determine whether the first candidate stage is the next adjacent stage of the current stable stage; if so, it performs hierarchical integral accumulation through the high-confidence path and the medium-confidence constraint path according to the probability threshold interval of the first predicted probability; when the accumulated integral of any path reaches the preset number of times threshold of the corresponding level, a stage advance trigger signal is generated.

[0043] The sliding window statistics unit is used to perform a global stability check on the stage advance trigger signal based on the average discrimination difference within the time domain sliding window. If the check passes, the current stage is switched to the next adjacent stage; if the check fails, the current stable stage is maintained.

[0044] The doubt state determination unit is used to monitor the confidence level of the current stable stage; when the first candidate stage is any stage earlier than the current stable stage, and the average prediction probability of the current stable stage within the time domain sliding window is lower than the preset doubt threshold, the system switches from the stable state to the doubt state.

[0045] The rollback correction unit is used to perform a stage rollback if, under the suspected state, the proportion of supported frames of the previous adjacent stage within the sliding window is not less than a preset proportion threshold. The stage rollback will be performed to roll back the current stable stage to the previous adjacent stage, and all stage forward trigger signals and stage rollback trigger signals will be blocked within a preset protection time, without performing any stage switching operation.

[0046] On the other hand, according to embodiments of the present invention, a stage stability identification and rollback correction system for surgical videos is also provided, including a data acquisition module, a stage prediction module, a stage stability identification and rollback correction device for surgical videos as described in the above technical solution, and a signal output module.

[0047] The data acquisition module is used to acquire intraoperative video stream through a video input interface. The video input interface supports real-time stream parsing at a preset frame rate and has a built-in frame buffer for distributing image sequences to the stage prediction module according to a preset sampling step size.

[0048] The stage prediction module is used to infer the received video frames based on a preset stage recognition model, output the predicted probability distribution of each candidate surgical stage, and transmit it to the stage stability recognition and backtracking correction device.

[0049] The signal output module is used to convert the current stable stage label output by the stage stability identification and backtracking correction device into a control command, and output it to an external surgical aid device through the command output interface.

[0050] In another aspect, according to embodiments of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the step of determining differences in a stage stability identification and rollback correction method for surgical videos as described in any of the above technical solutions.

[0051] Compared with the prior art, the present invention has the following beneficial effects:

[0052] First, a balance between recognition sensitivity and stability is achieved through a dual-path hierarchical design using a high-confidence path and a medium-confidence constraint path, which differentiates the response to the strength of single-frame predictive evidence. The high-confidence path uses a shorter count threshold to ensure rapid triggering of the jump when the model output clearly points to the next stage, avoiding the temporal lag problem caused by the traditional fixed decision span. The medium-confidence constraint path uses a longer count threshold and introduces discriminative difference for fine-grained filtering. In medium-confidence scenarios, the count value is gradually decayed through a saturation-decreasing operation rather than blindly zeroing it. This suppresses short-term high-frequency noise such as electrosurgical smoke and rapid instrument movement while preserving historical evidence of unstable trends. This asymmetric design allows the system to achieve anti-interference effects without significantly lengthening the decision window, effectively controlling recognition latency and meeting the immediate response requirements of high-risk intraoperative procedures.

[0053] Secondly, this invention overcomes the forward deadlock defect of traditional solutions. Traditional methods are mostly unidirectional progressive designs. Once the model jumps prematurely to an erroneous stage due to systematic deviation, the system falls into a deadlock state and cannot recover automatically. This invention constructs a closed-loop self-healing path from a doubt state to a rollback state. When logical backflow is detected in the model prediction and the survival confidence of the current stage is lower than the doubt threshold, the system switches to the doubt state. In the doubt state, the proportion of rollback evidence is checked, and the proportion of high-confidence frames supporting rollback within the sliding window is counted. When the proportion meets the standard and the target stage is not earlier than the reference starting stage, nonlinear backtracking is performed, forcibly rolling back the current stable stage to the previous adjacent stage. This mechanism enables the system to automatically detect anomalies and complete state correction after encountering systematic prediction drift caused by large-area anatomical structure obstruction, endoscopic contamination, or prolonged instrument obstruction, avoiding the problem of a single erroneous jump causing a complete deviation.

[0054] Third, a quantitative metric for classification ambiguity is established. Traditional methods only focus on the absolute value of the highest classification probability, ignoring the discriminant difference between the first and second candidate stages. This makes it impossible to distinguish between high-confidence and clear-cut states and high-confidence but ambiguous states at the fuzzy edges of stage transitions, thus inducing unexpected stage oscillations. This invention defines the difference between the first and second predicted probabilities as the discriminant difference, and uses this as the core criterion throughout the entire process of forward transitions and reverse backtracking. In global stability verification, the average discriminant difference within the sliding window serves as a threshold condition for secondary verification; in reverse backtracking, the discriminant difference also participates in the screening of high-confidence evidence. Through this unified quantitative metric, the system can significantly reduce frequent transitions at stage boundaries and significantly improve recognition consistency across the temporal dimension. Attached Figure Description

[0055] Figure 1 A flowchart illustrating the steps of a method for stage stability identification and rollback correction in surgical videos provided by the present invention;

[0056] Figure 2 The overall decision-making flowchart of the surgical phase stability identification and backtracking correction method provided by the present invention;

[0057] Figure 3 A flowchart illustrating the process of the doubt state determination and stage rollback correction mechanism provided by this invention;

[0058] Figure 4 This is the state transition topology diagram for stable identification and rollback correction of surgical video stages provided by the present invention;

[0059] Figure 5 This is an architecture block diagram of a stage stability recognition and rollback correction system for surgical videos provided by the present invention.

[0060] In the above figures: S110, data acquisition module; S120, stage prediction module; S130, stage stability identification and backtracking correction device; S140, discrimination difference calculation unit; S150, dual-path integral counter unit; S160, sliding window statistics unit; S170, suspected state determination unit; S180, backtracking correction unit; S190, signal output module. Detailed Implementation

[0061] The following embodiments are merely illustrative of several optional implementations of the present invention and are not intended to limit the actual scope of protection of the present invention. Any equivalent substitutions or partial adjustments made by those skilled in the art to which this invention pertains, without departing from the core technical concept and logical essence of the present invention, to specific technical features, parameter ranges, or logical step sizes, should be covered within the scope of protection of the present invention. Engineering implementation details not explicitly defined in the specification should be understood in accordance with general technical specifications in the art. Furthermore, unless otherwise expressly stated in the text, the same or similar reference numerals in the figures represent technical units or logical nodes with the same or similar functions.

[0062] This invention relates to the fields of medical image processing, computer vision, and intelligent surgical navigation, specifically to a method, apparatus, and computer-readable storage medium for stable identification and backtracking correction of surgical stages based on video sequences. This invention is applicable to the automated identification and state management of surgical procedures with clearly defined stage sequences, particularly suitable for intraoperative scenarios where video is the primary information carrier, such as laparoscopic surgery, endoscopic surgery, and robot-assisted surgery. By modeling the misjudgment suppression and backtracking correction mechanisms during stage switching, the stability and consistency of stage identification results in the temporal dimension can be improved, providing reliable stage information support for intraoperative workflow analysis, surgical navigation prompts, automated equipment control, and postoperative data analysis.

[0063] The method involved in this invention can be deployed in online or near real-time video analysis systems, and can be used in conjunction with existing surgical stage recognition models or video understanding models. It does not depend on specific imaging equipment or surgical types, and has good versatility and engineering feasibility.

[0064] In terms of hardware support, the core logic of this invention is not limited to general-purpose computing terminals, but can be deeply integrated into the computing architecture of surgical navigation workstations, endoscopic image processors, or robot-assisted surgical consoles. The physical carrier layer includes at least a high-performance heterogeneous processor, a collaborative memory for dynamically maintaining state variables, and a video stream parsing interface. The processor's logical core is divided into multiple collaboratively operating functional units: a probability distribution generation unit is responsible for real-time parsing of the endoscopic video stream and outputting a score vector; a dual-path consistency integral discrimination unit performs controlled delay triggering of stage index flipping based on the discrimination difference degree and a preset threshold. In particular, the system allocates a dedicated time-domain sliding statistical buffer, i.e., a suspicion domain sliding window, in the storage space to verify the persistence confidence of the current stable stage. Through the instruction output interface, the processed stable stage signal is converted into a level signal or a standard communication protocol message, thereby driving the UI interface switching of external surgical assistance devices or the change of robotic arm movement mode.

[0065] Before proceeding with specific embodiments, a unified measurement standard is first established for the parameter system involved in this invention. Unless otherwise stated, all probability prediction values, difference indices, and proportion thresholds involved in this invention are calculated using small-dimensional calculations within a closed interval of 0 to 1 to avoid logical drift caused by cross-scale calculations.

[0066] The core terms are defined below.

[0067] 1. Discriminant Difference M: A key quantitative indicator in this invention, defined as the algebraic difference between the probability of the first candidate stage (Top-1) and the probability of the second candidate stage (Top-2) of the current video frame in the model output distribution, i.e., M = P1 − P2 (also referred to as confidence interval or margin in some code implementations). Its physical meaning lies in quantifying the deterministic margin of the classification instruction at the current stage. A larger M value indicates a greater probability gap between the first and second candidate stages, resulting in a clearer classification result; a smaller M value indicates that the model is indecisive between the first and second candidates, leading to lower reliability of the classification result.

[0068] 2. Reference Start-up Phase: This refers to the logical baseline phase determined by the system based on surgical preset information or the first frame recognition result after the system starts the inference flow or performs a reset action.

[0069] 3. Stable Existence Phase: This refers to the surgical status label that the system currently outputs and locks after verification by the stabilization algorithm in this embodiment, which is the current stable phase described in this embodiment.

[0070] 4. Two types of saturated integral counters: The system has two sets of built-in logic accumulation units with physical boundary constraints. The first counter (sensitive path counter, corresponding to variable K80) is used to process signals with extremely high confidence; the second counter (robust constraint path counter, corresponding to variable K50) is used to process signals in fuzzy intervals.

[0071] 5. Suspicion Domain Sliding Window, i.e., a time-domain sliding window, is used to dynamically cache historical prediction data and features from the most recent frames in a temporal buffer. It supports statistical verification of the survival confidence of the current stable phase and provides evidence chain support for phase rollback determination.

[0072] The specific values, structures, and operation sequences described in each embodiment are merely illustrative and can be replaced, combined, or transformed in accordance with the spirit of the present invention without departing from the main body of the present invention, and such transformations should fall within the protection scope of the present invention.

[0073] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0074] Example 1

[0075] This embodiment provides a method for stage stability identification and backtracking correction in surgical videos. The surgical process has a preset linear stage sequence. This method is suitable for automated stage identification and state management of surgical processes with clear stage sequence characteristics, and is particularly applicable to intraoperative scenarios where video is the primary information carrier, such as laparoscopic surgery, endoscopic surgery, and robot-assisted surgery. This method can be deployed in online or near real-time video analysis systems and can be used in conjunction with existing surgical stage identification models or video understanding models. It is not dependent on specific imaging equipment or surgical types, and has good versatility and engineering feasibility.

[0076] like Figure 1 As shown, the specific steps of the method in this embodiment are as follows:

[0077] S1. Obtain the surgical video stream, obtain the predicted probability distribution of the current video frame for each candidate stage through the preset stage recognition model, determine the first candidate stage with the highest probability and its first predicted probability, the second candidate stage with the second highest probability and its second predicted probability, calculate the difference between the first predicted probability and the second predicted probability, and obtain the discrimination difference degree.

[0078] S2. Determine whether the first candidate stage is the next adjacent stage of the current stable stage; if so, perform hierarchical integration accumulation through high confidence path and medium confidence constraint path according to the probability threshold interval of the first predicted probability; when the accumulated integral of any path reaches the preset number threshold of the corresponding level, generate a stage advance trigger signal.

[0079] S3. Perform a global stability check on the stage advance trigger signal based on the average discrimination difference within the time domain sliding window. When the average discrimination difference is not lower than the preset smoothing threshold, the check passes and the current stable stage is updated. If the check fails, the current stable stage is maintained.

[0080] S4. Monitor the persistence confidence of the current stable stage. When the first candidate stage is any stage earlier than the current stable stage, and the average prediction probability of the current stable stage within the time-domain sliding window is lower than the preset doubt threshold, the system switches from the stable state to the doubt state.

[0081] S5. In the state of suspicion, if the proportion of supported frames of the previous adjacent stage of the current stable stage within the sliding window is not less than a preset proportion threshold, then stage rollback is executed, the current stable stage is rolled back to the previous adjacent stage, and a global cache collaborative reset is triggered simultaneously. All stage forward trigger signals and stage rollback trigger signals are blocked within the preset protection time, and no stage switching operation is performed.

[0082] S6. Convert the current stable phase into a control signal and output it to an external surgical aid device.

[0083] Please see Figure 2 In a specific implementation process, the surgical video stream is first acquired, and video frames to be processed are extracted according to a preset sampling step size. The image data is then input into a preset stage recognition model. The stage recognition model is constructed based on a deep convolutional network and a temporal convolutional network, outputting the predicted probability distribution of all candidate surgical stages corresponding to the current frame. From the predicted probability distribution, the first candidate stage with the highest probability and its corresponding first predicted probability P1 are determined, and the second candidate stage with the second highest probability and its corresponding second predicted probability P2 are determined. Subsequently, the difference between the first and second predicted probabilities is calculated to obtain the discrimination difference degree M. .

[0084] The discriminant difference M is a key quantitative indicator in this invention. Its physical meaning lies in quantifying the deterministic edge of the classification instruction at the current stage. The larger the M value, the greater the probability difference between the first candidate stage and the second candidate stage, and the clearer the classification result; the smaller the M value, the more the model is in a state of indecision between the first and second candidates, and the lower the reliability of the classification result.

[0085] It should be noted that existing technologies typically rely solely on the maximum probability value P1 output by the model for stage determination. However, in actual surgical scenarios, the value of P1 may be high, but if the probability P2 of the second candidate stage is also high, it indicates that the model is indecisive between the first and second candidates. In this case, stage determination based solely on P1 is unreliable. This invention, by introducing a discriminant difference M = P1 − P2, effectively compensates for the lack of measurement in traditional methods that only focus on the absolute value of the Top-1 probability while ignoring the clarity of the classification boundary. This provides a quantitative basis for distinguishing between two physical states—high confidence and clear versus high confidence but ambiguous—in subsequent steps. The detailed physical meaning and function of the discriminant difference M have been explained in the terminology definition section and will not be repeated here.

[0086] After obtaining the first candidate stage and its first prediction probability P1, and the discrimination difference M, a saturated integral consistency check based on the two paths is performed:

[0087] Determine whether the first candidate stage is the next adjacent stage of the current stable stage; if so, perform hierarchical integration accumulation through high-confidence path and medium-confidence constraint path according to the probability threshold interval of the first predicted probability; when the accumulated integral of any path reaches the preset number of times threshold of the corresponding level, generate a stage advance trigger signal.

[0088] In existing technologies, stage identification systems typically employ fixed-length sliding windows or simple probability accumulation mechanisms to determine whether a stage switch has been triggered. This approach suffers from a significant imbalance between sensitivity and latency: if the window is too short, it cannot effectively suppress false switches caused by momentary interference such as smoke obstruction; if the window is too long, it results in severe time lag in the identification results, making it difficult to meet the immediate response requirements of high-risk intraoperative procedures. To fundamentally resolve this contradiction, this embodiment introduces a dual-path hierarchical integration mechanism, which performs split processing based on the intensity differences of single-frame predicted evidence, achieving differentiated responses to signals with different confidence levels.

[0089] Before initiating the integral update, a stage topology constraint check is performed. Entry into the counting accumulation stream is only permitted if the first candidate stage given by the model points to the topological successor stage of the currently surviving stable stage—that is, the next adjacent stage in a linear sequence. The significance of this constraint is that the surgical procedure has a strict linear order; any jump prediction that does not conform to the topological order should not trigger stage advancement. If the prediction result points to a non-successor stage, the system enforces a protective reset, synchronously clears the sensitive path integrator, and performs zeroing or step decay on the robust path integrator according to a preset strategy to ensure that jump instructions are always based on strict temporal logic.

[0090] Once the first candidate stage is confirmed as the next adjacent stage to the current stable stage, hierarchical integration accumulation is performed through the high-confidence path and the medium-confidence constrained path, respectively, based on the probability threshold interval where the first predicted probability P1 is located:

[0091] The processing logic for the high-confidence path is as follows: Evaluate whether the first candidate probability P1 reaches the first preset probability threshold. If this condition is met, it indicates that the model points to the next stage with extremely high confidence. Then, perform a step-by-step accumulation operation on the first cumulative integral value, i.e., the sensitive path integral value. Where C1(t) is the value of the first cumulative integral in the current frame, and C1(t-1) is the value of the first cumulative integral in the previous frame. This path prioritizes response sensitivity, enabling rapid generation of a transition signal while continuously acquiring high-confidence evidence. Once the count value of C1(t) reaches a first preset threshold number of times... The system immediately sends a jump activation signal to the decision-making unit.

[0092] If the probability of the first candidate, P1, does not reach the first preset probability threshold, the instantaneous failure protection of that path is triggered, the first accumulated integral value is forcibly reset to zero, and the decision flow of the robust path is switched. The consideration for this design is that the high-confidence path seeks a fast response to clear signals. Once any uncertainty occurs, the current accumulation should be decisively abandoned and handed over to a more cautious robust path for re-evaluation, so as to avoid ambiguous signals from entering the fast channel.

[0093] The processing logic for the confidence constraint path is as follows: When the first predicted probability P1 is between the second preset probability threshold and the first preset probability threshold, that is, P1 is not lower than the second preset probability threshold and is lower than the first preset probability threshold, the model confidence is in the fuzzy range. It is necessary to further filter effective signals by combining the discriminant difference degree. Based on the discriminant difference degree M, fine filtering is performed, and the discriminant difference degree M is compared with the preset difference threshold.

[0094] If M is not lower than the preset difference threshold, it indicates that although P1 is at a moderate level, the difference between the first candidate and the second candidate is large enough, and the classification result has sufficient discriminative power. At this time, an increment operation is performed on the second cumulative integral value, i.e., the robust path integral value: Where C2(t) is the value of the second cumulative integral in the current frame, and C2(t-1) is the value of the second cumulative integral in the previous frame. This is the preset upper limit for the second cumulative integral value. This increment operation is constrained by the upper limit Kmax to prevent the count value from growing indefinitely.

[0095] If M is lower than the preset difference threshold, it indicates that the model's judgment between the two stages is ambiguous, the model is wavering between the first and second candidates, and the classification result is unreliable. In this case, instead of directly zeroing the integral, a saturated step decay logic is used, the specific formula of which is: This saturation decay operation means that when the classification is not clear enough, a step-by-step decay is performed without causing the cumulative integral value to fall below zero. This is achieved through explicit introduction. In terms of interpretation, this invention establishes that the lower bound of the second cumulative integral value is zero, thus logically eliminating the possibility of negative count values.

[0096] This approach employs a saturated reduction strategy instead of direct zeroing, offering significant advantages over existing blind zeroing methods. The zeroing strategy treats sporadic single-frame jitter and persistent classification ambiguity equally. Once interference occurs in a frame, all historical accumulation is lost, requiring the system to re-accumulate evidence from scratch. In high-frequency interference scenarios, this can prevent the system from ever reaching the trigger threshold. In contrast, the saturated reduction strategy uses a step-by-step decay method, only reducing the score for brief interference while preserving most of the historical accumulation; for persistent classification ambiguity, it gradually reduces the accumulated value through continuous reduction. This differentiated processing mechanism enables the system to distinguish between brief random jitter and persistent classification ambiguity, suppressing high-frequency fluctuations while maintaining the ability to perceive real-time phase transitions.

[0097] This technique has significant physical safety implications for engineering implementation. In digital circuits or embedded processors, if unsigned integers are used to store accumulated integral values, performing a subtraction operation at zero can cause numerical wraparound. That is, subtracting 1 from 0 will not result in a negative 1, but rather in an extremely large positive integer, leading to the unexpected triggering of stage jump logic and causing serious errors in the surgical stage output. This invention, through a saturated decrement operator, completely avoids this wraparound risk from both the mathematical definition and program logic levels, thereby ensuring the absolute physical safety of surgical stage decisions in complex clinical environments.

[0098] Meanwhile, compared to the blind zeroing strategy, the saturated reduction approach in the medium confidence constraint path can retain some historical accumulated evidence when short-term interference occurs. The zeroing strategy treats occasional single-frame jitter as the same as continuous classification ambiguity, resulting in the complete loss of historical information; while the saturated reduction strategy, through step-by-step decay, enables the system to distinguish between brief random jitter and continuous classification ambiguity, suppressing high-frequency fluctuations while maintaining the ability to perceive the real stage transition.

[0099] If the first predicted probability P1 is lower than the second preset probability threshold, it indicates that the model's confidence in the prediction of the next stage is too low, and the second cumulative integral value will be forcibly reset to zero.

[0100] The two paths described above constitute an asynchronous achievement mechanism: the high-confidence path, also known as the sensitive path, uses a shorter count value and a first preset threshold number of attempts. As a condition for meeting the standard, a rapid response is desired; the moderately confident constraint path, i.e., the robust path, uses a longer count value and a second preset threshold number of times. As a condition for achieving the target, state stability is pursued. The magnitude relationship between the thresholds satisfies: the first preset probability threshold is greater than the second preset probability threshold; the first preset number of times threshold... Less than the second preset threshold number of times Preset upper limit equal This asymmetric threshold design reflects a differentiated suppression strategy for complex interference in the operating room: the stronger the signal, the faster the response; the weaker the signal, the longer the continuous verification is required.

[0101] When the cumulative score of any path reaches the preset number of times for its corresponding level, that is, when the first cumulative score reaches the first preset number of times threshold. Or the second cumulative score reaches the second preset number of times threshold. At that time, the generation phase advance trigger signal is generated.

[0102] It should be noted that the aforementioned dual-path integral accumulation mechanism is only activated when the model prediction points to a reasonable subsequent stage of the workflow. In actual operation, various situations may occur in the first candidate stage of the model prediction. This invention divides the identification state into three processing paths: the forward path, the anomaly detection path, and the silent path.

[0103] When the first candidate stage is the next adjacent stage of the current stable stage, the system enters the forward channel and performs hierarchical integration accumulation according to the high-confidence path and medium-confidence constraint path described in this step. When the first candidate stage is the previous adjacent stage of the current stable stage or an earlier preceding stage, the system enters the anomaly detection channel, which is handled by steps S4 and S5.

[0104] When the first candidate stage is neither the next adjacent stage of the current stable stage nor any preceding stage of the current stable stage (i.e., there is no direct topological adjacency between the prediction stage and the current stable stage), the system enters a silent channel, directly maintaining the current stable stage without triggering any integration accumulation operations or performing stage switching. The silent channel ensures that the system only responds to prediction results that conform to the linear logical sequence of the surgical procedure, ignoring jumpy or irrelevant stage predictions, further enhancing the stability and rationality of the recognition results in the temporal dimension.

[0105] Furthermore, a global stability check is performed on the stage advancement trigger signal based on the average discrimination difference within the time-domain sliding window. When the average discrimination difference is not lower than a preset smoothing threshold, the check passes and the current stable stage is updated; otherwise, the current stable stage is maintained.

[0106] In step S2, the dual-path integral counter determines whether to trigger a forward transition only from a local perspective (whether the first candidate stage in several consecutive frames points to the next stage). However, in real clinical settings, there exists a special type of interference scenario: due to factors such as electrosurgical smoke, saline rinsing, or rapid instrument movement, the model may predict the next stage with moderate confidence for several consecutive frames, resulting in a robust path integral meeting the target. However, from a global perspective, the overall classification clarity during this period may not be high, meaning the model lacks a clear judgment on which stage to select in each frame. Existing technologies generally lack a global verification mechanism for this type of systematic noise, which can lead to erroneous switching even when the overall classification quality is low.

[0107] To address the aforementioned issues, this step introduces a global stability quadratic check of a temporal sliding window as a gating condition for stage transitions. Specifically, a temporal sliding window dynamically caches historical data of the discrimination difference M of the most recent L frames. The length L of the sliding window is on the same order of magnitude as the preset threshold number of times the middle confidence constraint path corresponds to. Dynamic configuration ensures that the time span covered by the window is sufficient to encompass the transition interval of stage switching, thereby guaranteeing the smoothness and effectiveness of the statistics. The average discrimination difference is obtained by calculating the arithmetic mean of the discrimination difference M of each frame within the temporal sliding window. .

[0108] After the phase advance trigger signal is generated, it does not directly trigger a phase jump; it still needs to undergo a secondary global stability check using a time-domain sliding window. The specific check condition is: the average discrimination difference within the time-domain sliding window. Not lower than the preset smoothing threshold Only when the counter reaches the target signal in step S2 is the state of the trigger phase reversed; if the average discrimination difference is... If the value falls below this threshold, even if the counter reaches the target, the system will remain in the current stable phase and lock the jump instruction.

[0109] The above conditions can be formally expressed as a jump trigger signal. Conditions for it to take effect:

[0110] ;

[0111] If none of the above conditions are met, the verification is deemed to have failed, the system locks the forward trigger signal for this stage, and maintains the current stable stage unchanged.

[0112] The technical effect of this step is that, through the global statistical constraints of a time-domain sliding window, it physically filters out instantaneous high-confidence misjudgments caused by surgical smoke, rapid instrument movement, etc. Even if the local prediction confidence of a few frames is high and triggers the integration threshold, the system will still refuse to jump if the overall classification clarity over a period of time is insufficient. This multi-dimensional joint constraint ensures that the workflow signal is only allowed to move forward when continuous and clear visual evidence is available.

[0113] In real, lengthy surgeries, another thorny issue arises: once the system has entered a certain stage, extreme situations such as endoscopic lens contamination, large-area anatomical obstruction, or the field of view deviating from the surgical area can cause systematic prediction drift, leading the model to continuously misidentify the current scene as a previous stage. Existing technologies are mostly designed for unidirectional progression; once this occurs, the system lacks the ability to self-doubt and perceive whether the current stage is still valid, which is the root cause of forward deadlock.

[0114] To address the aforementioned issues, this embodiment employs an anomaly detection mechanism based on survival confidence monitoring, enabling the system to self-assess and question the effectiveness of the current stable phase.

[0115] like Figure 3 As shown, Figure 3 This is a flowchart illustrating the process of the doubt state determination and phase rollback correction mechanism provided by this invention. During operation, the persistence confidence level of the current stable phase is continuously monitored. This embodiment enables the system to perceive systematic prediction drift by constructing a switching mechanism from a stable state to a doubt state.

[0116] In this embodiment, the average predicted probability of the current stable phase within the time-domain sliding window mentioned in step S4 is the cumulative survival confidence, and the survival confidence is obtained by considering the cumulative survival confidence within the time-domain sliding window. To quantify: L is the length of the time-domain sliding window. This represents the predicted probability of the current stable phase in the i-th frame preceding the current time. The formula means calculating the average support probability of the model for the current stable phase over the past L frames.

[0117] It is understandable that the judgment condition based on the average value is mathematically equivalent to directly comparing the sum of the built-in confidence levels of the window with L times the preset doubt threshold. The size relationship between the two indicates that they are equivalent expressions of the same technical concept.

[0118] The system monitors the current stable phase's existence status in real time. When it detects that the first candidate phase points to any preceding phase earlier than the current stable phase (such as the previous adjacent phase or other earlier preceding phases), indicating a logical backflow in the model prediction, the system further evaluates the existence confidence. It's important to note that when the first candidate phase points to any discontinuous target phase earlier than the current stable phase (i.e., a preceding phase that skips more than two phases), and the cumulative existence confidence of the current stable phase within the sliding window is lower than a preset doubt threshold... At that time, the system is also triggered to transition from a stable state to a state of doubt. If the accumulated confidence level... Below the preset suspicion threshold If the current stable state is determined to have lost statistical support, the system state will officially transition from a stable state to a doubtful state.

[0119] Upon entering the doubt state, the system does not immediately execute a rollback operation, but instead enters an observation and evidence-gathering phase. This design consideration is that brief single-frame prediction backflow may be caused by transient noise; immediately rolling back due to this would trigger frequent back-and-forth switching. Therefore, the doubt state is essentially a buffer and evidence-gathering state, providing sufficient time for subsequent rollback decisions. In the doubt state, the system continuously monitors prediction changes within the temporal sliding window. If it detects that the first candidate stage of the current frame has reverted to the current stable stage, and the accumulated confidence level rises back to the preset doubt threshold... If the above is true, the previous anomaly is determined to be a false alarm. A self-healing action is then executed, resetting the suspected state to false, exiting the suspected state, restoring to a stable state, resuming normal integration discrimination, and resuming the hierarchical integration accumulation in step S2. This self-healing mechanism ensures that the system can automatically calibrate after encountering brief disturbances, rather than remaining permanently in an abnormal state.

[0120] It is important to note that the conditions for entering the suspicious state are relatively strict, requiring both predicted backflow and cumulative confidence levels below a threshold to be met simultaneously; while the conditions for exiting the suspicious state are relatively lenient, requiring only current predicted regression and a rebound in confidence. This asymmetric design of entry and exit conditions ensures that the system can promptly detect abnormalities in complex clinical environments without frequently switching between stable and suspicious states due to short-term fluctuations.

[0121] In the state of suspicion, if the proportion of supported frames in the previous adjacent stage of the current stable stage within the sliding window is not less than a preset proportion threshold, then stage rollback is performed, the current stable stage is rolled back to the previous adjacent stage, and a global cache collaborative reset is triggered simultaneously. All stage forward trigger signals and stage rollback trigger signals are blocked within a preset protection time, and no stage switching operation is performed.

[0122] The specific verification method is as follows: count the number of frames that simultaneously meet the following two conditions within the time-domain sliding window. :

[0123] Condition 1 is that the first candidate stage is the stage adjacent to the current stable stage;

[0124] Condition two is that the first predicted probability of the frame is not lower than the first preset probability threshold. Frames that meet both conditions are called support frames, which provide high-confidence evidence to support the backoff.

[0125] Calculate the rollback percentage Where L is the length of the time-domain sliding window;

[0126] rollback trigger command The Boolean decision logic is as follows: ,in, This is a preset ratio threshold.

[0127] When the above proportional constraints are met, i.e. If the previous adjacent stage is not earlier than the system's preset reference start stage, the system determines that the evidence for rollback is sufficient, performs a nonlinear state backtracking operation, and forcibly reverts the current stable stage pointer to the previous adjacent stage. The constraint of the reference start stage ensures that the rollback target will not exceed the reasonable surgical procedure boundaries.

[0128] While performing the rollback operation, the system simultaneously triggers a global cache reset action, including the following three operations.

[0129] First, the first cumulative integral value corresponding to the high-confidence path and the second cumulative integral value corresponding to the medium-confidence constraint path are forcibly set to zero.

[0130] Second, physically clear the historical probability sequence within the current time-domain sliding window, including the discrimination difference and prediction probability data of all historical frames;

[0131] Third, a preset-duration jump cooling-off protection period is initiated. During this period, the system is prohibited from responding to any stage forward trigger signal or stage back trigger signal, and no stage switching operation is performed. After the cooling-off protection period ends, the system resumes the hierarchical integration accumulation in step S2 and continues to operate normally.

[0132] Specifically, after each state transition (whether forward or backward), the system forces a global coordinated reset, clearing all temporal caches. This design ensures non-memory interference during state transitions, fundamentally eliminating frequent and repeated transitions caused by residual historical interference signals.

[0133] In summary, the technical advantage of this embodiment lies in achieving the system's closed-loop self-healing capability. Traditional methods, lacking an effective nonlinear logic rollback mechanism, will immediately fall into a positive deadlock state if the model prematurely jumps to an erroneous stage due to systematic bias. Even if subsequent high-confidence corrective evidence is observed, the state cannot be automatically reset. This invention, by constructing a closed-loop path from the doubtful state to the regression state, breaks the path deadlock of traditional surgical stage identification systems that only advance and never retreat. This enables the system to possess automatic self-healing capability after encountering systematic prediction drift caused by large-area anatomical structure obstruction or endoscopic contamination.

[0134] Finally, the current stable stage label, determined after the above steps, is converted into a control signal through the command output interface. The command output interface can be a high-speed serial bus, Ethernet, or a dedicated medical message interface.

[0135] The control signal is converted into a level signal or a standard communication protocol message to drive external surgical aids. These external surgical aids include, but are not limited to, surgical robots, augmented reality display terminals, or operating room management systems. Specific driving methods include: triggering interface transitions in the surgical navigation system; triggering scene overlay switching on the augmented reality display terminal; triggering the surgical robot to adjust the impedance compensation parameters of its robotic arm in real time, thereby achieving physical adaptive responses to different surgical steps; and triggering automatic switching of the operating room management system's UI and changes in its operating mode.

[0136] The method in this embodiment is not an abstract mathematical model. By linking with physical surgical aids, it transforms the stabilized stage recognition results into control actions for real-world devices, thus realizing a complete closed loop from image perception to physical execution.

[0137] To further illustrate the transition relationship of the stage identification state in this invention, Figure 4 The diagram illustrates the state transition topology for stable identification and backtracking correction in surgical video stages provided by this invention. This topology fully presents all the core logic of the system during the surgical procedure, specifically including two asymmetric decision paths.

[0138] The first path is a forward stable recognition path from stage N to stage N+1. When the system is in a stable state at stage N, the predicted evidence for each frame is double-verified based on the hierarchical integration accumulation mechanism in step S2 and the global stability check in step S3. Only when either path in the dual-path integrator reaches saturation and the average discrimination difference within the temporal sliding window meets the smoothness requirement, a state transition is performed, updating the current stable stage from stage N to stage N+1. This forward transition path embodies the rate-limiting protocol of the present invention, ensuring that the system will not prematurely flip due to instantaneous high-confidence misjudgments before obtaining continuous and clear visual evidence support.

[0139] The second path is a correction path that triggers a state of suspicion, performs a rollback check, and then returns to the previous stage. When the system is in a stable state at stage N, if a logical backflow is detected in the model prediction and the cumulative confidence level of the current stage falls below the suspicion threshold, the system transitions from a stable state to a state of suspicion. In the state of suspicion, the system performs a rollback percentage check, calculating the percentage of high-confidence evidence supporting a rollback to stage N-1 within the sliding window. If this percentage reaches a preset percentage threshold, a state rollback is performed, correcting the current stable stage from stage N to stage N-1, and simultaneously triggering a global state reset, clearing all accumulated integral values ​​and historical cached data, and entering a jump cooling-off protection period. If the evidence for rollback is insufficient in the state of suspicion, and the confidence level of the current stage rebounds, the system exits the state of suspicion and returns to a stable state.

[0140] The two paths described above together constitute the closed-loop design of this invention, which includes forward verification, grading of doubtful states, and backtracking error correction. The forward path features rigorous multi-level verification, while the backtracking path is sensitive and controlled. Through bidirectional state transitions between stable and doubtful states, the two paths enable the surgical phase identification system to achieve adaptive adjustment and closed-loop self-healing capabilities in complex clinical environments.

[0141] Example 2

[0142] like Figure 5 As shown, this embodiment provides a device for stage stability recognition and rollback correction of surgical videos. It is based on the same inventive concept as the method described in Embodiment 1, and the device includes:

[0143] The discrimination difference calculation unit S140 is used to obtain the predicted probability distribution of each candidate stage corresponding to the current video frame, determine the first candidate stage with the highest probability and its first predicted probability, the second candidate stage with the second highest probability and its second predicted probability, and calculate the difference between the first predicted probability and the second predicted probability to obtain the discrimination difference degree M. This discrimination difference degree M serves as the core criterion for classification determinism and is synchronously pushed to the counter management unit and the sliding window cache.

[0144] The dual-path integral counter unit S150 has a built-in first counter and a second counter, which is used to determine whether the first candidate stage is the next adjacent stage of the current stable stage; if so, it performs hierarchical integral accumulation through the high-confidence path and the medium-confidence constraint path according to the probability threshold interval of the first predicted probability; when the cumulative integral of any path reaches the preset number of times threshold of the corresponding level, a stage advance trigger signal is generated.

[0145] The sliding window statistics unit S160 dynamically maintains a time-domain sliding window buffer of a preset length. Based on the average discrimination difference within the time-domain sliding window, it performs a global stability check on the stage advancement trigger signal. When the average discrimination difference is not lower than a preset smoothing threshold, the check passes and the current stable stage is updated; otherwise, the current stable stage is maintained. This unit not only counts the average discrimination difference within the window (for secondary verification of jump decisions) but also monitors the cumulative confidence level of the current stable stage in real time, providing a chain of evidence to support subsequent anomaly detection.

[0146] The doubt state determination unit S170 is used to monitor the confidence level of the current stable stage. When a logical backflow is observed in the model prediction (i.e., the first candidate stage points to any preceding stage earlier than the current stable stage) and the probability of the current stable stage existing within the sliding window is lower than a preset doubt threshold, the system switches from the stable state to the doubt state.

[0147] The rollback correction unit S180 is used to perform a phase rollback if, under the suspected state, the proportion of supported frames in the previous adjacent stage within the sliding window is not lower than a preset proportion threshold. This rollback reverts the current stable stage to the previous adjacent stage and simultaneously triggers a global cache reset. Within a preset protection period, all stage forward and rollback trigger signals are blocked, and no stage switching operation is performed. This unit acts as the final logical review node, combining the compliance signal from the counting unit with the proportion statistics within the sliding window to issue execution instructions for forward, rollback, or maintenance. If a rollback is executed, the system simultaneously triggers a global cache cleanup, clears the sliding window, and resets all counters to prevent system oscillations caused by residual old states.

[0148] Each unit can be deployed on the same processor or in a distributed computing system and interconnected via a bus or network. The specific functional implementation of each unit is consistent with the corresponding steps in the method described in Embodiment 1, and will not be repeated here.

[0149] Example 3

[0150] This embodiment also provides a stage stability recognition and rollback correction system for surgical videos. The system includes a data acquisition module S110, a stage prediction module S120, a stage stability recognition and rollback correction device S130, and a signal output module S190. The modules are interconnected via a bus or network and can be deployed on the same processor or in a distributed computing system.

[0151] The data acquisition module S110 is used to acquire intraoperative video streams via a video input interface. This video input interface supports real-time stream parsing at 25 to 30 frames per second and has a built-in frame buffer for distributing image sequences to the stage prediction module at a preset sampling step size. The sampling step size can be set to process every frame or every 3 frames to achieve a balance between perception latency and processing power consumption. The video input interface can connect to various video sources such as endoscopic camera systems, surgical robot vision systems, or operating room panoramic camera systems.

[0152] The stage prediction module S120 is used to perform inference on the received video frames based on a preset stage recognition model. This stage recognition model is built based on a deep convolutional network or a temporal convolutional network and can calculate the predicted probability distribution vector of the current video frame for each candidate surgical stage; and transmit it to the stage stabilization recognition and backtracking correction device.

[0153] The stage stability identification and backoff correction device S130 internally includes a discrimination difference calculation unit S140, a dual-path integral counter unit S150, a sliding window statistics unit S160, a suspicion state determination unit S170, and a backoff correction unit S180. As the core layer of the system, this device is constructed as a self-healing closed-loop control system. It physically suppresses identification noise through a high-performance computing unit and performs temporal stability processing on the frame-by-frame prediction probability distribution output by the stage prediction module.

[0154] The signal output module S190 converts the current stable stage label, ultimately determined by the stage stability identification and backtracking correction device, into control commands. These control commands are output to external surgical aids via a command output interface. The command output interface can be a high-speed serial bus, an Ethernet interface, or a dedicated medical message interface. External surgical aids include surgical robots, augmented reality display terminals, or operating room management systems. The control commands trigger stage switching responses from these devices; for example, they may trigger the surgical robot to adjust the impedance compensation parameters of its robotic arm in real time to adapt to the mechanical requirements of different surgical steps, trigger the augmented reality display terminal to automatically switch the overlaid navigation information layer, or trigger the operating room management system's user interface to automatically jump to the corresponding stage's operating mode.

[0155] In this embodiment, the data acquisition module S110, the stage prediction module S120, the stage stability identification and backtracking correction device S130, and the signal output module S190 constitute a complete processing link. The data acquisition module S110 is responsible for video stream access and frame extraction; the stage prediction module S120 completes the semantic mapping from image to probability distribution; the stage stability identification and backtracking correction device S130 performs stability management and anomaly correction in the temporal dimension; and the signal output module S190 converts the processing results into control actions for external devices. These four links are sequentially connected, realizing a closed-loop processing chain from raw video stream input to adaptive control of surgical equipment.

[0156] Example 4

[0157] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the program implements all the steps of a stage stability identification and rollback correction method for surgical videos as described in any of the embodiments in Example 1.

[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for stage stability identification and backtracking correction in surgical videos, wherein the surgical process has a preset linear stage sequence, characterized in that, The method includes the following steps: S1. Obtain the surgical video stream, obtain the predicted probability distribution of the current video frame for each candidate stage through the preset stage recognition model, determine the first candidate stage with the highest probability and its first predicted probability, the second candidate stage with the second highest probability and its second predicted probability, calculate the difference between the first predicted probability and the second predicted probability, and obtain the discrimination difference degree. S2. Determine whether the first candidate stage is the next adjacent stage of the current stable stage; If so, then based on the probability threshold range in which the first predicted probability is located, hierarchical integration accumulation is performed through high-confidence paths and medium-confidence constraint paths; when the accumulated integral of any path reaches the preset number of times threshold of the corresponding level, a stage advance trigger signal is generated. S3. Perform a global stability check on the stage advance trigger signal based on the average discrimination difference within the time domain sliding window. When the average discrimination difference is not lower than the preset smoothing threshold, the check passes and the current stable stage is updated. If the check fails, the current stable stage is maintained. S4. Monitor the persistence confidence of the current stable stage. When the first candidate stage is any stage earlier than the current stable stage, and the average prediction probability of the current stable stage within the time-domain sliding window is lower than the preset doubt threshold, the system switches from the stable state to the doubt state. S5. In the state of suspicion, if the proportion of supported frames of the previous adjacent stage of the current stable stage within the sliding window is not less than a preset proportion threshold, then stage rollback is executed, the current stable stage is rolled back to the previous adjacent stage, and a global cache collaborative reset is triggered simultaneously. All stage forward trigger signals and stage rollback trigger signals are blocked within the preset protection time, and no stage switching operation is performed. S6. Convert the current stable phase into a control signal and output it to an external surgical aid device.

2. The method for stage stability recognition and backtracking correction of surgical videos according to claim 1, characterized in that, In step S2, the hierarchical integration accumulation through the high-confidence path and the medium-confidence constraint path is specifically performed as follows: High-confidence path: When the first predicted probability is not lower than the first preset probability threshold, perform an accumulation operation on the first cumulative integral value: Otherwise, the first accumulated score will be cleared to zero. Medium confidence constraint path: When the first predicted probability is not lower than the second preset probability threshold, but is lower than the first preset probability threshold, the second cumulative integral value is updated according to the comparison result of the discrimination difference degree and the preset difference threshold. If the discrimination difference is not lower than the preset difference threshold, then the second cumulative integral value is incremented: ; If the discrimination difference is lower than the preset difference threshold, then a saturation reduction operation is performed on the second cumulative integral value: ; When the first predicted probability is lower than the second preset probability threshold, the second cumulative integral value is cleared to zero; Among them, C1(t), C1(t-1) and C2(t-1) are the values ​​of the first and second cumulative integrals in the current frame, respectively, and the values ​​of the first and second cumulative integrals in the previous frame, respectively. This is the preset upper limit for the second cumulative score.

3. The method for stage stability recognition and backtracking correction of surgical videos according to claim 2, characterized in that, In step S3, the global stability check of the stage advance trigger signal is performed only when the average discrimination difference within the time-domain sliding window is not lower than a preset smoothing threshold. The check condition is that any one of the following sub-conditions is met: If the first accumulated points value reaches the corresponding first preset number of times threshold. Alternatively, the second cumulative score reaches the corresponding second preset number of times threshold; Otherwise, if the verification fails, the stage advance trigger signal is locked and the current stable stage is maintained.

4. The method for stage stability recognition and backtracking correction of surgical videos according to claim 2, characterized in that, In step S4, the average predicted probability of the current stable phase within the time-domain sliding window is the cumulative survival confidence, calculated using the following formula: ; in, To accumulate the survival confidence, L is the length of the time-domain sliding window. This represents the predicted probability of the current stable phase corresponding to the i-th frame forward from the current time. When the accumulated confidence level is lower than the preset doubt threshold, the system switches from a stable state to a doubt state.

5. The method for stage stability recognition and rollback correction of surgical videos according to claim 1, characterized in that, When the system is in a state of suspicion, if it detects that the first candidate stage of the current frame has reverted to the current stable stage, and the average prediction probability of the current stable stage within the time-domain sliding window rises above the preset suspicion threshold, then the system exits the state of suspicion, returns to the stable state, and resumes the execution of the hierarchical integral accumulation.

6. The method for stage stability recognition and rollback correction of surgical videos according to claim 2, characterized in that, In step S5, the percentage of frames is determined in the following way: Count the number of frames that simultaneously meet the following two conditions within the time-domain sliding window. The first candidate stage is the stage adjacent to the previous stable stage, and the first predicted probability of the frame is not lower than the first preset probability threshold. Calculate the rollback percentage Where L is the length of the time-domain sliding window; when If the preceding adjacent stage is not earlier than the system's preset reference start stage, then the execution stage rollback occurs; wherein, This is a preset ratio threshold.

7. The method for stage stability recognition and backtracking correction of surgical videos according to claim 1, characterized in that, The synchronous triggering of global cache collaborative reset in step S5 also includes: Clear all accumulated points and empty the historical data within the time-domain sliding window to prevent phase oscillations caused by residual historical data; After the preset protection period ends, resume the graded integral accumulation in step S2.

8. A device for stage stability recognition and rollback correction in surgical videos, characterized in that, include: The discrimination difference calculation unit is used to obtain the prediction probability distribution of each candidate stage corresponding to the current video frame, determine the first candidate stage with the highest probability and its first prediction probability, the second candidate stage with the second highest probability and its second prediction probability, calculate the difference between the first prediction probability and the second prediction probability, and obtain the discrimination difference degree. A dual-path integration counter unit is used to determine whether the first candidate stage is the next adjacent stage of the current stable stage; If so, then based on the probability threshold range in which the first predicted probability is located, hierarchical integration accumulation is performed through high-confidence paths and medium-confidence constraint paths; when the accumulated integral of any path reaches the preset number of times threshold of the corresponding level, a stage advance trigger signal is generated. The sliding window statistics unit is used to perform a global stability check on the stage advancement trigger signal based on the average discrimination difference within the time domain sliding window. When the average discrimination difference is not lower than a preset smoothing threshold, the check passes and the current stable stage is updated; otherwise, the current stable stage is maintained. The doubt state determination unit is used to monitor the persistence confidence of the current stable stage. When the first candidate stage is any stage earlier than the current stable stage, and the average prediction probability of the current stable stage within the time domain sliding window is lower than the preset doubt threshold, the system switches from the stable state to the doubt state. The rollback correction unit is used to perform a stage rollback if, under the suspected state, the proportion of supported frames of the previous adjacent stage within the sliding window is not less than a preset proportion threshold. The stage rollback will be performed to roll back the current stable stage to the previous adjacent stage, and a global cache collaborative reset will be triggered simultaneously. All stage forward trigger signals and stage rollback trigger signals will be blocked within a preset protection time, and no stage switching operation will be performed.

9. A system for stage stability recognition and rollback correction in surgical videos, characterized in that, It includes a data acquisition module, a stage prediction module, a stage stability recognition and rollback correction device for surgical videos as described in claim 8, and a signal output module; The data acquisition module is used to acquire intraoperative video stream through a video input interface. The video input interface supports real-time stream parsing at a preset frame rate and has a built-in frame buffer for distributing image sequences to the stage prediction module according to a preset sampling step size. The stage prediction module is used to infer the received video frames based on a preset stage recognition model, output the predicted probability distribution of each candidate surgical stage, and transmit it to the stage stability recognition and backtracking correction device. The signal output module is used to convert the current stable stage label output by the stage stability identification and rollback correction device into a control command, and output it to an external surgical auxiliary device through the command output interface.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the step of determining differences in a stage stability identification and backtracking correction method for surgical videos as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Operation process identification method, device and system and computer readable storage medium

    CN112818959A