A machine vision-based duodenoscope reprocessing detection method

By using machine vision technology to acquire multi-angle light disturbance images on a duodenoscope, constructing brightness response features, and identifying and locating contaminated areas, the problem of low cleaning efficiency and misjudgment in traditional detection is solved, achieving high-precision identification and targeted cleaning of contaminated areas.

CN121120518BActive Publication Date: 2026-05-26南昌大学第一附属医院
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
南昌大学第一附属医院
Filing Date
2025-08-20
Publication Date
2026-05-26

Smart Images

  • Figure CN121120518B_ABST
    Figure CN121120518B_ABST
Patent Text Reader

Abstract

This invention discloses a machine vision-based method for detecting contaminant residues after duodenoscope reprocessing, specifically in the field of machine vision, to address the problem of accurately locating and removing contaminant residues after existing duodenoscope reprocessing. The method involves applying controlled incident angle, wavelength, and polarization state light perturbations to the outer surface and inner lumen of the duodenoscope, acquiring image sequences under perturbation, and extracting temporal brightness response features of pixel blocks. Brightness difference residuals and consistency weights are calculated at different incident angles to identify candidate abnormal regions and generate a difference map reflecting their response characteristics to a clean baseline. The difference map is segmented, analyzed for connectivity, and clustered. Combining three-dimensional coordinate continuity and surface normal consistency, the three-dimensional spatial boundary of the suspected contamination area is delineated. Within this range, directional cleaning and retesting are performed, with repeated detection until the contamination area disappears, achieving high-precision detection and efficient cleaning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision technology, and more specifically, to a machine vision-based method for reprocessing and detecting duodenoscopes. Background Technology

[0002] In the actual use of endoscopic equipment such as duodenoscopes, due to the need for multiple insertions into the patient's digestive tract in clinical settings, the outer surface and inner cavity of the equipment are highly susceptible to contamination from tissue fluid, blood, food residue, and other pollutants. These contaminants not only affect the clarity and color reproduction of subsequent image acquisition but may also cause optical reflection and scattering interference, resulting in abnormal local field-of-view brightness and distortion of structural details. In traditional manual inspection and cleaning procedures, fixed automated cleaning processes are typically used, and operators can only rely on visual observation or low-magnification examination to determine the presence of uncleaned contaminants. This method is prone to missed detections and misjudgments under complex lighting conditions, when contaminants exhibit weak contrast characteristics, or when their distribution is concealed. Furthermore, the surface structure of a duodenoscope has multiple curvature variations and complex microstructures, and contaminants may exhibit different optical responses at different incident angles after adhering, making it difficult for manual visual inspection to accurately identify the entire contaminated area from a single observation angle. Under the strict requirements of medical device cleaning and disinfection management, failure to detect the distribution of contaminants in a timely and accurate manner may lead to increased cleaning cycles, decreased equipment turnover efficiency, and even the risk of hospital-acquired infections.

[0003] Therefore, high-precision automated inspection of the surface and lumen of the duodenoscope before cleaning and reuse, especially the identification of contaminated areas by using multi-angle image acquisition and machine vision analysis under light disturbance, has become an important technical direction for improving the efficiency and reliability of cleaning inspection. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a machine vision-based method for reprocessing and detecting duodenoscopes to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] A machine vision-based method for reprocessing and detecting duodenoscopy, comprising the following steps:

[0007] S1. Apply a preset light perturbation to the outer surface and inner lumen of the duodenoscope, and acquire an image sequence under the light perturbation;

[0008] S2. Extract the brightness changes of each pixel block in the image sequence and construct temporal brightness response feature parameters by combining the light source perturbation time;

[0009] S3. Divide the image sequences under different incident angles and identify candidate abnormal regions based on the brightness difference residual;

[0010] S4. Based on the candidate abnormal region identification results, generate a map reflecting the difference in response characteristic parameters between the candidate abnormal region and the clean baseline state of the duodenoscope;

[0011] S5. Perform spatial connectivity analysis and pixel block clustering on the difference map to delineate the spatial boundaries of suspected contamination areas;

[0012] S6. Based on the three-dimensional spatial boundary of the suspected contamination area, perform targeted cleaning of the duodenoscope.

[0013] In a preferred embodiment, step S1, applying a preset illumination disturbance to the outer surface and inner lumen of the duodenoscope and acquiring an image sequence under the illumination disturbance specifically includes:

[0014] A preset light perturbation is sequentially applied to the detection areas of the outer surface and inner lumen of the duodenoscope using an adjustable light source array. The light perturbation parameters include the incident light angle, wavelength, and polarization state.

[0015] Under the influence of light disturbance, continuous image acquisition is performed on the detection area of ​​the outer surface and inner cavity, and the light disturbance parameters and timestamps corresponding to each frame of image are recorded during the acquisition process.

[0016] The recorded images, illumination perturbation parameters, and time information are stored in a structured manner according to the acquisition order to form an illumination perturbation image dataset covering the complete perturbation cycle.

[0017] In a preferred embodiment, step S2, extracting the brightness changes of each pixel block in the image sequence and constructing temporal brightness response feature parameters in conjunction with the light source perturbation time, specifically includes:

[0018] A pixel block location index is established for the illumination-perturbed image dataset, and the pixel brightness values ​​at the same index position within the perturbation period are extracted to form a brightness sequence of the pixel block;

[0019] A time-series response curve is constructed based on the brightness values ​​in the pixel block brightness sequence and their corresponding acquisition time order.

[0020] The brightness change rate, phase delay, and change amplitude parameters are calculated on the timing response curve, and the parameters are integrated and defined as the response characteristic parameters of the pixel block.

[0021] Synchronization processing is performed on all pixel blocks and the corresponding response feature parameters are extracted to generate a response feature set covering the detection area.

[0022] In a preferred embodiment, step S3, dividing the image sequence under different incident angles and identifying candidate abnormal regions based on brightness difference residuals, specifically includes:

[0023] Spatial registration is performed on the illumination-perturbed image dataset according to the pixel block position index to establish a unified reference system;

[0024] Under a unified reference frame, the response feature parameters of the same pixel block position index in the response feature set are arranged in order of incident angle to construct the incident angle channel.

[0025] The brightness difference values ​​between each angle are calculated in the incident angle channel to obtain the brightness difference sequence of the incident angle channel;

[0026] The brightness difference sequences corresponding to the position indices of all pixels are integrated, and a fitting process based on the incident angle is performed to obtain the fitting curve of the global brightness difference.

[0027] The brightness difference residual corresponding to the position index of each pixel block is calculated based on the fitted curve, and the consistency weight of the position indices of adjacent pixel blocks in the direction of residual change is extracted.

[0028] When the residual magnitude exceeds the set threshold and the consistency weight is lower than the set threshold, the corresponding pixel block position index is marked as a candidate abnormal region mask, and the corresponding pixel block position index is output in the structural reference system.

[0029] In a preferred embodiment, step S4, based on the candidate abnormal region identification results, specifically includes generating a difference map reflecting the response characteristic parameters of the candidate abnormal region and the duodenoscope clean baseline state, which specifically includes:

[0030] Extract the response feature parameters corresponding to the mask positions of candidate anomaly regions as a local feature vector set;

[0031] The local feature vector set is compared with the light field response feature matrix under the clean baseline state of the duodenoscope by vector-wise difference calculation to generate a difference feature matrix containing pixel block position index and difference value. The difference feature matrix is ​​then mapped into a difference map according to the pixel block position index.

[0032] In a preferred embodiment, the method for constructing the light field response feature matrix under the clean baseline state of the duodenoscope is as follows:

[0033] With the duodenoscope in a clean state free of contaminants, the same light perturbation as in S1 is applied, and a perturbation image sequence covering the detection area is acquired.

[0034] For the disturbed image sequence under clean conditions, the response feature parameters are extracted in the same way as in S2;

[0035] The response feature parameters under the clean state are mapped to a unified reference system according to the pixel block position index to generate the light field response feature matrix covering the detection area.

[0036] In a preferred embodiment, step S5, performing spatial connectivity analysis and pixel block clustering on the difference map to delineate the spatial boundaries of suspected contamination areas, specifically includes:

[0037] Perform binarization segmentation on the difference map based on a set threshold, and mark pixels with difference values ​​higher than the set threshold as abnormal pixel blocks;

[0038] In a two-dimensional plane, the connectivity between abnormal pixel blocks is calculated according to the eight-neighborhood connection rule, and the blocks are divided into a set of connected pixel blocks.

[0039] Clustering is performed on each set of connected pixel blocks to form a set of suspected contamination regions;

[0040] The suspected contamination area is remapped into the three-dimensional space of the duodenoscope, and the regions are merged according to the continuity of spatial coordinates and the consistency of surface normals to obtain the spatial boundary of the suspected contamination area.

[0041] In a preferred embodiment, the step of remapping the suspected contamination area onto the three-dimensional space of the duodenoscopy, and merging the regions based on spatial coordinate continuity and surface normal consistency to obtain the spatial boundary of the suspected contamination area specifically involves:

[0042] Based on the three-dimensional structural model of the duodenoscopy, the three-dimensional spatial coordinates of the pixel block in each suspected contamination area on the model surface are obtained;

[0043] The surface normal vector corresponding to each pixel block is calculated using the triangular mesh reconstruction method;

[0044] Determine whether adjacent suspected contamination areas meet a preset distance continuity threshold in three-dimensional spatial coordinates, and determine whether the surface normal angle between adjacent pixel blocks is less than a preset normal difference threshold.

[0045] Merging is performed on suspected contamination regions that simultaneously meet the conditions of distance continuity and normal difference threshold comparison to obtain the final three-dimensional spatial boundary of the suspected contamination region.

[0046] In a preferred embodiment, step S6, which involves directional cleaning of the duodenoscope based on the three-dimensional spatial boundary of the suspected contamination area, specifically includes:

[0047] Within the three-dimensional spatial boundary of the designated suspected contamination area, the duodenoscope was subjected to targeted cleaning, and local optical re-examination of the area was performed after cleaning.

[0048] Repeat the identification and targeted cleaning of suspected contamination areas until the suspected contamination areas disappear, at which point the reprocessing process ends.

[0049] The technical effects and advantages of the duodenoscopy reprocessing detection method based on machine vision of the present invention are as follows:

[0050] This invention provides a machine vision-based method for detecting duodenal endoscope reprocessing contamination. By acquiring image sequences of the duodenoscope from multiple incident angles under illumination disturbance conditions, pixel-level temporal brightness response features are constructed. Brightness difference residuals are then used to identify candidate abnormal regions, significantly improving the detection sensitivity for weak contrast and concealed contamination. Based on candidate abnormal regions, this method generates a difference map reflecting the response characteristic parameters compared to a clean baseline state. Combined with spatial connectivity analysis and clustering, the boundaries of suspected contamination areas are precisely delineated, achieving accurate three-dimensional positioning of contaminated areas. This avoids missed detections and misjudgments caused by single observation angles and subjective judgment in traditional manual detection. Compared to methods relying on manual visual inspection, this invention not only has significant advantages in detection accuracy but also enables automated scanning of large-area surfaces and lumens in a shorter time, improving the efficiency of contamination assessment before equipment cleaning, reducing unnecessary repeated cleaning, and lowering equipment turnaround time and labor costs. Simultaneously, the contamination spatial boundary information provided by this method can be directly used for targeted cleaning, achieving precise allocation of cleaning resources and targeted contamination removal, improving the safety and traceability of the reprocessing process, and meeting the high standards required for medical device cleaning and disinfection. Attached Figure Description

[0051] Figure 1 This is a schematic diagram of a duodenoscope reprocessing detection method based on machine vision according to the present invention. Detailed Implementation

[0052] 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 some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0053] Example 1

[0054] Figure 1 This invention presents a machine vision-based method for reprocessing and detecting duodenoscopes, comprising the following steps:

[0055] S1. Apply a preset light perturbation to the outer surface and inner lumen of the duodenoscope, and acquire an image sequence under the light perturbation;

[0056] S2. Extract the brightness changes of each pixel block in the image sequence and construct temporal brightness response feature parameters by combining the light source perturbation time;

[0057] S3. Divide the image sequences under different incident angles and identify candidate abnormal regions based on the brightness difference residual;

[0058] S4. Based on the candidate abnormal region identification results, generate a map reflecting the difference in response characteristic parameters between the candidate abnormal region and the clean baseline state of the duodenoscope;

[0059] S5. Perform spatial connectivity analysis and pixel block clustering on the difference map to delineate the spatial boundaries of suspected contamination areas;

[0060] S6. Based on the three-dimensional spatial boundary of the suspected contamination area, perform targeted cleaning of the duodenoscope.

[0061] In step S1, a preset light perturbation is applied to the outer surface and inner lumen of the duodenoscope, and an image sequence under the light perturbation is acquired.

[0062] A controllable light source array is used to perform area-by-area illumination perturbation on the outer surface and inner lumen of the duodenoscope. The light source array consists of multiple independently controllable light-emitting units, and the emission direction, emission wavelength, and polarization state of each light-emitting unit can be adjusted individually to ensure that the target area can be fully covered by optical scanning according to the detection requirements.

[0063] Before testing, the arrangement and irradiation path of the light source array are precisely set according to the geometry of the duodenoscope and the spatial distribution of its outer surface and inner lumen. For example, for the outer surface of the endoscope, the angle of the incident light is gradually changed by axial rotation scanning to ensure that the light can cover surface details at different radii of curvature. For the inner lumen, multiple reflection irradiation paths need to be set in combination with the direction of the end opening and the curved structure of the inner wall to ensure that the light can enter and irradiate all blind spots of the inner wall. The incident light angle should be set to cover a range from near normal incident to a large tilt angle to obtain sufficient information on the variation in reflection and scattering characteristics. The incident angle range is set to 0°-75°, and sequentially switched in 15° increments. The wavelength parameters are selected based on the spectral response differences of the target contaminant or surface features, for example, switching between 450nm (blue light), 550nm (green light), and 650nm (red light) to enhance the contrast between the contaminant and the background material under different spectral conditions. The polarization state can be set in two forms: linear polarization and circular polarization. The direction of linear polarization can be changed by adjusting the rotation angle of the polarizer, for example, by switching sequentially at four angles: 0°, 45°, 90°, and 135°. This allows the detector to capture differences in polarization response caused by surface roughness, liquid film, or particle deposition. In actual operation, the light source array switches the incident light angle, wavelength, and polarization state sequentially according to a pre-planned sequence. The illumination duration for each parameter combination should be controlled within a stable exposure cycle (default 50 ms to 200 ms) to ensure that the camera module can acquire images without jitter or brightness fluctuations under stable illumination conditions.

[0064] To ensure that the acquired images accurately reflect changes in surface optical properties caused by illumination disturbances, each switch of light source parameters is strictly synchronized with the imaging trigger signal. That is, image acquisition only begins after the light source array has completed a new parameter setting. This avoids image distortion caused by unstable illumination conditions. Each image frame contains not only the brightness information of the pixel array but also records the illumination disturbance parameters at the time of acquisition, including the specific values ​​of the incident light angle, wavelength, and polarization state. The recorded images, illumination disturbance parameters, and time information are structured and stored in the order of acquisition, creating a complete metadata description for each image frame to form an illumination disturbance image dataset covering the entire disturbance cycle.

[0065] In step S2, the brightness changes of each pixel block in the image sequence are extracted, and the time-series brightness response feature parameters are constructed by combining the light source disturbance time.

[0066] After the structured storage of the illumination-perturbed image dataset is completed, precise block division and indexing are performed on the pixel space of the detection region. Specifically, the image plane of the detection region is divided into several regular pixel blocks according to a predetermined spatial resolution. The size of each pixel block needs to be determined comprehensively based on the imaging resolution and the scale of contaminant features. For example, in an image with a resolution of 1920×1080 pixels, it can be divided into square pixel blocks with a side length of 8 pixels. This maintains sufficient local detail while achieving a balance between computational complexity and feature stability. After partitioning, a unique spatial location index is assigned to each pixel block. This index is composed of row and column numbers and remains unchanged throughout the entire perturbation period. Next, based on the location index of the pixel block, the brightness values ​​corresponding to the same pixel block at different acquisition times are retrieved sequentially in the illumination-perturbed image dataset. The brightness value is obtained by weighted averaging of the brightness components (such as the Y component or grayscale value) of all pixels within the pixel block. The weights are flexibly set based on the pixel contrast, with the default setting being an equal-weighted average to ensure that the brightness value stably reflects the overall optical response of the pixel block. The brightness values ​​are recorded sequentially according to time, forming a brightness change sequence for the pixel block within a complete perturbation period. For example, if the perturbation period contains 60 sets of illumination parameter combinations, each pixel block will correspond to a brightness sequence of length 60. The brightness sequence extraction method based on spatial indexing transforms two-dimensional image spatial information into one-dimensional temporal data, providing a direct data foundation for subsequent dynamic feature calculations and supporting continuous tracking and analysis of the optical response at the same physical location across time points.

[0067] After obtaining the brightness sequence of all pixel blocks, these discrete brightness values ​​are paired with their corresponding acquisition timestamps, and the brightness change curve of the pixel block within the perturbation period is plotted in chronological order, which is the time-series response curve. The horizontal axis of the curve represents the acquisition time (accurate to the millisecond level), and the vertical axis represents the brightness value. Each point on the curve corresponds to a brightness measurement result under specific lighting conditions. To reduce noise interference, a low-pass filter is used to smooth the brightness sequence before plotting the curve, making the curve shape more reflective of the true optical response trend rather than instantaneous fluctuations. The purpose of the time-series response curve is to visualize the dynamic process of brightness change under lighting perturbation and to provide a continuous change trajectory for quantitative analysis. The curve shape can be used to intuitively judge the sensitivity of a pixel block to changes in different lighting parameters: if the curve shows obvious fluctuations when lighting conditions change, it indicates that the reflection, scattering, or absorption characteristics of the area are significantly coupled with the lighting conditions, which is often directly related to surface material characteristics or contaminants; conversely, if the curve shape is flat and the change amplitude is small, it may mean that the area has a uniform and clean background material. In addition, the timing response curve can also reveal the phase lag phenomenon, that is, the peak or valley of the brightness change has a time delay relative to the switching time of the illumination disturbance. This may be related to the multiple scattering of the surface microstructure, thin film interference, or the optical lag effect caused by the adsorption layer.

[0068] After constructing the time-series response curve, quantitative analysis was performed to extract key numerical features describing the optical response characteristics of the pixel block. First, the rate of brightness change was obtained by dividing the difference in brightness values ​​between adjacent sampling points of the curve by the time interval. This parameter reflects the speed of brightness change and is crucial for identifying fast optical responses (such as highly reflective contaminant particles) or slow responses (such as areas covered by liquid films). Second, the phase delay was calculated by aligning the time-series curve with the time series of the illumination perturbation control signal, obtained by detecting the time difference between the peak point of the curve and the moment of perturbation change. For example, if the incident angle of illumination changes at a certain moment, and the peak brightness of the curve appears 20 milliseconds later, then the phase delay parameter is 20 milliseconds. This type of delay is used to infer the thickness characteristics of the multilayer dielectric structure or contaminant layer on the surface. The amplitude parameter was obtained by calculating the difference between the maximum and minimum brightness values ​​of the curve within the perturbation period. This parameter directly reflects the sensitivity of the pixel block to illumination perturbations; a high amplitude indicates significant differences in surface optical properties under different illumination conditions. After calculating the above three parameters, they are combined into a three-dimensional feature vector, which serves as the response feature parameter for that pixel block. This calculation process is then executed synchronously on all pixel blocks within the entire detection area to obtain a response feature set covering the entire detection area. This feature set provides quantitative input for subsequent differential analysis, spatial clustering, and delineation of contaminated area boundaries.

[0069] In step S3, image sequences under different incident angles are divided, and candidate abnormal regions are identified based on the brightness difference residual.

[0070] After completing the pixel block position indexing and response feature parameter extraction for the detection area, spatial registration is required for the illumination-perturbed image dataset to ensure spatial comparability of data from multiple incident angles. The goal of spatial registration is to eliminate pixel position drift caused by minute displacements, optical distortions, or changes in mirror attitude during imaging, thereby ensuring that pixel blocks at the same physical location are strictly aligned in a unified reference frame under different illumination incident angles. Specifically, a high-quality, structurally clear, and motion-blur-free reference image is selected as the baseline frame. This reference image is typically taken from a moment when illumination conditions are uniform during the perturbation period. For each frame in the illumination-perturbed image dataset, global and local structural feature points, such as edge corners, texture intersections, or high-gradient regions, are extracted and matched with corresponding feature points in the baseline frame. Histogram of Oriented Gradients (HOG) matching is used to obtain stable spatial correspondences even with brightness variations. After matching is complete, the pixel grid in the frame image is mapped to the coordinate system of the reference frame through affine or perspective transformation, and the registered pixel indexes are registered one-to-one with the original indices. Through this process, all frame images in the entire illumination perturbation image dataset are unified under the same spatial reference system, thereby ensuring that the brightness differences calculated at different incident angles all originate from the same physical location, rather than spurious changes introduced by imaging geometric errors.

[0071] After spatial registration, the response feature parameters of the same position index within the response feature set are arranged sequentially according to the incident angle in a unified reference frame, forming an incident angle channel. This incident angle order originates from the illumination perturbation control sequence, extracting a series of discrete incident angle sampling points obtained by sequentially changing the azimuth and elevation angles of the illumination source during detection. For each pixel block position index, each element in its incident angle channel corresponds to a brightness response value at a specific incident angle. Next, within the same incident angle channel, a difference operation is performed on the brightness values ​​corresponding to adjacent angles to obtain a brightness difference value sequence for that pixel block under different incident angle variations. The brightness difference value sequence reflects the sensitivity of surface optical properties to changes in the incident direction and is highly sensitive for identifying contaminants or defect areas with directional reflection and scattering characteristics. To grasp the trend of brightness difference changes from a global perspective, the brightness difference values ​​corresponding to all pixel block position indices are collected and statistically integrated according to the incident angle dimension. The integrated data typically represents the overall distribution of brightness difference as a function of the incident angle. By fitting this distribution with a polynomial fitting function, a fitting curve for the global brightness difference is obtained. This curve smooths out local noise fluctuations and represents the regularity of the response of the incident angle to the overall brightness difference, providing a unified reference baseline for residual calculation.

[0072] For each pixel block location index, the actual brightness difference value sequence within the incident angle channel is compared item by item with the predicted brightness difference at the corresponding angle position on the fitted curve. The difference between the two is calculated, and this difference is the brightness difference residual. The sign and magnitude of the residual reflect the directional and amplitude deviations of the brightness difference change of that pixel block, respectively. To improve the accuracy of identifying suspected contamination areas, it is necessary to analyze the spatial consistency of the residuals, that is, the degree of correlation between adjacent pixel blocks in the direction of residual change. In practice, the proportion of residuals with consistent signs can be calculated for each pair of adjacent pixel blocks, and this proportion can be recorded as a consistency weight. When the direction of pixel block residual change in a certain area is highly consistent and deviates significantly from the global trend, it is very likely to correspond to actual abnormal structures such as surface contamination, scratches, or foreign matter attachment.

[0073] The threshold for residual amplitude determination was calibrated using experimental samples during the development phase. For example, when inspecting the surface of a duodenoscope with different levels of contamination, the residual amplitude distribution between normal / clean areas and contaminated areas was statistically analyzed, and the boundary value that could stably distinguish between the two was determined as the residual amplitude threshold. After obtaining the residual amplitude determination result, the consistency weight corresponding to the position index of each pixel block was read simultaneously. This weight reflects the degree of consistency between the pixel block and its neighboring pixel blocks in the direction of residual change. A higher consistency weight means that the pixel block is in a region with the same trend of change over a large area, while a lower consistency weight indicates that the trend of change of the pixel block is significantly different from that of the surrounding pixels. To avoid misjudging large areas of normal regions or local texture features as contamination, a lower limit determination of the consistency weight was added to the candidate abnormal region screening. This lower limit threshold was obtained through experimental calibration, for example, by calculating the consistency weight distribution between the actual contaminated points and the background area in multiple batches of clean and contaminated samples, and taking the value that can effectively remove isolated background noise points as the threshold. When the residual magnitude of a pixel block location index is greater than a preset residual threshold, and its consistency weight is lower than a preset consistency weight threshold, it meets the dual conditions for being designated as a candidate anomalous region. In this case, the system will directly mark the pixel block location index as an anomalous mask point in the structural reference frame and record it in the candidate anomalous region mask dataset.

[0074] In step S4, based on the candidate abnormal region identification results, a difference map reflecting the response characteristic parameters of the candidate abnormal region and the duodenoscope clean baseline state is generated.

[0075] The system reads the position indices of all labeled pixel blocks in the candidate anomaly region mask, with each index uniquely corresponding to the specific physical location of the duodenoscopy detection area. The system then locates the response feature parameters obtained during illumination disturbance detection at each corresponding location. These parameters include the rate of brightness change, phase delay, and amplitude of change, all calculated based on the pixel brightness time series in the aforementioned response feature extraction step. These parameters characterize the dynamic response characteristics of the pixel at that location within a complete illumination disturbance cycle. The response feature parameters extracted at each location are combined into a feature vector, with each component of the feature vector corresponding to the three feature indices mentioned above, forming a data unit with a fixed structure. These data units are then stored sequentially in a feature set, which is the local feature vector set.

[0076] After establishing the local feature vector set, the light field response characteristics of the same detection area in a clean state without contaminant adhesion are obtained as the benchmark for differential calculation. In this embodiment, the duodenoscope is restored to a clean state or an unused device is used directly, in which there are no stains, residual droplets, scratches, or attached particles on the outer surface and inner lumen. To ensure the accuracy of the benchmark state, the cleaning process must be strictly carried out in accordance with the medical device disinfection specifications, and no visible residues must be confirmed by independent detection methods. After the clean state is confirmed, the detection area is irradiated again using the same light perturbation method as in step S1. The perturbation parameters include the light incident angle, light source wavelength, and polarization state, and the perturbation sequence, amplitude, and duration must be completely consistent with the previous detection to ensure the comparability of the two detection data. During the light perturbation process, a perturbation image sequence covering the entire detection area is acquired according to a predetermined acquisition frequency, and the perturbation parameters and timestamp information corresponding to each frame of the image are recorded. These images and their metadata are stored in a structured manner to form a light perturbation image dataset in a clean state. Subsequently, referring to the processing method in step S2 above, response feature parameters such as the rate of brightness change, phase delay, and magnitude of change are extracted pixel by pixel from the image dataset under the clean state, forming a complete baseline response feature set. To ensure direct alignment with the local feature vector set in subsequent analysis, this baseline feature set is mapped to a unified structure reference system identical to the candidate anomaly region according to the pixel block location index, generating a light field response feature matrix covering the detection area. Each row or column of this matrix (the specific storage structure can be determined according to implementation requirements) corresponds to a pixel block location index, and the matrix elements are the response feature values ​​at that location under the clean state.

[0077] After obtaining the local feature vector set (from the mask positions of candidate anomaly regions) and the light field response feature matrix under clean conditions, differential calculation is performed to quantify the difference between the current detection state and the baseline state. In this embodiment, for each feature vector in the local feature vector set, the corresponding baseline feature vector is found in the light field response feature matrix according to its pixel block position index. Before differential calculation, normalization processing needs to be performed on each sub-parameter. In this embodiment, the linear minimum-maximum normalization method is used to map the value range of the same type of sub-parameter under all pixel block position indices to the interval [0,1]. For example, the normalization formula for the brightness change rate is: the velocity value of each pixel block minus the global minimum velocity value, and then divided by the difference between the global maximum and minimum velocity values ​​to obtain the dimensionless velocity value; the normalization process for phase delay and change amplitude is the same. Through this processing, each sub-parameter is converted into a dimensionless value and falls within the same numerical range. After normalization, element-wise difference operations are performed on the feature vector of each pixel block in the local feature vector set and the feature vector of the corresponding pixel block position index under the clean baseline state. This yields the dimensionless difference results of the pixel block in three dimensions: brightness change rate, phase delay, and change amplitude. To form a comprehensive difference value, this embodiment performs weighted summation on the three-dimensional difference results. The weights can be preset according to the sensitivity of each sub-parameter to pollutant identification in the actual detection scenario. For example, the weight of brightness change rate can be set to 0.4, phase delay to 0.3, and change amplitude to 0.3. The result of the weighted calculation is the comprehensive difference value of the pixel block. This value is dimensionless and can be directly used for spatial mapping and visualization. Finally, the comprehensive dimensionless difference values ​​corresponding to the position indices of all pixel blocks are bound to their spatial coordinates to generate a difference feature matrix, which is then mapped to a difference map. In the difference map, the magnitude of the difference value is visually displayed through color gradients. For example, areas with a difference value close to 0 are displayed as dark blue, and areas with a difference value close to 1 are displayed as bright yellow, thus visually reflecting the locations that differ significantly from the clean baseline state.

[0078] In step S5, spatial connectivity analysis and pixel block clustering are performed on the difference map to delineate the spatial boundaries of suspected contamination areas.

[0079] After generating the difference map and obtaining the comprehensive dimensionless difference value corresponding to the location index of each pixel block, this embodiment performs a binarization segmentation operation on the difference map based on a set threshold. The threshold is set by combining a large amount of comparative sample data of known contaminated and clean states, calculating a histogram of difference value distribution, and selecting the segmentation point that can effectively distinguish contaminated pixels from uncontaminated pixels as a fixed threshold. For example, when statistics show that the difference values ​​of pixels in contaminated areas are mostly concentrated in the range of 0.65 to 1.00, while the difference values ​​of pixels in uncontaminated areas are concentrated in the range of 0 to 0.45, the threshold can be set to 0.55, thus directly identifying pixels with difference values ​​higher than 0.55 as abnormal pixel blocks during segmentation. The principle of this process is to utilize the strong correlation between difference values ​​and contaminant adhesion, mapping continuous difference intensity information into binary "contaminated / uncontaminated" labels for subsequent spatial structure analysis. After binarization, each pixel block in the difference map is assigned a value of 0 or 1, where a pixel block with a value of 1 represents an abnormal area with a difference value higher than the threshold, and a pixel block with a value of 0 represents a normal area.

[0080] After binarization, connectivity analysis is performed on anomalous pixel blocks in the binary image within a two-dimensional plane. The specific method for connectivity analysis is as follows: an eight-neighborhood connection rule is adopted. For each anomalous pixel block, the eight adjacent pixel blocks in the eight directions (vertical, horizontal, left, and four diagonal directions) are checked to see if they are also anomalous pixel blocks. If the value of adjacent pixel blocks is 1, they are considered to belong to the same connected region. This rule is superior to the four-neighborhood rule because the eight-neighborhood rule can identify pixel connections in the diagonal direction, thus ensuring that connectivity is not broken even when the actual contaminated area boundary exhibits a diagonal expansion or elongated shape. A recursive traversal algorithm is used to group all interconnected anomalous pixel blocks into a single connected pixel block set. The core principle of this process is to treat spatially contacting or only one pixel apart anomalous regions as the same structural unit, thereby accurately reconstructing the overall spatial distribution contour of contaminants on the mirror surface.

[0081] After obtaining multiple sets of connected pixel blocks, each set is further clustered to form the final set of suspected contamination regions. The clustering process includes: first, extracting spatial feature parameters for each set of connected pixel blocks, such as the number of pixel blocks (area), the aspect ratio of the bounding rectangle, the centroid coordinates, and the mean and variance of pixel intensity; then, inputting these features into the clustering algorithm for automatic grouping. A density-based clustering method is used, which groups closely spaced and densely packed sets together, while labeling isolated small sets as noise or independent categories. The effect of clustering is that for regions in actual detection scenarios caused by the same contamination source but segmented into multiple independent connected sets due to local illumination or imaging resolution variations, the clustering algorithm can recombine them into a more realistic suspected contamination region; at the same time, for contaminants that are geographically independent and have significantly different characteristics, they remain as multiple independent suspected regions.

[0082] After completing the two-dimensional detection and clustering of suspected contamination areas, a three-dimensional spatial localization operation is performed on the pixel blocks within each suspected contamination area based on the three-dimensional structural model of the duodenoscope. The three-dimensional structural model consists of the geometric shape data and luminal morphology data of the duodenoscope. This data can be obtained from high-precision three-dimensional scanning, structured light measurement, or laser contour scanning, and undergoes coordinate unification processing to ensure that each two-dimensional pixel position is accurately mapped to the corresponding three-dimensional spatial coordinate point on the model surface. In practice, the previously established unified reference system is first used to match the pixel block position index of the suspected contamination area with the model's mapping table to obtain the coordinate representation of each pixel block on the three-dimensional surface. This mapping process maintains a one-to-one correspondence between the two-dimensional detection results and the three-dimensional geometric surface.

[0083] After obtaining the 3D spatial coordinates of pixel blocks within each suspected contamination area, the surface normal vectors corresponding to these pixel blocks on the model surface are calculated using a triangular mesh reconstruction method. The principle of triangular mesh reconstruction is to group discrete spatial coordinate points into non-overlapping triangular units according to certain connection rules, thereby approximately reconstructing the local surface morphology of the suspected contamination area. Specifically, the Delaunay triangulation surface reconstruction is first performed on the pixel block coordinates of each suspected contamination area to form a compact and geometrically continuous triangular patch network. Then, using the coordinates of the three vertices of each triangular face, the normal vector of that triangular face is calculated using the vector cross product formula. Finally, the normal vectors of adjacent triangular faces are weighted and averaged to obtain the surface normal vector of the corresponding pixel block position. This process ensures that each pixel block not only has spatial location attributes but also includes geometric parameters that accurately describe the orientation of the local surface, providing a reliable normal information basis for subsequent judgments on whether two contamination areas belong to the same continuous contamination zone.

[0084] Given three-dimensional spatial coordinates and surface normal vectors, spatial relationships between adjacent suspected contamination areas are determined. This involves two aspects: distance continuity and normal difference constraints. The distance continuity threshold is set by combining the projected area of ​​a single pixel block on the duodenoscope surface in real physical space with the sampling interval, setting a spatial distance value that reflects the continuous proximity of the surface, for example, 0.8 mm. When the nearest spatial distance between the boundary pixel blocks of two suspected contamination areas is less than this threshold, they are considered spatially continuous or close, possibly belonging to the same contamination zone. The normal difference threshold is set by statistically analyzing the range of normal variation in adjacent areas on a clean surface, and considering the characteristic that the surface orientation difference is usually small when contaminants adhere to the same surface area, setting an upper limit, for example, 15°. When the angle between the normals of adjacent pixel blocks in two suspected contamination areas is less than this threshold, they are considered to be on a continuous surface with consistent geometric orientation. During the merging judgment, when two suspected contamination areas simultaneously satisfy the above distance continuity and normal difference conditions, they are merged into a new suspected contamination area. The merged region is then recalculated in the 3D model to determine its overall spatial boundary. This boundary is formed by the outer envelope of the 3D coordinates of all merged pixel blocks, and the complete spatial outline can be obtained using a convex hull calculation algorithm. This process eliminates region fragmentation caused by projection distortion, occlusion, or lighting variations during 2D detection, while accurately restoring the true distribution range of pollutants on a 3D spatial scale.

[0085] In step S6, the duodenoscope is cleaned in a targeted manner based on the three-dimensional spatial boundary of the suspected contamination area.

[0086] After determining the three-dimensional spatial boundary of the suspected contamination area, targeted cleaning is performed on the duodenoscope surface covered by this boundary. The core of targeted cleaning is to utilize the determined three-dimensional spatial boundary as the cleaning target area, concentrating the energy, position, and force of the cleaning operation on the curved surface segment where the suspected contamination area is located. This avoids ineffective cleaning of clean areas, reduces overall cleaning time, and lowers cleaning fluid consumption. In practice, guided by the color gradient of the duodenoscope's differential image, the working end of the cleaning nozzle, brush head, or ultrasonic vibrating head is positioned to the suspected contamination area for targeted cleaning. The coordinates of this position are directly converted from the spatial points output by the three-dimensional model into physical operation reference coordinates.

[0087] After cleaning, local optical retesting is performed within the same three-dimensional spatial boundary to verify whether the cleaning effect meets the standard. The retesting process follows the illumination disturbance imaging and feature extraction process of the contamination identification stage, but the imaging range is strictly limited to the area that was just cleaned, and the detection conditions such as light source intensity, incident angle, and acquisition frequency are kept completely consistent with those during contamination identification to ensure the comparability of the retesting results. The disturbance image sequence acquired during the retesting process is precisely registered to the pixel block position index under a unified reference system, and then the local response feature parameters are calculated and vector-wise differencing is performed with the light field response feature matrix of the clean baseline state to obtain the difference feature matrix and difference map. This difference map directly shows the distribution of residual contamination in the area after cleaning. When there are pixel blocks with difference values ​​exceeding a set threshold, it can be confirmed that there is still contaminant residue in the area. After completing one cleaning and retesting, the process enters the cyclic processing stage. If the retesting finds that there is still contaminant, the three-dimensional spatial boundary of the suspected contamination area is redefined based on the latest difference map, and the aforementioned directional cleaning and retesting process is executed again. There is no upper limit to the number of times the loop is executed. The area can be considered completely clean only when the retest results show that the difference value of all pixel blocks in the polluted area is lower than the set threshold and no new pollution signal appears in two consecutive retests.

[0088] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.

[0089] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0090] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0091] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0092] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0093] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0094] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0095] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0096] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0097] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A machine vision-based method for reprocessing and detecting duodenoscopes, characterized in that, Includes the following steps: S1. Apply a preset light perturbation to the outer surface and inner lumen of the duodenoscope, and acquire an image sequence under the light perturbation; S2. Extract the brightness changes of each pixel block in the image sequence and construct temporal brightness response feature parameters by combining the light source perturbation time; S3. Divide the image sequences under different incident angles and identify candidate abnormal regions based on the brightness difference residual; S4. Based on the candidate abnormal region identification results, generate a map reflecting the difference in response characteristic parameters between the candidate abnormal region and the clean baseline state of the duodenoscope; S5. Perform spatial connectivity analysis and pixel block clustering on the difference map to delineate the spatial boundaries of suspected contamination areas; S6. Based on the three-dimensional spatial boundary of the suspected contamination area, perform targeted cleaning of the duodenoscope; In step S3, dividing the image sequence under different incident angles and identifying candidate abnormal regions based on brightness difference residuals specifically includes: Spatial registration is performed on the illumination-perturbed image dataset according to the pixel block position index to establish a unified reference system; Under a unified reference frame, the response feature parameters of the same pixel block position index in the response feature set are arranged in order of incident angle to construct the incident angle channel. The brightness difference values ​​between each angle are calculated in the incident angle channel to obtain the brightness difference sequence of the incident angle channel; The brightness difference sequences corresponding to the position indices of all pixels are integrated, and a fitting process based on the incident angle is performed to obtain the fitting curve of the global brightness difference. The brightness difference residual corresponding to the position index of each pixel block is calculated based on the fitted curve, and the consistency weight of the position indices of adjacent pixel blocks in the direction of residual change is extracted. When the residual magnitude exceeds the set threshold and the consistency weight is lower than the set threshold, the corresponding pixel block position index is marked as a candidate abnormal region mask, and the corresponding pixel block position index is output in the structural reference system.

2. The duodenoscopy reprocessing detection method based on machine vision according to claim 1, characterized in that, In step S1, applying a preset illumination disturbance to the outer surface and inner lumen of the duodenoscope and acquiring an image sequence under the illumination disturbance specifically includes: A preset light perturbation is sequentially applied to the detection areas of the outer surface and inner lumen of the duodenoscope using an adjustable light source array. The light perturbation parameters include the incident light angle, wavelength, and polarization state. Under the influence of light disturbance, continuous image acquisition is performed on the detection area of ​​the outer surface and inner cavity, and the light disturbance parameters and timestamps corresponding to each frame of image are recorded during the acquisition process. The recorded images, illumination perturbation parameters, and time information are stored in a structured manner according to the acquisition order to form an illumination perturbation image dataset covering the complete perturbation cycle.

3. The duodenoscopy reprocessing detection method based on machine vision according to claim 1, characterized in that, In step S2, extracting the brightness changes of each pixel block in the image sequence and constructing temporal brightness response feature parameters by combining the light source perturbation time specifically includes: A pixel block location index is established for the illumination-perturbed image dataset, and the pixel brightness values ​​at the same index position within the perturbation period are extracted to form a brightness sequence of the pixel block; A time-series response curve is constructed based on the brightness values ​​in the pixel block brightness sequence and their corresponding acquisition time order. The brightness change rate, phase delay, and change amplitude parameters are calculated on the timing response curve, and the parameters are integrated and defined as the response characteristic parameters of the pixel block. Synchronization processing is performed on all pixel blocks and the corresponding response feature parameters are extracted to generate a response feature set covering the detection area.

4. The duodenoscopy reprocessing detection method based on machine vision according to claim 1, characterized in that, In step S4, generating a difference map reflecting the response characteristic parameters of the candidate abnormal region compared to the clean baseline state of the duodenoscope, based on the candidate abnormal region identification results, specifically includes: Extract the response feature parameters corresponding to the mask positions of candidate anomaly regions as a local feature vector set; The local feature vector set is compared with the light field response feature matrix under the clean baseline state of the duodenoscope by vector-wise difference calculation to generate a difference feature matrix containing pixel block position index and difference value. The difference feature matrix is ​​then mapped into a difference map according to the pixel block position index.

5. The duodenoscopy reprocessing detection method based on machine vision according to claim 4, characterized in that, The method for constructing the light field response feature matrix under the clean baseline state of the duodenoscopy is as follows: With the duodenoscope in a clean state free of contaminants, the same light perturbation as in S1 is applied, and a perturbation image sequence covering the detection area is acquired. For the disturbed image sequence under clean conditions, the response feature parameters are extracted in the same way as in S2; The response feature parameters under the clean state are mapped to a unified reference system according to the pixel block position index to generate the light field response feature matrix covering the detection area.

6. The duodenoscopy reprocessing detection method based on machine vision according to claim 1, characterized in that, In step S5, spatial connectivity analysis and pixel block clustering are performed on the difference map to delineate the spatial boundaries of suspected contamination areas. Specifically, this includes: Perform binarization segmentation on the difference map based on a set threshold, and mark pixels with difference values ​​higher than the set threshold as abnormal pixel blocks; In a two-dimensional plane, the connectivity between abnormal pixel blocks is calculated according to the eight-neighborhood connection rule, and the blocks are divided into a set of connected pixel blocks. Clustering is performed on each set of connected pixel blocks to form a set of suspected contamination regions; The suspected contamination area is remapped into the three-dimensional space of the duodenoscope, and the regions are merged according to the continuity of spatial coordinates and the consistency of surface normals to obtain the spatial boundary of the suspected contamination area.

7. The duodenoscopy reprocessing detection method based on machine vision according to claim 6, characterized in that, The process of remapping the suspected contamination area onto the three-dimensional space of the duodenoscopy, and merging the regions based on the continuity of spatial coordinates and the consistency of surface normals, to obtain the spatial boundary of the suspected contamination area is as follows: Based on the three-dimensional structural model of the duodenoscopy, the three-dimensional spatial coordinates of the pixel block in each suspected contamination area on the model surface are obtained; The surface normal vector corresponding to each pixel block is calculated using the triangular mesh reconstruction method; Determine whether adjacent suspected contamination areas meet a preset distance continuity threshold in three-dimensional spatial coordinates, and determine whether the surface normal angle between adjacent pixel blocks is less than a preset normal difference threshold. Merging is performed on suspected contamination regions that simultaneously meet the conditions of distance continuity and normal difference threshold comparison to obtain the final three-dimensional spatial boundary of the suspected contamination region.

8. The duodenoscopy reprocessing detection method based on machine vision according to claim 1, characterized in that, In step S6, the targeted cleaning of the duodenoscope based on the three-dimensional spatial boundary of the suspected contamination area specifically includes: Within the three-dimensional spatial boundary of the designated suspected contamination area, the duodenoscope was subjected to targeted cleaning, and local optical re-examination of the area was performed after cleaning. Repeat the identification and targeted cleaning of suspected contamination areas until the suspected contamination areas disappear, at which point the reprocessing process ends.