A real-time evaluation system and method for quality of preoperative intestinal preparation of digestive endoscopy

CN122468646BActive Publication Date: 2026-10-16THE SECOND XIANGYA HOSPITAL OF CENT SOUTH UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202610931442.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-26
Publication Date
2026-10-16
Estimated Expiration
2046-06-26

AI Technical Summary

Technical Problem

[0007]针对上述现有技术缺陷,本发明的目的是提供一种消化道内镜术前肠道准备质量实时评估系统及方法,旨在解决居家肠道准备质量评估滞后、主观且难以连续客观监测的技术问题

Benefits of technology

[0033] This invention provides a real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy. Addressing the issues of delayed, subjective, and difficult-to-monitor continuous objective assessment of bowel preparation quality at home, this invention collaboratively configures a smart toilet data acquisition unit, a time-series analysis server, and an interactive terminal. Through automatic trigger detection, multi-source feature extraction, preliminary edge-end assessment, server-side time-series analysis, and terminal feedback, it can provide a relatively objective, stable, and continuous quality assessment of the bowel preparation process while minimizing additional patient operations and privacy concerns, and provides a reference for the preoperative preparation status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122468646B_ABST
    Figure CN122468646B_ABST
Patent Text Reader

Abstract

The application provides a kind of digestive tract endoscopy preoperative intestinal tract preparation quality real-time evaluation system and method, including intelligent closestool acquisition end, time sequence analysis server and interactive terminal;Acquisition end triggers detection after defecation, carries out visible light and near infrared sequential illumination collection to mixture in toilet bowl, forms multi-band image group, and synchronously acquires turbidity, conductivity and temperature;Edge computing extracts water surface area, color residue, near infrared particle scattering and multi-band ratio feature, calculates suspended solids concentration inversion value or normalized difference spectral index, generates detection feature vector in combination with sensing data, and outputs cleaning category and score by local model and uploads desensitization data;Server will multiple detection results form time sequence, predict compliance probability and cleanliness trend, and generate compliance evaluation results when continuous detection results and related indicators meet threshold value;Interactive terminal outputs evaluation results, preparation progress and medical treatment reminder, realizes the objective, continuous evaluation of intestinal tract preparation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical testing and intelligent health monitoring technology, and in particular to a real-time assessment system and method for the quality of bowel preparation before gastrointestinal endoscopy. Background Technology

[0002] Gastrointestinal endoscopy, especially colonoscopy, requires high-quality preoperative bowel preparation. The presence of fecal residue, turbid fluid, or other obstructions in the intestinal lumen can easily affect the endoscopic view, reduce the quality of the examination, and in severe cases, may lead to the termination of the examination or the need for repeated preparation.

[0003] Currently, the quality of bowel preparation is usually judged by the patient based on the appearance of their stool, or by the physician based on the cleanliness of the bowel lumen after the endoscopy has begun. The former relies on the patient's experience and visual observation, which is highly subjective; the latter evaluation is delayed, and once inadequate preparation is discovered, the patient has often already entered the consultation or examination process, making timely adjustments difficult and easily leading to a waste of medical resources and a burden of repeated preparation for the patient.

[0004] To improve judgment during the home preparation phase, some solutions have attempted to use mobile phones to photograph and analyze excrement. However, these methods are greatly affected by factors such as the shooting environment, lighting conditions, lens differences, shooting angle, and water reflection, resulting in poor image consistency. Furthermore, requiring patients to actively photograph excrement leads to low user experience and privacy concerns. For liquids that appear clear but may still contain small residues, relying solely on ordinary visible light images is insufficient to reliably determine their true cleanliness.

[0005] Furthermore, existing smart toilets mostly focus on toilet behavior monitoring, urine analysis, or stool morphology recognition, and typically do not establish continuous monitoring and quality assessment mechanisms for the specific process of bowel preparation before endoscopic surgery. The bowel preparation process is characterized by its long duration, significant dynamic changes in excretion status, and limited representativeness of single observation results; therefore, it is difficult to accurately reflect the overall preparation quality based on a single excretion status.

[0006] Therefore, there is an urgent need for a quality assessment technology suitable for home bowel preparation scenarios, which can objectively, stably, and continuously monitor and evaluate the bowel preparation process, and provide patients and medical institutions with preparation quality references in the preoperative stage. Summary of the Invention

[0007] In view of the above-mentioned defects in the prior art, the purpose of this invention is to provide a real-time assessment system and method for the quality of bowel preparation before gastrointestinal endoscopy, which aims to solve the technical problems of lagging, subjective and difficult to continuously and objectively monitor the quality of bowel preparation at home.

[0008] To achieve the above objectives, in a first aspect, the present invention provides a real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy, comprising a smart toilet data acquisition terminal, a time-series analysis server, and an interactive terminal; The smart toilet's data acquisition unit includes a detection trigger module, a multispectral imaging module, an auxiliary sensor module, an edge computing module, and a control module. The detection trigger module generates a trigger signal after each toilet use. The control module triggers the multispectral imaging module to sequentially illuminate the mixture of excrement and water in the toilet bowl using visible and near-infrared bands, forming a multi-band image set, and triggers the auxiliary sensor module to collect turbidity, conductivity, and temperature. The edge computing module extracts the water surface area, calculates color residue features, near-infrared particle scattering features, and multi-band ratio features, and calculates the suspended solids concentration inversion value and / or normalized differential spectral index based on multi-band reflectance. It then combines turbidity, conductivity, and temperature to generate a single-detection feature vector. After the local evaluation model outputs a cleaning category and cleanliness score, the desensitized single-detection feature vector is uploaded. The time-series analysis server is used to combine multiple single-detection feature vectors within the same bowel preparation process into a time-series feature sequence, input it into the time-series prediction model to obtain the probability of compliance and the trend of cleanliness change, and generate an evaluation result that the bowel preparation quality meets the preset requirements when the results of multiple consecutive detections, the probability of compliance, near-infrared particle scattering characteristics, suspended matter concentration inversion value or normalized difference spectral index, turbidity change rate and conductivity deviation all meet the threshold conditions. An interactive terminal is used to output assessment results, preparation progress, and medical appointment reminders.

[0009] As a further improvement to the above technical solution, the multispectral imaging module includes an illumination unit and an image acquisition unit; the illumination unit includes a blue light emitting component, a green light emitting component, a red light emitting component, a first near-infrared light emitting component, and a second near-infrared light emitting component, wherein the center wavelengths of the blue light emitting component, the green light emitting component, the red light emitting component, the first near-infrared light emitting component, and the second near-infrared light emitting component are respectively within the ranges of 430nm to 470nm, 505nm to 545nm, 600nm to 640nm, 720nm to 760nm, and 830nm to 870nm.

[0010] As a further improvement to the above technical solution, the control module is used to sequentially light up each light-emitting component in a preset order, and control the image acquisition unit to acquire corresponding band images during the lighting of a single light-emitting component, so that images of different bands are obtained separately in time.

[0011] As a further improvement to the above technical solution, the image acquisition unit includes a monochrome image sensor sensitive to visible and near-infrared light and an anti-fog fixed-focus lens. The illumination unit is arranged in a ring around the anti-fog fixed-focus lens and a uniform light structure is set on the light-emitting side.

[0012] As a further improvement to the above technical solution, the multispectral imaging module is housed in a waterproof and corrosion-resistant sealed chamber, and a light-transmitting protective window is provided on the side of the sealed chamber facing the toilet detection area; the smart toilet acquisition end also includes a flushing structure, a wiping structure or a shielding protection structure for cleaning the light-transmitting protective window before and / or after detection.

[0013] As a further improvement to the above technical solution, the auxiliary sensor module includes a turbidity sensor, a conductivity sensor, and a temperature sensor; the turbidity sensor is used to obtain the turbidity value based on the intensity of scattered light, the conductivity sensor is used to obtain the conductivity value of the mixture, and the temperature sensor is used to obtain the temperature value and perform temperature compensation on the turbidity value and / or conductivity value.

[0014] As a further improvement to the above technical solution, the auxiliary sensor module is integrated on a retractable or rotatable probe, which is configured to extend into the toilet water during the detection cycle to collect turbidity, conductivity and temperature, and retract to the cleaning position or storage position after the detection is completed.

[0015] As a further improvement to the above technical solution, the detection trigger module includes one or more of the following: a weight sensor, an infrared sensor, a seat detection sensor, a toilet seat status sensor, and a flushing status sensor, and determines the end of a toilet use process based on the user leaving the seat, the toilet seat closing, or the completion of flushing.

[0016] As a further improvement to the above technical solution, the edge computing module performs processing on multi-band image groups including image registration, distortion correction, illumination unevenness correction, noise suppression, and water surface region segmentation.

[0017] As a further improvement to the above technical solution, near-infrared particle scattering features include one or more of the following in near-infrared band images: proportion of high grayscale pixels, number of high grayscale connected regions, area distribution of high grayscale connected regions, bright spot density, and texture dispersion; color retention features include one or more of the following in blue light band, green light band, and red light band: grayscale mean, grayscale variance, and band ratio.

[0018] The single-detection feature vector includes one or more of the mean, standard deviation, skewness, kurtosis, and normalized difference spectral index for each band of the water surface region.

[0019] As a further improvement to the above technical solution, the edge computing module calculates the suspended solids concentration inversion value based on the reflectance of the water surface area. This suspended solids concentration inversion value can be obtained using a multi-band reflectance regression model or a red / near-infrared dual-band ratio model. The edge computing module can also calculate the normalized difference spectral index, which includes one or more of the following: clear water discrimination index, bile residue index, and occult blood correlation index. As a further improvement to the above technical solution, the conductivity deviation is the degree of deviation between the currently detected conductivity value and the preset clear water reference conductivity, or the degree of deviation between the temperature-compensated conductivity value and the temperature-compensated clear water reference conductivity.

[0020] As a further improvement to the above technical solution, the turbidity change rate is the rate of change of the current detected turbidity value relative to the previous detected turbidity value, or the slope of change obtained by fitting the turbidity values ​​from the most recent multiple detections.

[0021] As a further improvement to the above technical solution, the local evaluation model is a lightweight neural network model, a gradient boosting decision tree model, or a random forest model; the cleanliness categories include heavily polluted, slightly residual, basically clear, and completely clean water, and the cleanliness score is a continuous or discrete value within a preset score range.

[0022] As a further improvement to the above technical solution, the data uploaded by the edge computing module to the time series analysis server includes device identifier, intestinal preparation process identifier, detection time, single detection feature vector, cleanliness category, cleanliness score, turbidity value, conductivity value and temperature value, and does not upload the original images in the multi-band image group.

[0023] As a further improvement to the above technical solution, the time-series prediction model includes a Transformer encoder model or a bidirectional long short-term memory network model. The input of the time-series prediction model is multiple single detection feature vectors sorted by detection time within the same intestinal preparation process. The Transformer encoder model can add positional encoding to the time-sorted single detection feature vectors and extract the change features of the intestinal preparation process from turbidity to clarity through a self-attention mechanism. The output includes the probability of achieving the target, the predicted value of future cleanliness, and the equivalent preparation score.

[0024] As a further improvement to the above technical solution, the threshold conditions include: the cleanliness category of the most recent M consecutive tests is basically clear or completely clear water, or the cleanliness score of the most recent M consecutive tests is not lower than the first threshold; the compliance probability is not lower than the second threshold; the near-infrared particle scattering characteristics of the most recent M consecutive tests are not higher than the third threshold; the turbidity change rate of the most recent M consecutive tests is not higher than the fourth threshold; the suspended matter concentration inversion value or normalized difference spectral index of the most recent M consecutive tests meets the sixth threshold; the conductivity deviation of the most recent M consecutive tests is not higher than the fifth threshold; where M is an integer not less than 2.

[0025] As a further improvement to the above technical solution, the time series analysis server includes a database and a central analysis module; The database is used to store the bowel preparation process identifier, test records, model version information, and manual quality confirmation labels corresponding to the bowel preparation process. The central analysis module is used to train or update the time series prediction model using historical time series feature sequences with the manually confirmed quality labels.

[0026] As a further improvement to the above technical solution, the interactive terminal includes one or more of the following: a display screen set on the smart toilet's data collection terminal, a voice prompt module, a mobile terminal application, and a display interface on the medical institution's end; the preparation progress includes one or more of the following: cleanliness score trend, turbidity trend, conductivity deviation trend, number of tests, test timeline, and confidence level of achievement.

[0027] Secondly, the present invention also provides a method for real-time assessment of the quality of bowel preparation before gastrointestinal endoscopy, applied to the real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy described in the first aspect, the method comprising:

[0028] A detection trigger signal is generated after a toilet visit is detected; Based on the detection trigger signal, the mixture of excrement and water in the toilet bowl is sequentially illuminated and acquired using visible light and near-infrared bands to form a multi-band image group, and the turbidity, conductivity and temperature of the mixture are acquired. Extract the water surface area from the multi-band image group, calculate the color residue features, near-infrared particle scattering features and multi-band ratio features, and calculate the suspended matter concentration inversion value and / or normalized differential spectral index based on multi-band reflectance, and generate a single detection feature vector by combining turbidity, conductivity and temperature. Input the feature vector of a single detection into the local evaluation model to obtain the cleanliness category and cleanliness score of the excrement in this instance; Multiple single-detection feature vectors within the same intestinal preparation process are combined into a time-series feature sequence and input into a time-series prediction model to obtain the probability of compliance and the trend of cleanliness changes; When the results of multiple consecutive tests, the probability of meeting the standard, the near-infrared particle scattering characteristics, the inversion value of suspended matter concentration or the normalized differential spectral index, the rate of change of turbidity and the deviation of conductivity all meet the threshold conditions, an assessment result is generated to show that the quality of bowel preparation meets the preset requirements. The assessment result, preparation progress and medical reminder are then output through the interactive terminal.

[0029] As a further improvement to the above technical solution, the calculation of near-infrared particle scattering characteristics includes: determining high grayscale pixels or high grayscale connected regions in the water surface area of ​​the near-infrared band image, and calculating the bright spot density, number of connected regions, area distribution of connected regions, or texture dispersion based on the high grayscale pixels or high grayscale connected regions.

[0030] As a further improvement to the above technical solution, the calculation of conductivity deviation includes: performing temperature compensation on the currently detected conductivity value based on the temperature value, obtaining the clean water reference conductivity corresponding to the current water source or equipment calibration state, and calculating the degree of deviation between the temperature-compensated conductivity value and the clean water reference conductivity.

[0031] As a further improvement to the above technical solution, the training method of the time-series prediction model includes: acquiring historical detection records corresponding to multiple historical bowel preparation processes, assembling the historical detection records into a historical time-series feature sequence according to the bowel preparation process, acquiring the manual confirmation quality label corresponding to each historical bowel preparation process, and training or updating the time-series prediction model with the historical time-series feature sequence as input and the manual confirmation quality label as supervision information.

[0032] Because the present invention adopts the above technical solutions, the beneficial effects of this application are as follows:

[0033] This invention provides a real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy. Addressing the issues of delayed, subjective, and difficult-to-monitor continuous objective assessment of bowel preparation quality at home, this invention collaboratively configures a smart toilet data acquisition unit, a time-series analysis server, and an interactive terminal. Through automatic trigger detection, multi-source feature extraction, preliminary edge-end assessment, server-side time-series analysis, and terminal feedback, it can provide a relatively objective, stable, and continuous quality assessment of the bowel preparation process while minimizing additional patient operations and privacy concerns, and provides a reference for the preoperative preparation status.

[0034] Specifically, the present invention has at least the following beneficial effects:

[0035] First, this invention automatically generates a detection trigger signal after each toilet visit via a detection trigger module. The control module then triggers the multispectral imaging module and auxiliary sensor module to perform detection, enabling the data acquisition process to be completed automatically with the toilet visit. Compared to methods relying on the patient's visual observation or actively taking images of excrement, this approach reduces the influence of factors such as the patient's subjective judgment, shooting angle, and willingness to operate on the assessment results, thus improving the continuity and feasibility of data acquisition during home bowel preparation.

[0036] Secondly, this invention employs visible and near-infrared light bands to sequentially illuminate and collect data on the mixture of excrement and water in the toilet bowl. An edge computing module then extracts color residue features, near-infrared particle scattering features, and multi-band ratio features. Furthermore, this invention uses suspended solids concentration inversion values ​​and normalized differential spectral indices to transform the near-infrared scattering response and visible light color response into structured parameters that can participate in threshold determination, providing a clearer quantitative basis for the state of "appearing clear but still containing fine residues." Specifically, visible light features can reflect the state of liquid color residue, near-infrared particle scattering features can characterize scattering changes caused by fine suspended particles, undigested fibers, and other residues, and multi-band ratio features can reduce fluctuations caused by uneven illumination or localized reflections in a single band. Therefore, compared to methods relying solely on ordinary RGB visible light images, this invention provides richer feature data for identifying situations where the liquid appears clear but may still contain fine residues.

[0037] Third, this invention simultaneously collects turbidity, conductivity, and temperature, and combines them with multispectral image features to form a single-detection feature vector. Turbidity reflects the degree of scattering caused by suspended matter in the mixture, conductivity reflects the difference between the test liquid and a clean water reference, and temperature can be used to compensate for physical quantities such as turbidity or conductivity. The above-mentioned sensor data and multispectral image features corroborate each other, so that the evaluation process no longer relies on a single image feature or a single sensor reading, which helps to reduce judgment biases caused by factors such as water surface reflection, local foam, and light fluctuations.

[0038] Fourth, this invention completes water surface area extraction, feature calculation, and local preliminary evaluation in the edge computing module, and uploads the anonymized single-detection feature vector to the time-series analysis server. Since the uploaded data is structured features rather than raw excrement images, it reduces privacy concerns related to the transmission, storage, and use of raw images, while also reducing the computational and storage burden on the server side for processing raw images. This is beneficial for improving the system's acceptance and operational efficiency in home application scenarios.

[0039] Fifth, this invention combines multiple single-detection feature vectors within the same intestinal preparation process into a temporal feature sequence, and obtains the probability of achieving the target and the trend of cleanliness change through a temporal prediction model. With the introduction of multi-task output, the temporal prediction model can also simultaneously output future cleanliness prediction values ​​and equivalent preparation scores, enabling the system to analyze the preparation status from a continuously changing process rather than single-detection results. This reduces the impact of occasional fluctuations in single-detection results on the evaluation results and provides a basis for judging whether the preparation process tends to meet preset requirements in the preoperative stage.

[0040] Sixth, when generating evaluation results, this invention comprehensively judges whether the results of multiple consecutive tests, the probability of meeting the standard, near-infrared particle scattering characteristics, the inverted value of suspended matter concentration or the normalized differential spectral index, the rate of change of turbidity, and the deviation of conductivity meet the threshold conditions. This judgment method combines the output of the time series model with specific physical detection quantities, which helps to improve the stability and reliability of the intestinal preparation quality assessment.

[0041] Seventh, this invention outputs assessment results, preparation progress, and medical reminders via an interactive terminal, enabling patients to understand their preparation status in a timely manner during the home preparation phase, and also facilitating medical institutions to obtain preoperative preparation quality references. This output is limited to bowel preparation quality assessment, preparation progress prompts, and medical reminders, making it well-suited for the application scenario of preoperative bowel preparation quality monitoring for gastrointestinal endoscopy. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0043] Figure 1 This is a schematic diagram of a real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy disclosed in this invention. Figure 2 This is a partial cross-sectional schematic diagram of the intelligent toilet data acquisition terminal disclosed in this invention; Figure 3 This is a schematic diagram of the interface display of the interactive terminal disclosed in this invention; Figure 4 This invention discloses a method for real-time assessment of the quality of bowel preparation before gastrointestinal endoscopy.

[0044] Figure label:

[0045] 1. Multispectral imaging module; 2. Auxiliary sensor module.

[0046] The realization of the objective, functional characteristics and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] It should be noted that the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0049] Example 1

[0050] See Figures 1-3 This invention provides a real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy. The system includes a smart toilet data acquisition terminal, a time-series analysis server, and an interactive terminal. The system is used to detect the mixture of excrement and water after each bowel movement during the patient's home bowel preparation process, and to generate a bowel preparation quality assessment result based on multiple consecutive test results, thereby reducing the lag caused by relying solely on the patient's subjective observation or evaluation after the examination begins.

[0051] The smart toilet's data acquisition unit includes a detection trigger module, a multispectral imaging module 1, an auxiliary sensor module 2, an edge computing module, and a control module. The detection trigger module may include one or more of the following: a weight sensor, an infrared sensor, a seat detection sensor, a toilet seat status sensor, or a flushing status sensor, used to determine whether a toilet use process has ended. When the detection trigger module determines that the user has left the seat, the toilet seat has closed, or flushing has been completed, it generates a detection trigger signal. In this way, the detection process can be automatically started with toilet use, eliminating the need for the patient to actively take images of excrement or manually record observation results, thus reducing operational burden and improving the continuity of home monitoring.

[0052] After receiving the detection trigger signal, the control module triggers the multispectral imaging module 1 to acquire images of the mixture of excrement and water in the toilet bowl. The multispectral imaging module 1 includes an illumination unit and an image acquisition unit. The illumination unit can be configured as a light-emitting component in the visible and near-infrared bands, such as blue light, green light, red light, first near-infrared light, and second near-infrared light. The control module sequentially illuminates the light-emitting components of each band according to a preset order, and the image acquisition unit synchronously acquires images during the corresponding band illumination period, thereby forming a multi-band image group. Using sequential illumination allows image information from different bands to be obtained separately in time, facilitating subsequent comparison of different spectral responses.

[0053] In the multi-band image set, visible light images are mainly used to reflect the state of color residue, while near-infrared images are mainly used to reflect scattering changes caused by residues such as fine suspended particles and undigested fibers. For the liquid state commonly seen in the later stages of bowel preparation, some mixtures may appear relatively clear to the naked eye or in ordinary visible light images, but low concentrations of fine residues may still be present. Introducing near-infrared particle scattering characteristics can provide supplementary evidence for identifying such cases where the mixture appears clear but still contains fine residues.

[0054] Auxiliary sensor module 2 is used to collect the turbidity, conductivity, and temperature of the mixture in the toilet bowl. Turbidity can be used to characterize the degree of light scattering by suspended matter in the mixture; conductivity can be used to characterize the difference between the test liquid and a clean water reference; temperature can be used to compensate for the detected values ​​such as turbidity or conductivity. Auxiliary sensor module 2 can be integrated into a retractable or rotatable probe. During detection, the probe extends into the toilet bowl water, and after detection, it retracts to a clean or stored position. Thus, multispectral image information and physical sensing information can complement each other, providing a relatively stable data basis for evaluation results even when there is water surface reflection, local foam, or fluctuations in single image features.

[0055] After receiving a multi-band image set, turbidity, conductivity, and temperature, the edge computing module first preprocesses the multi-band image set. This preprocessing may include image registration, distortion correction, illumination unevenness correction, noise suppression, and water surface region segmentation. Following preprocessing, the edge computing module calculates color retention features, near-infrared particle scattering features, and multi-band ratio features within the water surface region. The color retention features may include the gray-level mean, gray-level variance, and their band ratios in the visible light band. The near-infrared particle scattering features may include the proportion of high-gray-level pixels in the near-infrared image, the number of high-gray-level connected components, the area distribution of high-gray-level connected components, bright spot density, or texture dispersion. The multi-band ratio features reflect the relative changes between different band responses to reduce the impact of overall illumination intensity, local reflection, or sensor gain variations on the detection results.

[0056] In one embodiment, the edge computing module can first convert the grayscale values ​​of each band image into the reflectance of the corresponding band. The reflectivity of each band can be expressed as: ; in, For wavelength The reflectivity of the band; This refers to the image grayscale value or average grayscale value of the water surface area under this band. This is the reference grayscale value for the dark field. This is the reference grayscale value under the calibration conditions of a whiteboard or clean water. To prevent constants with zero denominators, reflectivity normalization can reduce the impact of variations in light source intensity and sensor gain on different detection cycles.

[0057] Furthermore, the edge computing module can calculate the suspended matter concentration inversion value based on multi-band reflectance. The complete empirical inversion model can be expressed as: ; in, This is the inversion value of suspended solids concentration; , , , , The reflectivity is measured at the 450nm, 525nm, 620nm, 740nm, and 850nm wavelengths, respectively. For constant terms; to These are the regression coefficients obtained through calibration experiments. This model is used to map multi-band reflectance differences into a calculable index of suspended matter concentration.

[0058] To reduce computational complexity at the edge, a dual-band ratio inversion model can also be used: ; in, The reflectance is either 740nm or 850nm near-infrared band, or a weighted average of the two. Reflectivity in the 620nm red light band; and For empirical calibration parameters; To prevent a constant with a denominator of zero. Since the 620nm band can be used as a reference for visible light turbidity, and the near-infrared band is more sensitive to scattering by suspended particles, the ratio of the two can reflect the changes in near-infrared response caused by fine particles, thus providing a quantitative basis for distinguishing between true and false clear water.

[0059] In another embodiment, the edge computing module can also interpret and utilize the response differences across different bands based on the Beer-Lambert optical attenuation relationship. When a light beam passes through a liquid medium containing suspended particles, the emitted light intensity can be expressed as: ; in, wavelength The intensity of the emitted light after passing through the liquid; This represents the incident light intensity in the corresponding wavelength band. The effective optical path length of light in a liquid; This represents the total attenuation coefficient.

[0060] The total attenuation coefficient can be decomposed into absorption and scattering terms: ; in, The absorption coefficient is used to characterize the absorption of light energy by water and dissolved substances. is the scattering coefficient, used to characterize the scattering effect of suspended particles on light.

[0061] In the context of detecting intestinal preparation fluids, the total attenuation coefficient can also be expressed as the sum of the contributions of each component: ; in, The intrinsic absorption coefficient of pure water; The absorption coefficient of suspended particulate matter; It represents the absorption coefficient of colored soluble substances such as bile pigments; This represents the scattering coefficient of suspended particles. Water exhibits strong absorption in the 740nm and 850nm wavelength bands, while pure clear water shows low near-infrared reflectance. However, the presence of fine suspended particles or undigested fibers enhances near-infrared scattering, providing a physical basis for identifying falsely clear water. Specifically, see Table 1 for the differences in optical properties of each component in the five characteristic wavelength bands (450nm, 525nm, 620nm, 740nm, and 850nm).

[0062] Table 1

[0063] The edge computing module can also calculate the normalized difference spectral index. Any two bands... and The normalized difference spectral index can be expressed as: ; in, For band With band Normalized difference spectral index; and These are the reflectivities for the corresponding wavebands; To prevent constants with a denominator of zero, the impact of changes in overall lighting intensity on individual grayscale values ​​can be reduced by using a normalized difference form.

[0064] As an example, the water discrimination index can be expressed as: ; in, The water quality index; The reflectance is in the 850nm near-infrared band. This refers to the reflectance in the 620nm red light band. This index can be used to reflect the variation of the near-infrared scattering response relative to a visible light reference band.

[0065] The bile residue index can be expressed as: ;

[0066] in, The bile residue index; Reflectivity in the 450nm blue light band; The reflectance is measured in the 620nm red light band. Since bile pigments exhibit significant absorption in the blue light band, this index can be used to characterize the difference in band response caused by yellow residue.

[0067] The occult blood correlation index can be expressed as: ; in, For occult blood-related indices; The reflectivity is 525nm green light band; This refers to the reflectance in the 620nm red light band. This index is used to reflect spectral changes related to absorption differences near 525nm, and is only used as a reference feature to indicate abnormal conditions, not as a direct conclusion for disease diagnosis.

[0068] The edge computing module combines color residue features, near-infrared particle scattering features, multi-band ratio features, suspended matter concentration inversion values, and / or normalized differential spectral indices with turbidity, conductivity, and temperature to form a single-detection feature vector. This single-detection feature vector can be expressed as: ; in, For the first The single-detection feature vector of the next detection; These are the color retention features, near-infrared particle scattering features, and multi-band ratio features calculated from multi-band images. For the first The inversion value of suspended solids concentration from the second test; , , The first The water discrimination index, bile residue index and occult blood correlation index were tested in this test; This refers to the turbidity value. This represents the conductivity value. This is the temperature value.

[0069] In practical applications, all or some of the above features can be selected according to the model input requirements.

[0070] During sensor data processing, temperature compensation can be applied to turbidity and conductivity values. Turbidity temperature compensation can be expressed as: ; Conductivity temperature compensation can be expressed as: ; in, This is the turbidity value after temperature compensation; This is the conductivity value after temperature compensation; This is the original turbidity value; This is the original conductivity value; This is the measured temperature; For reference temperature; This is the temperature compensation coefficient for the turbidity sensor; This represents the temperature compensation coefficient for the conductivity sensor. Temperature compensation improves the comparability of sensor data from different detection periods.

[0071] The deviation of conductivity can be expressed as: ; in, For the first The deviation of conductivity in the second test; This is the conductivity value after temperature compensation; The baseline conductivity of clean water after temperature compensation; To prevent a constant with a denominator of zero, the smaller the deviation in conductivity, the closer the tested liquid is to the clean water reference state of the corresponding water source.

[0072] The rate of change of turbidity can be expressed as: ; in, For the first The rate of change in turbidity in each test relative to the previous test; and The first Second and third Turbidity value after temperature compensation in the second test; and The first Second and third The detection time is [time]. The turbidity change rate is used to reflect the rate at which the turbidity of a mixture changes.

[0073] After generating a single detection feature vector, the edge computing module inputs this feature vector into the local evaluation model to obtain the cleanliness category and cleanliness score of the excrement-water mixture. The local evaluation model can employ a lightweight neural network model, a gradient boosting decision tree model, or a random forest model. All of these models can be deployed in the edge computing module of the smart toilet's data acquisition terminal for rapid inference of structured features, thereby reducing the waiting time for single detection result feedback. The local evaluation model can be represented as: ; in, For the class probability vector output by the local evaluation model; For local evaluation models deployed in edge computing modules; For the first The feature vector of a single detection. Cleanliness categories can include heavily soiled, lightly residued, mostly clear, and completely clean water. The cleaning category can be determined by the following formula: ; in, For the first The cleaning category corresponding to this test; For the first The second test belongs to the first The probability or confidence level of a class; These correspond to heavily contaminated, slightly residual, mostly clear, and completely clear water, respectively. By classifying the test results into these categories, the output at the edge end has a clear hierarchy, which facilitates subsequent time-series analysis servers in determining the changing trends of cleanliness status within the same intestinal preparation process.

[0074] In one optional embodiment, the cleanliness score can be set as a continuous or discrete value within a preset score range. For example, the cleanliness score can be set in the range of 0 to 3 points, where a higher score indicates that the detected liquid is closer to a preset cleanliness state. If a category probability weighting method is used to calculate the cleanliness score; Then the first Cleanliness score of the second test It can be represented as: ; in, For the first Cleanliness score of the second test; For the first Each cleanliness category corresponds to a score weight. For example, the score weights for heavily polluted, slightly residual, mostly clear, and completely clean water could be 0, 1, 2, and 3, respectively. By using probability weighting to obtain the score, the cleanliness score reflects the combined results of multiple category probabilities, avoiding the problem of excessive score jumps caused by relying solely on a single category with the highest probability. In practical applications, the cleanliness score can also be set as a discrete score or a continuous score directly output by the regression model, based on model training results or equipment calibration results.

[0075] After completing local evaluation, the edge computing module uploads the anonymized structured data to the time-series analysis server. For the t-th detection, the uploaded structured data can be represented as: ; in, For the first The data uploaded during the second detection; For equipment identification; Identify the intestinal preparation process; For the detection time; This is a single detection feature vector; Category: Cleaning; Rate the cleanliness; This is the turbidity value after temperature compensation; This is the conductivity value after temperature compensation; The value is the temperature. The edge computing module does not upload the original images from the multi-band image group, thereby reducing privacy concerns related to the transmission and storage of original excrement images and reducing the computational burden on the server side for processing the original images.

[0076] The time-series analysis server includes a time-series feature construction module, a time-series prediction module, a threshold determination module, and an evaluation result generation module. The time-series feature construction module receives multiple test data points within the same bowel preparation process, assembles multiple single-test feature vectors into a time-series feature sequence based on the test time, and inputs this time-series feature sequence into the time-series prediction model. The time-series prediction model can employ a Transformer encoder model or a bidirectional long short-term memory network model to output the probability of achieving the bowel preparation quality standard and the trend of cleanliness changes. Since the bowel preparation process typically exhibits a continuous change from turbidity to clarity, relying solely on a single test result is easily affected by random factors; by performing time-series analysis on multiple test data, the overall change status of the preparation process can be reflected more stably.

[0077] When generating evaluation results, the time-series analysis server not only refers to the compliance probability output by the time-series prediction model, but also comprehensively judges whether the results of multiple consecutive detections, near-infrared particle scattering characteristics, suspended solids concentration inversion values ​​or normalized differential spectral indices, turbidity change rate, and conductivity deviation meet the corresponding threshold conditions. Specifically, the threshold determination module stores threshold conditions, which include: the cleaning category or cleanliness score of the most recent multiple consecutive detections meets preset requirements; the compliance probability is not lower than a preset probability threshold; the near-infrared particle scattering characteristics are not higher than the corresponding threshold; the suspended solids concentration inversion values ​​or normalized differential spectral indices are within a preset range; the turbidity change rate tends to be stable; and the conductivity deviation is not higher than the corresponding threshold. Through the above multi-condition constraints, the evaluation results reflect both the time-series model's judgment on the changing trend of the preparation process and are limited by quantitative spectral indicators and physical sensor data, which helps to reduce misjudgments caused by single image features, single sensor readings, or single model outputs. When the aforementioned threshold conditions are met, the evaluation result generation module generates an evaluation result indicating that the bowel preparation quality meets the preset requirements; when the aforementioned threshold conditions are not met, the evaluation result generation module may generate an evaluation result indicating continued monitoring or prompting attention to the preparation status. The evaluation result reflects the preoperative bowel preparation quality status and is not used as a disease diagnosis conclusion, nor does it directly output medication instructions.

[0078] The interactive terminal communicates with the time-series analysis server to output assessment results, preparation progress, and medical reminders. The interactive terminal can be a display screen installed on the smart toilet's data collection terminal, a voice prompt module, a mobile application, or a display interface at the medical institution. Preparation progress can include trends in cleanliness scores, turbidity, conductivity deviation, suspended solids concentration, spectral index, number of tests, test timelines, or confidence levels for achieving targets. Through the interactive terminal, patients can promptly understand their preparation status at home, and medical institutions can obtain preoperative preparation quality references, thus transforming bowel preparation quality assessment from a single, delayed subjective judgment into a continuous, objective, and process-oriented assessment.

[0079] In a preferred embodiment, the illumination unit is positioned at a corresponding location in the toilet detection area to provide detection light of different wavelengths to the mixture of excrement and water in the toilet; the image acquisition unit is used to acquire images of the mixture under corresponding wavelength illumination conditions.

[0080] Specifically, the lighting unit includes a blue light-emitting component, a green light-emitting component, a red light-emitting component, a first near-infrared light-emitting component, and a second near-infrared light-emitting component. The center wavelength of the blue light-emitting component is in the range of 430nm to 470nm, the green light-emitting component is in the range of 505nm to 545nm, the red light-emitting component is in the range of 600nm to 640nm, the first near-infrared light-emitting component is in the range of 720nm to 760nm, and the second near-infrared light-emitting component is in the range of 830nm to 870nm. These wavelength ranges can respectively cover the optical responses corresponding to common color residues, turbidity, and fine particle scattering changes during bowel preparation, which is beneficial for reflecting the cleanliness of the excrement-water mixture from different dimensions.

[0081] The control module can sequentially illuminate each light-emitting component in a preset order, and control the image acquisition unit to acquire corresponding band images during the illumination of a single light-emitting component, thereby forming a multi-band image group composed of multiple single-band images. Obtaining images of each band through sequential illumination can reduce mutual interference between light signals of different bands, enabling the subsequent edge computing module to calculate the image features under each band separately, and further obtain multi-band ratio features.

[0082] In the aforementioned band combinations, the blue band can be used to reflect differences in absorption or reflection caused by yellow or light-colored residues, the green band can be used to assist in reflecting subtle color changes in the liquid, and the red band can serve as a reference for turbidity and color status within the visible light range. The first and second near-infrared bands are used to obtain the scattering characteristics caused by fine suspended particles, undigested fibers, and other residues in the mixture. Since the liquid in the later stages of intestinal preparation may appear relatively clear under visible light, but still contains low concentrations of fine residues, the scattering response in the near-infrared band can provide supplementary information for identifying such cases.

[0083] The image acquisition unit includes a monochrome image sensor capable of responding to both visible and near-infrared light. Compared to conventional color image acquisition methods, the monochrome image sensor does not rely on a color filter array to separate color information and can receive reflected or scattered signals from different bands under sequential illumination conditions, facilitating the acquisition of more stable single-band grayscale images. The illumination unit can be arranged in a ring around the lens of the image acquisition unit, with a uniform light structure on the light-emitting side to improve the uniformity of illumination in the toilet detection area and reduce the impact of local shadows and water surface reflections on image feature extraction.

[0084] With the above settings, the multispectral imaging module 1 can acquire multidimensional image information in the visible and near-infrared bands within a single detection cycle. The edge computing module extracts color residue features, near-infrared particle scattering features, and multi-band ratio features based on this multi-band image set, which can then be combined with sensor data such as turbidity, conductivity, and temperature to form a single-detection feature vector. Therefore, compared to methods that rely solely on the patient's visual observation or ordinary visible light images to determine cleanliness, this embodiment provides a more stable and objective image feature basis for assessing the quality of home bowel preparation.

[0085] In a preferred embodiment, the image acquisition unit includes an anti-fog fixed-focus lens. Since the multispectral imaging module 1 is installed near the toilet bowl, the detection environment typically includes factors such as water vapor, temperature variations, and localized humidity. The anti-fog fixed-focus lens reduces the impact of fogging on the lens surface on image clarity, ensuring relatively stable image quality across different spectral bands during continuous detection. Using a fixed-focus lens also avoids fluctuations in image scale and clarity caused by autofocus changes during detection, facilitating consistent processing of the water surface area by the edge computing module across different detection cycles.

[0086] The illumination units are arranged in a ring around the anti-fog fixed-focus lens. Specifically, blue light emitting components, green light emitting components, red light emitting components, a first near-infrared light emitting component, and a second near-infrared light emitting component are spaced apart along the circumference of the lens, so that light of each wavelength can be evenly illuminated to the toilet detection area from around the lens. This ring arrangement can reduce shadows and local bright spots caused by unilateral illumination, and provide more stable illumination conditions for the mixture of excrement and water in the water surface area, thereby facilitating the subsequent extraction of color residue features, near-infrared particle scattering features, and multi-band ratio features.

[0087] In a preferred embodiment, the multispectral imaging module 1 is housed within a waterproof and corrosion-resistant sealed chamber. The sealed chamber accommodates the lighting unit, image acquisition unit, and their connecting circuitry, minimizing the impact of moisture, cleaning fluid, excrement splashes, and corrosive gases within the toilet bowl on the optical components and circuitry. The sealed chamber can be made of moisture-resistant and corrosion-resistant engineering plastics, and its joints are equipped with sealing rings, sealant, or waterproof connectors, thereby improving the stability of the multispectral imaging module 1 in the toilet's operating environment.

[0088] The sealed chamber has a light-transmitting protective window on the side facing the toilet detection area. The light-transmitting protective window is located in front of the optical path of the lighting unit and the image acquisition unit, and is used to allow light of various detection wavelengths to pass through while isolating external contaminants.

[0089] Furthermore, the smart toilet's data acquisition unit also includes a cleaning structure for cleaning the light-transmitting protective window. The cleaning structure may include one or more of a flushing structure, a wiping structure, or a shielding and protective structure. The flushing structure may include a spray nozzle or spray channel facing the light-transmitting protective window, used to spray clean water or cleaning fluid onto the window before and / or after detection to remove water stains, foam, or adhering substances from the window surface; the wiping structure may include a micro-scraper, a flexible brush, or a reciprocating wiping component for mechanical cleaning of the light-transmitting protective window; the shielding and protective structure may include a movable baffle or protective cover for shielding the light-transmitting protective window when not in a detection state to reduce direct adhesion of dirt.

[0090] In the actual operation, when the detection trigger module determines that a toilet visit has ended, the control module can first control the cleaning structure to pre-clean the light-transmitting protective window, and then start the multispectral imaging module 1 for sequential illumination acquisition. After the detection is completed, the control module can also control the cleaning structure again to rinse or wipe the light-transmitting protective window, and restore the shielding protective structure to its shielding position. This reduces the impact of window surface residue, water mist, or stains on the grayscale distribution of multi-band images and the extraction of near-infrared particle scattering features, resulting in better repeatability of image data obtained in different detection cycles.

[0091] In a preferred embodiment, the auxiliary sensor module 2 includes a turbidity sensor, a conductivity sensor, and a temperature sensor. The auxiliary sensor module 2 provides physical detection data for the mixture of excrement and water, in addition to multispectral imaging, to corroborate with image features and reduce biases caused by water surface reflection, localized foam, or changes in illumination when relying solely on image analysis.

[0092] Specifically, a turbidity sensor is used to obtain the turbidity value of a mixture based on the intensity of scattered light. The turbidity sensor can employ a structure combining an infrared emitter and receiver, characterizing changes in the content of suspended solids in the mixture by detecting the intensity of scattering of incident light by suspended particles. During bowel preparation, the turbidity of the mixture typically decreases as excrement is gradually cleared. Therefore, the turbidity value and its changes can serve as reference data for assessing changes in cleanliness.

[0093] Conductivity sensors are used to obtain the conductivity value of mixtures. Due to differences in excrement residue, electrolyte composition, and the degree of dilution in toilet water, the conductivity of the detected liquid may differ from that of a clean water standard. By detecting the conductivity value and further calculating its deviation from the clean water standard, an auxiliary basis can be provided for determining whether the mixture is gradually approaching a clean water state. Combining this data with color residue characteristics and near-infrared particle scattering characteristics from multispectral images helps improve the stability of single detection results.

[0094] Temperature sensors are used to obtain the temperature of the water or mixture in the toilet bowl and can be used for temperature compensation of turbidity and / or conductivity values. Since physical parameters such as conductivity are easily affected by temperature changes, directly using uncompensated measurements may introduce additional errors. By incorporating temperature data for correction, sensor data obtained from different detection cycles can be more comparable, thus providing a more consistent data basis for subsequently generating single-detection feature vectors.

[0095] In one embodiment, the auxiliary sensor module 2 is integrated onto a retractable or rotatable probe. The probe can be positioned on the side wall of the toilet bowl, at the rear of the toilet bowl, or in another location that does not interfere with normal toilet use, and is connected to the control module. At the start of the detection cycle, the control module drives the probe to extend or rotate, allowing the turbidity sensor, conductivity sensor, and temperature sensor to enter the toilet bowl water for data collection. After the detection is completed, the control module drives the probe to retract to a cleaning or storage position.

[0096] By mounting the auxiliary sensor module 2 on a retractable or rotatable probe, the sensor can be in contact with the toilet bowl water only during the detection cycle, reducing the risk of adhesion and corrosion caused by long-term exposure to a humid and polluted environment. After the probe is retracted, it can be cleaned with water or other cleaning methods, which helps maintain the detection stability and lifespan of the sensor probe.

[0097] Therefore, the auxiliary sensor module 2 can collect physical parameters such as turbidity, conductivity, and temperature without requiring additional procedures from the patient, and combine them with multispectral image features to form a single detection feature vector. This setup allows the assessment of bowel preparation quality to not only rely on image appearance judgment, but also incorporate detection data that reflects the effects of suspended matter, liquid ion state, and temperature, which helps to improve the objectivity of continuous assessment of the home bowel preparation process.

[0098] In a preferred embodiment, after receiving the multi-band image group acquired by the multispectral imaging module 1, the edge computing module first performs preprocessing on each band image. The preprocessing includes image registration, distortion correction, illumination unevenness correction, noise suppression, and water surface region segmentation.

[0099] Image registration ensures that images acquired at different wavelengths correspond spatially, preventing positional shifts in the same area across different wavelengths due to acquisition time differences, optical path variations, or local water surface disturbances. Distortion correction corrects edge distortions caused by wide-angle lens imaging, making subsequent extracted water surface areas and particle distribution features closer to actual spatial distribution. Illumination unevenness correction reduces the impact of local shadows, reflections, or illumination attenuation within the toilet detection area on grayscale statistical results. Noise suppression reduces interference from sensor noise, fine water surface ripples, and isolated abnormal pixels on feature calculations. Water surface region segmentation extracts the effective detection area containing the excrement and water mixture from multi-wavelength images, minimizing the impact of toilet walls, drain outlets, foam edges, or other non-detection areas on evaluation results.

[0100] After the above preprocessing, the edge computing module calculates color residue features, near-infrared particle scattering features, and multi-band ratio features within the water surface area. Color residue features may include one or more of the gray-level mean, gray-level variance, and band ratios of the blue, green, and red light bands. The gray-level mean reflects the overall color or turbidity of the water surface area, the gray-level variance reflects the uniformity of color distribution, and the band ratio reflects the relative response differences between different visible light bands. These color residue features provide image-based evidence for determining bile pigments, fecal color, or other visible color residues.

[0101] Near-infrared particle scattering characteristics can include one or more of the following in near-infrared images: the proportion of high grayscale pixels, the number of high grayscale connected components, the area distribution of high grayscale connected components, bright spot density, and texture dispersion. Specifically, the proportion of high grayscale pixels is used to characterize the proportion of suspected scattering points within the water surface area; the number of high grayscale connected components is used to characterize the number of scattering points or particle clusters; the area distribution of high grayscale connected components is used to characterize the size variation of the scattering area; bright spot density is used to characterize the degree of scattering response formed by suspected suspended particles or undigested fibers within a unit detection area; and texture dispersion is used to characterize the dispersion of the grayscale distribution in the near-infrared image. Since the fluid in the later stages of intestinal preparation may appear relatively clear under visible light, but still contains low concentrations of fine residues, near-infrared particle scattering characteristics can provide supplementary evidence for identifying this state.

[0102] Multi-band ratio characteristics can be obtained based on the grayscale response ratios between the visible light band and the near-infrared band, or between different near-infrared bands. By using relative ratios instead of single grayscale values, the influence of overall illumination intensity, local reflection, and sensor gain variations on the characteristics can be reduced to some extent, making the characteristics obtained from different detection cycles more comparable.

[0103] The edge computing module combines color residue features, near-infrared particle scattering features, multi-band ratio features, suspended matter concentration inversion values, and / or normalized differential spectral indices with turbidity, conductivity, and temperature to form a single detection feature vector. This processing method ensures that a single detection result includes not only visible color information but also near-infrared scattering information and physical sensing information. This helps reduce the subjectivity and instability that arises when judging cleanliness solely based on visual observation or ordinary visible light images, and provides a unified data input for subsequent local evaluation models and time-series analysis servers.

[0104] In a preferred embodiment, the time-series analysis server is equipped with a time-series prediction model. This model analyzes multiple single-detection feature vectors sorted by detection time within the same bowel preparation process to obtain the probability of achieving the required bowel preparation quality, the predicted future cleanliness value, and the equivalent preparation score. The time-series prediction model can employ a Transformer encoder model or a bidirectional long short-term memory network model. Both models process continuous detection data and do not directly use single-detection results as the final judgment basis, thereby reducing the impact of occasional fluctuations in single excretion status on the evaluation results.

[0105] For a complete bowel preparation process, let the first... The single-detection feature vector corresponding to the first detection is Then up to the The temporal feature sequence formed by the subsequent detections can be represented as: ; in, This indicates the number of steps taken within the same bowel preparation process up to the [number missing]. The temporal feature sequence formed by the secondary detection; Indicates the first The single detection feature vector corresponding to each detection; This indicates the total number of tests performed during the current bowel preparation process; This indicates the detection sequence number. The single detection feature vector may include one or more of the following: color residue features, near-infrared particle scattering features, multi-band ratio features, suspended matter concentration inversion value, normalized differential spectral index, turbidity value, conductivity value, temperature value, turbidity change rate, and conductivity deviation.

[0106] When the time-series prediction model uses the Transformer encoder model, each single detection feature vector in the time-series feature sequence can be mapped to an input embedding vector, and positional encoding can be added to obtain the model input: ; in, This represents the sequence representation of the input Transformer encoder model; Represents the time-series feature sequence The input embedding matrix obtained after feature embedding; This represents the positional encoding corresponding to the detection order. Positional encoding can be in sine / cosine form or a learnable positional vector. By incorporating positional encoding, the model can distinguish the sequential relationship between different detection results during the intestinal preparation process, avoiding the simplistic view of multiple detection data as an unordered set of features.

[0107] The Transformer encoder model uses a self-attention mechanism to perform correlation analysis on features at different detection times to extract the change features from turbidity to clarity during bowel preparation. Its encoding process can be represented as follows: ; in, This represents the timing coding result obtained after processing by the Transformer encoder model; This represents the input sequence after adding positional encoding. The self-attention mechanism allocates weights based on the correlation between different detection times, allowing the model to focus on key changes during analysis, such as significant improvement in cleanliness, a slower decline in turbidity, reduced near-infrared particle scattering, or conductivity gradually approaching the clean water baseline. Therefore, the time-series prediction model can utilize the overall trend of changes across multiple detection times, rather than relying solely on the result of a single detection.

[0108] In one embodiment, the timing coding result can be used as a reference. The final time-based encoding vector or the preset convergence vector is obtained as the session-level representation, denoted as... Based on the corresponding session-level representation, the time-series prediction model can output multiple tasks: ; ; ; in, This indicates the probability that the current bowel preparation process meets the preset requirements. This represents the Sigmoid activation function; This indicates a predicted cleanliness level for a future test. Indicates equivalent preparation score; , , These represent the weight matrices corresponding to different output tasks; , , These represent the bias terms for the corresponding output tasks; This represents the session-level feature representation after temporal encoding. The equivalent preparation score is a reference score used to characterize the adequacy of bowel preparation and is not used as a disease diagnosis.

[0109] In another embodiment, the temporal prediction model employs a bidirectional long short-term memory network model. This model can learn the state changes during the intestinal preparation process along both the forward and backward time axes, and fuse the hidden states from both sides to obtain a comprehensive representation of the temporal feature sequence. The process can be represented as follows: ; ; in, Indicates the first The hidden state in the positive long short-term memory network is detected. Indicates the first The hidden state of the reverse long short-term memory network is detected in the next step. This represents a positive long short-term memory network unit; Represents a reverse long short-term memory network unit; Represents the temporal characteristics after fusing forward and reverse states; symbol This represents vector concatenation. The bidirectional long short-term memory network model is suitable for analyzing preparation processes with a small number of detections but clear trends, and can serve as an alternative implementation of the Transformer encoder model.

[0110] The probability of meeting standards, predicted future cleanliness, and equivalent preparation score output by the time-series prediction model can be used by the time-series analysis server for subsequent comprehensive judgment. Specifically, the time-series analysis server can combine cleanliness categories or cleanliness scores from multiple consecutive tests, near-infrared particle scattering characteristics, suspended matter concentration inversion values ​​or normalized difference spectral indices, turbidity change rate, and conductivity deviation to determine whether the quality of bowel preparation meets the preset requirements. In this way, the model output is constrained by multiple test data and objective test indicators, which helps to improve the stability of home bowel preparation quality assessment.

[0111] By inputting the feature vectors of multiple single detections within the same bowel preparation process into a time-series prediction model, the dynamic changes in the mixture of excrement and water from turbid to clear can be utilized. Through positional encoding and self-attention mechanisms, the correlation features between different detection times can be extracted. By simultaneously outputting the probability of achieving the target, the predicted value of future cleanliness, and the equivalent preparation score, a more complete data foundation can be provided for patient-side preparation progress prompts and medical institution-side preoperative quality references.

[0112] In a preferred embodiment, after obtaining the probability of compliance and the trend of cleanliness changes from the time-series prediction model, the time-series analysis server does not directly use the output of a single model as the result of the bowel preparation quality assessment. Instead, it further combines the results of multiple recent consecutive tests and multi-source detection indicators for joint judgment. This approach reduces the impact of abnormal single tests, fluctuations in a single sensor, or deviations in model output on the final assessment result, thus making the home bowel preparation quality assessment more stable.

[0113] Specifically, let the most recent consecutive The subsequent detections constitute the decision window, in which It is an integer not less than 2. If the current value is the th... In the second detection, the decision window can be represented as: ; in, Indicates the first The most recent consecutive values ​​used for joint determination during the next detection. Secondary detection window; Indicates the current detection sequence number; This indicates the number of consecutive tests used in the determination.

[0114] Within this judgment window, the time-series analysis server assesses the cleaning category, cleanliness score, probability of compliance, near-infrared particle scattering characteristics, turbidity change rate, suspended solids concentration inversion value or normalized difference spectral index, and conductivity deviation. Only when all of the above indicators meet their corresponding threshold conditions is an evaluation result indicating that the intestinal preparation quality meets the preset requirements generated.

[0115] In one embodiment, the cleaning category condition is: most recent consecutive All tests were conducted under the cleanliness category of basically clear or completely clean water; or, most recently... The cleanliness scores of each test were not lower than the first threshold. For ease of calculation, the most recent consecutive... The cleanliness score statistics for this test are expressed as follows: ; in, Indicates the most recent consecutive The average cleanliness score of each test; Indicates the first Cleanliness score of the second test; This indicates the detection sequence number within the judgment window. The first threshold can be preset according to the scoring range of the local evaluation model. For example, when the cleanliness score is in the range of 0 to 3, the first threshold can correspond to a scoring level of "basically clear" or higher. By setting conditions for multiple consecutive scoring, it is possible to avoid prematurely judging the preparation to be completed based solely on a good result from a single test.

[0116] The compliance probability condition is: the compliance probability output by the time series prediction model is not lower than the second threshold, which can be expressed as: ; in, Indicates the first The probability of meeting the standard is output by the time series prediction model after the second test; This represents the second threshold. Compared to a single cleaning category, the probability of meeting the standard is obtained based on the characteristic sequence of multiple detection times within the same preparation process, which can reflect the continuous change in the excretion state from turbid to clear.

[0117] Near-infrared particle scattering conditions are: nearest contiguous The near-infrared particle scattering characteristics detected in the second test do not exceed the third threshold. Near-infrared particle scattering characteristics may include one or more of the following: the proportion of high grayscale pixels, bright spot density, number of connected components, or texture dispersion in the near-infrared band image. For ease of determination, the most recent continuous... The statistical values ​​of the near-infrared particle scattering characteristics detected in this study are expressed as follows: ; in, Indicates the most recent consecutive Statistical values ​​of near-infrared particle scattering characteristics from the second detection; Indicates the first The near-infrared particle scattering characteristic value detected in this step can specifically be the proportion of high grayscale pixels, the density of bright spots, or other scattering characteristics. This indicates that the maximum value is taken. When using the maximum value as the statistical value, as long as there is still a significant particle scattering response within the judgment window, it can be constrained by the threshold condition. This condition is used to constrain situations where the water appears clear but still contains fine residues, which helps reduce the possibility of false positives for clear water.

[0118] The condition for the rate of change of turbidity is: the most recent continuous The turbidity change rate of the second detection is not higher than the fourth threshold. For the first... The rate of change in turbidity relative to the previous test can be expressed as: ; in, Indicates the first The rate of turbidity change corresponding to each detection; Indicates the first The turbidity value of the second test can be expressed in NTU. This indicates the turbidity value from the previous test; and They represent the first The testing time between the current test and the previous test; To prevent constants with a denominator of zero. Most recently continuous. The statistical value of the turbidity change rate of each test can be expressed as: ; in, This represents the statistical value of the turbidity change rate within the judgment window. When the turbidity value is still in a state of significant decrease or fluctuation, it indicates that the state of the mixture has not yet stabilized; when the turbidity change rate decreases and tends to stabilize, it can be used as a reference for the clean state to tend to stabilize.

[0119] Suspended solids concentration or spectral index conditions are: most recent consecutive The suspended solids concentration inversion value or normalized difference spectral index of the second detection meets the sixth threshold. The suspended solids concentration inversion value can be calculated from multi-band reflectance or the ratio of reflectance in the red band to the near-infrared band; the normalized difference spectral index can be used to characterize differences in clear water discrimination, bile residue, or other spectral responses. For ease of uniform expression, the sixth detection value can be... The suspended solids concentration inversion value or normalized difference spectral index of the second detection is denoted as... and the most recent consecutive The statistical values ​​for this test are expressed as follows: ; in, This indicates the inverted value of suspended matter concentration or the statistical value of normalized difference spectral index within the judgment window; Indicates the first The inversion value of suspended solids concentration or the normalized difference spectral index of the second detection. When When the value is the inversion value of suspended solids concentration, an upper threshold can be used for judgment; when When normalizing the differential spectral index, an upper limit threshold, a lower limit threshold, or an allowable range can be used for judgment based on the index type. By introducing this condition, the reflectance change in multispectral images can be transformed into a quantifiable discriminant, making the evaluation results not only dependent on the grayscale appearance of the image, but also further constrained by quantitative spectral indicators.

[0120] The conductivity condition is: most recent continuous The conductivity deviation in each test shall not exceed the fifth threshold. The conductivity deviation can be the degree of deviation between the current detected conductivity value and the preset clean water reference conductivity, or the degree of deviation between the temperature-compensated conductivity value and the temperature-compensated clean water reference conductivity.

[0121] In one optional embodiment, the first The conductivity deviation of the second test can be expressed as: ; in, Indicates the first The deviation of conductivity in the second test; Indicates the first The conductivity value after temperature compensation is measured, and its unit can be microsiemens per centimeter; This represents the baseline conductivity of clean water after temperature compensation. To prevent constants with a denominator of zero.

[0122] Recent consecutive The statistical value of the conductivity deviation in each test can be expressed as: ; in, This indicates the statistical value of conductivity deviation within the judgment window. When the conductivity deviation gradually decreases and remains within a preset range, it can serve as an auxiliary basis for detecting that the liquid is gradually approaching the clean water reference state.

[0123] In one optional embodiment, the time series analysis server may use the following joint decision logic to generate the evaluation result: ; in, Indicates the first The evaluation results obtained after the test This indicates that the quality of bowel preparation meets the preset requirements; This indicates an indicator function that takes the value 1 when all conditions within the parentheses are met, and 0 otherwise. Indicates the most recent consecutive Statistical values ​​of cleanliness scores from the previous test; Indicates the probability of meeting the standard; Indicates the most recent consecutive Statistical values ​​of near-infrared particle scattering characteristics from the second detection; Indicates the most recent consecutive Statistical values ​​of turbidity change rate from each test; Indicates the most recent consecutive Statistical values ​​of conductivity deviation from each test; Indicates the most recent consecutive The inversion value of suspended solids concentration or the statistical value of normalized difference spectral index of the second test; , , , , These represent the first threshold, second threshold, third threshold, fourth threshold, and fifth threshold, respectively. This indicates the allowable range corresponding to the sixth threshold.

[0124] In practical applications, The most recent consecutive can be used Mean, minimum or other statistical measures of the cleanliness score; , , and The nearest consecutive can be used respectively The mean, maximum, or slope of change of each test result. Each threshold can be configured based on equipment calibration data, historical test data, or the preparation quality requirements set by the medical institution.

[0125] When the combined criteria are met, the time-series analysis server generates an assessment result indicating that the bowel preparation quality meets the preset requirements. When any key condition is not met, the time-series analysis server may generate an assessment result indicating continued monitoring or prompting attention to the preparation status. This assessment result is used for preoperative bowel preparation quality reference and is not used as a disease diagnosis conclusion, nor does it directly output medication instructions.

[0126] Through the above settings, this embodiment incorporates cleaning category or cleanliness score, time-series compliance probability, near-infrared particle scattering characteristics, suspended matter concentration inversion value or normalized differential spectral index, turbidity change rate, and conductivity deviation into the same judgment window. This joint judgment method considers both the temporal continuity of the bowel preparation process and introduces quantitative spectral indicators and physical sensor indicators for cross-validation, which helps to improve the objectivity and stability of home bowel preparation quality assessment.

[0127] In a preferred embodiment, the time-series analysis server includes a database and a central analysis module. The database stores identifiers for the bowel preparation process, records of each test, model version information, and manually verified quality labels corresponding to the bowel preparation process. Each test record may include one or more of the following: test time, single test feature vector, cleanliness category, cleanliness score, turbidity value, conductivity value, temperature value, suspended solids concentration inversion value, normalized differential spectral index, and local evaluation results. Because the database stores structured test data, rather than multi-band raw images, it can retain the information required for time-series analysis while reducing privacy concerns and data management burdens associated with storing raw excrement images.

[0128] The database can associate multiple test records from the same bowel preparation process according to the bowel preparation process identifier, forming a corresponding time-series feature sequence. Manually verified quality labels can originate from medical institutions' confirmation of the adequacy of bowel preparation, endoscopic preparation quality evaluation results, or quality level labels based on bowel preparation scoring scales. Model version information can include one or more of the following: model number, model type, training data batch, update time, and model parameter configuration, to facilitate traceability management of the model training and update process.

[0129] The central analysis module is used to train or update the time-series prediction model using historical time-series feature sequences with manually verified quality labels. Specifically, the central analysis module can read detection records corresponding to multiple historical bowel preparation processes from the database, form historical time-series feature sequences according to the detection time, and use the corresponding manually verified quality labels as supervision information to train or update the parameters of the time-series prediction model. The trained or updated time-series prediction model is used to analyze the detection sequences of the current bowel preparation process, outputting the probability of achieving the target, the predicted value of future cleanliness, and the equivalent preparation score. Thus, the time-series analysis server can use historical data to correct model parameters and improve the model's adaptability to different users and different preparation process trends.

[0130] During real-time analysis, when the time-series analysis server receives new test records uploaded by the edge computing module, the central analysis module retrieves historical test records from the same preparation process based on the bowel preparation process identifier, and combines these records with the new test records to form an updated time-series feature sequence. Subsequently, the central analysis module inputs the updated time-series feature sequence into the time-series prediction model to obtain the current preparation process's success rate and cleanliness trend, and generates an evaluation result based on preset threshold conditions. In this way, the evaluation results can be dynamically updated as the number of tests increases, avoiding judgment of bowel preparation quality based solely on a single test result.

[0131] In a preferred embodiment, the interactive terminal includes one or more of the following: a display screen installed on the smart toilet's data collection terminal, a voice prompt module, a mobile terminal application, and a display interface on the medical institution's end. The interactive terminal is used to output bowel preparation quality assessment results, preparation progress, and medical reminders. The preparation progress may include one or more of the following: cleanliness score trend, turbidity trend, conductivity deviation trend, number of tests, test timeline, and confidence level of achievement. Through trend graphs, status prompts, test record lists, or report pages, patients can understand whether the preparation process is stabilizing during the home preparation phase, and medical institutions can also obtain a reference for the quality of preoperative preparation.

[0132] The interactive terminal outputs limited information to bowel preparation quality assessment results, preparation progress, and medical reminders; it does not directly provide disease diagnoses or medication instructions. Through the collaboration of the database, central analysis module, and interactive terminal, this embodiment can transform multiple structured detection data uploaded from the smart toilet's data collection terminal into continuous, traceable, and feedback-enabled bowel preparation quality assessment information, thereby improving the objectivity and usability of home bowel preparation monitoring.

[0133] Example 2

[0134] See Figure 4This invention also provides a method for real-time assessment of the quality of bowel preparation before gastrointestinal endoscopy, which can be applied to the real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy described in Example 1. The specific implementation steps are as follows:

[0135] Specifically, the detection trigger module generates a detection trigger signal when it detects the completion of a toilet use. The completion of a toilet use can be determined based on the user leaving the seat, the toilet lid closing, flushing, or a combination of these states. After receiving the detection trigger signal, the control module enters the detection cycle. Through this triggering method, the detection process can be automatically executed along with toilet use, eliminating the need for the patient to actively take images of excrement or manually record observation results, thus reducing the operational burden during home use.

[0136] During the detection cycle, the control module triggers the multispectral imaging module 1 to sequentially illuminate and acquire images of the mixture of excrement and water in the toilet bowl using visible and near-infrared bands, forming a multi-band image set. Specifically, the multispectral imaging module 1 can sequentially illuminate the blue, green, red, first near-infrared, and second near-infrared light emission components, and simultaneously acquire corresponding band images during each band illumination period. Sequential illumination acquisition can separate the spectral responses under different bands, facilitating subsequent analysis of color residue, turbidity, and fine particle scattering.

[0137] While acquiring a multi-band image set, auxiliary sensor module 2 acquires the turbidity, conductivity, and temperature of the mixture. Turbidity reflects the degree of scattering caused by suspended matter in the mixture, conductivity reflects the difference between the detection liquid and a clean water reference, and temperature is used to compensate for turbidity and / or conductivity. By combining multispectral image data with physical sensor data, judgment biases caused by the influence of single image features on water surface reflection, foam, or lighting fluctuations can be reduced.

[0138] After receiving a multi-band image set, the edge computing module preprocesses the image set and extracts the water surface region corresponding to the mixture of excrement and water. The preprocessing may include image registration, distortion correction, illumination unevenness correction, noise suppression, and water surface region segmentation. Through these processes, the impact of positional deviations between different band images, lens distortion, local shadows, reflections, and non-detection areas on subsequent feature calculations can be reduced.

[0139] Within the water surface area, the edge computing module calculates color residue features, near-infrared particle scattering features, and multi-band ratio features. Color residue features may include the gray-level mean, gray-level variance, and their band ratios in the visible light band, reflecting bile pigments, fecal color, or other visible residue states. Near-infrared particle scattering features may include the proportion of high gray-level pixels in the near-infrared image, the number of high gray-level connected regions, the area distribution of high gray-level connected regions, bright spot density, or texture dispersion, characterizing the scattering response caused by fine suspended particles, undigested fibers, and other residues. Multi-band ratio features reflect the relative changes between different band responses, which can, to some extent, reduce the impact of overall illumination intensity and sensor gain variations on the detection results.

[0140] Furthermore, the edge computing module can calculate the reflectance of each band based on a multi-band image set, and calculate the suspended solids concentration inversion value and / or normalized differential spectral index based on the multi-band reflectance. The suspended solids concentration inversion value can be obtained through a multi-band empirical model or the reflectance ratio of the red band to the near-infrared band, used to characterize the concentration change of fine suspended residues in the mixture; the normalized differential spectral index can be obtained based on the ratio of the difference and sum of the reflectance of two bands, used to characterize the difference in clear water discrimination, bile residue, or other spectral response differences. By introducing the above quantitative spectral indicators, the state of "appearing clear but still possibly containing fine residues" can be transformed into a calculable feature, which helps to reduce the possibility of false clear water misjudgment.

[0141] The edge computing module combines color residue features, near-infrared particle scattering features, multi-band ratio features, suspended matter concentration inversion values, and / or normalized differential spectral indices with turbidity, conductivity, and temperature to generate a single-detection feature vector. This single-detection feature vector simultaneously contains visible light color information, near-infrared scattering information, spectral quantitative indicators, and physical sensor data, providing a unified data input for subsequent local evaluation and time-series analysis.

[0142] Subsequently, the edge computing module inputs the single-detection feature vector into the local evaluation model to obtain the cleanliness category and cleanliness score of the excrement-water mixture. The local evaluation model can employ a lightweight neural network model, a gradient boosting decision tree model, or a random forest model. Cleanliness categories can include heavily contaminated, slightly residual, basically clear, and completely clean water, while the cleanliness score can be a continuous or discrete value within a preset range. Because the local evaluation model processes structured features rather than the raw image, it can quickly complete the initial evaluation at the edge, reducing the computational burden on the server side and facilitating immediate feedback.

[0143] The edge computing module uploads the structured data corresponding to this detection to the time-series analysis server. Uploaded data may include device identifier, intestinal preparation process identifier, detection time, single detection feature vector, cleanliness category, cleanliness score, turbidity value, conductivity value, and temperature value. The edge computing module does not upload the original images from the multi-band image group. This method preserves the detection information required for time-series analysis while reducing privacy concerns associated with the transmission and storage of raw excrement images.

[0144] The time-series analysis server receives multiple single-detection feature vectors within the same bowel preparation process, assembles them into a time-series feature sequence according to detection time, and inputs this time-series feature sequence into a time-series prediction model to obtain the probability of achieving the target and the trend of cleanliness changes. The time-series prediction model can employ a Transformer encoder model or a bidirectional long short-term memory network model. Since the bowel preparation process typically involves a continuous change in the state of excrement from turbid to clear, analysis using the time-series feature sequence can more stably reflect the overall state of the preparation process than single-detection results.

[0145] When generating evaluation results, the time-series analysis server combines multiple consecutive detection results, compliance probability, near-infrared particle scattering characteristics, suspended solids concentration inversion value or normalized differential spectral index, turbidity change rate, and conductivity deviation for joint judgment. The turbidity change rate can be the rate of change of the current detected turbidity value relative to the previous detected turbidity value, or the slope of change obtained by fitting the turbidity values ​​from the most recent multiple detections; the conductivity deviation can be determined based on the degree of deviation between the temperature-compensated conductivity value and the clean water baseline conductivity. When all the above indicators meet the corresponding threshold conditions, the time-series analysis server generates an evaluation result indicating that the intestinal preparation quality meets the preset requirements; when at least one key indicator does not meet the corresponding threshold condition, the time-series analysis server can generate an evaluation result indicating continued monitoring or prompting attention to the preparation status. This joint judgment method ensures that the evaluation results are constrained by both the time-series model output and the quantitative spectral indicators and physical sensing indicators, which helps improve the objectivity and stability of the evaluation results.

[0146] The interactive terminal receives the assessment results output by the time-series analysis server and displays the assessment results, preparation progress, and medical reminders to the patient or medical institution. Preparation progress may include trends in cleanliness score, turbidity, conductivity deviation, suspended solids concentration, spectral index, number of tests, test timeline, or confidence level of achievement. The above output reflects the preoperative bowel preparation quality status and does not constitute a disease diagnosis, nor does it directly output medication instructions.

[0147] As a preferred embodiment, the calculation of near-infrared particle scattering features includes: identifying high-grayscale pixels or high-grayscale connected regions within the water surface area of ​​the near-infrared image, and calculating the bright spot density, number of connected regions, area distribution of connected regions, or texture dispersion based on the high-grayscale pixels or high-grayscale connected regions. Since the near-infrared band is highly sensitive to scattering caused by fine suspended particles and undigested fibers, the above features can provide supplementary information for identifying situations where the image appears clear but still contains fine residues.

[0148] In a preferred embodiment, the calculation of conductivity deviation includes: performing temperature compensation on the currently detected conductivity value based on the temperature value, obtaining a clean water reference conductivity corresponding to the current water source or equipment calibration state, and calculating the degree of deviation between the temperature-compensated conductivity value and the clean water reference conductivity. By introducing temperature compensation and comparison with a clean water reference, the comparability of conductivity data within different detection cycles can be improved, enabling it to serve as an auxiliary basis for judging whether the detected liquid is gradually approaching a clean water state.

[0149] As a preferred embodiment, the training method for the time-series prediction model includes: acquiring historical detection records corresponding to multiple historical bowel preparation processes; assembling the historical detection records into a historical time-series feature sequence according to the bowel preparation process; acquiring manual confirmation quality labels corresponding to each historical bowel preparation process; and training or updating the time-series prediction model using the historical time-series feature sequence as input and the manual confirmation quality labels as supervision information. The manual confirmation quality labels can originate from the confirmation results of bowel preparation adequacy by medical institutions, the preparation quality evaluation results after endoscopic examination, or quality level labels formed based on a bowel preparation scoring scale. By using manual confirmation quality labels to train or update the time-series prediction model, a correspondence can be established between the model output and the actual preparation quality evaluation, thereby improving the model's adaptability to different users and changing trends in different preparation processes.

[0150] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct or indirect applications in other related technical fields, are within the patent protection scope of the present invention.

Claims

1. A real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy, characterized in that, This includes a smart toilet data acquisition terminal, a time-series analysis server, and an interactive terminal; The smart toilet's data acquisition unit includes a detection trigger module, a multispectral imaging module, an auxiliary sensor module, an edge computing module, and a control module; The system includes a detection trigger module for generating a detection trigger signal after each toilet visit; a control module for triggering the multispectral imaging module to sequentially illuminate and acquire the mixture of excrement and water in the toilet bowl using visible and near-infrared bands to form a multi-band image group, and triggering the auxiliary sensor module to acquire turbidity, conductivity, and temperature; the multispectral imaging module includes an illumination unit and an image acquisition unit; the illumination unit includes a blue light emitting component, a green light emitting component, a red light emitting component, a first near-infrared light emitting component, and a second near-infrared light emitting component, the center wavelengths of which are respectively within the ranges of 430nm to 470nm, 505nm to 545nm, 600nm to 640nm, 720nm to 760nm, and 830nm to 870nm; The edge computing module is used to extract water surface areas, calculate color residue features, near-infrared particle scattering features, and multi-band ratio features, and calculate suspended matter concentration inversion values ​​and / or normalized differential spectral indices based on multi-band reflectance. Specifically, the edge computing module converts the grayscale values ​​of each band image into the corresponding band reflectance according to the following formula. : ,in, This refers to the grayscale value or average grayscale value of the water surface region image corresponding to wavelength λ. This is the reference grayscale value for the dark field. This is the reference grayscale value under whiteboard or water calibration conditions. To prevent constants with zero denominators; and according to The suspended solids concentration inversion value is obtained, where TSS is the suspended solids concentration inversion value. The reflectance is the near-infrared band reflectance at 740nm or 850nm, or a weighted value of the two. The reflectivity is 620nm red light band. and The parameters are calibrated for empirical purposes; and a single detection feature vector is generated by combining turbidity, conductivity and temperature. After the local evaluation model outputs the cleaning category and cleanliness score, the desensitized single detection feature vector is uploaded. The time-series analysis server is used to combine the feature vectors of multiple single detections within the same bowel preparation process into a time-series feature sequence. This sequence is then input into a time-series prediction model to obtain the probability of achieving the target and the trend of cleanliness changes. When multiple consecutive detection results, the probability of achieving the target, near-infrared particle scattering characteristics, suspended matter concentration inversion value or normalized difference spectral index, turbidity change rate, and conductivity deviation all meet threshold conditions, an assessment result is generated to determine if the bowel preparation quality meets preset requirements. For the T-th detection, the time-series analysis server uses the most recent M consecutive detections as a judgment window. Where M is an integer not less than 2; within the determination window, the average cleanliness score of the most recent M consecutive tests is recorded as . Statistical values ​​of near-infrared particle scattering characteristics Statistical value of turbidity change rate Statistical value of conductivity deviation Take the maximum value of the corresponding detection value within the judgment window, and convert the suspended solids concentration inversion value or the normalized differential spectral index statistical value. Take the average of the corresponding detection values ​​within the judgment window; where the conductivity value after temperature compensation is the t-th detection. The conductivity deviation in the t-th test , The reference conductivity of clean water after temperature compensation, γ is the temperature compensation coefficient of the conductivity sensor, and EC t T is the conductivity value. t T0 is the measured temperature, and T0 is the reference temperature. The threshold conditions include: the cleanliness category of the most recent M consecutive tests is basically clear or completely clear water, or the average cleanliness score of the most recent M consecutive tests is not lower than the first threshold; the probability of meeting the standard is not lower than the second threshold; the near-infrared particle scattering characteristics of the most recent M consecutive tests are not higher than the third threshold; the turbidity change rate of the most recent M consecutive tests is not higher than the fourth threshold; the suspended solids concentration inversion value or normalized difference spectral index of the most recent M consecutive tests meets the sixth threshold; and the conductivity deviation of the most recent M consecutive tests is not higher than the fifth threshold. The time-series analysis server also includes a database and a central analysis module. The database is used to organize multiple detection records from the same historical bowel preparation process into a historical time-series feature sequence according to the bowel preparation process identifier, and to store the artificially confirmed quality labels corresponding to the historical bowel preparation process. The artificially confirmed quality labels are derived from one or more of the following: the confirmation results of the adequacy of bowel preparation by medical institutions, the preparation quality evaluation results after endoscopy, or the quality level labels formed based on the bowel preparation scoring scale. The central analysis module is used to train or update the time-series prediction model using the historical time-series feature sequence as input and the corresponding artificially confirmed quality labels as supervision information. An interactive terminal is used to output assessment results, preparation progress, and medical appointment reminders.

2. The real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy according to claim 1, characterized in that, The control module is used to sequentially light up each light-emitting component in a preset order, and control the image acquisition unit to acquire corresponding band images during the lighting of a single light-emitting component, so that images of different bands are obtained separately in time. The image acquisition unit includes a monochrome image sensor sensitive to visible and near-infrared light and an anti-fog fixed-focus lens. The illumination unit is arranged in a ring around the anti-fog fixed-focus lens and is uniformly disposed on the light-emitting side.

3. The real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy according to claim 1, characterized in that, The multispectral imaging module is housed in a sealed chamber, and the side of the sealed chamber facing the toilet detection area is provided with a light-transmitting protective window; the smart toilet acquisition end also includes a flushing structure, wiping structure or shielding protection structure for cleaning the light-transmitting protective window before and / or after detection.

4. The real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy according to claim 1, characterized in that, The auxiliary sensor module includes a turbidity sensor, a conductivity sensor, and a temperature sensor; the turbidity sensor is used to obtain the turbidity value based on the intensity of scattered light, the conductivity sensor is used to obtain the conductivity value of the mixture, and the temperature sensor is used to obtain the temperature value and perform temperature compensation on the turbidity value and / or conductivity value. An auxiliary sensor module is integrated on a retractable or rotatable probe, which is configured to extend into the toilet bowl water during the detection cycle to collect turbidity, conductivity, and temperature, and retract after the detection is completed.

5. The real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy according to claim 1, characterized in that, The edge computing module performs image registration, distortion correction, illumination unevenness correction, noise suppression, and water surface region segmentation on multi-band image groups. Near-infrared particle scattering characteristics include one or more of the following in near-infrared band images: proportion of high grayscale pixels, number of high grayscale connected components, area distribution of high grayscale connected components, bright spot density, and texture dispersion. Color retention characteristics include one or more of the following: grayscale mean, grayscale variance, and band ratio of the blue, green, and red light bands; The single-detection feature vector includes one or more of the mean, standard deviation, skewness, kurtosis, and normalized difference spectral index for each band of the water surface region.

6. The real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy according to claim 1, characterized in that, The suspended matter concentration inversion value is obtained based on a multi-band reflectance regression model or based on a ratio model of red band reflectance to near-infrared band reflectance. The normalized differential spectral index includes one or more of the following: water discrimination index, bile residue index, and occult blood correlation index.

7. The real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy according to claim 1, characterized in that, The local evaluation model is a lightweight neural network model, a gradient boosting decision tree model, or a random forest model; Cleaning categories include heavily soiled, lightly residued, mostly clear, and completely clean water; The data uploaded by the edge computing module to the time series analysis server includes device identifier, intestinal preparation process identifier, detection time, single detection feature vector, cleanliness category, cleanliness score, turbidity value, conductivity value and temperature value, but does not upload the original images in the multi-band image group.

8. The real-time assessment system for the quality of bowel preparation before gastrointestinal endoscopy according to claim 1, characterized in that, Temporal prediction models include Transformer encoder models or bidirectional long short-term memory network models.

9. A method for real-time assessment of the quality of bowel preparation before gastrointestinal endoscopy, characterized in that, The method, applied to the real-time assessment system for preoperative bowel preparation quality as described in any one of claims 1-8, comprises: A detection trigger signal is generated after a toilet visit is detected; Based on the detection trigger signal, the mixture of excrement and water in the toilet bowl is sequentially illuminated and acquired using visible light and near-infrared bands to form a multi-band image group, and the turbidity, conductivity and temperature of the mixture are acquired. Extract the water surface area from the multi-band image group, calculate the color residue features, near-infrared particle scattering features and multi-band ratio features, calculate the suspended matter concentration inversion value and / or normalized differential spectral index based on multi-band reflectance, and generate a single detection feature vector by combining turbidity, conductivity and temperature. Input the feature vector of a single detection into the local evaluation model to obtain the cleanliness category and cleanliness score of the excrement in this instance; Multiple single-detection feature vectors within the same intestinal preparation process are combined into a time-series feature sequence and input into a time-series prediction model to obtain the probability of compliance and the trend of cleanliness changes; When the results of multiple consecutive tests, the probability of meeting the standard, the near-infrared particle scattering characteristics, the inversion value of suspended matter concentration or the normalized differential spectral index, the rate of change of turbidity and the deviation of conductivity all meet the threshold conditions, an assessment result is generated to show that the quality of bowel preparation meets the preset requirements. The assessment result, preparation progress and medical reminder are then output through the interactive terminal.

Citation Information

Patent Citations

  • Real-time intestinal tract cleanliness scoring system and method based on artificial intelligence

    CN110916606A

  • Industrial intelligent manufacturing edge computing task scheduling method

    CN114077491A

  • Smart toilet for human health monitoring

    US11604177B1

  • Health monitoring toilet

    WO2017027994A1