Intelligent judgment system and method for preoperative bowel preparation quality in gastrointestinal surgery

CN123015465APending Publication Date: 2026-10-30TIANJIN INTEGRATED TRADITIONAL CHINESE & WESTERN MEDICINE HOSPITAL (TIANJIN NANKAI HOSPITAL)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611205201.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]本发明提供了一种用于胃肠外科术前肠道准备质量智能判定系统及方法,要解决的技术问题在于:现有技术中存在评价时机盲目、易受水膜反光干扰以及缺乏空间锚定的问题

Benefits of technology

[0057]1、本发明通过目标检测网络提取解剖学界标特征,系统能够自动将无序的视频流精准划分至具体的解剖节段;同时,结合动作识别网络与时序门控机制,系统仅在医生完成冲洗-抽吸动作,且水波平息后才触发截帧评价,彻底规避了临床清创过程中脏污翻滚引起的假阳性误报,使得人工智能的评价时机与临床真实的最终干预状态完美同步;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015465A_ABST
    Figure CN123015465A_ABST
Patent Text Reader

Abstract

The application discloses a kind of for gastrointestinal surgery preoperative intestinal tract preparation quality intelligent judging system and method, it is related to medical information processing field.The method includes: obtaining continuous endoscopic video stream data, anatomical landmark features are extracted by target detection network to generate anatomical segment information;Video stream is input into action recognition network to extract clinical flushing and pumping operation features and generate action state label;When the label indicates that action ends, trigger timing gate mechanism, accurately extract post-action stable frame image;The image is decoupled using the double-color reflection model and the specular reflection component is removed;From the purified diffuse reflection component, feature is extracted to calculate local preparation quality score;According to timestamp matching anatomical segment information, the score is stored in record and covers historical low score data, generates final intestinal tract score result.The application effectively overcomes flushing and pumping action interference and water film reflection artifact, realizes high-precision adaptive dynamic evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical information processing technology, and in particular to an intelligent system and method for judging the quality of bowel preparation before gastrointestinal surgery. Background Technology

[0002] In colonoscopies performed in gastrointestinal surgery and gastroenterology, the quality of preoperative bowel preparation directly determines the detection rate of small lesions (such as flat adenomas and early-stage colorectal cancer). Currently, the Boston Bowel Preparation Score (BBPS) and other standards are commonly used clinically to assess bowel cleanliness. With the development of artificial intelligence technology, deep learning-based image segmentation networks have been introduced to automatically determine the quality of bowel preparation.

[0003] However, existing intelligent assessment systems suffer from three core technical deficiencies in real-world clinical workflows: First, existing image analysis models lack spatiotemporal awareness. The models blindly perform static scoring on individual input frames, failing to automatically anchor the current image to specific anatomical segments (such as the right colon or transverse colon). This results in a chaotic global scoring space logic, making it difficult to directly align with the gold standard for clinical segmentation assessment. Second, existing systems conflict with physician interventions. In real examination scenarios, when encountering localized contamination, physicians perform irrigation and aspiration debridement. Existing assessment systems are passive; during irrigation, the presence of turbid fluid in the field of view frequently triggers falsely low contamination alarms. This preemptive evaluation mechanism, acting before the intervention ends, fails to reflect the true final mucosal state after debridement. Finally, the complex physical and optical environment leads to distorted feature extraction. After irrigation, a thin film of water inevitably remains on the intestinal wall. Under the illumination of a single-point strong light source on the endoscopic probe, this film produces strong specular reflection (highlight artifacts). Existing visual models are prone to misjudging these glaring white highlight areas as foreign matter or debris, or failing to make judgments because the highlights obscure normal tissue texture.

[0004] Therefore, there is an urgent need in this field for a new intelligent judgment system and method to solve the technical problems of existing technologies, such as missing spatial anchoring, incorrect evaluation timing, and interference from optical reflection artifacts. Summary of the Invention

[0005] This invention provides an intelligent judgment system and method for preoperative bowel preparation quality in gastrointestinal surgery. The technical problem to be solved is that the existing technology has problems such as blind evaluation timing, susceptibility to water film reflection interference, and lack of spatial anchoring.

[0006] To achieve the aforementioned objectives, the present invention employs the following technical solution: an intelligent method for judging the quality of bowel preparation before gastrointestinal surgery, executed by a processor, the method comprising:

[0007] S1. Acquire continuous endoscopic video stream data, input the continuous endoscopic video stream data into a target detection network to extract anatomical landmark features, and generate anatomical segment information based on the anatomical landmark features;

[0008] S2. Input the continuous endoscopic video stream data into the action recognition network to extract clinical irrigation and aspiration operation features to generate action status labels;

[0009] S3. When the action status label indicates that the clinical irrigation and aspiration action has ended, the timing gating mechanism is triggered to extract the post-action stable frame image from the continuous endoscopic video stream data.

[0010] S4. Using a preset dual-color reflection model, the pixels of the stabilized frame image after the action are decoupled to separate the diffuse reflection component and the specular reflection component, and the specular reflection component is removed from the image data.

[0011] S5. Extract the foreign matter residue area feature and normal mucosal texture feature from the purified diffuse reflection component, and calculate the local preparation quality score of the stabilized frame image after the action based on the foreign matter residue area feature and the normal mucosal texture feature.

[0012] S6. Obtain the timestamp corresponding to the stable frame image after the action, match the corresponding anatomical segment information according to the timestamp, store the local preparation quality score into the anatomical segment evaluation record corresponding to the anatomical segment information to cover and update the historical low score data, and generate the final intestinal score result.

[0013] Furthermore, step S1 specifically includes:

[0014] S11. Extract the ileocecal valve landmark features and the dentate line landmark features from the anatomical landmark features, and combine the ileocecal valve landmark features and the dentate line landmark features in the order of timestamps to generate observation sequence data;

[0015] S12. Input the observed sequence data into the Hidden Markov Model and use the formula... Calculate the spatial state transition probability distribution matrix; where O represents the observed variables constituted by the observed sequence data, and Q represents the latent state sequence variables corresponding to the intestinal segments. represents the feature emission probability parameters in a Hidden Markov Model. This represents the prior transition probability parameter between intestinal segments;

[0016] S13. Based on the spatial state transition probability distribution matrix, the currently processed image is assigned to the right colon sequence data, transverse colon sequence data, or left colon sequence data to generate the corresponding anatomical segment information.

[0017] Furthermore, in step S2, extracting clinical irrigation and aspiration operation features to generate action state labels specifically includes an adaptive isolation step for endoscope washing status, specifically:

[0018] S21. Calculate the global frequency response matrix data of the continuous endoscopic video stream data, and extract the spatial focus defocus ratio feature parameter from the global frequency response matrix data;

[0019] S22. Based on the proportion of water flow pixels in the clinical irrigation and aspiration operation features, calculate the full-screen water flow feature value, and extract the pre-set cleaning interference judgment threshold parameter for numerical comparison.

[0020] S23. When the full-screen water flow characteristic value exceeds the cleaning interference judgment threshold parameter, a cleaning suspension tag representing the lens cleaning operation is generated and written into the action status tag.

[0021] S24. When the action status label includes the cleaning suspension label, execute the stop action status recognition instruction and directly suspend the image feature extraction process until the full-screen water flow feature value decreases.

[0022] Furthermore, step S3 specifically includes:

[0023] S31. Extract a set of image frame data within a continuous time window from the continuous endoscopic video stream data, and use the pixel optical flow function to calculate the motion energy gradient matrix data of two adjacent frames in the set of image frame data.

[0024] S32, using the energy convergence formula Calculate the total motion energy decay value of the entire image in real time; whereby... and These represent the optical flow vector component parameters of a pixel in the horizontal and vertical directions, respectively. This represents the attenuation constant corresponding to fluid dynamics, retrieved from memory. This represents the sampling time interval in the group of image frame data;

[0025] S33. Obtain a pre-set stable state determination threshold parameter. When the motion energy decay value of the whole image is less than the stable state determination threshold parameter, output the current frame as the stable frame image after the action.

[0026] Furthermore, in step S4, after separating the diffuse reflection component and the specular reflection component, the method further includes a step of optically correcting the diffuse reflection component, specifically:

[0027] S41. Extract the scattering spectrum data of the diffuse reflection component and obtain the preset Kubelka-Munk optical evolution formula. Where R is the absolute diffuse reflectance parameter;

[0028] S42. Extract the pre-stored optical prior parameter library, and obtain the medium absorption coefficient matrix K and optical scattering coefficient matrix S corresponding to normal mucosal texture from the optical prior parameter library;

[0029] S43. Based on the mapping relationship between the medium absorption coefficient matrix K and the optical scattering coefficient matrix S, the characteristic parameter correction calculation of the diffuse reflection component of the diffuse reflection component of deep turbid tissue fluid is performed using the Kubelka-Munk optical evolution formula, and the purified diffuse reflection component after correcting for ambient light interference is output for subsequent processing.

[0030] Furthermore, prior to step S5, a physical boundary fallback process is also included:

[0031] S501. Obtain the gray-level co-occurrence matrix data corresponding to the diffuse reflection component, and use the Shannon information entropy formula.

[0032] Calculate the local pixel entropy feature data; where P(i) represents the spatial probability distribution value of the i-th gray level in the gray-level co-occurrence matrix data appearing in the local area of ​​the stable frame image after the action;

[0033] S502. Extract the extreme turbidity confidence threshold stored in the memory in advance, and compare the relationship between the local pixel entropy value feature data and the extreme turbidity confidence threshold.

[0034] S503. When the local pixel entropy value feature data is lower than the extreme turbidity confidence threshold, mechanical debridement prompt information is directly generated for display on the display interface to assist in determining the current environmental state.

[0035] Furthermore, step S5 specifically includes:

[0036] S51. Input the diffuse reflection component into the preset image semantic segmentation model, and output the absolute pixel count set data parameters corresponding to the foreign object residual area feature;

[0037] S52. Based on the image closure boundary coordinate parameters of the normal mucosal texture features, the total effective area of ​​the visible intestinal lumen in the current image is calculated using the polygon area calculation formula.

[0038] S53. Divide the absolute pixel count set data parameter by the total effective area feature data of the visible intestinal lumen to calculate the foreign object occlusion ratio parameter result corresponding to the diffuse reflection component.

[0039] S54. Extract the mapping equation of the Boston Bowel Preparation Rating Scale, use the mapping equation to perform non-linear level transformation on the foreign body obstruction ratio parameter results, and output the local preparation quality score.

[0040] Furthermore, step S6 specifically includes:

[0041] S61. Extract the pre-stored local historical dirt score sequence data from the anatomical segment assessment record, and obtain the timestamp identification information data corresponding to the stable frame image after the action;

[0042] S62. Retrieve all preceding low-scoring dirty nodes in the local historical dirt score sequence data whose time attribute is earlier than the timestamp identification information data, and use the local preparation quality score to cover the nodes.

[0043] S63. Generate a target anatomical segment target score set with updated coverage, and input the target anatomical segment target score set into a preset weighted average function model to calculate the segment mean.

[0044] S64. The calculated average segment quality is used as the final intestinal score result of the target anatomical segment, and output and displayed on a display device that is communicatively connected to the processor.

[0045] Another objective of this invention is to provide an intelligent assessment system for the quality of preoperative bowel preparation in gastrointestinal surgery, the system comprising:

[0046] The spatial anchoring module is used to acquire continuous endoscopic video stream data, input the continuous endoscopic video stream data into the target detection network to extract anatomical landmark features, and generate anatomical segment information based on the anatomical landmark features;

[0047] The action recognition module is used to input the continuous endoscopic video stream data into the action recognition network and extract clinical irrigation and aspiration operation features to generate action status labels.

[0048] The timing gating module is used to trigger the timing gating mechanism when the action status label indicates the end of the clinical irrigation and aspiration action, and extract the post-action stable frame image from the continuous endoscopic video stream data;

[0049] An optical decoupling module is used to perform pixel decoupling on the post-action stabilized frame image using a preset dual-color reflection model, separate the diffuse reflection component and the specular reflection component, and remove the specular reflection component from the image data.

[0050] The feature scoring module is used to extract foreign matter residue area features and normal mucosal texture features from the purified diffuse reflection component, and to calculate the local preparation quality score of the stabilized frame image after the action based on the foreign matter residue area features and normal mucosal texture features.

[0051] The record update module is used to obtain the timestamp corresponding to the stable frame image after the action, match the corresponding anatomical segment information according to the timestamp, store the local preparation quality score into the corresponding anatomical segment evaluation record to overwrite and update the historical low score data, and generate the final intestinal score result.

[0052] Furthermore, after separating the diffuse reflection component and the specular reflection component, the optical decoupling module is also used to perform an optical correction step on the diffuse reflection component, specifically including:

[0053] Extract the scattering spectrum data of the diffuse reflection component to obtain the preset Kubelka-Munk optical evolution formula. Where R is the absolute diffuse reflectance parameter;

[0054] Extract the pre-stored optical prior parameter library, and obtain the medium absorption coefficient matrix K and optical scattering coefficient matrix S corresponding to normal mucosal texture from the optical prior parameter library;

[0055] Based on the mapping relationship between the medium absorption coefficient matrix K and the optical scattering coefficient matrix S, the diffuse reflection component is subjected to characteristic parameter correction calculation of the diffuse reflection characteristics of deep turbid tissue fluid using the Kubelka-Munk optical evolution formula, and the corrected diffuse reflection component is output to the feature scoring module.

[0056] The beneficial effects of this invention are as follows:

[0057] 1. This invention extracts anatomical landmark features through a target detection network, enabling the system to automatically and accurately divide disordered video streams into specific anatomical segments. Simultaneously, by combining an action recognition network with a temporal gating mechanism, the system only triggers frame-by-frame evaluation after the doctor has completed the rinsing-aspiration action and the water ripples have subsided. This completely avoids false positives caused by the churning of dirt during clinical debridement, ensuring that the timing of AI evaluation is perfectly synchronized with the actual final intervention state in clinical practice.

[0058] 2. This invention introduces a dual-color reflection model to decouple the image at the bottom layer pixels. By directly removing the specular reflection component that obscures the essential features of the tissue, it restores the true diffuse reflection optical properties of normal mucosal texture and foreign matter residue to the greatest extent. This fundamentally eliminates the feature extraction failure caused by water film reflection and significantly improves the robustness and accuracy of local quality scoring.

[0059] 3. Based on the timestamp of the stable frame image after the action, the present invention dynamically matches and overwrites the high-precision local score to the corresponding anatomical segment assessment record, and forcibly cancels the invalid historical dirt low score before the intervention. This ensures that the final generated report structure strictly conforms to clinical segmentation evaluation standards such as BBPS, and greatly reduces the quality control record burden of clinicians. Attached Figure Description

[0060] Figure 1 A flowchart of an intelligent method for judging the quality of bowel preparation before gastrointestinal surgery provided in an embodiment of the present invention;

[0061] Figure 2 A schematic diagram illustrating the principle of the optical decoupling processing mechanism provided in an embodiment of the present invention;

[0062] Figure 3 This is a block diagram of the module structure of an intelligent judgment system for preoperative bowel preparation quality in gastrointestinal surgery, provided in an embodiment of the present invention. Detailed Implementation

[0063] To make the content of this invention easier to understand, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings.

[0064] This application provides an intelligent method for judging the quality of bowel preparation before gastrointestinal surgery, executed by a processor, the method including the following steps:

[0065] Step S1: Acquire continuous endoscopic video stream data, input the continuous endoscopic video stream data into the target detection network to extract anatomical landmark features, and generate anatomical segment information based on the anatomical landmark features.

[0066] The purpose of this step is to endow the preoperative assessment system with automatic spatial localization capabilities, thereby meeting the fundamental clinical need for independent quality control of different anatomical regions. Based on the application requirements involving artificial intelligence scenarios, the input data for the target detection network is set to a sequence of raw color video frames acquired in real-time by gastrointestinal endoscopy equipment, i.e., continuous endoscopic video stream data; its output data is set to bounding box information containing the spatial coordinates of specific physiological tissues. During the training phase, this target detection network (which can employ a highly real-time YOLO architecture or a two-stage Faster R-CNN architecture) undergoes supervised learning by inputting a large number of pre-annotated colonoscopy images with anatomical landmarks (such as the ileocecal valve, appendiceal fossa, and terminal ileum), enabling the network parameters to accurately locate anatomical landmark features. Finally, the processor automatically converts and generates the anatomical segment information to which the current image belongs based on the mapping rules between the bounding box information and the inherent topology of the intestine.

[0067] The technical effect of this process is that it establishes a spatiotemporal anchoring relationship under the medical perspective, completely eliminating the global scoring distortion caused by disordered movement of the doctor's probe or repeated observation in local areas.

[0068] Example scenario: In a real-world scenario of assessing the quality of preoperative bowel preparation for a 65-year-old patient, the gastrointestinal endoscope probe is gradually withdrawn to the bottom of the cecum. The system captures continuous endoscopic video stream data in real time. The object detection network automatically identifies and delineates a lip-shaped anatomical structure in the current image frame, extracting the key anatomical landmark feature of the "ileocecal valve." Subsequently, the system automatically generates anatomical segment information belonging to the "right colon" in the current image based on mapping rules.

[0069] Further, step S1 specifically includes: step S11, extracting the ileocecal valve landmark features and the dentate line landmark features from the anatomical landmark features, and combining the ileocecal valve landmark features and the dentate line landmark features according to the timestamp order to generate observation sequence data; step S12, inputting the observation sequence data into the hidden Markov model, and using the formula Calculate the spatial state transition probability distribution matrix; where O represents the observed variables composed of observed sequence data, and Q represents the latent state sequence variables corresponding to the intestinal segments. P(Q) represents the feature emission probability parameter in the Hidden Markov Model, and P(Q) represents the prior transition probability between intestinal segments. Step S13: Based on the spatial state transition probability distribution matrix, the currently processed image is assigned to the right colon sequence data, transverse colon sequence data, or left colon sequence data to generate the corresponding anatomical segment information.

[0070] The above steps detail the technical means of using a temporal probabilistic graphical model to solve intraluminal spatial localization. In the complex clinical withdrawal process, the semilunar folds within the colon have highly similar morphologies, and target detection based solely on isolated frames is prone to misjudgment due to local mucosal reflections or deformations. This step introduces a Hidden Markov Model (HMM), treating the discrete anatomical markers observed by the physician as observable random variables O, forming the observation sequence data; while defining the actual anatomical position of the probe as the implicit dynamic state Q. This is achieved by extracting pre-trained emission probabilities... The posterior probability matrix of the current state, i.e., the spatial state transition probability distribution matrix, is calculated using the conditional probability of seeing a specific anatomical structure in a specific intestinal segment and the transition probability P(Q). The technical advantage lies in the introduction of rigorous mathematical temporal context constraints. Even if there are no significant topological landmarks in the current image, the system can determine with remarkable accuracy whether the current location is the transverse colon or the left colon based on the historical probability chain of "just passed the hepatic flexure and is smoothly withdrawing the scope," significantly improving the anti-interference capability of segmented spatial anchoring.

[0071] Example of continuous observation: The probe continues to move outward, at which point the image enters a long, straight lumen without any obvious physiological markers. The system extracts the preceding timestamp sequence and concatenates the previously captured "ileocecal valve landmark features" and the recently passed "hepatic flexure features" along the timeline into observation sequence data O, which is then input into the HMM model. The formula automatically performs conditional probability matrix derivation, calculating that the posterior probability (spatial state transition probability distribution matrix) of the current latent state Q belonging to the "transverse colon sequence data" is as high as 99%. Based on this, the processor forcibly assigns the current continuous frames to the transverse colon, accurately generating anatomical segment information of the transverse colon and effectively preventing positioning drift.

[0072] Step S2: Input the continuous endoscopic video stream data into the action recognition network to extract clinical irrigation and aspiration operation features to generate action status labels.

[0073] This step connects to and builds upon the previously acquired continuous endoscopic video stream data. Its aim is to establish a temporal perception mechanism for intraoperative clinical interventions. The input data for the action recognition network (which can employ a Temporal Misalignment Network (TSM) or a 3D Convolutional Neural Network (3D-CNN) architecture) is also set to continuous endoscopic video stream data. Unlike target detection, which focuses on static isolated frames, the action recognition network extracts the high-speed displacement morphology of pixels along the time axis and specific occlusion patterns through temporal difference and optical flow evolution between multiple consecutive images. These patterns are characteristic of clinical irrigation and aspiration operations (e.g., the bright linear trajectory scattered by water jets, or the specific black geometric occlusion generated when the aspirator tube tip enters the frame). The network's output data is set as discrete temporal classification states, i.e., action state labels (e.g., irrigation in progress, aspiration in progress, static observation). Its technical effect lies in achieving adaptive linkage between artificial intelligence judgment logic and the surgeon's surgical behavior, preventing the system from blindly "rushing" to output low-score alarms during interventions before all contaminants are completely removed.

[0074] Example: Following the previous scenario, the doctor discovers a patch of yellow fecal matter covering the mucosal surface in the right colon region and immediately presses the endoscopic infusion pump pedal to perform local high-pressure flushing. At this moment, the action recognition network extracts the characteristics of the high-speed jet of water (i.e., clinical flushing and aspiration operation characteristics) from multiple consecutive frames, and the processor generates and outputs the action status label "flushing in progress" in real time.

[0075] Further, in step S2, extracting clinical irrigation and aspiration operation features to generate action status labels specifically includes an adaptive isolation step for endoscope washing status, specifically: Step S21, calculate the global frequency response matrix data of the continuous endoscopic video stream data, and extract the spatial focus defocus ratio feature parameter in the global frequency response matrix data; Step S22, combine the water flow pixel ratio in the clinical irrigation and aspiration operation features to calculate the full-screen water flow feature value, and extract the pre-set cleaning interference judgment threshold parameter for numerical comparison; Step S23, when the full-screen water flow feature value exceeds the cleaning interference judgment threshold parameter, generate a cleaning suspension label representing the lens cleaning operation, and write it into the action status label; Step S24, when the action status label contains the cleaning suspension label, execute the stop action status recognition command, directly suspend the image feature extraction process until the full-screen water flow feature value decreases.

[0076] This step defines a boundary isolation mechanism for interference from "lens washing" in the complex environment of real gastrointestinal surgery endoscopy. In actual clinical practice, in addition to frequently flushing the intestinal wall with water (intestinal irrigation), doctors also frequently press the endoscope button to spray water to clean the endoscope lens itself (lens washing). When lens washing occurs, the high-pressure water jet directly adheres to the lens glass surface, causing the entire image to instantly produce severe global blurring and disordered bright water film. The system analyzes the two-dimensional frequency domain features of the image through Fast Fourier Transform (FFT), calculates the global frequency response matrix data of rapidly decaying high-frequency components, and extracts spatial focus defocus ratio feature parameters to quantify the degree of defocusing. Combined with the multi-textured water flow pixels identified by the action network, it is fused into full-screen water flow feature values ​​that can sensitively represent the complete coverage of the lens. The technical effect is that by setting an adaptive hard-suspend gating at the software execution level, when it exceeds the cleaning interference judgment threshold parameter, the artificial intelligence feature scoring process is forcibly blocked, completely eliminating the systemic false positive vulnerability caused by lens cleaning leading to the system misjudging the intestinal lumen as "extremely dirty".

[0077] Example: When observing the transverse colon with the endoscope, a layer of cloudy mucus suddenly adhered to the lens surface, darkening the field of view. The doctor immediately performed a water spray cleaning procedure. At this moment, the system detected that all edges and microvascular high-frequency textures in the image instantly disappeared, and the calculated spatial focus defocus ratio characteristic parameter soared to 95%, causing the fused full-screen water flow characteristic value to reach 0.98, far exceeding the system's preset threshold of 0.85. The system then instantly generated a "cleaning suspended" label and forcibly inserted it into the current action status label. The processor executed a kernel suspension instruction, pausing all frame capture and scoring computational power allocation until two seconds later when high-pressure gas dried the water droplets on the lens and the image returned to clarity.

[0078] Step S3: When the action status label indicates that the clinical irrigation and aspiration action has ended, the processor triggers the timing gating mechanism to extract the post-action stable frame image from the continuous endoscopic video stream data.

[0079] This step is crucial in addressing the core technological gap of when to trigger AI-based quality assessment. By connecting and introducing the action status labels generated in the preceding steps, the temporal gating mechanism logically manifests as an adaptive control gate triggered by state transitions. When the action status label transitions from "rinsing / aspiration in progress," indicating human intervention, to a static state indicating the end of debridement, the temporal gating mechanism is instantly activated. The control system precisely intercepts and extracts the high-definition image after the water ripples subside from the continuous endoscopic video stream data—that is, the stabilized frame image after the action.

[0080] Its technical effect lies in filtering out the physical and optical artifacts caused by the violent turbulence of liquid, dense reflection of bubbles, and extreme shaking of the image during rinsing, ensuring that the data subsequently sent to the scoring network fully represents the final mucosal exposure status of the area after clinical intervention.

[0081] Example: The doctor releases the pump pedal and uses a suction device to quickly aspirate the diluted fecal matter, then the probe returns to a stationary position for observation. The system detects that the action status label has changed from "Aspiration in progress" to a stationary state after the action has ended. The timing gating mechanism is then triggered, and the system automatically captures a clear, bubble-free image 0.5 seconds after the fluid dynamics have stabilized, as the post-action stable frame image.

[0082] Further, step S3 specifically includes: step S31, extracting a set of image frame data within a continuous time window from the continuous endoscopic video stream data, and calculating the motion energy gradient matrix data of two adjacent frames in the set of image frame data using the pixel optical flow function; step S32, using the energy convergence formula... Calculate the total motion energy decay value of the entire image in real time; whereby... and These represent the optical flow vector component parameters of a pixel in the horizontal and vertical directions, respectively. This represents the attenuation constant corresponding to fluid dynamics, retrieved from memory. The sampling time interval in the group of image frame data is indicated; Step S33: Obtain the preset stable state determination threshold parameter. When the motion energy decay value of the whole image is less than the stable state determination threshold parameter, the current frame is output as the stable frame image after the action.

[0083] This step defines the specific algorithmic approach for "dynamically optimal extraction" of images after an action through physical motion energy modeling. At the instant the doctor stops injecting or aspirating, the fluid within the intestinal lumen, due to fluid inertia, will still maintain a brief period of disordered sloshing and ripples. This scheme utilizes the classic computer vision optical flow field function to calculate the instantaneous motion velocity matrix of image pixels on a two-dimensional plane, i.e., the motion energy gradient matrix data. Furthermore, to adaptively track the energy dissipation process of the fluid, this step creatively constructs an energy convergence formula based on a fluid dynamics attenuation model:

[0084] In the formula, the horizontal vector of all pixels in the entire image is calculated. and vertical vector The sum of squares of the kinetic energy on the sampled surface, multiplied by the time interval. Exponentially decaying hydrodynamic constant term It quantifies the overall motion activity of the fluid within the cavity in real time, i.e., the motion energy attenuation value E(t) of the entire image. Its technical advantage lies in overcoming the mechanical defects of traditional fixed-delay frame interception, and dynamically capturing the golden moment when the water waves are completely calm and the refractive index is most uniform according to extremely scientific physical rules, thereby ensuring that the extracted post-motion stable frame image has the highest optical fidelity.

[0085] Example: The doctor completes debridement and aspiration in the transverse colon and releases the instrument button. The system captures a series of consecutive frames within a continuous time window T and calculates their motion energy gradient matrix data. At 0.1 seconds after the action stops, due to the violent oscillation of the accumulated fluid, the calculated motion energy decay value E(t) for the entire image reaches as high as 350; as fluid resistance is consumed, at 0.6 seconds, E(t) decays exponentially to 8. Since 8 is already less than the system's stored steady-state determination threshold parameter (preset to 10), the processor determines that the intestinal fluid has completely stopped and then outputs this clear image frame at 0.6 seconds as the stable frame image after the action.

[0086] Step S4: The processor uses a preset two-color reflection model to decouple pixels in the stabilized frame image after the action, separates the diffuse reflection component and the specular reflection component, and removes the specular reflection component from the image data.

[0087] This step delves into the underlying physical optics of medical image feature extraction. Connecting this to the stabilized frame images captured in the preceding steps, it's evident that a microscopic water film inevitably remains on the surface of the intestinal mucosa after flushing. Under direct illumination from the endoscope's single-point LED light source, this film easily produces large-area specular reflections (high-gloss glare). To eliminate this severe feature masking, the system introduces the classic Shafer two-color reflection model, whose physical principle is expressed as follows: In the formula, I(x) represents the total RGB visible light intensity vector of a specific pixel x in the stabilized frame image after the action; This represents the diffuse reflectance component, which reflects the essential texture and pigment properties of intestinal wall tissue or residual foreign bodies. This represents the specular reflection component produced by the direct reflection of the light source spectrum by the surface water film. The processor solves this equation through high-frequency matrix operations, completely decoupling the image pixel space, and performs a subtraction operation to directly eliminate the specular reflection component. The technical effect is that it purifies the image using the laws of physical optics, restoring tiny early lesions or tightly adhered transparent mucus textures that were previously obscured by strong reflections.

[0088] Example: In the center of the extracted, stabilized frame image, a glaring white highlight blind spot is formed due to the reflection of the water film. The processor performs pixel decoupling operations using the two-color reflection model formula, completely removing this white spot, which belongs to the specular reflection component, from the image data. This allows the pale yellow adhesive mucus layer (i.e., the purified diffuse reflection component) that was originally obscured by strong light to be revealed in the data layer.

[0089] Furthermore, in step S4, after separating the diffuse reflection component and the specular reflection component, the method also includes a step of optically correcting the diffuse reflection component, specifically: Step S41, extract the scattering spectrum data of the diffuse reflection component and obtain the preset Kubelka-Munk optical evolution formula. , where R is the absolute diffuse reflectance parameter obtained from the diffuse reflectance component measurement; Step S42: Extract the pre-stored optical prior parameter library, and obtain the medium absorption coefficient matrix K and optical scattering coefficient matrix S corresponding to normal mucosal texture from the optical prior parameter library; Step S43: Based on the mapping relationship between the medium absorption coefficient matrix K and the optical scattering coefficient matrix S, use the Kubelka-Munk optical evolution formula to perform characteristic parameter correction calculation on the diffuse reflectance component of deep turbid tissue fluid diffuse reflectance characteristics, and output the pure diffuse reflectance component after correcting for ambient light interference for subsequent processing.

[0090] This step defines the technical means for deep purification and correction of the decoupled diffuse reflection component using an advanced physical optics semi-transparent medium evolution model. After clinical flushing, although large pieces of feces are removed, the intestinal wall surface is often covered with a layer of semi-transparent tissue fluid rich in tiny suspended particles (such as a diluted yellow bile layer). While this thin, turbid fluid does not produce strong specular reflection, its internal particles cause severe multiple diffuse scattering and absorption in specific wavelengths, resulting in a severe yellow-green spectral shift in the color space of the underlying normal intestinal mucosa (i.e., ambient light artifacts). To thoroughly restore the true tissue features optically masked by the turbid fluid layer, the system introduces the classic Kubelka-Munk two-stream radiative transfer evolution formula: This theory is specifically designed to solve for the intrinsic optical properties of strongly scattering translucent media. The system retrieves the known medium absorption coefficient matrix K and optical scattering coefficient matrix S from a database of optical prior parameters generated from a massive amount of clinically purified mucosa and pure bile calibrations within the chip. By substituting the measured absolute diffuse reflectance parameter R into the formula for inverse matrix solving, the technical advantage lies in forcibly stripping and filtering out the multiple scattering spectral interference belonging to the turbid liquid layer from the pixel matrix, outputting a pure diffuse reflectance component exhibiting an intrinsic pink color. This completely avoids the technical defect of traditional segmentation networks that misclassify clean mucosa as contaminated due to bile staining.

[0091] Example: In the diffuse reflection component feature map after removing the highlights, a thin layer of translucent bile covers the pink mucosa surface of a certain area of ​​the transverse colon, causing the pixels in that area to exhibit an abnormal yellow-green characteristic. The system extracts its scattering spectrum, retrieves the absorption coefficient matrix K and scattering coefficient matrix S of normal colonic mucosa from a pre-defined optical prior parameter library, and substitutes them into the Kubelka-Munk formula for inverse filter removal. After the operation, the pixels in that area successfully recover the intrinsic cherry pink color of the mucosa (pure diffuse reflection component), allowing the optical boundary of a very flat and small lesion (flat serrated adenoma) hidden beneath it to be perfectly identified by the semantic segmentation module.

[0092] Furthermore, before step S5, a physical boundary fallback processing step is included, specifically: Step S501, obtaining the gray-level co-occurrence matrix data corresponding to the diffuse reflection component, and using the Shannon information entropy formula... Calculate local pixel entropy feature data ; where P(i) represents the spatial probability distribution value of the i-th gray level in the gray-level co-occurrence matrix data appearing in the local area of ​​the stable frame image after the action; step S502, extract the extremely turbidity confidence judgment threshold stored in the memory in advance, and compare the size relationship between the local pixel entropy value feature data and the extremely turbidity confidence judgment threshold; step S503, when the local pixel entropy value feature data is lower than the extremely turbidity confidence judgment threshold, directly generate mechanical debridement prompt information to be presented on the display interface to assist in judging the current environmental state.

[0093] This step defines a fallback safety mechanism to address the "physical boundary failure" of AI algorithms in extremely challenging intestinal environments. In a very rare and dire clinical case, the patient did not take any preoperative bowel preparation medication, resulting in the entire colon being filled with a dense, uniformly textured, large, solid, black fecal mass. In this situation, due to the lack of any alternating light and dark boundaries or normal red mucosal texture within the field of view, the pure diffuse reflection feature map will present a large area of ​​uniform, low-grayscale, solid-color pixels. This extreme feature loss can cause conventional image semantic segmentation networks to completely fail due to the lack of boundary gradients or to output disordered, garbage data.

[0094] This scheme utilizes the gray-level co-occurrence matrix from mathematical statistics and introduces the Shannon information entropy formula to quantify the information richness of the microscopic spatial structure of an image. A monochromatic image means that the spatial probability distribution P(i) is extremely concentrated at a single gray level, and the local pixel entropy feature data H calculated by the formula will instantly plummet. The technical effect is that by setting an extreme turbidity confidence threshold, the system has the ability to self-identify extreme black-box scenarios; once the physical boundary is crossed, the system actively stops the conventional scoring and instead outputs high-value auxiliary debridement decision suggestions, greatly improving the robustness and engineering practicality of the medical software.

[0095] Example of penetration: The probe continues to slide into the descending colon of the left hemicolon. Due to the patient's extremely poor preoperative compliance, the entire descending colon is completely blocked by a large, uniformly thick, dark black mass of dried feces, resulting in a completely black field of view devoid of any structural lines. The system calculates the gray-level co-occurrence matrix of the pure diffuse reflection feature map at this point, and substitutes it into the Shannon entropy formula to obtain the local pixel entropy value feature data H, which is only 0.45 (representing an extremely monotonous and disordered image). The system searches the memory and finds that 0.45 is far below the preset confidence threshold of 1.20 for extreme turbidity. The judgment is reached, and the system skips meaningless area segmentation and immediately pops up a conspicuous red prompt box on the right edge of the doctor's main monitoring screen: "Warning: The current cavity is detected to be at the boundary of extreme physical turbidity. Routine water washing is ineffective. Please use mechanical instruments for physical debridement" (mechanical debridement prompt information), assisting the doctor in quickly adjusting the examination decision.

[0096] Step S5: Extract the foreign matter residue area features and normal mucosal texture features from the purified diffuse reflection component, and calculate the local preparation quality score of the stabilized frame image after the action based on the foreign matter residue area features and normal mucosal texture features.

[0097] This step represents a leap from pure physical features to clinical semantic quantitative assessment. Connecting this to the diffuse reflectance component purified after highlight removal in the preceding steps, the processor inputs it into a pre-defined image semantic segmentation model (such as a U-Net network architecture fine-tuned with a medical dataset). The input data for this AI model is the diffuse reflectance component feature map after de-reflection. Through multi-layer convolution, it extracts complex color gradients and spatial context information, and its output data is a pixel-level category mask. Based on this, the system accurately extracts the foreign body residue area features representing fecal matter and bile, as well as the normal mucosal texture features representing the healthy colon wall. By calculating the mathematical ratio of foreign body pixels to the total visible intestinal lumen pixels, an objective local preparation quality score is generated. Its technical advantage lies in eliminating the arbitrariness of traditional subjective scoring and achieving extremely high-precision quantitative quality control.

[0098] Example: The system inputs the purified diffuse reflection component feature map into the semantic segmentation model. The model accurately identifies that the layer of pale yellow mucus (foreign matter residue area feature) occupies 5% of the entire visible image, while the remaining 95% is reddish intestinal wall (normal mucosal texture feature). Based on the built-in proportional mapping rules, the system automatically calculates the local preparation quality score of this image as 3 points (representing excellent cleanliness).

[0099] Further, step S5 specifically includes: Step S51, inputting the diffuse reflection component into a preset image semantic segmentation model, and outputting the absolute pixel count set data parameters corresponding to the foreign body residue area features; Step S52, calculating the total effective area feature data of the visible intestinal lumen in the current image using the polygon area calculation formula based on the image closure boundary coordinate parameters of the normal mucosal texture features; Step S53, dividing the absolute pixel count set data parameters by the total effective area feature data of the visible intestinal lumen to calculate the foreign body occlusion ratio parameter result corresponding to the diffuse reflection component; Step S54, extracting the Boston Bowel Preparation Rating Scale mapping equation, using the mapping equation to perform nonlinear level conversion on the foreign body occlusion ratio parameter result, and outputting a local preparation quality score.

[0100] This step details the pipeline for converting pixel-level geometric features into a scoring calculation method that conforms to internationally recognized clinical quality control standards. During colonoscopy imaging, large areas of pure black, ineffective shadows (useless pixels) often form around the edges of the image due to insufficient light source or limited viewing angles at the probe edges. To ensure the scientific accuracy of the scoring denominator, this solution not only extracts the absolute number of pixels contaminated with foreign matter through semantic segmentation (absolute pixel count data parameter), but also extracts the total effective area of ​​the visible intestinal lumen that is actually illuminated and has diagnostic value by tracing the two-dimensional closure curve surrounded by normal mucosal texture features. Through division of these two methods, the dilution interference of the ineffective black shadows on the proportion of foreign matter is completely eliminated. Finally, a nonlinear Boston Standard Rating Scale (BBPS) mapping equation (which simulates the nonlinear cognitive curve of clinical experts regarding the harm of different area gradients) is used to accurately normalize the continuous proportional parameters and convert them into discrete scores that conform to gastroenterology standards. The technical advantage lies in achieving extremely high cross-device compatibility and industry standard alignment.

[0101] Example: After overcoming the aforementioned obstruction, the doctor thoroughly flushed the left colon and successfully captured a stable frame. The semantic segmentation model detected that the remaining tiny fecal fragments (foreign body residue area feature) in the pure diffuse component image occupied a total of 24,000 pixels. Simultaneously, by calculating the closure coordinates of the mucosal image's outer contour, the system eliminated the black, invalid blind zone pixels at the surrounding edges, calculating the total effective area of ​​the truly visible intestinal lumen to be 300,000 pixels. Dividing these two values, the system accurately calculated the foreign body occlusion ratio parameter to be 8%. The system input 8% into the Boston Consulting Group (BCG) mapping equation, determining that it fell within the non-linear interval of "good mucosal exposure with only very few tiny residues remaining," ultimately accurately outputting a "BBPS 3" score corresponding to the local preparation quality rating.

[0102] Step S6: Obtain the timestamp corresponding to the stable frame image after the action, match the corresponding anatomical segment information according to the timestamp, store the local preparation quality score into the anatomical segment assessment record corresponding to the anatomical segment information to cover and update the historical low score data, and generate the final intestinal score result.

[0103] This step completes the spatiotemporal data closed-loop archiving of the entire intelligent judgment method. Connecting the anatomical segment information generated in step S1 with the local preparation quality score calculated in step S5, since endoscopy is a continuous temporal process, the stabilized frame image after the action inevitably carries a globally unique machine runtime data, i.e., a timestamp, when captured. The system accurately matches the score to which intestinal segment it spatially belongs by seamlessly comparing the timestamp with the time intervals dynamically divided by the aforementioned Hidden Markov Model. More importantly, since this score represents the "final excellent state" after the doctor's debridement intervention, the system stores it in the corresponding anatomical segment assessment record and adaptively overwrites the historical low-score data recorded for that intestinal segment before flushing due to obscuring by dirt. Its technical effect is to ensure that the final output quality control report can truly and accurately reflect the final usable exposure quality of the patient's intestine after cleaning, perfectly aligning with the real clinical workflow logic of gastrointestinal surgery.

[0104] Example: The system extracts the timestamp of the stable frame image as "10:15:33". Through timeline retrieval, it matches the probe's position at that moment within the previously generated "right colon" (anatomical segment information). The system then retrieves the anatomical segment assessment record of the right colon and finds that two minutes prior, this area was scored as 1 point due to obscuring it with a large piece of feces (historical low score). The system immediately executes an overwrite update command, replacing the historical low score of 1 point with the latest score of 3 points after intervention. Finally, the intelligent quality control report generates and outputs a final intestinal score result of 3 points for right colon preparation quality.

[0105] Further, step S6 specifically includes: step S61, extracting the pre-stored local historical contamination score sequence data from the anatomical segment assessment record, and obtaining the timestamp identification information data corresponding to the stable frame image after the action; step S62, retrieving all previous low-scoring contamination nodes in the local historical contamination score sequence data whose time attributes are earlier than the timestamp identification information data, and using the local preparation quality score to cover the nodes; step S63, generating the target anatomical segment targeted score set after coverage update, and inputting the target anatomical segment targeted score set into a preset weighted average function model to calculate the segment mean; step S64, the processor uses the calculated segment quality mean as the final intestinal score result of the target anatomical segment, outputs it and displays it on the display device that is communicatively connected to the processor.

[0106] This step defines the underlying logic structure for adaptive temporal smoothing and cleaning of redundant historical scoring sequences within each independent anatomical segment. During a laparoscopic examination of a segment of the intestine (such as the left colon) that lasts several minutes, the image inevitably captures a large amount of raw, dirty video footage that the doctor hasn't yet begun cleaning. This causes the AI ​​to generate hundreds of consecutive frames with extremely low evaluation values ​​of 1 or 0. If all frame scores are simply and blindly averaged, the final segment score will be severely dragged down by this invalid historical data from before cleaning, completely deviating from the original clinical assessment of whether the mucosa is clearly visible after irrigation intervention. This solution locks the timestamp information of stable frames after the current action, using this as a time boundary to trace back and precisely retrieve all useless low-scoring nodes recorded before the completion of the cleaning action, and then uses the superior scores after irrigation to overwrite and update them. Its technical effectiveness lies in dynamically eliminating temporal redundant noise and generating a target anatomical segment targeted score set that truly represents the clean state after debridement, thereby ensuring that the final intestinal score results output to the display device have extremely high clinical reliability and guiding significance.

[0107] Example: As the examination nears completion, the system begins calculating the overall score for the left colon. The processor retrieves the anatomical segment assessment records for the left colon, extracting all local historical filth score sequences generated during the three-minute endoscopy withdrawal process. The system captures the timestamp information (e.g., "10:32:15") of the recently generated BBPS 3-point image. Subsequently, the processor performs a high-speed temporal traversal in memory, retrieving 150 consecutive "BBPS 1-point" nodes recorded before 10:32:15, when large clumps of fecal fluid were not aspirated, and then uses the current "3-point" to overwrite and erase these historically low-scoring nodes in blocks. After the update, all remaining nodes in the left colon segment are the true high-scoring nodes after intervention, forming a clean target anatomical segment targeted score set. The system inputs this into a weighted average function model, calculating a final mean of 2.9 points, which serves as the final intestinal score result for the left colon, displayed in bright green on the digital display screen of the endoscopy workstation in real time.

[0108] In addition, the present invention also provides an intelligent judgment system for the quality of bowel preparation before gastrointestinal surgery, the system comprising:

[0109] The spatial anchoring module is used to acquire continuous endoscopic video stream data, input the continuous endoscopic video stream data into the target detection network to extract anatomical landmark features, and generate anatomical segment information based on the anatomical landmark features;

[0110] The action recognition module is used to input continuous endoscopic video stream data into the action recognition network and extract clinical irrigation and aspiration operation features to generate action status labels;

[0111] The timing gating module is used to trigger the timing gating mechanism when the action status label indicates the end of the clinical irrigation and aspiration action, and to extract the stable frame image after the action from the continuous endoscopic video stream data;

[0112] The optical decoupling module is used to decouple pixels of the stabilized frame image after the action using a preset dual-color reflection model, separate the diffuse reflection component and the specular reflection component, and remove the specular reflection component from the image data.

[0113] The feature scoring module is used to extract foreign matter residue area features and normal mucosal texture features from the purified diffuse reflection component, and calculate the local preparation quality score of the stabilized frame image after the action based on the foreign matter residue area features and normal mucosal texture features.

[0114] The record update module is used to obtain the timestamp corresponding to the stable frame image after the action, match the corresponding anatomical segment information based on the timestamp, store the local preparation quality score into the corresponding anatomical segment assessment record to overwrite and update the historical low score data, and generate the final intestinal score result.

[0115] In the above system, the spatial anchoring module and the action recognition module monitor the original video stream concurrently in a dual-threaded manner, the timing gating module is responsible for controlling the timing switching and truncation of the control stream, the optical decoupling module and the feature scoring module are responsible for performing physical purification and model feature inference at the pixel matrix layer, and finally the record update module realizes the writing and information overwriting of the underlying database.

[0116] Its technical effect lies in providing a solid object architecture support for the software compilation and modular implementation of the aforementioned judgment method on specific medical edge computing hardware terminals (such as external intelligent endoscope artificial intelligence auxiliary host).

[0117] Example: In the collaborative hardware and software deployment of this system, the host's acquisition card captures continuous video streams from the endoscopic camera in real time. The spatial anchoring module and motion recognition module, residing in the system core, operate synchronously and in parallel. When the doctor finishes flushing the right colon at 10:15:33, the timing gating module instantly intercepts control, streaming the captured stable image to the optical decoupling module. This module performs a two-color reflection matrix calculation in the GPU shader, instantly filtering out the reflective water film, and then pumps the denoised diffuse reflection feature map into the feature scoring module, which segments and calculates an evaluation value of 3. Finally, the record update module forcibly writes the 3-point score into the database history sub-table corresponding to the patient's right colon using an SQL overwrite update command, realizing the real-time closed-loop pipeline flow of the entire virtual system.

[0118] Furthermore, after separating the diffuse reflection component and the specular reflection component, the optical decoupling module is also used to perform an optical correction step for the diffuse reflection component, specifically including: extracting the scattering spectrum data of the diffuse reflection component and obtaining the preset Kubelka-Munk optical evolution formula. The diffuse reflection component is corrected using the Kubelka-Munk optical evolution formula to correct the characteristic parameters of diffuse reflection of deep turbid tissue fluid, where R is the absolute diffuse reflectance parameter. The pre-stored optical prior parameter library is extracted, and the medium absorption coefficient matrix K and optical scattering coefficient matrix S corresponding to normal mucosal texture are obtained from the optical prior parameter library. Based on the mapping relationship between the medium absorption coefficient matrix K and the optical scattering coefficient matrix S, numerical matrix calculation is performed, and the corrected diffuse reflection component is output to the feature scoring module.

[0119] This step explicitly defines that the module not only possesses the single decoupling function of eliminating surface specular matrices, but also deeply integrates an advanced physical evolution kernel for inverse spectral radiative transfer operations in turbid, semi-transparent fluid media. By forcibly calling the optical prior dictionary at the hardware level, the system is equipped with the engineering execution capability to perform spectral-level restoration of the inherent diffuse reflectance characteristics of deep tissues within extremely harsh and complex medical cavities filled with turbid digestive fluids.

[0120] Example: During operation, a dedicated physical evolution calculation sub-thread within the optical decoupling module is activated. Upon receiving the decoupled diffuse reflection image pixel matrix, this sub-thread directly retrieves a set of absorption coefficient matrices K and scattering coefficient matrices S, specifically characterizing the properties of the colonic mucosa and gastrointestinal bile, from the motherboard ROM storage unit via DMA (Direct Memory Access) technology. The evolution kernel, operating on the GPU unit, performs ultra-high-concurrency floating-point operations, inputting the measured scattering spectrum data into the Kubelka-Munk matrix equation for pixel-by-pixel inversion correction. This eliminates the ambient light filter artifacts caused by multiple scattering of bile, ultimately delivering the restored high-resolution, pinkish mucosal diffuse reflection feature components perfectly to the feature scoring module. This provides impeccable underlying computing hardware support for the highly robust operation of the entire system.

[0121] The technical solutions in the above embodiments will now be clearly and completely described with reference to the accompanying drawings.

[0122] Embodiments of the present invention can be executed by an electronic device, which includes, but is not limited to, a smart endoscopic image processing host with edge computing capabilities. For example... Figure 3 As shown, the electronic device mainly includes a processor 100, a memory 200 connected to the processor 100 via a bus, and a display device 300 for outputting visual rating results. The memory 200 pre-stores various computer-readable instructions and neural network models for the processor 100 to call and execute.

[0123] like Figure 1 As shown in the figure, this invention provides an intelligent method for judging the quality of bowel preparation before gastrointestinal surgery. This method is mainly executed by the processor 100 and specifically includes the following execution process:

[0124] First, the processor 100 acquires continuous endoscopic video stream data in real time via a video acquisition interface. To endow the system with spatial awareness, the processor 100 inputs the continuous endoscopic video stream data into a target detection network 400 pre-deployed in the memory 200. The target detection network 400 scans the image frame by frame, extracting anatomically significant landmark features such as the ileocecal valve and appendiceal fossa. Subsequently, the processor 100 generates anatomical segment information (e.g., right colon or transverse colon) of the current image based on preset intestinal spatial topology rules and the extracted anatomical landmark features, thereby achieving spatial anchoring of the evaluation perspective.

[0125] Since real clinical examinations are not static observations, doctors frequently use water pumps for irrigation. To prevent the AI ​​model from blindly scoring during irrigation, the processor 100 inputs the same continuous endoscopic video stream data in parallel into the motion recognition network 500. The motion recognition network 500 accurately captures the clinical irrigation and aspiration operation features of water jet spraying or suction device movement by extracting pixel displacement gradients between multiple frames, and outputs the current action status label (such as "irrigating in progress" or "action completed") in real time.

[0126] When the action status label indicates that the clinical irrigation and aspiration action has ended, the processor 100 triggers a timing gating mechanism at the kernel level. This gating mechanism acts like a camera shutter, automatically avoiding periods of fluid turbulence and precisely capturing the frame where the fluid dynamics tend to stabilize from the continuous endoscopic video stream data, using it as the stable frame image after the action and entering it into the subsequent scoring pipeline.

[0127] like Figure 2 The diagram illustrates the pixel decoupling principle for eliminating specular reflection components. After acquiring the stabilized frame image following the action, to eliminate the strong specular reflection caused by the residual water film on the intestinal wall, the processor 100 calls a preset two-color reflection model to decouple the image in pixel space. According to Shafer's two-color reflection law, the total reflected beam of the image is composed of the diffuse reflection component from the object surface and the specular reflection component directly reflected from the light source, and its physical constraints satisfy the formula:

[0128] Where I(x) represents the total RGB information of the pixel; This represents the diffuse reflectance component, which reflects the true color of the mucosa and residue. The strong reflection caused by the water film is the specular reflection component. The processor 100 solves this formula in reverse, separating these two components, and executes a data removal instruction to remove the specular reflection component (…). Figure 2 The white highlight artifacts in the image were completely removed.

[0129] After the purification process described above, the processor 100 obtains a diffuse reflection component with extremely high optical fidelity. Subsequently, the processor 100 uses a semantic segmentation algorithm to accurately extract foreign matter residue area features representing bile or feces, as well as normal mucosal texture features representing the healthy intestinal wall, from the diffuse reflection component. By calculating the pixel area ratio of these two features within the closure region, a local preparation quality score for the stabilized frame image after the action is quantified.

[0130] Finally, the system needs to archive isolated local scores to form a final report. For example... Figure 1 and Figure 3 As shown, the processor 100 obtains the timestamp corresponding to the generation of the stable frame image after the action through the record update module 600, and performs precise timeline matching based on the timestamp and the previously generated anatomical segment information. After successful matching, the processor 100 forcibly stores the local preparation quality score into the corresponding segment's anatomical segment evaluation record. If the system outputs a low score alarm due to uncleaned contaminants before the flushing-aspiration action, the processor 100 will use the current high-quality score to overwrite and update the historical low-score data, and finally output the processed segment mean as the final intestinal score result to the display device 300, assisting doctors in completing high-standard medical quality control records.

[0131] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for intelligently assessing the quality of bowel preparation before gastrointestinal surgery, characterized in that, Executed by the processor, the method includes: S1. Acquire continuous endoscopic video stream data, input the continuous endoscopic video stream data into a target detection network to extract anatomical landmark features, and generate anatomical segment information based on the anatomical landmark features; S2. Input the continuous endoscopic video stream data into the action recognition network to extract clinical irrigation and aspiration operation features to generate action status labels; S3. When the action status label indicates that the clinical irrigation and aspiration action has ended, the timing gating mechanism is triggered to extract the post-action stable frame image from the continuous endoscopic video stream data. S4. Using a preset dual-color reflection model, the pixels of the stabilized frame image after the action are decoupled to separate the diffuse reflection component and the specular reflection component, and the specular reflection component is removed from the image data. S5. Extract the foreign matter residue area feature and normal mucosal texture feature from the purified diffuse reflection component, and calculate the local preparation quality score of the stabilized frame image after the action based on the foreign matter residue area feature and the normal mucosal texture feature. S6. Obtain the timestamp corresponding to the stable frame image after the action, match the corresponding anatomical segment information according to the timestamp, store the local preparation quality score into the anatomical segment evaluation record corresponding to the anatomical segment information to cover and update the historical low score data, and generate the final intestinal score result.

2. The intelligent method for judging the quality of bowel preparation before gastrointestinal surgery according to claim 1, characterized in that, Step S1 specifically includes: S11. Extract the ileocecal valve landmark features and the dentate line landmark features from the anatomical landmark features, and combine the ileocecal valve landmark features and the dentate line landmark features in the order of timestamps to generate observation sequence data; S12. Input the observed sequence data into the Hidden Markov Model and use the formula... Calculate the spatial state transition probability distribution matrix; where O represents the observed variables constituted by the observed sequence data, and Q represents the latent state sequence variables corresponding to the intestinal segments. represents the feature emission probability parameters in a Hidden Markov Model. This represents the prior transition probability parameter between intestinal segments; S13. Based on the spatial state transition probability distribution matrix, the currently processed image is assigned to the right colon sequence data, transverse colon sequence data, or left colon sequence data to generate the corresponding anatomical segment information.

3. The intelligent method for judging the quality of bowel preparation before gastrointestinal surgery according to claim 1, characterized in that, In step S2, extracting clinical irrigation and aspiration operation features to generate action status labels specifically includes an adaptive isolation step for endoscope washing status, as follows: S21. Calculate the global frequency response matrix data of the continuous endoscopic video stream data, and extract the spatial focus defocus ratio feature parameter from the global frequency response matrix data; S22. Based on the proportion of water flow pixels in the clinical irrigation and aspiration operation features, calculate the full-screen water flow feature value, and extract the pre-set cleaning interference judgment threshold parameter for numerical comparison. S23. When the full-screen water flow characteristic value exceeds the cleaning interference judgment threshold parameter, a cleaning suspension tag representing the lens cleaning operation is generated and written into the action status tag. S24. When the action status label includes the cleaning suspension label, execute the stop action status recognition instruction and directly suspend the image feature extraction process until the full-screen water flow feature value decreases.

4. The intelligent method for judging the quality of bowel preparation before gastrointestinal surgery according to claim 1, characterized in that, Step S3 specifically includes: S31. Extract a set of image frame data within a continuous time window from the continuous endoscopic video stream data, and use the pixel optical flow function to calculate the motion energy gradient matrix data of two adjacent frames in the set of image frame data. S32, using the energy convergence formula Calculate the total motion energy decay value of the entire image in real time; whereby... and These represent the optical flow vector component parameters of a pixel in the horizontal and vertical directions, respectively. This represents the attenuation constant corresponding to fluid dynamics, retrieved from memory. This represents the sampling time interval in the group of image frame data; S33. Obtain a pre-set stable state determination threshold parameter. When the motion energy decay value of the whole image is less than the stable state determination threshold parameter, output the current frame as the stable frame image after the action.

5. The intelligent method for judging the quality of bowel preparation before gastrointestinal surgery according to claim 1, characterized in that, In step S4, after separating the diffuse reflection component and the specular reflection component, the method further includes a step of optically correcting the diffuse reflection component, specifically: S41. Extract the scattering spectrum data of the diffuse reflection component and obtain the preset Kubelka-Munk optical evolution formula. Where R is the absolute diffuse reflectance parameter; S42. Extract the pre-stored optical prior parameter library, and obtain the medium absorption coefficient matrix K and optical scattering coefficient matrix S corresponding to normal mucosal texture from the optical prior parameter library; S43. Based on the mapping relationship between the medium absorption coefficient matrix K and the optical scattering coefficient matrix S, the characteristic parameter correction calculation of the diffuse reflection component of the diffuse reflection component of deep turbid tissue fluid is performed using the Kubelka-Munk optical evolution formula, and the purified diffuse reflection component after correcting for ambient light interference is output for subsequent processing.

6. The intelligent method for judging the quality of bowel preparation before gastrointestinal surgery according to claim 1, characterized in that, Before step S5, physical boundary fallback processing is also included: S501. Obtain the gray-level co-occurrence matrix data corresponding to the diffuse reflection component, and use the Shannon information entropy formula. Calculate local pixel entropy feature data; Where P(i) represents the spatial probability distribution value of the i-th gray level in the gray-level co-occurrence matrix data appearing in the local area of ​​the stable frame image after the action; S502. Extract the extreme turbidity confidence threshold stored in the memory in advance, and compare the relationship between the local pixel entropy value feature data and the extreme turbidity confidence threshold. S503. When the local pixel entropy value feature data is lower than the extreme turbidity confidence threshold, mechanical debridement prompt information is directly generated for display on the display interface to assist in determining the current environmental state.

7. The intelligent method for judging the quality of bowel preparation before gastrointestinal surgery according to claim 1, characterized in that, Step S5 specifically includes: S51. Input the diffuse reflection component into the preset image semantic segmentation model, and output the absolute pixel count set data parameters corresponding to the foreign object residual area feature; S52. Based on the image closure boundary coordinate parameters of the normal mucosal texture features, the total effective area of ​​the visible intestinal lumen in the current image is calculated using the polygon area calculation formula. S53. Divide the absolute pixel count set data parameter by the total effective area feature data of the visible intestinal lumen to calculate the foreign object occlusion ratio parameter result corresponding to the diffuse reflection component. S54. Extract the mapping equation of the Boston Bowel Preparation Rating Scale, use the mapping equation to perform non-linear level transformation on the foreign body obstruction ratio parameter results, and output the local preparation quality score.

8. The intelligent method for judging the quality of bowel preparation before gastrointestinal surgery according to claim 1, characterized in that, Step S6 specifically includes: S61. Extract the pre-stored local historical dirt score sequence data from the anatomical segment assessment record, and obtain the timestamp identification information data corresponding to the stable frame image after the action; S62. Retrieve all preceding low-scoring dirty nodes in the local historical dirt score sequence data whose time attribute is earlier than the timestamp identification information data, and use the local preparation quality score to cover the nodes. S63. Generate a target anatomical segment target score set with updated coverage, and input the target anatomical segment target score set into a preset weighted average function model to calculate the segment mean. S64. The calculated average segment quality is used as the final intestinal score result of the target anatomical segment, and output and displayed on a display device that is communicatively connected to the processor.

9. A system for intelligently judging the quality of preoperative bowel preparation in gastrointestinal surgery as described in any one of claims 1-8, characterized in that, The system includes: The spatial anchoring module is used to acquire continuous endoscopic video stream data, input the continuous endoscopic video stream data into the target detection network to extract anatomical landmark features, and generate anatomical segment information based on the anatomical landmark features; The action recognition module is used to input the continuous endoscopic video stream data into the action recognition network and extract clinical irrigation and aspiration operation features to generate action status labels. The timing gating module is used to trigger the timing gating mechanism when the action status label indicates the end of the clinical irrigation and aspiration action, and extract the post-action stable frame image from the continuous endoscopic video stream data; An optical decoupling module is used to perform pixel decoupling on the post-action stabilized frame image using a preset dual-color reflection model, separate the diffuse reflection component and the specular reflection component, and remove the specular reflection component from the image data. The feature scoring module is used to extract foreign matter residue area features and normal mucosal texture features from the purified diffuse reflection component, and to calculate the local preparation quality score of the stabilized frame image after the action based on the foreign matter residue area features and normal mucosal texture features. The record update module is used to obtain the timestamp corresponding to the stable frame image after the action, match the corresponding anatomical segment information according to the timestamp, store the local preparation quality score into the corresponding anatomical segment evaluation record to overwrite and update the historical low score data, and generate the final intestinal score result.

10. The intelligent judgment system for preoperative bowel preparation quality in gastrointestinal surgery according to claim 9, characterized in that, After separating the diffuse reflection component and the specular reflection component, the optical decoupling module is further used to perform an optical correction step on the diffuse reflection component, specifically including: Extract the scattering spectrum data of the diffuse reflection component to obtain the preset Kubelka-Munk optical evolution formula. Where R is the absolute diffuse reflectance parameter; Extract the pre-stored optical prior parameter library, and obtain the medium absorption coefficient matrix K and optical scattering coefficient matrix S corresponding to normal mucosal texture from the optical prior parameter library; Based on the mapping relationship between the medium absorption coefficient matrix K and the optical scattering coefficient matrix S, the diffuse reflection component is subjected to characteristic parameter correction calculation of the diffuse reflection characteristics of deep turbid tissue fluid using the Kubelka-Munk optical evolution formula, and the corrected diffuse reflection component is output to the feature scoring module.