Artificial intelligence-based bowel cleanliness assisted assessment method, system, device and medium

By using a time-series model and state transition probability matrix based on a multi-layer gated loop unit, the intestinal preparation process is dynamically evaluated, solving the problem that existing technologies cannot understand the intestinal preparation process in real time, and improving the real-time performance and accuracy of intestinal preparation.

CN122117376APending Publication Date: 2026-05-29别巍

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
别巍
Filing Date
2026-02-10
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing AI-based intestinal cleanliness assessment systems cannot dynamically evaluate the intestinal preparation process, resulting in patients and healthcare workers being unable to understand the preparation progress in real time, which can easily lead to examination delays and wasted resources.

Method used

By using a time-series model based on multi-gated cyclic units, combined with visual feature extraction and temporal coding, the bowel preparation process is dynamically evaluated, cleanliness status classification results and next defecation status prediction results are generated, and the state transition probability matrix is ​​used to calculate quantitative indicators of bowel preparation progress and evolution trend indicators, and personalized early warnings are triggered in combination with target inspection time.

Benefits of technology

It enables dynamic monitoring and trend prediction of the bowel preparation process, improves the real-time nature and accuracy of assessment, provides personalized guidance, and reduces examination delays and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122117376A_ABST
    Figure CN122117376A_ABST
Patent Text Reader

Abstract

The application relates to an artificial intelligence-based intestinal tract cleanliness auxiliary evaluation method, system, device and medium. The method comprises the following steps: inputting an updated fusion feature vector sequence into a pre-trained time sequence model based on a multilayer gate recurrent unit to obtain a cleanliness state classification result of a current defecation reporting event and a next defecation state prediction result; according to the cleanliness state classification result and the next defecation state prediction result, an intestinal tract preparation progress quantitative index and an evolution trend index up to the current defecation reporting event are calculated through a state residence time model based on a state transition probability matrix; and based on the intestinal tract preparation progress quantitative index and the evolution trend index, a dynamic threshold judgment mechanism is triggered for personalized early warning of the intestinal tract preparation process in combination with a target examination time. The method can dynamically monitor, evaluate the progress and predict the trend of the intestinal tract preparation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medical auxiliary technology, and in particular relates to an artificial intelligence-based method, system, device and medium for assisting in the assessment of intestinal cleanliness. Background Technology

[0002] With the development of technology in the field of gastrointestinal endoscopy-assisted diagnosis, an artificial intelligence-based intestinal cleanliness assessment system has emerged. This system uses a smartphone to take a single photo of the toilet after defecation, and a trained convolutional neural network (CNN) is used to classify the photo, ultimately outputting a static intestinal cleanliness score.

[0003] In traditional techniques, the determination of bowel cleanliness mainly relies on the patient taking laxatives and then manually or via CNN to determine whether the excrement has reached the final state of a colorless or pale yellow clear liquid, or on medical staff indirectly interpreting it based on the patient's description.

[0004] However, the aforementioned CNN assessment system overlooks the fact that bowel preparation is a dynamic physiological process that lasts for several hours. That is, the shape, color, and turbidity of stool will undergo continuous non-linear evolution with time and the effect of laxatives. It cannot answer key clinical questions such as which stage of the preparation process the patient is currently in, whether the evolution speed is normal, how long it will take to reach the target state, and whether there is a risk of evolutionary stagnation. This leaves patients and medical staff in a passive waiting and post-event judgment situation. If inadequate preparation is only discovered during the examination, it is often difficult to remedy, which in turn leads to problems such as examination delays, waste of resources, and increased diagnostic risks. Summary of the Invention

[0005] Therefore, it is necessary to provide an AI-based method, system, device, and medium for assisting in the assessment of intestinal cleanliness based on artificial intelligence, which can evaluate the dynamic temporal process of the entire intestinal preparation, in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides an artificial intelligence-based method for assisting intestinal cleanliness assessment, comprising: Based on a patient's single bowel preparation cycle, in response to the acquisition of a defecation reporting event, the defecation status data packet corresponding to the defecation reporting event is structured to obtain single observation data; the defecation status data packet contains the original defecation image and temporal metadata of this defecation reporting event; Visual features are extracted from defecation images in a single observation data to obtain a visual feature vector, and temporal encoding is performed on the single observation data to obtain a temporal encoding vector; The visual feature vector and the temporal coding vector are fused to obtain the fused feature vector of the current defecation reporting event, and the fused feature vector sequence is updated based on the fused feature vector of the current defecation reporting event; the fused feature vector sequence includes the fused feature vectors corresponding to each historical defecation reporting event arranged in chronological order within a single bowel preparation cycle of the patient; The updated fused feature vector sequence is input into a pre-trained time series model based on a multi-layer gated recurrent unit to obtain the cleanliness status classification result of the current defecation reporting event and the prediction result of the next defecation status. Based on the cleanliness status classification results and the next defecation status prediction results, the quantitative indicators and evolution trend indicators of intestinal preparation progress up to the current defecation reporting event are calculated by using a state residence time model based on the state transition probability matrix. Based on quantitative indicators of bowel preparation progress and evolution trend indicators, combined with the target examination time, a dynamic threshold judgment mechanism is used to trigger personalized early warnings for the bowel preparation process.

[0007] In one embodiment, the defecation status data packet corresponding to the defecation reporting event is structured to obtain single observation data, including: The original defecation image and time-series metadata of this defecation reporting event are parsed from the defecation status data packet; the time-series metadata includes an absolute timestamp and a sequence index. The original defecation image is preprocessed to obtain a standardized defecation image. The preprocessing corresponds to segmenting the fecal region image in the original defecation image based on color and contour detection, and then performing color normalization and target scale scaling on the fecal region image. Based on the absolute timestamp and sequence index, the relative time interval between the current defecation reporting event and the previous defecation reporting event is calculated, and the cumulative time from the start of the patient's single bowel preparation cycle is calculated. The defecation image, absolute timestamp, sequence index, relative time interval, and cumulative time are encapsulated together to construct single observation data.

[0008] In one embodiment, the cleanliness status classification result and the next defecation status prediction result are obtained in the time-series model based on a multi-layer gated circulation unit through the following methods: The fused feature vector sequence is dynamically evolved and encoded using a multi-layer gated recurrent unit (GRU) gating mechanism to obtain the hidden state sequence. The gating mechanism includes an update gate and a reset gate; the expression for the update gate is... The expression for resetting the door is: The expression for each hidden state in the hidden state sequence is: , ,in, To update the gate vector, To reset the gate vector, It is the sigmoid activation function. For the front The hidden state of the defecation reporting event at the time step. For the first The fused feature vector of defecation reporting events at each time step. For the first The hidden state of the defecation reporting event at the time step. For the first Candidate hidden states of defecation reporting events at time steps. For element-wise multiplication, , and This is the weight matrix. , and For bias vectors, This is the fused feature vector at the current time step; The hidden state of the current defecation reporting event in the hidden state sequence is input into the fully connected decoder to obtain the cleanliness state classification result and the next defecation state prediction result. The fully connected decoder includes a first output branch and a second output branch. The first output branch maps the hidden state of the current defecation reporting event to the cleanliness state classification result. The cleanliness state classification result is a probability distribution on the cleanliness state. The second output branch maps the hidden state of the current defecation reporting event to the next defecation state prediction result. The next defecation state prediction result is a probability distribution of the defecation state prediction for the next defecation reporting event.

[0009] In one embodiment, based on the cleanliness status classification result and the next defecation status prediction result, a quantitative indicator and evolutionary trend indicator of intestinal preparation progress up to the current defecation reporting event are calculated using a state residence time model based on the state transition probability matrix, including: Based on the state with the highest probability in the cleanliness state classification results, the corresponding state transition probability row vector is extracted from the state transition probability matrix; the state transition probability matrix includes the conditional probability of each cleanliness state transitioning to the target cleanliness state. The prediction result of the next defecation state is weighted and fused with the row vector of the state transition probability to obtain the enhanced defecation state prediction probability distribution. Based on the state with the highest probability in the cleanliness state classification results and the hidden state of this defecation reporting event in the hidden state sequence, the expected residence time in the state with the highest probability in the cleanliness state classification results is estimated by using a parameterized negative binomial distribution model. Based on the hidden state, cleanliness classification results, enhanced defecation state prediction probability distribution, and expected residence time of the current defecation reporting event in the hidden state sequence, the current progress percentage is calculated to obtain a quantitative indicator of bowel preparation progress. Based on multiple defecation reporting events within a single bowel preparation cycle up to the current defecation reporting event, the change rate of each quantitative indicator of bowel preparation progress is calculated to obtain an evolutionary trend indicator.

[0010] In one embodiment, based on the hidden state of the current defecation reporting event in the hidden state sequence, the cleanliness status classification result, the enhanced defecation status prediction probability distribution, and the expected residence time, the current progress percentage is comprehensively calculated to obtain a quantitative indicator of intestinal preparation progress, including: The hidden state of the current defecation reporting event in the hidden state sequence is input into a pre-trained value function regression network to obtain a utility value estimate; the value function regression network is used to estimate the expected utility value of finally reaching the ideal clean state from the hidden state; Based on the status baseline schedule, query the basic progress reference value corresponding to the status with the highest probability in the cleanliness status classification results. Based on the enhanced defecation state prediction probability distribution, the expected progress value of the next defecation state prediction result is calculated; the expression for the expected progress value is: ,in, This represents the total number of cleanliness levels. To enhance the probability distribution of defecation status prediction, the first... The probability of each state. For the first The basic progress reference value corresponding to each state; The time adjustment factor is calculated based on the expected length of stay; the expression for the time adjustment factor is: ,in, The attenuation coefficient is... For the expected length of stay; The estimated utility value, baseline schedule reference value, expected schedule value, and time adjustment factor are weighted and fused to calculate the quantitative index of bowel preparation progress; the expression for the quantitative index of bowel preparation progress is as follows: ,in, This is an estimate of utility value. Based on the basic progress reference value, The expected progress value, For time adjustment factor, , , and These are the weighting coefficients. This is the preset maximum normalization constant for the utility value estimate.

[0011] In one embodiment, based on quantitative indicators of bowel preparation progress and evolutionary trend indicators, combined with the target examination time, a personalized early warning for the bowel preparation process is triggered through a dynamic threshold judgment mechanism, including: Based on quantitative indicators of intestinal preparation progress and evolution trend indicators, combined with target inspection time and cumulative time, the time required to achieve the ideal clean state is calculated. If the time required to reach the ideal cleanliness state is greater than the remaining safe available time, a personalized alert will be triggered; personalized alerts include delayed alerts and standstill alerts.

[0012] Secondly, this application also provides an artificial intelligence-based intestinal cleanliness assisted assessment system, comprising: The event response module is used to perform structured processing on the defecation status data packet corresponding to the defecation reporting event in response to the acquisition of a defecation reporting event based on a single bowel preparation cycle of the patient, so as to obtain single observation data; the defecation status data packet contains the original defecation image and time-series metadata of this defecation reporting event; The feature module is used to extract visual features from defecation images in a single observation data to obtain a visual feature vector, and to perform temporal encoding on the single observation data to obtain a temporal encoding vector. The feature fusion module is used to fuse visual feature vectors and temporal coding vectors to obtain a fused feature vector for the current defecation reporting event, and to update the fused feature vector sequence based on the fused feature vector for the current defecation reporting event. The fused feature vector sequence includes the fused feature vectors corresponding to each historical defecation reporting event arranged in chronological order within a single bowel preparation cycle of the patient. The cleanliness status module is used to input the updated fused feature vector sequence into a pre-trained time series model based on multi-layer gated recurrent units to obtain the cleanliness status classification result of the current defecation reporting event and the prediction result of the next defecation status. The state transition module is used to calculate quantitative indicators and evolution trend indicators of intestinal preparation progress up to the current defecation reporting event based on the cleanliness status classification results and the next defecation status prediction results, using a state residence time model based on the state transition probability matrix. The auxiliary module is used to trigger personalized early warnings for the bowel preparation process based on quantitative indicators and evolution trend indicators of bowel preparation progress, combined with the target examination time, through a dynamic threshold judgment mechanism.

[0013] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above-described artificial intelligence-based intestinal cleanliness assisted assessment methods.

[0014] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described artificial intelligence-based intestinal cleanliness assisted assessment methods.

[0015] The aforementioned AI-based method, system, device, and medium for assisting intestinal cleanliness assessment respond to each patient's reported defecation event by structurally processing data packets containing raw images and temporal metadata to obtain single-observation data. Visual features are then extracted and encoded with temporal information, which is fused into a fusion feature vector for the current event. The dynamic process context is accumulated by updating historical fusion feature vector sequences, and this sequence is input into a pre-trained temporal model based on multi-layer gated recurrent units to classify the cleanliness status of the current defecation event and predict the status of the next defecation. Based on the cleanliness status classification results and the predicted status of the next defecation, quantitative progress indicators and evolutionary trend indicators reflecting the current preparation process are calculated using a state transition probability matrix and a state residence time model. Personalized early warnings are triggered by dynamic thresholds combined with the target examination time. This represents a shift from judging single static images to dynamic process modeling, trend prediction, and prospective intervention based on fused temporal context, effectively improving the real-time performance, accuracy, and personalized guidance capabilities of intestinal preparation assessment. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the artificial intelligence-based intestinal cleanliness assisted assessment method of the present invention. Figure 2 This is a structural diagram of the artificial intelligence-based intestinal cleanliness assisted assessment system of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0019] In one embodiment, such as Figure 1As shown, an artificial intelligence-based method for assisting intestinal cleanliness assessment is provided. This embodiment illustrates the application of this method to a terminal, but it is understood that the method can also be applied to a server, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps: S101. Based on a patient's single bowel preparation cycle, in response to the acquisition of a defecation reporting event, the defecation status data packet corresponding to the defecation reporting event is structured to obtain single observation data; the defecation status data packet contains the original defecation image and time-series metadata of this defecation reporting event.

[0020] To illustrate, a single bowel preparation cycle for a patient is the complete process of defecation preparation, from the first dose of bowel preparation medication to the scheduled colonoscopy time. Defecation reporting events are monitored in real-time via an application deployed on the patient's terminal. These events are triggered either by the patient actively clicking the reporting button within the application, or by the patient confirming the notification after the application sends reminders at preset time intervals. Upon detecting a defecation reporting event, the corresponding defecation status data packet is acquired. The original defecation image is captured by the patient's terminal camera. During the acquisition process, the application can guide the patient to adjust the shooting angle through a real-time viewfinder to ensure that the defecation area inside the toilet is completely centered in the image, while avoiding image distortion caused by excessively strong or dark ambient light. The temporal metadata is automatically collected, specifically including the absolute timestamp of the current defecation reporting event and the sequence index, which is a unique sequence number assigned to all defecation reporting events in a single bowel preparation cycle according to their chronological order. The initial value is 1, and the sequence number increments by 1 for each new reporting event. It also includes the relative time interval, which is the difference between the absolute timestamp of the current defecation reporting event and the previous defecation reporting event, as well as the difference between the absolute timestamp of the current defecation reporting event and the time of the first administration of bowel preparation medication, i.e., the cumulative duration.

[0021] S102. Visual features are extracted from the defecation images in the single observation data to obtain a visual feature vector, and the single observation data is temporally encoded to obtain a temporally encoded vector.

[0022] Specifically, visual feature extraction of defecation images from a single observation dataset is achieved using a pre-trained convolutional neural network, such as a ResNet or EfficientNet model. During feature extraction, the standardized defecation image is input into the pre-trained convolutional neural network. Features are extracted and dimensionality compressed sequentially through the network's convolutional and pooling layers. The convolutional layers calculate the feature responses of local image regions using a sliding window, while the pooling layers downsample the feature maps output by the convolutional layers, preserving key features while reducing data dimensionality. Each element in the visual feature vector corresponds to a specific visual feature of the defecation image, including color distribution features, texture features, and morphological contour features, comprehensively characterizing the visual attributes of the defecation.

[0023] The temporal encoding process for single-observation data is accomplished using a lightweight fully connected network. This network comprises an input layer, hidden layers, and an output layer, with 1-2 hidden layers. The ReLU activation function is used to fit the nonlinear characteristics of the time-series data. The input to the temporal encoding is the temporal metadata from the single-observation data, including the relative time interval, cumulative duration, sequence index, and the reciprocal of the relative time interval. During the encoding process, each temporal metadata parameter is passed as an input vector to the input layer of the fully connected network. After nonlinear transformation by the hidden layers, the output layer outputs a fixed-dimensional temporal encoding vector. This temporal encoding vector, by mapping discrete temporal parameters to a high-dimensional continuous vector, effectively captures the temporal contextual information of the defecation reporting event and reflects the temporal evolution of the defecation process.

[0024] S103. The visual feature vector and the temporal coding vector are fused to obtain the fused feature vector of the current defecation reporting event, and the fused feature vector sequence is updated based on the fused feature vector of the current defecation reporting event. The fused feature vector sequence includes the fused feature vectors corresponding to each historical defecation reporting event arranged in chronological order within a single bowel preparation cycle of the patient.

[0025] Furthermore, the fusion of the visual feature vector and the temporal coding vector is achieved through vector concatenation. The fusion process follows the dimension matching principle, ensuring that the two vectors remain consistent in all dimensions except the concatenation dimension. For example, let the dimension of the visual feature vector be... The dimension of the time-series coding vector is Then the dimension of the fused feature vector The expression for fusing feature vectors is: ,in Represents the fused feature vector. This represents a vector concatenation operation. Represents visual feature vectors. This represents the temporal coding vector. This fusion method can completely preserve and organically combine the visual attributes of the excrement with the temporal attributes of the defecation process, so that the fused feature vector contains not only intuitive features such as the shape and color of the excrement, but also temporal information such as the time interval and cumulative duration of defecation.

[0026] The update process of the fusion feature vector sequence is based on the time order priority principle. The fusion feature vector sequence is an ordered data structure used to store the fusion feature vectors corresponding to all defecation reporting events within a single bowel preparation cycle of a patient. The initial state is empty. After the fusion feature vector of the current defecation reporting event is generated, the absolute timestamp corresponding to the fusion feature vector is obtained and inserted into the end of the fusion feature vector sequence to ensure that all fusion feature vectors in the sequence are always arranged in chronological order of the occurrence of defecation reporting events.

[0027] S104. Input the updated fused feature vector sequence into the pre-trained time series model based on multi-layer gated recurrent units to obtain the cleanliness status classification result of this defecation reporting event and the prediction result of the next defecation status.

[0028] The pre-trained temporal model based on multi-gated recurrent units (GRUs) consists of an input layer, a GRU layer, and an output layer. The number of GRU layers is set to 2-3, and the number of hidden units in each layer is adaptively adjusted according to the feature dimension and the scale of the training data. The pre-training process of this model is based on a large-scale labeled temporal dataset. The training data includes fused feature vector sequences of multiple patients' single bowel preparation cycles, corresponding cleanliness status annotations, and next defecation status annotations. The training objective is to minimize the error between the model's prediction results and the true annotations.

[0029] For example, after inputting the updated fused feature vector sequence into the temporal model, the input layer maps the fused feature vector to a feature space that matches the dimension of the hidden units in the GRU layer, and then feeds it into the GRU layer for temporal feature modeling. The GRU layer effectively captures long-sequence dependencies through a dynamic adjustment mechanism of reset and update gates. , , , ,in, For the first The reset gate output vector at each time step. It is the sigmoid activation function. To reset the weight matrix of the gate, For the first The GRU hidden state vector at each time step For the first The fused feature vector at each time step To reset the gate's bias vector; For the first Update the gate output vector at each time step. To update the gate weight matrix, To update the bias vector of the gate; For the first The candidate hidden state vectors at each time step. The hyperbolic tangent activation function is used. Let be the weight matrix of the candidate hidden states. is the bias vector of the candidate hidden state; This is an element-wise multiplication operation for vectors. For the first The final hidden state vector at each time step.

[0030] The output of the multi-layer GRU is a sequence of hidden state vectors for each time step, which contains temporal evolution information of the fused feature vector sequence. The hidden state vector corresponding to the current defecation reporting event is fed into the model's output layer, which consists of two parallel fully connected sub-networks, used for cleanliness state classification and next defecation state prediction, respectively. The cleanliness state classification sub-network outputs a probability distribution through a softmax activation function. This probability distribution corresponds to K predefined discrete cleanliness states, with each element representing the probability that the current defecation reporting event belongs to the corresponding cleanliness state. The cleanliness state with the highest probability can be taken as the cleanliness state classification result. The next defecation state prediction sub-network also outputs a probability distribution through a softmax activation function. This probability distribution corresponds to the transition probabilities between the K cleanliness states, with each element representing the probability that the next defecation reporting event belongs to the corresponding cleanliness state, i.e., the next defecation state prediction result.

[0031] S105. Based on the cleanliness status classification results and the prediction results of the next defecation status, the quantitative indicators and evolution trend indicators of intestinal preparation progress up to the current defecation reporting event are calculated using a state residence time model based on the state transition probability matrix.

[0032] Optionally, the state transition probability matrix is ​​a single... The square array, denoted as ,in For a predefined number of cleanliness states, matrix elements This indicates the current cleanliness status is... At that time, the cleanliness status will transition to the next reported bowel movement event. The conditional probability, and satisfying The state transition probability matrix is ​​learned from state transition samples in the training data and optimized through end-to-end training along with other parameters of the time series model.

[0033] The state dwell time model is used to characterize the dwell characteristics of defecation events under a certain cleanliness state, and is implemented using a parameterized probability distribution. For each cleanliness state... The model learns the distribution parameters corresponding to this state, and the distribution can be used to calculate the current state using this parameterized distribution. The probability distribution of the number or duration of subsequent defecation events provides a quantitative basis for determining whether the state has stagnated.

[0034] The calculation of quantitative indicators for bowel preparation progress is based on a value function and state transition information. The value function... Used to characterize the current cleanliness status The expected discounted return upon reaching the target cleanliness state (completely clean) is obtained by regressing the hidden state vector of the time series model using a specialized value head network. For example, the formula for calculating the progress quantification index is as follows: ,in, This represents a quantitative indicator of bowel preparation progress, with a value range of [0,1]. This represents the contribution of the past time to achieving the target, calculated by integrating the cumulative duration with the value function corresponding to the historical state sequence; This represents the predicted contribution of the current state to achieving the target, i.e., the value function value corresponding to the current cleanliness state. , The cleanliness status classification results for this reported defecation event; The total expected value represents the maximum expected discounted return from the initial cleanliness state to the target cleanliness state, which is obtained from training data statistics.

[0035] The evolutionary trend indicators include two core indicators: the average rate of change in schedule and the change in state classification probability entropy. The formula for calculating the average rate of change in schedule is as follows: , This represents the average rate of change in progress. This indicates the quantitative indicators of the progress of this bowel movement reporting event. Indicates the preceding Quantitative indicators of the progress of each bowel movement reporting event. The preset sliding window size reflects the rate of change in recent bowel preparation progress. The formula for calculating the change in state classification probability entropy is as follows: ,in This represents the change in entropy. This represents the entropy value of the probability distribution of the cleanliness status classification for this reported defecation event. The entropy value represents the probability distribution of the cleanliness status classification of the last reported defecation event; entropy value The calculation formula is ,in Cleanliness status The corresponding classification probability and the change in entropy value reflect the trend of uncertainty in the cleanliness state. A negative value indicates that the state is becoming clearer, while a positive value indicates that the uncertainty of the state is increasing.

[0036] S106. Based on quantitative indicators and evolutionary trend indicators of bowel preparation progress, combined with the target inspection time, a dynamic threshold judgment mechanism is used to trigger personalized early warnings for the bowel preparation process.

[0037] For example, the dynamic threshold judgment mechanism involves adaptive adjustment of threshold parameters, including progress lag threshold, stagnation judgment threshold, and abnormal pattern threshold. Each threshold can be dynamically generated based on the statistical distribution characteristics of the training data and individual patient characteristics. Personalized warnings include three categories: progress lag warnings, stagnation warnings, and abnormal pattern warnings. The triggering conditions for each type of warning are quantitatively defined using formulas.

[0038] Optionally, the triggering condition for the progress delay warning is: ,in A safety margin is provided to allow sufficient adjustment time; its value is set based on clinical risk assessment. This is the remaining time required to reach the target cleanliness state, as predicted by the state dwell time model. The target examination time is the scheduled colonoscopy time. When this inequality holds, it indicates that, based on the current progress, bowel preparation cannot be completed before the target examination time, and the system triggers a progress lag warning. The trigger condition for the stall warning is... ,in The number of defecation events monitored continuously. The threshold for determining stagnation; when continuous The incremental progress indicators for each reported bowel movement event were all less than [a certain percentage]. If the remaining time of the current state predicted by the state dwell time model exceeds a preset upper limit, the system triggers a stagnation warning, indicating a potential risk of stagnation in intestinal preparation evolution. The trigger condition for the abnormal pattern warning is achieved by calculating the distance between the hidden state vector of the time-series model corresponding to the current defecation reporting event and the cluster centers of the hidden states in the training set. Let the set of cluster centers be... , To determine the number of clusters, Euclidean distance is used for distance calculation. ,in, The distance between the hidden state vector and the nearest cluster center. This is the GRU hidden state vector corresponding to this defecation reporting event. Indicates Euclidean distance calculation; when When the value exceeds the abnormal pattern threshold, it indicates that the current bowel preparation evolution pattern differs significantly from the normal evolution pattern in the training set. The system triggers an abnormal pattern warning, suggesting that there may be situations such as the patient not following medical advice or abnormal drug response.

[0039] Once various warnings are triggered, the warning information is displayed in a visual format on the patient's terminal application and the medical staff's back-end management system. At the same time, targeted guidance and suggestions are provided, such as adjusting water intake and contacting medical staff, so as to realize real-time monitoring and intervention of the bowel preparation process.

[0040] In the aforementioned AI-based method for assisting intestinal cleanliness assessment, within a single bowel preparation cycle, a defecation status data packet containing original defecation images and temporal metadata is structured in response to a defecation reporting event to obtain single-observation data. Visual feature vectors are extracted from the defecation images in this single-observation data, and temporal encoding is performed on the observation data to obtain temporal encoded vectors. These two types of vectors are fused to generate a fused feature vector for the current defecation reporting event, and the fused feature vector sequence, composed of the fused feature vectors corresponding to historical defecation reporting events arranged in chronological order, is updated. The updated fused feature vector sequence is then input into a pre-trained multi-layer gated recurrent unit. The time-series model yields cleanliness status classification results and next defecation status prediction results. Then, based on the state residence time model of the state transition probability matrix, it calculates quantitative indicators and evolution trend indicators of bowel preparation progress up to the current defecation reporting event. Combined with the target examination time, a dynamic threshold judgment mechanism triggers personalized early warnings, realizing dynamic monitoring, progress assessment, and trend prediction of the bowel preparation process. It can identify risks such as insufficient or stalled bowel preparation in advance, providing patients and medical staff with intuitive and valuable reference information, improving the adequacy and controllability of bowel preparation, optimizing the medical efficiency related to colonoscopy, and reducing the workload of medical staff.

[0041] In one embodiment, the defecation status data packet corresponding to the defecation reporting event is structured to obtain single observation data, including: S21. Parse the original defecation image and time-series metadata of this defecation reporting event from the defecation status data packet; the time-series metadata includes an absolute timestamp and a sequence index.

[0042] As an illustration, the parsing process is implemented through a preset data parsing protocol. This protocol is designed for the storage format of defecation status data packets, and selectively extracts image data fields and time-series metadata fields to ensure that the pixel information of the original defecation image is completely preserved and that the time and sequence information of the time-series metadata are accurate, thus providing basic data support for subsequent data processing.

[0043] S22. Preprocess the original defecation image to obtain a standardized defecation image. The preprocessing corresponds to segmenting the fecal region image in the original defecation image based on color and contour detection, and performing color normalization and target scale scaling on the fecal region image.

[0044] Specifically, the preprocessing process first segments the fecal region image based on color and contour detection technology. By using the difference threshold between feces and the toilet background in the color space, suspected fecal regions are initially screened out. Further, the contour detection algorithm extracts the edge features of the regions and removes background interference to obtain a clean fecal region image. By adjusting the color channel parameters of the image, color deviations caused by different shooting lighting and different terminal devices are eliminated to ensure the consistency of fecal color features. Finally, the fecal region image is adjusted to a fixed size to provide input data of uniform specifications for the subsequent visual feature extraction stage.

[0045] S23. Based on the absolute timestamp and sequence index, calculate the relative time interval between the current defecation reporting event and the previous defecation reporting event, and calculate the cumulative time from the start of the patient's single bowel preparation cycle.

[0046] Furthermore, the relative time interval is calculated based on the sequence index to determine the previous defecation reporting event corresponding to the current defecation reporting event. The absolute timestamps of the two events are extracted, and the result is obtained through time difference calculation. If this is the first defecation reporting event, the relative time interval is directly set to 0. The cumulative time is calculated based on the start time of the patient's single bowel preparation cycle. The absolute timestamp of the current defecation reporting event is subtracted from the start time to obtain the duration from the start of the preparation cycle to the current defecation reporting. The two types of time parameters jointly characterize the temporal correlation features of defecation events.

[0047] S24. Encapsulate the defecation image, absolute timestamp, sequence index, relative time interval, and cumulative time together to construct single observation data.

[0048] Optionally, the preprocessed standardized defecation images, combined with the absolute timestamps and sequence indices obtained from parsing, as well as the calculated relative time intervals and cumulative times, are uniformly encapsulated according to a preset data structure. The encapsulation process ensures that the correspondence between various data fields is clear and that the data format meets the input requirements of subsequent feature processing, ultimately constructing a single observation dataset that is structurally complete and information-rich.

[0049] In one embodiment, the cleanliness status classification result and the next defecation status prediction result are obtained in the time-series model based on a multi-layer gated circulation unit through the following methods: S31. The fused feature vector sequence is dynamically evolved and encoded using a multi-layer gated recurrent unit (MRU) gating mechanism to obtain the hidden state sequence; the gating mechanism includes an update gate and a reset gate; the expression for the update gate is: The expression for resetting the door is: The expression for each hidden state in the hidden state sequence is: , ,in, To update the gate vector, To reset the gate vector, It is the sigmoid activation function. For the front The hidden state of the defecation reporting event at the time step. For the first The fused feature vector of defecation reporting events at each time step. For the first The hidden state of the defecation reporting event at the time step. For the first Candidate hidden states of defecation reporting events at time steps. For element-wise multiplication, , and This is the weight matrix. , and For bias vectors, This is the fused feature vector at the current time step.

[0050] This diagram illustrates how a multi-layered gated recurrent unit (GRU) mechanism dynamically evolves and encodes the fused feature vector sequence. The core mechanism relies on the coordinated adjustment of update and reset gates to capture the temporal dependencies and evolutionary patterns of the fused feature vectors at each time step, ultimately generating a hidden state sequence containing complete evolutionary information. The core function of the update gate is to control the retention ratio of the hidden state from the previous time step and the fusion weight of the current input feature. The reset gate is used to filter valid information from the hidden state of the previous time step, determining its contribution to the current candidate hidden state. The candidate hidden state is calculated based on the previous hidden state after the reset gate filtering and the current fused feature vector, capturing the core feature information of the current time step, i.e. Finally, the hidden state is dynamically fused with the previous hidden state and the candidate hidden state through an update gate to form a comprehensive evolutionary feature representation for the current time step, i.e. .in, For the first Update the gate vector at each time step. For the first Reset gate vector at time step It is the sigmoid activation function. For the first The hidden state corresponding to the time-step defecation reporting event. For the first The fused feature vector of the time-step defecation reporting event contains visual and temporal fusion information of the current time step. For the first The final hidden state vector at time step, For the first Candidate hidden state vectors at time step This is an element-wise multiplication operation for vectors. , , Calculate the corresponding weight matrices for the update gate, reset gate, and candidate hidden state, respectively. , , These are the corresponding bias vectors, used to adjust the offset of the linear transformation.

[0051] S32. Input the hidden state of the current defecation reporting event in the hidden state sequence into the fully connected decoder to obtain the cleanliness state classification result and the next defecation state prediction result. The fully connected decoder includes a first output branch and a second output branch. The first output branch maps the hidden state of the current defecation reporting event to the cleanliness state classification result. The cleanliness state classification result is the probability distribution on the cleanliness state. The second output branch maps the hidden state of the current defecation reporting event to the next defecation state prediction result. The next defecation state prediction result is the probability distribution of the defecation state prediction for the next defecation reporting event.

[0052] The hidden state corresponding to this defecation reporting event in the hidden state sequence, i.e., the th... time step The input is a pre-defined fully connected decoder. This decoder completes the cleanliness state classification and next defecation state prediction tasks through two parallel output branches, respectively, thus characterizing the current state and predicting the future state. The first output branch consists of multiple fully connected layers and a softmax activation function. It maps the hidden state to a predefined cleanliness state space through nonlinear transformation and outputs the cleanliness state classification result. This result is presented in the form of a probability distribution, where each element corresponds to the probability of belonging to a cleanliness state, and the sum of all elements is 1, intuitively reflecting the confidence level of the current defecation state belonging to each cleanliness category. The second output branch adopts the same network design as the first output branch. It also processes the current hidden state through nonlinear mapping of fully connected layers and softmax activation function, transforming it into a predicted probability distribution of the next defecation state. Each element in this distribution corresponds to the predicted probability that the next defecation report event belongs to a certain cleanliness state.

[0053] In one embodiment, based on the cleanliness status classification result and the next defecation status prediction result, a quantitative indicator and evolutionary trend indicator of intestinal preparation progress up to the current defecation reporting event are calculated using a state residence time model based on the state transition probability matrix, including: S41. Based on the state with the highest probability in the cleanliness state classification results, extract the corresponding state transition probability row vector from the state transition probability matrix; the state transition probability matrix includes the conditional probability of each cleanliness state transitioning to the target cleanliness state.

[0054] Indicatively, the target state with the highest probability value in the cleanliness state classification results is identified. This target state directly corresponds to a row index in the state transition probability matrix. The state transition probability matrix is ​​a pre-defined standardized matrix, where each element is defined as the conditional probability of transitioning from any cleanliness state to the target cleanliness state. Each row in the matrix corresponds to the probability distribution of all possible transition directions under an initial cleanliness state. Based on the identified target state, the corresponding row of data is precisely extracted from the state transition probability matrix through index matching, forming a state transition probability row vector. This vector fully contains the probability information of transitioning from the current target state to the target cleanliness state, providing a foundation for enhancing subsequent prediction results.

[0055] S42. The prediction result of the next defecation state is weighted and fused with the row vector of the state transition probability to obtain the enhanced defecation state prediction probability distribution.

[0056] Furthermore, weighted fusion is achieved through a pre-defined weight allocation rule. This rule is determined based on the confidence levels of the two types of probability information learned during model training, ensuring that the fusion result retains both the temporal evolution characteristics of the next defecation state prediction and incorporates the statistical regularity of the state transition probability matrix. For example, ,in, To enhance the probability distribution for predicting defecation status, This is a prediction of the next defecation state. Let the row vector be the state transition probability. The fusion weights are adjustable.

[0057] S43. Based on the state with the highest probability in the cleanliness state classification results and the hidden state of the current defecation reporting event in the hidden state sequence, the expected residence time in the state with the highest probability in the cleanliness state classification results is estimated by using a parameterized negative binomial distribution model.

[0058] Optionally, a parameterized negative binomial distribution model is used as the state dwell time model. The parameters of the parameterized negative binomial distribution model are adaptively learned through training data. The parameters have a mapping relationship with the cleanliness state and the hidden state, and can capture the statistical distribution characteristics of dwell time under different states. By inputting the target state and the current hidden state into this model, the expected dwell time in the current target state is output through probability calculation. This time quantifies the possible duration of the current cleanliness state.

[0059] S44. Based on the hidden state, cleanliness status classification results, enhanced defecation status prediction probability distribution, and expected residence time of the current defecation reporting event in the hidden state sequence, calculate the current progress percentage to obtain a quantitative indicator of bowel preparation progress. Based on multiple defecation reporting events up to the current defecation reporting event within a single bowel preparation cycle, calculate the change rate of each quantitative indicator of bowel preparation progress to obtain an evolutionary trend indicator.

[0060] Specifically, the calculation process involves uncovering deep features of temporal evolution through hidden state mining, combining current state information from cleanliness status classification results, utilizing future trend information from the probability distribution of enhanced defecation status prediction, and correcting for the influence of the time dimension through expected residence time. Finally, a standardized calculation yields the current progress percentage, i.e., the quantitative indicator of bowel preparation progress. This indicator directly reflects the degree of completion of bowel preparation up to the current defecation reporting event. The evolutionary trend indicator is calculated based on the quantitative indicators of bowel preparation progress corresponding to all defecation reporting events generated within a single bowel preparation cycle. By calculating the ratio of the difference between two adjacent quantitative indicators to the time interval, multiple progress change rate data are obtained, collectively constituting the evolutionary trend indicator. This clearly depicts the rate of change and development trend of bowel preparation progress, providing a trend basis for early warning judgment.

[0061] In one embodiment, based on the hidden state of the current defecation reporting event in the hidden state sequence, the cleanliness status classification result, the enhanced defecation status prediction probability distribution, and the expected residence time, the current progress percentage is comprehensively calculated to obtain a quantitative indicator of intestinal preparation progress, including: S51. The hidden state of the current defecation reporting event in the hidden state sequence is input into the pre-trained value function regression network to obtain the utility value estimate; the value function regression network is used to estimate the expected utility value of finally reaching the ideal clean state from the hidden state.

[0062] Indicatively, the value function regression network is a pre-trained deep learning network model. Its training objective is to learn the expected utility value mapping from hidden states to the final ideal clean state. This network is trained on large-scale labeled time-series data, which includes the final bowel preparation achievement results and clinical utility assessments corresponding to different hidden states. The hidden state corresponding to the current defecation reporting event in the hidden state sequence is taken as input and fed into the value function regression network. The network outputs a utility value estimate through nonlinear transformation and feature mapping across multiple fully connected layers. This estimate quantifies the expected utility level of successfully reaching the ideal clean state from the bowel preparation stage represented by the current hidden state. A higher utility value indicates a higher probability of achieving the target preparation and higher clinical value in the current state, providing deep temporal feature support for progress quantification.

[0063] S52. Based on the status baseline schedule, query the basic progress reference value corresponding to the status with the highest probability in the cleanliness status classification results.

[0064] Specifically, the status baseline progress table is a standardized reference table built based on clinical bowel cleanliness assessment standards and a large amount of historical preparation data. The table predefines a basic progress reference value for each cleanliness status. The setting of this basic progress reference value comprehensively considers the degree of difference between the current status and the ideal cleanliness status, the average difficulty and time required to progress from the current status to the target cleanliness status in clinical practice, and the range of all basic progress reference values ​​is normalized to the [0,1] interval to ensure consistency in progress calculation. Based on the target status with the highest probability in the cleanliness status classification results, the corresponding value is retrieved from the status baseline progress table through precise status matching. This value is the basic progress reference value, providing a fundamental reference basis for progress quantification.

[0065] S53. Based on the probability distribution of the enhanced defecation state prediction, calculate the expected progress value of the next defecation state prediction result; the expression for the expected progress value is: ,in, This represents the total number of cleanliness levels. To enhance the probability distribution of defecation status prediction, the first... The probability of each state. For the first The basic progress reference value corresponding to each state.

[0066] For example, This represents the total number of predefined cleanliness states, covering all discrete state categories from the initial preparation state to the ideal cleanliness state; This represents the probability distribution for predicting enhanced defecation status. The predicted probability corresponding to each cleanliness state reflects the confidence that the next defecation event will be in that state; Indicates the first The baseline progress reference value corresponding to each cleanliness state in the state baseline progress table; this expected progress value integrates all possible predictions of the next defecation state and their corresponding weights, quantifying the expected contribution of a future defecation event to the progress of intestinal preparation.

[0067] S54. Calculate the time adjustment factor based on the expected length of stay; the expression for the time adjustment factor is: ,in, The attenuation coefficient is... This refers to the expected length of stay.

[0068] Furthermore, a time adjustment factor is used to correct the impact of expected residence time on bowel preparation progress. As the expected residence time increases, the timeliness of progress growth gradually diminishes. ,in, The decay coefficient is determined through optimization using model training data. It is used to control the rate of time decay, and its value needs to balance the characteristics of the clinical preparation cycle and the sensitivity of progress assessment. The expected residence time is the length of time that needs to continue in the current clean state, estimated by the state residence time model. The time adjustment factor ranges from (0,1). The longer the expected residence time, the smaller the adjustment factor, and vice versa, thus correcting the time dimension of the progress assessment.

[0069] S55. The estimated utility value, baseline schedule reference value, expected schedule value, and time adjustment factor are weighted and fused to calculate the quantitative index of bowel preparation progress; the expression for the quantitative index of bowel preparation progress is as follows: ,in, This is an estimate of utility value. Based on the basic progress reference value, The expected progress value, For time adjustment factor, , , and These are the weighting coefficients. This is the preset maximum normalization constant for the utility value estimate.

[0070] For example, This is an estimate of utility value. This represents the result after normalizing the estimated utility value. The preset maximum normalization constant for utility value is taken as the maximum value of the estimated utility value in the training data, ensuring that the normalized result is in the range of [0,1]. Basic progress reference value; This represents the expected progress value. For time adjustment factors; , , and The weight coefficients are all equal to 1. Their specific values ​​are determined through cross-validation optimization during model training. They are used to balance the contribution of each input factor to the progress quantification index, ensuring that the final progress quantification index can comprehensively and accurately reflect the actual progress of bowel preparation.

[0071] In one embodiment, based on quantitative indicators of bowel preparation progress and evolutionary trend indicators, combined with the target examination time, a personalized early warning for the bowel preparation process is triggered through a dynamic threshold judgment mechanism, including: S61. Based on quantitative indicators of intestinal preparation progress and evolution trend indicators, combined with target inspection time and cumulative time, the time required to achieve the ideal clean state is calculated.

[0072] In a schematic manner, the calculation of the time required to reach the ideal clean state is based on the synergistic analysis of multi-dimensional parameters. A quantitative indicator of intestinal preparation progress provides a benchmark for the current degree of completion of intestinal preparation; an evolutionary trend indicator reflects the dynamic changes in progress; the target inspection time clarifies the final deadline for intestinal preparation; and the cumulative time characterizes the time consumed from the start of the preparation cycle to the current moment. Specifically, based on the quantitative indicator of intestinal preparation progress, the difference between the current progress and the ideal clean state is determined, i.e., the incomplete progress. Combined with the effective progress change rate in the evolutionary trend indicator (i.e., the recent average progress change rate after filtering out abnormal fluctuations), a time prediction model is established. For example, the ratio of incomplete progress to the effective progress change rate is used to initially estimate the basic required time. Simultaneously, considering the time constraint of the target inspection time and the proportion of cumulative time consumed, the basic required time is dynamically adjusted, ultimately yielding the time required to reach the ideal clean state that conforms to actual evolutionary patterns. This time quantifies the theoretical time required to complete the remaining preparation work.

[0073] S62. If the time required to reach the ideal cleanliness state is greater than the remaining safe available time, a personalized warning will be triggered; personalized warnings include delayed warnings and standstill warnings.

[0074] For example, the remaining safe available time is defined as the difference between the target examination time and the cumulative time. This time is not only the latest deadline for completing bowel preparation, but also reserves the buffer time required by the clinic to cope with the necessary preparation process from the completion of preparation to the examination. The triggering of personalized warnings is based on the core judgment condition that the time required to reach the ideal clean state is greater than the remaining safe available time. Optionally, the delayed warning is applicable to scenarios where bowel preparation is still progressing, but according to the current progress quantitative indicators and evolution trend, the required time has exceeded the remaining safe available time. This prompts the patient to adjust their preparation behavior in a timely manner, such as increasing water intake as instructed, confirming the dosage of laxatives, or contacting medical staff. The stagnation warning is for situations where the evolution trend indicators show that the rate of change in progress is continuously lower than the preset effective threshold, such as the progress increment reported by multiple consecutive bowel movements approaching 0, resulting in the time required to reach the ideal clean state being extended indefinitely or far exceeding the remaining safe available time. This indicates that there may be a risk of stagnation in the evolution of bowel preparation, such as the medication not achieving the expected effect or the patient's bowel function being abnormal. Immediate intervention is required to investigate the cause and take targeted measures.

[0075] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0076] Based on the same inventive concept, this application also provides an AI-based intestinal cleanliness auxiliary assessment system for implementing the aforementioned AI-based intestinal cleanliness auxiliary assessment method. The solution provided by this system is similar to the implementation described in the above method; therefore, the specific limitations of one or more AI-based intestinal cleanliness auxiliary assessment system embodiments provided below can be found in the limitations of the AI-based intestinal cleanliness auxiliary assessment method described above, and will not be repeated here.

[0077] In one exemplary embodiment, such as Figure 2 As shown, an artificial intelligence-based intestinal cleanliness assisted assessment system is provided, including: The event response module 201 is used to perform structured processing on the defecation status data packet corresponding to the defecation reporting event in response to the acquisition of a defecation reporting event based on a single bowel preparation cycle of the patient, so as to obtain single observation data; the defecation status data packet contains the original defecation image and time-series metadata of this defecation reporting event; The feature module 202 is used to extract visual features from the defecation images in a single observation data to obtain a visual feature vector, and to perform temporal encoding on the single observation data to obtain a temporal encoding vector. The feature fusion module 203 is used to fuse the visual feature vector and the temporal coding vector to obtain the fused feature vector of the current defecation reporting event, and to update the fused feature vector sequence based on the fused feature vector of the current defecation reporting event; the fused feature vector sequence includes the fused feature vectors corresponding to each historical defecation reporting event arranged in chronological order within a single bowel preparation cycle of the patient; The cleanliness status module 204 is used to input the updated fused feature vector sequence into the pre-trained time series model based on multi-layer gated recurrent units to obtain the cleanliness status classification result of the current defecation reporting event and the prediction result of the next defecation status. The state transition module 205 is used to calculate the quantitative indicators and evolution trend indicators of intestinal preparation progress up to the current defecation reporting event by using a state residence time model based on the state transition probability matrix, based on the cleanliness state classification results and the next defecation state prediction results. The auxiliary module 206 is used to trigger personalized early warnings for the bowel preparation process based on quantitative indicators and evolution trend indicators of bowel preparation progress, combined with the target inspection time, through a dynamic threshold judgment mechanism.

[0078] In one embodiment, the event response module 201 is further configured to: The original defecation image and time-series metadata of this defecation reporting event are parsed from the defecation status data packet; the time-series metadata includes an absolute timestamp and a sequence index. The original defecation image is preprocessed to obtain a standardized defecation image. The preprocessing corresponds to segmenting the fecal region image in the original defecation image based on color and contour detection, and then performing color normalization and target scale scaling on the fecal region image. Based on the absolute timestamp and sequence index, the relative time interval between the current defecation reporting event and the previous defecation reporting event is calculated, and the cumulative time from the start of the patient's single bowel preparation cycle is calculated. The defecation image, absolute timestamp, sequence index, relative time interval, and cumulative time are encapsulated together to construct single observation data.

[0079] In one embodiment, the cleaning status module 204 is further configured to: The fused feature vector sequence is dynamically evolved and encoded using a multi-layer gated recurrent unit (GRU) gating mechanism to obtain the hidden state sequence. The gating mechanism includes an update gate and a reset gate; the expression for the update gate is... The expression for resetting the door is: The expression for each hidden state in the hidden state sequence is: , ,in, To update the gate vector, To reset the gate vector, It is the sigmoid activation function. For the front The hidden state of the defecation reporting event at the time step. For the first The fused feature vector of defecation reporting events at each time step. For the first The hidden state of the defecation reporting event at the time step. For the first Candidate hidden states of defecation reporting events at time steps. For element-wise multiplication, , and This is the weight matrix. , and For bias vectors, This is the fused feature vector at the current time step; The hidden state of the current defecation reporting event in the hidden state sequence is input into the fully connected decoder to obtain the cleanliness state classification result and the next defecation state prediction result. The fully connected decoder includes a first output branch and a second output branch. The first output branch maps the hidden state of the current defecation reporting event to the cleanliness state classification result. The cleanliness state classification result is a probability distribution on the cleanliness state. The second output branch maps the hidden state of the current defecation reporting event to the next defecation state prediction result. The next defecation state prediction result is a probability distribution of the defecation state prediction for the next defecation reporting event.

[0080] In one embodiment, the state transition module 205 is further configured to: Based on the state with the highest probability in the cleanliness state classification results, the corresponding state transition probability row vector is extracted from the state transition probability matrix; the state transition probability matrix includes the conditional probability of each cleanliness state transitioning to the target cleanliness state. The prediction result of the next defecation state is weighted and fused with the row vector of the state transition probability to obtain the enhanced defecation state prediction probability distribution. Based on the state with the highest probability in the cleanliness state classification results and the hidden state of this defecation reporting event in the hidden state sequence, the expected residence time in the state with the highest probability in the cleanliness state classification results is estimated by using a parameterized negative binomial distribution model. Based on the hidden state, cleanliness classification results, enhanced defecation state prediction probability distribution, and expected residence time of the current defecation reporting event in the hidden state sequence, the current progress percentage is calculated to obtain a quantitative indicator of bowel preparation progress. Based on multiple defecation reporting events within a single bowel preparation cycle up to the current defecation reporting event, the change rate of each quantitative indicator of bowel preparation progress is calculated to obtain an evolutionary trend indicator.

[0081] In one embodiment, a progress module is also included for: The hidden state of the current defecation reporting event in the hidden state sequence is input into a pre-trained value function regression network to obtain a utility value estimate; the value function regression network is used to estimate the expected utility value of finally reaching the ideal clean state from the hidden state; Based on the status baseline schedule, query the basic progress reference value corresponding to the status with the highest probability in the cleanliness status classification results. Based on the enhanced defecation state prediction probability distribution, the expected progress value of the next defecation state prediction result is calculated; the expression for the expected progress value is: ,in, This represents the total number of cleanliness levels. To enhance the probability distribution of defecation status prediction, the first... The probability of each state. For the first The basic progress reference value corresponding to each state; The time adjustment factor is calculated based on the expected length of stay; the expression for the time adjustment factor is: ,in, The attenuation coefficient is... For the expected length of stay; The estimated utility value, baseline schedule reference value, expected schedule value, and time adjustment factor are weighted and fused to calculate the quantitative index of bowel preparation progress; the expression for the quantitative index of bowel preparation progress is as follows: ,in, This is an estimate of utility value. Based on the basic progress reference value, The expected progress value, For time adjustment factor, , , and These are the weighting coefficients. This is the preset maximum normalization constant for the utility value estimate.

[0082] In one embodiment, the auxiliary module 206 is further configured to: Based on quantitative indicators of intestinal preparation progress and evolution trend indicators, combined with target inspection time and cumulative time, the time required to achieve the ideal clean state is calculated. If the time required to reach the ideal cleanliness state is greater than the remaining safe available time, a personalized alert will be triggered; personalized alerts include delayed alerts and standstill alerts.

[0083] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above method embodiments.

[0084] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0085] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0086] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. An artificial intelligence-based method for assisting in the assessment of intestinal cleanliness, characterized in that, The method includes: Based on a patient's single bowel preparation cycle, in response to the acquisition of a defecation reporting event, the defecation status data packet corresponding to the defecation reporting event is structured to obtain single observation data; the defecation status data packet contains the original defecation image and temporal metadata of this defecation reporting event; Visual features are extracted from the defecation images in the single observation data to obtain a visual feature vector, and the single observation data is temporally encoded to obtain a temporally encoded vector. The visual feature vector and the temporal coding vector are fused to obtain the fused feature vector of the current defecation reporting event, and the fused feature vector sequence is updated based on the fused feature vector of the current defecation reporting event; the fused feature vector sequence includes the fused feature vectors corresponding to each of the historical defecation reporting events arranged in chronological order within a single bowel preparation cycle of the patient. The updated fused feature vector sequence is input into a pre-trained time series model based on a multi-layer gated recurrent unit to obtain the cleanliness status classification result of the current defecation reporting event and the prediction result of the next defecation status. Based on the cleanliness status classification results and the next defecation status prediction results, quantitative indicators and evolution trend indicators of intestinal preparation progress up to the current defecation reporting event are calculated using a state residence time model based on the state transition probability matrix. Based on the quantitative indicators of intestinal preparation progress and the evolution trend indicators, combined with the target inspection time, a personalized early warning for the intestinal preparation process is triggered through a dynamic threshold judgment mechanism.

2. The method according to claim 1, characterized in that, The defecation status data packet corresponding to the defecation reporting event is structured to obtain single observation data, including: The original defecation image and the time-series metadata of this defecation reporting event are parsed from the defecation status data packet; the time-series metadata includes an absolute timestamp and a sequence index; The original defecation image is preprocessed to obtain a standardized defecation image; the preprocessing corresponds to segmenting the fecal region image in the original defecation image based on color and contour detection, and performing color normalization and target scale scaling on the fecal region image. Based on the absolute timestamp and sequence index, the relative time interval between the current defecation reporting event and the previous defecation reporting event is calculated, and the cumulative time from the start time of the patient's single bowel preparation cycle is calculated. The defecation image, the absolute timestamp, the sequence index, the relative time interval, and the cumulative time are collectively encapsulated to construct the single observation data.

3. The method according to claim 2, characterized in that, The time-series model based on multi-layer gated loop units obtains the cleanliness status classification results and the next defecation status prediction results through the following methods: The fused feature vector sequence is dynamically evolved and encoded using a multi-layer gated recurrent unit (GRU) mechanism to obtain a hidden state sequence; the GRU mechanism includes an update gate and a reset gate; the expression for the update gate is: The expression for resetting the door is: The expression for each hidden state in the hidden state sequence is: , ,in, To update the gate vector, To reset the gate vector, It is the sigmoid activation function. For the front The hidden state of the defecation reporting event at the time step. For the first The fused feature vector of the defecation reporting event at each time step. For the first The hidden state of the defecation reporting event at the time step. For the first Candidate hidden states of defecation reporting events at time steps. For element-wise multiplication, , and This is the weight matrix. , and For bias vectors, This is the fused feature vector at the current time step; The hidden state of the current defecation reporting event in the hidden state sequence is input into a fully connected decoder to obtain the cleanliness state classification result and the next defecation state prediction result. The fully connected decoder includes a first output branch and a second output branch. The first output branch maps the hidden state of the current defecation reporting event to the cleanliness state classification result, which is a probability distribution of cleanliness states. The second output branch maps the hidden state of the current defecation reporting event to the next defecation state prediction result, which is a probability distribution of the defecation state prediction for the next defecation reporting event.

4. The method according to claim 3, characterized in that, Based on the cleanliness status classification results and the next defecation status prediction results, the quantitative indicators and evolutionary trend indicators of intestinal preparation progress up to the current defecation reporting event are calculated using a state residence time model based on the state transition probability matrix, including: Based on the state with the highest probability in the cleanliness state classification results, the corresponding state transition probability row vector is extracted from the state transition probability matrix; the state transition probability matrix includes the conditional probability of each cleanliness state transitioning to the target cleanliness state; The next defecation state prediction result is weighted and fused with the state transition probability row vector to obtain the enhanced defecation state prediction probability distribution. Based on the state with the highest probability in the cleanliness state classification results and the hidden state of the current defecation reporting event in the hidden state sequence, the expected residence time in the state with the highest probability in the cleanliness state classification results is estimated by using a parameterized negative binomial distribution model. Based on the hidden state of the current defecation reporting event in the hidden state sequence, the cleanliness state classification result, the enhanced defecation state prediction probability distribution, and the expected residence time, the current progress percentage is comprehensively calculated to obtain the quantitative index of bowel preparation progress. Based on multiple defecation reporting events within a single bowel preparation cycle of the patient up to the current defecation reporting event, the change rate of each quantitative index of bowel preparation progress is calculated to obtain the evolutionary trend index.

5. The method according to claim 4, characterized in that, The method involves comprehensively calculating the current progress percentage based on the hidden state of the current defecation reporting event in the hidden state sequence, the cleanliness state classification result, the enhanced defecation state prediction probability distribution, and the expected residence time, to obtain the quantitative index of intestinal preparation progress, including: Based on the hidden state sequence of the current defecation reporting event, the hidden state is input into a pre-trained value function regression network to obtain a utility value estimate; the value function regression network is used to estimate the expected utility value of finally reaching the ideal cleanliness state from the hidden state. Based on the status baseline schedule, query the basic progress reference value corresponding to the status with the highest probability in the cleanliness status classification results; Based on the enhanced defecation state prediction probability distribution, the expected progress value of the next defecation state prediction result is calculated; the expression for the expected progress value is as follows: ,in, This represents the total number of cleanliness levels. To enhance the probability distribution of defecation status prediction, the first... The probability of each state. For the first The basic progress reference value corresponding to each state; Based on the expected length of stay, a time adjustment factor is calculated; the expression for the time adjustment factor is as follows: ,in, The attenuation coefficient is... The expected stay time; The estimated utility value, the baseline progress reference value, the expected progress value, and the time adjustment factor are weighted and fused to calculate a quantitative index for bowel preparation progress; the expression for the quantitative index for bowel preparation progress is as follows: ,in, The estimated value of the utility value, This is the basic progress reference value. The desired progress value, The time adjustment factor is... , , and These are the weighting coefficients. The preset maximum normalization constant for the utility value estimate is denoted as .

6. The method according to claim 2, characterized in that, The method of triggering personalized early warnings for the bowel preparation process based on the quantitative indicators of bowel preparation progress and the evolutionary trend indicators, combined with the target examination time, and through a dynamic threshold judgment mechanism, includes: Based on the quantitative indicators of intestinal preparation progress and the evolutionary trend indicators, combined with the target inspection time and the cumulative time, the time required to reach the ideal clean state is calculated. If the time required to reach the ideal cleanliness state is greater than the remaining safe available time, the personalized warning is triggered; the personalized warning includes a delayed warning and a standstill warning.

7. An artificial intelligence-based intestinal cleanliness assessment system, characterized in that, The system includes: The event response module is used to perform structured processing on the defecation status data packet corresponding to the defecation reporting event in response to the acquisition of a defecation reporting event based on a single bowel preparation cycle of the patient, so as to obtain single observation data; the defecation status data packet contains the original defecation image and time-series metadata of this defecation reporting event; The feature module is used to extract visual features from the defecation images in the single observation data to obtain a visual feature vector, and to perform temporal encoding on the single observation data to obtain a temporal encoding vector. The feature fusion module is used to fuse the visual feature vector and the temporal coding vector to obtain the fused feature vector of the current defecation reporting event, and update the fused feature vector sequence based on the fused feature vector of the current defecation reporting event; the fused feature vector sequence includes the fused feature vectors corresponding to each of the historical defecation reporting events arranged in chronological order within a single bowel preparation cycle of the patient. The cleanliness status module is used to input the updated fused feature vector sequence into a pre-trained time series model based on a multi-layer gated recurrent unit to obtain the cleanliness status classification result of the current defecation reporting event and the prediction result of the next defecation status. The state transition module is used to calculate, based on the cleanliness state classification results and the next defecation state prediction results, the quantitative indicators of intestinal preparation progress and the evolution trend indicators up to the current defecation reporting event by using a state residence time model based on the state transition probability matrix. The auxiliary module is used to trigger personalized early warnings for the intestinal preparation process based on the quantitative indicators of intestinal preparation progress and the evolution trend indicators, combined with the target inspection time, through a dynamic threshold judgment mechanism.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.