Diabetes urine sugar rapid detection method based on image recognition

By using the multi-color space collaborative branching and difference-sensitive fusion structure of the DCPNet network, the problem of inaccurate segmentation of urine glucose test strips in complex environments is solved, achieving high-precision urine glucose concentration identification and reliable detection results.

CN121599963BActive Publication Date: 2026-05-08LIAONING PROVINCE JINQIU HOSPITAL
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LIAONING PROVINCE JINQIU HOSPITAL
Filing Date
2026-01-16
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Under complex shooting environments and equipment variations, existing technologies for urine glucose test strip image recognition are unable to effectively cope with color distortion and brightness fluctuations, resulting in unclear segmentation between the reaction area and the background area, making it difficult to achieve high-precision urine glucose concentration identification.

Method used

Using the DCPNet network based on RGB, HSV and Lab color spaces, robust segmentation and high-confidence recognition of the reaction zone of urine glucose test strips are achieved through multi-color space collaborative branching and difference-sensitive fusion structure, combined with morphological optimization and geometric prior rules.

Benefits of technology

It significantly improves the recognition accuracy and concentration level classification robustness of urine glucose test strips under different equipment and lighting conditions, reduces the missegmentation rate, and improves the segmentation accuracy and concentration level classification reliability of the detection system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121599963B_ABST
    Figure CN121599963B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on image recognition's diabetes urine sugar rapid detection method, comprising: generating quality control image data;Obtain three color space image data set;Obtain reaction zone final positioning data;Generate reaction zone three color space image data;Improved DCPNet three color space perception network is constructed, and RGB branch feature data, HSV branch feature data and Lab branch feature data are obtained;RGB branch feature data, HSV branch feature data and Lab branch feature data are input into cross color space attention fusion module, and fusion feature data is generated;Fusion feature data is input into main feature coding network, and depth fusion feature data is obtained, and is input into classification branch and regression branch, and generates standardization detection result data.The application better satisfies the automation detection demand in the scene of family self-test, primary health care and remote health management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of diabetes technology, and in particular to a rapid method for detecting urinary glucose in diabetes based on image recognition. Background Technology

[0002] With the popularization of mobile health monitoring and home-based self-medical monitoring, the method of capturing and automatically identifying and analyzing urine glucose test strip images based on portable terminals has received widespread attention in the field of diabetes auxiliary diagnosis and management. As an in vitro diagnostic chemical colorimetric carrier, urine glucose test strips need to achieve automatic segmentation of the reaction area, color discrimination and concentration output through image acquisition equipment. However, existing technologies generally have technical bottlenecks under the actual application conditions of complex shooting environment, equipment differences and subtle color changes.

[0003] Most existing urine glucose test strip image recognition methods use global threshold segmentation or simple feature extraction in a single color space, which is difficult to effectively deal with color distortion and brightness fluctuations caused by multi-source heterogeneous factors in home or grassroots scenarios. This leads to a decrease in the distinction between the reaction area and the background and reference color band, and is prone to over-segmentation, under-segmentation or blurred boundaries and misjudgment.

[0004] Traditional processes based on fixed segmentation, manual features, and static grade mapping have limited effectiveness in distinguishing subtle differences in color grades on urine glucose test strips. Because the color changes in the reaction area of ​​urine glucose test strips exhibit multi-level gradations and subtle differences in saturation, it is difficult to achieve high-precision end-to-end closed-loop identification between weak positive and low concentration grades using only single-channel or coarse-grained features. Furthermore, existing end-to-end models are mostly single-task and single-space input models that lack cross-color space fusion and color development specificity enhancement mechanisms, making it difficult to guarantee the reliability of identification under the challenges of small targets, strong interference, and extremely subtle color differences. Summary of the Invention

[0005] One objective of this invention is to propose a rapid detection method for diabetic urine glucose based on image recognition. This invention better meets the automated detection needs in scenarios such as home self-testing, primary healthcare, and remote health management.

[0006] A rapid method for detecting diabetic urine glucose based on image recognition according to an embodiment of the present invention includes:

[0007] Acquire urine glucose test strip image data and perform image preprocessing to generate quality control image data;

[0008] The RGB color space image data of the quality control image data is retained, and the quality control image data is converted into HSV color space image data and Lab color space image data respectively, resulting in a set of three color space image data;

[0009] Perform HSV adaptive segmentation on the HSV color space image data to obtain the final location data of the reaction area;

[0010] Based on the final location data of the reaction zone, the data is simultaneously cropped from the three-color space image dataset to generate three-color space image data of the reaction zone.

[0011] An improved DCPNet three-color-space perception network is constructed, including an RGB color space branch feature encoder, an HSV color space branch feature encoder, and a Lab color space branch feature encoder. The three color space image data of the reaction area are input into the corresponding color space branch feature encoders to obtain RGB branch feature data, HSV branch feature data, and Lab branch feature data.

[0012] The RGB branch feature data, HSV branch feature data, and Lab branch feature data are input into the cross-color space attention fusion module to generate fused feature data.

[0013] The fused feature data is input into the backbone feature encoding network to obtain deep fused feature data, which is then input into the classification and regression branches to output urine glucose concentration level data and urine glucose concentration numerical data. The urine glucose concentration level data and urine glucose concentration numerical data are combined with the standard color card mapping relationship data to generate standardized test result data.

[0014] Optionally, the construction of the three-color space image data set includes:

[0015] Perform a color space decomposition operation on the quality control image data to preserve the original RGB color space image data of the quality control image data;

[0016] Convert quality control image data from RGB color space image data to HSV color space image data;

[0017] Convert quality control image data from RGB color space image data to Lab color space image data;

[0018] Image data in RGB color space, HSV color space, and Lab color space are stored together to form a set of image data in three color spaces.

[0019] Optionally, the extraction of the final location data of the reaction zone includes:

[0020] Based on HSV color space image data, calculate the adaptive threshold in HSV space for each pixel;

[0021] The saturation and brightness channel values ​​in the HSV color space image data are compared with the corresponding adaptive thresholds in the HSV space for each pixel.

[0022] When the saturation channel value is greater than or equal to the average value of the saturation channel values ​​in the local neighborhood and the luminance channel value is greater than or equal to the average value of the luminance channel values ​​in the local neighborhood, and the sum of the saturation channel value and the luminance channel value is greater than or equal to the adaptive threshold in HSV space, the corresponding pixel is assigned a value of 1; otherwise, it is assigned a value of 0, thus obtaining the preliminary binary mask data.

[0023] Morphological structural constraint operations are performed based on the initial binary mask data to obtain morphologically optimized mask data.

[0024] Perform connected component analysis on morphologically optimized masked data to extract a set of connected regions;

[0025] For each connected region in the set of connected regions, calculate its boundary rectangle;

[0026] Based on the geometric prior rules of the urine glucose test strip, screening criteria are set, including area threshold, aspect ratio threshold range and position constraint range. The boundary rectangles of each connected region in the connected region set are screened to obtain a set of candidate regions that meet the conditions and their corresponding boundary rectangles.

[0027] For each region in the candidate region set, calculate the boundary sharpness index based on the corresponding boundary rectangle;

[0028] All regions in the candidate region set are sorted according to the boundary sharpness index. The region with the highest boundary sharpness index and its corresponding boundary rectangle are selected as the final location region of the reaction area. The coordinate data of the boundary rectangle of the candidate region are output as the final location data of the reaction area.

[0029] Optionally, the generation of the three-color space image data of the reaction region includes:

[0030] Based on the coordinates of the boundary rectangle recorded in the final positioning data of the reaction area, all pixels within the boundary rectangle are cropped from the RGB color space image data, HSV color space image data and Lab color space image data respectively, to obtain the RGB color space image data, HSV color space image data and Lab color space image data of the reaction area.

[0031] The RGB color space image data, HSV color space image data, and Lab color space image data of the reaction zone are uniformly packaged and stored to form a three-color space image data set for the reaction zone.

[0032] Optionally, the improved DCPNet three-color space perception network includes:

[0033] Construct differentiated RGB color space branch feature encoders, HSV color space branch feature encoders, and Lab color space branch feature encoders. Input the RGB color space image data, HSV color space image data, and Lab color space image data of the reaction area into the differentiated RGB color space branch feature encoders, HSV color space branch feature encoders, and Lab color space branch feature encoders, respectively, and output RGB branch feature data, HSV branch feature data, and Lab branch feature data, respectively.

[0034] Optionally, the RGB color space branch feature encoder includes:

[0035] The RGB color space image data of the reaction area is subjected to grayscale fusion processing to obtain a grayscale color image;

[0036] A weighted edge map is obtained by performing multi-scale Sobel gradient operator operations on the grayscale color image;

[0037] Global-local contrast processing is performed on the RGB color space image data of the reaction area to obtain local contrast map and global contrast map. The local contrast map and global contrast map are combined into a multi-channel contrast feature map by channel splicing and then max pooling is performed to obtain the spliced ​​pooled multi-channel contrast feature map.

[0038] Color uniformity detection was performed on the RGB color space image data of the reaction area to obtain a color shift map;

[0039] The weighted edge map, multi-channel contrast feature map, and color shift map are multi-scale feature stitched together and channel fused, and then input into the backbone convolutional layer of the RGB color space branch feature encoder to obtain RGB branch feature data.

[0040] Optionally, the HSV color space branch feature encoder includes:

[0041] Extract the saturation channel value and brightness channel value of each pixel in the HSV color space image data of the reaction area, and calculate the pixel-level saturation-brightness joint response factor.

[0042] Divide the brightness channel value of the current pixel by the global mean of the brightness channel of the reaction area to obtain the normalized matrix of the overall brightness distribution of the reaction area.

[0043] Perform channel recalibration on the input HSV color space image data and calculate the color constancy residual map;

[0044] The pixel-level saturation-luminance joint response factor, luminance distribution normalization matrix, and color constancy residual map are remapped in a multi-scale space and used as a gating weight matrix in the backbone feature extraction channel of the HSV color space branch feature encoder. Pixel-level weight modulation is applied to the output features of each convolution layer, and the HSV branch feature data is generated after pixel-level weight modulation.

[0045] Optionally, the Lab color space branch feature encoder includes:

[0046] Channel decomposition processing was performed on the Lab color space image data of the reaction area to extract the lightness channel value, red-green channel value and yellow-blue channel value of each pixel, forming a lightness channel map, a red-green channel map and a yellow-blue channel map;

[0047] Multi-scale spatial convolution is performed on the brightness channel image, red-green channel image, and yellow-blue channel image respectively to obtain brightness perception feature map, red-green perception feature map, and yellow-blue perception feature map;

[0048] The dynamic weighted pooling weight matrix is ​​obtained by calculating the ΔE color difference between the brightness channel value, red-green channel value, and yellow-blue channel value of each pixel and the Lab reference color value at the corresponding position on the clinical standard color chart.

[0049] The brightness perception feature map, red-green perception feature map, and yellow-blue perception feature map are multiplied pixel by pixel with the dynamic weighted pooling weight matrix to obtain the brightness pooling feature map, red-green pooling feature map, and yellow-blue pooling feature map after color difference perception enhancement.

[0050] The luminance pooling feature map, red-green pooling feature map, and yellow-blue pooling feature map after color difference perception enhancement are concatenated along the channel dimension to form a multi-channel Lab color difference enhancement feature map. The multi-channel Lab color difference enhancement feature map is then input into the backbone convolutional layer of the Lab color space branch feature encoder to generate Lab branch feature data.

[0051] Optionally, the cross-color space attention fusion module includes:

[0052] Spatial and channel alignment are performed on the RGB branch feature data, HSV branch feature data, and Lab branch feature data to obtain the RGB aligned feature tensor, HSV aligned feature tensor, and Lab aligned feature tensor.

[0053] Local color space response features and global color space statistical features are extracted from the RGB alignment feature tensor, HSV alignment feature tensor, and Lab alignment feature tensor, respectively. The RGB attention weight tensor, HSV attention weight tensor, and Lab attention weight tensor are then calculated.

[0054] The RGB alignment feature tensor, HSV alignment feature tensor, and Lab alignment feature tensor are weighted and reconstructed to generate the RGB attention-enhanced feature tensor, HSV attention-enhanced feature tensor, and Lab attention-enhanced feature tensor, respectively.

[0055] Cross-spatial difference enhancement fusion is performed on the RGB attention-enhanced feature tensor, HSV attention-enhanced feature tensor, and Lab attention-enhanced feature tensor to generate fused feature data;

[0056] Optionally, the generation of the standardized test result data includes:

[0057] The fused feature data is input into the backbone feature encoding network to generate deep fused feature data;

[0058] Input the deep fusion feature data into the classification branch and output the urine glucose concentration level data;

[0059] Input the deeply fused feature data into the regression branch, and output the numerical data of urine glucose concentration;

[0060] By combining urine glucose concentration level data with urine glucose concentration numerical data and standard color chart mapping data, standardized test result data is generated. The standardized test result data is output by the following logic:

[0061] If the urine glucose concentration level data is negative and the urine glucose concentration value is less than the negative upper limit threshold in the standard color chart, the standardized test result data will be output as negative and the corresponding value and threshold range will be given.

[0062] If the urine glucose concentration level data is weakly positive, and the urine glucose concentration value data is within the concentration range corresponding to weak positive in the standard color card, then the standardized test result data will output as weakly positive and provide an explanation of the range of the corresponding value and threshold.

[0063] If the urine glucose concentration level data is 1+ or higher, and the urine glucose concentration values ​​fall within the corresponding concentration range of their respective standard color cards, then the standardized test result data will be output at the corresponding level, along with the actual value, level range, and concentration description.

[0064] If the urine glucose concentration level data is inconsistent with the urine glucose concentration numerical data, or if the numerical data falls within the critical range of any colorimetric level, the standardized test result will be output as critical or uncertain, and a repeat test or manual verification will be required.

[0065] The beneficial effects of this invention are:

[0066] This invention significantly improves the robustness of identifying subtle color differences through multi-color space collaborative branches and a difference-sensitive fusion structure. It employs an improved DCPNet three-color space perception network and designs dedicated feature encoders for RGB, HSV, and Lab color spaces to address color drift in the urine glucose test strip reaction area under different equipment and lighting conditions. These encoders achieve cross-color space feature fusion through pixel-level spatial alignment, channel alignment, and dynamic allocation of attention weights. Each branch incorporates domain knowledge to set convolutional structures and feature enhancement mechanisms. The Lab branch introduces ΔE color difference weighted pooling, the HSV branch sets saturation-brightness gating and color constancy residual correction, and the RGB branch strengthens the edge contrast between the color development area and the background and reference color bands. Through cross-space attention fusion and mutual information enhancement modules, it can collaboratively suppress subtle color difference missegmentation, color band swapping, and weak color misjudgment caused by environmental factors, test strip batches, and equipment white balance. This achieves high-confidence recognition even under extremely subtle color development level changes in the urine glucose test strip, significantly improving the overall detection system's segmentation accuracy and concentration level classification robustness.

[0067] In the reaction zone localization process, this invention introduces a dynamic threshold generation method based on local saturation and brightness statistics in HSV space, and combines it with the geometric prior rules and boundary clarity ranking of urine glucose test strips to achieve robust segmentation of the reaction zone in complex backgrounds. Through morphological optimization, connected component screening, geometric feature screening, and joint decision-making based on boundary clarity index, it effectively eliminates missegmentation caused by strong interference, weak contrast backgrounds, and blurred edges. The segmentation results show a significant improvement in the adaptability to environmental changes and the accuracy of ROI extraction, greatly reducing the missegmentation and missed segmentation rates, and ensuring accurate input for feature extraction and concentration determination.

[0068] This invention employs a deep fusion feature network to jointly output classification and regression branches via a backbone feature encoding network, obtaining urinary glucose concentration level data and urinary glucose concentration numerical data respectively. Standardized test results for levels and values ​​are output through a standard color chart mapping relationship. The multi-branch structure and standard color chart mapping mechanism can automatically correct easily confused scenarios, improve the discrimination ability of low concentration and weak positive intervals, and support the output of confidence and reference intervals for levels and values. This effectively enhances the clinical interpretability and traceability of urinary glucose test results, better meeting the automated testing needs in home self-testing, primary healthcare, and remote health management scenarios. Attached Figure Description

[0069] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0070] Figure 1 This is a flowchart of a rapid method for detecting diabetic urine glucose based on image recognition proposed in this invention; Figure 2 This is a schematic diagram of the differentiated structure of the RGB, HSV, and Lab three-branch feature encoders in the improved DCPNet three-color space perception network in the image recognition-based rapid detection method for diabetes urine glucose proposed in this invention. Detailed Implementation Example

[0071] refer to Figure 1 A rapid method for detecting diabetic urine glucose based on image recognition, comprising:

[0072] Acquire urine glucose test strip image data and perform image preprocessing to generate quality control image data, and perform imaging quality assessment on the quality control image data;

[0073] In Example 1, the processing of urine glucose test strip image data includes:

[0074] Acquire urine glucose test strip image data, perform geometric distortion correction, white balance correction, brightness equalization, noise suppression, sharpness enhancement and gamma correction on the urine glucose test strip image data, and generate quality control image data;

[0075] The image quality is evaluated on the quality control image data, and the image quality evaluation result data is generated. If the image quality evaluation result data is lower than the preset threshold, a re-shoot prompt is output and the current detection process is terminated; otherwise, the process proceeds to the next step.

[0076] While retaining the RGB color space image data corresponding to the quality control image data, the quality control image data is converted into HSV color space image data and Lab color space image data respectively, resulting in a set of three color space image data.

[0077] In this embodiment, the construction of the three-color space image data set includes:

[0078] Perform a color space decomposition operation on the quality control image data to preserve the original RGB color space image data of the quality control image data;

[0079] RGB color space image data represents the numerical components of each pixel in the red, green, and blue channels. The red channel values ​​reflect the red information of the pixel, the green channel values ​​reflect the green information of the pixel, and the blue channel values ​​are used to represent the blue information of the pixel.

[0080] Convert quality control image data from RGB color space image data to HSV color space image data. ;

[0081] In Example 1, HSV color space image data represents the numerical components of each pixel in the hue, saturation, and lightness channels. The hue channel value reflects the color type of the pixel, the saturation channel value reflects the color purity of the pixel, and the lightness channel value reflects the brightness of the pixel. The calculation of the hue, saturation, and lightness channel values ​​all depend on the maximum, minimum, and difference measure relationship between the numerical components of each pixel in the red, green, and blue channels. The conversion relationship is based on the following mapping function: ;

[0082] ;

[0083] ;in, Indicates a measure of color difference. and These represent the maximum and minimum channel values ​​of a pixel, respectively. , , These represent the red, green, and blue channel values ​​of a pixel, respectively. , , These represent the hue, saturation, and lightness channel values ​​of a pixel in the HSV color space; the quality control image data is converted from RGB color space image data to Lab color space image data. ;

[0084] In Example 1, Lab color space image data represents the numerical components of each pixel in the lightness channel, red-green channel, and yellow-blue channel. The lightness channel value reflects the overall brightness of the pixel, the red-green channel value reflects the color change of the pixel in the red-to-green direction, and the yellow-blue channel value reflects the color change of the pixel in the yellow-to-blue direction. The calculation of the lightness channel value, red-green channel value, and yellow-blue channel value is based on the standardized linear color value of each pixel in the red, green, and blue channels. The red, green, and blue channel values ​​are standardized by performing a linear transformation to obtain the three standardized primary color components. The standardized three primary color components are then transformed by a linear matrix to obtain the chromaticity components in the XYZ space. The chromaticity components are then non-linearly mapped using a reference white point standard to obtain the lightness channel value, red-green channel value, and yellow-blue channel value. ;

[0085] in, The normalized linear red, green, and blue channel values, ranging from 0 to 11, are mapped to the Lab color space using the following function: ; ;in, Represents pixels In the Lab color space, the lightness channel value, ranging from 0 to 100, represents the brightness. Represents pixels In the Lab color space, the red-green channel values ​​represent the color shift from green to red. Represents pixels In the Lab color space, the yellow-blue channel values ​​represent the color shift from blue to yellow. Represents pixels The three components in the CIEXYZ color space This represents the non-linear mapping function in Lab color space conversion. This represents the boundary threshold in Lab color space conversion. This represents the standard value of the reference white point in the XYZ space.

[0086] Image data in RGB color space, HSV color space, and Lab color space are stored together to form a set of image data in three color spaces.

[0087] Based on the HSV color space image data, an adaptive threshold is calculated. Combined with the preset morphological structure constraints and the geometric prior rules of the urine glucose test strip, HSV adaptive segmentation is performed on the HSV color space image data to obtain candidate region data of the reaction area. Connectivity analysis, boundary refinement and geometric consistency screening are performed on the candidate region data of the reaction area to obtain the final location data of the reaction area.

[0088] In this embodiment, the extraction of the final location data of the reaction zone includes:

[0089] Based on HSV color space image data, calculate the adaptive threshold in HSV space for each pixel;

[0090] The adaptive threshold in HSV space is obtained by a weighted combination of the average value of the saturation channel and the average value of the luminance channel in the local neighborhood centered on the pixel.

[0091] The saturation and brightness channel values ​​in the HSV color space image data are compared with the corresponding adaptive thresholds in the HSV space for each pixel.

[0092] When the saturation channel value is greater than or equal to the average value of the saturation channel values ​​in the local neighborhood and the luminance channel value is greater than or equal to the average value of the luminance channel values ​​in the local neighborhood, and the sum of the saturation channel value and the luminance channel value is greater than or equal to the adaptive threshold in HSV space, the corresponding pixel is assigned a value of 1; otherwise, it is assigned a value of 0, thus obtaining the preliminary binary mask data.

[0093] Based on the initial binary mask data, morphological structural constraint operations are performed to obtain morphologically optimized mask data;

[0094] Morphological structure constraint operations include closing operations and erosion operations, which eliminate small-sized noise regions and fill isolated voids in the reaction zone.

[0095] Perform connected component analysis on morphologically optimized masked data to extract a set of connected regions;

[0096] Each connected region in the set of connected regions represents a set of candidate reaction region pixels.

[0097] For each connected region in the set of connected regions, calculate its boundary rectangle;

[0098] The boundary rectangle includes the minimum and maximum boundary coordinates of the connected region. The minimum and maximum boundary coordinates are used to construct geometric constraints.

[0099] Based on the geometric prior rules of the urine glucose test strip, screening criteria are set, including area threshold, aspect ratio threshold range and position constraint range. The boundary rectangles of each connected region in the connected region set are screened to obtain a set of candidate regions that meet the conditions and their corresponding boundary rectangles.

[0100] In Example 1, screening criteria are set according to the geometric prior rules of the urine glucose test strip. For each connected region in the set of connected regions, the area value is calculated based on the number of pixels in the connected region. The width, height and aspect ratio are calculated based on the boundary rectangle of the connected region. The position of the boundary rectangle is determined based on its coordinate information to see if it falls within the preset effective area. Only when the area value of the connected region is greater than or equal to the area threshold, the aspect ratio is within the aspect ratio threshold range, and the position of the boundary rectangle meets the position constraint range, the connected region and its boundary rectangle are retained together as candidate regions and corresponding boundary rectangles that meet the conditions. All connected regions and their boundary rectangles that meet the area threshold, aspect ratio threshold range and position constraint range are screened to obtain the candidate region set and its corresponding boundary rectangle.

[0101] For each region in the candidate region set, calculate the boundary sharpness index based on the corresponding boundary rectangle;

[0102] The boundary sharpness index is calculated based on the mean gradient values ​​of the region edges using the Sobel gradient operator. The mean edge gradient value is obtained by averaging the sum of the absolute values ​​of the horizontal and vertical grayscale intensity changes of all pixels within the region. ;in, For boundary clarity indicators, This represents the intensity value of the original quality control image data in the grayscale channel. Indicates candidate region Total number of pixels within the unit.

[0103] All regions in the candidate region set are sorted according to the boundary sharpness index. The region with the highest boundary sharpness index and its corresponding boundary rectangle are selected as the final location region of the reaction area. The coordinate data of the boundary rectangle of the candidate region are output as the final location data of the reaction area.

[0104] Based on the final positioning data of the reaction zone, the data is simultaneously cropped from the three-color space image data set to generate three-color space image data of the reaction zone. The three-color space image data of the reaction zone includes RGB color space image data of the reaction zone, HSV color space image data of the reaction zone and Lab color space image data of the reaction zone.

[0105] In this embodiment, the generation of the three-color space image data of the reaction region includes:

[0106] Based on the coordinates of the boundary rectangle recorded in the final positioning data of the reaction area, all pixels within the boundary rectangle are cropped from the RGB color space image data, HSV color space image data and Lab color space image data respectively, to obtain the RGB color space image data, HSV color space image data and Lab color space image data of the reaction area.

[0107] The RGB color space image data of the reaction area represents the numerical components of each pixel within the reaction area in the red, green, and blue channels. The HSV color space image data of the reaction area represents the numerical components of each pixel within the reaction area in the hue, saturation, and lightness channels. The Lab color space image data of the reaction area represents the numerical components of each pixel within the reaction area in the lightness, red-green, and yellow-blue channels. The minimum and maximum boundary coordinates of the boundary rectangle together determine the spatial range of the reaction area.

[0108] The RGB color space image data, HSV color space image data, and Lab color space image data of the reaction zone are uniformly packaged and stored to form a three-color space image data set for the reaction zone.

[0109] The three-color space image data set of the reaction area is used as input to the improved DCPNet three-color space perception network to ensure that the spatial range of the reaction area in the three color spaces of RGB, HSV and Lab is completely consistent, so as to realize the collaborative expression and difference discrimination of the color features of the reaction area of ​​urine glucose test strip in multiple color spaces.

[0110] An improved DCPNet three-color space perception network is constructed, which includes an RGB color space branch feature encoder, an HSV color space branch feature encoder, and a Lab color space branch feature encoder. The three color space image data of the reaction area are input into the corresponding color space branch feature encoders to obtain RGB branch feature data, HSV branch feature data, and Lab branch feature data.

[0111] refer to Figure 2 In this embodiment, the improved DCPNet three-color space perception network includes:

[0112] Construct differentiated RGB color space branch feature encoders, HSV color space branch feature encoders, and Lab color space branch feature encoders. Input the RGB color space image data, HSV color space image data, and Lab color space image data of the reaction area into the differentiated RGB color space branch feature encoders, HSV color space branch feature encoders, and Lab color space branch feature encoders, respectively, and output RGB branch feature data, HSV branch feature data, and Lab branch feature data, respectively.

[0113] In this embodiment, the RGB color space branch feature encoder includes:

[0114] The RGB color space image data of the reaction area is subjected to grayscale fusion processing to obtain a grayscale color image;

[0115] The grayscale colorimetric image highlights the original contrast characteristics between the reaction area and the background area of ​​the urine glucose test strip. The grayscale colorimetric image is obtained by weighting the red channel value, green channel value and blue channel value of each pixel.

[0116] A weighted edge map is obtained by performing multi-scale Sobel gradient operator operations on the grayscale color image;

[0117] The weighted edge map is used to enhance the edge response of the urine glucose test strip edge structure, reaction area outline and reference color band. It is obtained by calculating the gray-level gradient value of each pixel in the horizontal and vertical directions, squaring the gray-level gradient values ​​in the two directions respectively, adding them together and performing a square root operation.

[0118] Global-local contrast processing is performed on the RGB color space image data of the reaction area to obtain local contrast map and global contrast map. The local contrast map and global contrast map are combined into a multi-channel contrast feature map by channel splicing and then max pooling is performed to obtain the spliced ​​pooled multi-channel contrast feature map.

[0119] In Example 1, global-local contrast refers to simultaneously calculating the grayscale contrast characteristics of the RGB color space image data of the reaction area at different spatial scales:

[0120] The local contrast map reflects the dispersion of the gray value of each pixel within its neighborhood range compared to the average gray value of the current neighborhood. The local contrast map calculates the difference between the gray values ​​of all pixels within a window of a preset size centered on each pixel and the average gray value of the current window, and measures the intensity of local gray-level changes within the current window in root mean square form, thus obtaining the gray-level contrast characteristics of different small areas within the reaction area. The global contrast map reflects the overall dispersion of the gray values ​​of all pixels in the reaction area. The global contrast map calculates the difference between the gray values ​​of all pixels in the reaction area and the overall gray-level average of the reaction area, and measures it in root mean square form, thus obtaining the overall gray-level contrast characteristics of the reaction area.

[0121] By stitching the local contrast map and the global contrast map together by channel and unifying the feature scale through max pooling, the grayscale contrast feature is enhanced to distinguish between weakly colored areas and strongly interfering background areas within the reaction area, thereby achieving the synergistic expression and significant fusion of global and local contrast information.

[0122] Color uniformity detection was performed on the RGB color space image data of the reaction area to obtain a color shift map;

[0123] The color shift map detects the colorimetric isomerism of the reaction area of ​​urine glucose test strips caused by uneven drug diffusion or light shift. It is obtained by calculating the absolute difference between the value of each pixel in the red, green and blue channels and the average value in the local neighborhood of the corresponding channel, and adding the absolute differences of the red, green and blue channels.

[0124] The weighted edge map, multi-channel contrast feature map, and color shift map are multi-scale feature stitched together and channel fused, and then input into the backbone convolutional layer of the RGB color space branch feature encoder to obtain RGB branch feature data.

[0125] In Example 1, the weighted edge map, multi-channel contrast feature map, and color shift map are used as input feature channels, and multi-scale feature concatenation is performed to form a fused feature tensor. The fused feature tensor is formed by sequentially concatenating the weighted edge map, multi-channel contrast feature map, and color shift map along the channel dimension, ensuring that the correspondence of each feature in the spatial dimension is completely consistent. The fused feature tensor is input into the backbone convolutional layer of the RGB color space branch feature encoder. The backbone convolutional layer uses multiple convolutional units to perform layer-by-layer feature extraction and information interaction on the fused feature tensor. The convolution operation of the backbone convolutional layer extracts edge detail information, contrast grading information, and color change information from the fused feature tensor through different convolutional kernel scales, realizing the effective fusion of multi-scale information. The backbone convolutional layer outputs RGB branch feature data with structural edge perception, contrast grading, and enhanced color stability capabilities.

[0126] In this embodiment, the HSV color space branch feature encoder includes:

[0127] Extract the saturation channel value and brightness channel value of each pixel in the HSV color space image data of the reaction area, and calculate the pixel-level saturation-brightness joint response factor.

[0128] The pixel-level saturation-brightness joint response factor is used to dynamically adjust the feature expression intensity of different pixels in the color display area. It is obtained by multiplying the saturation channel value of the current pixel with the preset saturation weight coefficient, multiplying the brightness channel value of the current pixel with the preset brightness weight coefficient, adding the two and adding a bias term to perform a Sigmoid activation operation. The pixel-level saturation-brightness joint response factor has a dimensionless value between zero and one.

[0129] Divide the brightness channel value of the current pixel by the global mean of the brightness channel of the reaction area to obtain the normalized matrix of the overall brightness distribution of the reaction area.

[0130] The brightness distribution normalization matrix is ​​used to measure the degree of deviation of a pixel from the average brightness.

[0131] Perform channel recalibration on the input HSV color space image data and calculate the color constancy residual map;

[0132] The color constancy residual map suppresses color drift interference caused by differences in device white balance and changes in natural light. It is obtained by multiplying the absolute value of the difference between the current pixel's tone channel value and the global mean of the tone channel in the reaction area with the value of the luminance distribution normalization matrix. The value of the color constancy residual map represents the degree of deviation of the current pixel under color constancy.

[0133] The pixel-level saturation-luminance joint response factor, luminance distribution normalization matrix, and color constancy residual map are remapped in a multi-scale space and used as a gating weight matrix in the backbone feature extraction channel of the HSV color space branch feature encoder. Pixel-level weight modulation is applied to the output features of each convolution layer, and the HSV branch feature data is generated after pixel-level weight modulation.

[0134] In Example 1, the pixel-level saturation-luminance joint response factor, luminance distribution normalization matrix, and color constancy residual map are subjected to multi-scale spatial remapping processing. Specifically, convolution or pooling operations at different spatial scales are applied to the pixel-level saturation-luminance joint response factor, luminance distribution normalization matrix, and color constancy residual map to obtain multiple sets of weighted feature maps. The weighted feature maps at each scale are concatenated according to pixel space and channel dimension to form a multi-scale gated weight matrix. The multi-scale gated weight matrix is ​​then multiplied pixel-by-pixel and channel-by-channel by the feature map output from the HSV color space branch feature encoder backbone convolutional layer to achieve pixel-level weight modulation. The feature map after pixel-level weight modulation is the HSV branch feature data. The HSV branch feature data is used for multi-color space collaborative expression and the task of recognizing extremely subtle color differences in diabetic urine glucose test strip images.

[0135] In this embodiment, the Lab color space branch feature encoder includes:

[0136] Channel decomposition processing was performed on the Lab color space image data of the reaction area to extract the lightness channel value, red-green channel value and yellow-blue channel value of each pixel, forming a lightness channel map, a red-green channel map and a yellow-blue channel map;

[0137] Multi-scale spatial convolution is performed on the brightness channel image, red-green channel image, and yellow-blue channel image respectively to obtain brightness perception feature map, red-green perception feature map, and yellow-blue perception feature map;

[0138] Multi-scale spatial convolution employs convolution kernels of different scales to capture scale-sensitive features of brightness variation, red-green difference variation, and yellow-blue difference variation in urine glucose test strip images under conditions of weakened color development or background interference.

[0139] The dynamic weighted pooling weight matrix is ​​obtained by calculating the ΔE color difference between the brightness channel value, red-green channel value, and yellow-blue channel value of each pixel and the Lab reference color value at the corresponding position on the clinical standard color chart.

[0140] ΔE color difference indicates the degree of difference between the color change of each pixel in the color development area of ​​the urine glucose test strip and the reference color of the clinical standard color card. The larger the ΔE color difference, the higher the clinical diagnostic discrimination of the pixel in the color development area.

[0141] The brightness perception feature map, red-green perception feature map, and yellow-blue perception feature map are multiplied pixel by pixel with the dynamic weighted pooling weight matrix to obtain the brightness pooling feature map, red-green pooling feature map, and yellow-blue pooling feature map after color difference perception enhancement.

[0142] The pooled feature map enhanced by ΔE color difference perception highlights the feature expression ability of clinically significant color difference areas, while suppressing redundant expression in areas with weak color development and background interference areas.

[0143] The brightness pooling feature map, red-green pooling feature map and yellow-blue pooling feature map after color difference perception enhancement are concatenated according to the channel dimension to form a multi-channel Lab color difference enhancement feature map. The multi-channel Lab color difference enhancement feature map is then input into the backbone convolutional layer of the Lab color space branch feature encoder to generate Lab branch feature data.

[0144] Lab branch feature data has a high sensitivity to identify and discriminate weakened color development, abnormal background interference, and subtle clinical-grade color difference changes in urine glucose test strip images.

[0145] The RGB branch feature data, HSV branch feature data, and Lab branch feature data are input into the cross-color space attention fusion module to perform cross-color space feature alignment, weight allocation, and difference enhancement to generate fused feature data.

[0146] This implementation significantly improves the robustness of identifying subtle color differences by employing a multi-color space collaborative branching and difference-sensitive fusion structure. It utilizes an improved DCPNet three-color space perception network and designs dedicated feature encoders for RGB, HSV, and Lab color spaces to address color drift in the urine glucose test strip's reaction area under different device and lighting conditions. These encoders achieve cross-color space feature fusion through pixel-level spatial alignment, channel alignment, and dynamic allocation of attention weights. Each branch incorporates domain knowledge to set up convolutional structures and feature enhancement mechanisms. The Lab branch introduces ΔE color difference weighted pooling, the HSV branch sets saturation-brightness gating and color constancy residual correction, and the RGB branch strengthens the edge contrast between the color development area and the background and reference color bands. Through cross-space attention fusion and mutual information enhancement modules, it can collaboratively suppress subtle color difference missegmentation, color band swapping, and weak color misjudgment caused by environmental factors, test strip batches, and device white balance. This achieves high-confidence recognition even under extremely subtle color development level changes in the urine glucose test strip, significantly improving the overall detection system's segmentation accuracy and concentration level classification robustness.

[0147] In this embodiment, the cross-color space attention fusion module includes:

[0148] Spatial and channel alignment are performed on the RGB branch feature data, HSV branch feature data, and Lab branch feature data to obtain the RGB aligned feature tensor, HSV aligned feature tensor, and Lab aligned feature tensor.

[0149] Spatial alignment unifies the feature maps of the three color space branches into a scale proportional to the input image through interpolation upsampling. Channel alignment transforms the number of feature channels output by different branches into a uniform number of channels using convolutional mapping.

[0150] Local color space response features and global color space statistical features are extracted from the RGB alignment feature tensor, HSV alignment feature tensor, and Lab alignment feature tensor, respectively. The RGB attention weight tensor, HSV attention weight tensor, and Lab attention weight tensor are then calculated.

[0151] In Example 1, for each color space alignment feature tensor, the mean, variance, and maximum value of each pixel in the color space channel are calculated in the local neighborhood to obtain the local color space response features. The local color space response features represent the color consistency, local color difference changes, and small-scale color mutations of the current pixel in the spatial neighborhood.

[0152] For each color space aligned feature tensor, calculate the global mean, global variance, and global extremum of each channel across the entire reaction space to obtain global color space statistical features. These global color space statistical features represent the overall color distribution characteristics of the current color space at the global scale, including the distribution of dominant colors, color saturation, and brightness concentration.

[0153] The local color space response features and global color space statistical features are combined into channel-level fusion features through feature concatenation. The features are then transformed through a fully connected neural network, and the output is a normalized weight coefficient vector with a length equal to the number of channels in the color space. After being activated by Softmax, the normalized weight coefficient vector becomes the attention weight tensor of the corresponding color space.

[0154] Each attention weight tensor has a dimensionless value between zero and one, and the sum of the attention weights of all channels is equal to one, thus achieving dynamic weighted adjustment of the contribution of different color space channels.

[0155] The RGB alignment feature tensor, HSV alignment feature tensor, and Lab alignment feature tensor are weighted and reconstructed to generate the RGB attention-enhanced feature tensor, HSV attention-enhanced feature tensor, and Lab attention-enhanced feature tensor, respectively.

[0156] Weighted reconstruction involves performing a channel-wise and pixel-wise weighted product operation on the RGB alignment feature tensor and its corresponding RGB attention weight tensor to obtain the RGB attention-enhanced feature tensor. Similarly, the HSV and Lab branch features are respectively subjected to a weighted product operation on their HSV attention weight tensor and Lab attention weight tensor to obtain the HSV attention-enhanced feature tensor and the Lab attention-enhanced feature tensor.

[0157] Cross-spatial difference enhancement fusion is performed on the RGB attention-enhanced feature tensor, HSV attention-enhanced feature tensor, and Lab attention-enhanced feature tensor to generate fused feature data;

[0158] In Example 1, cross-space feature mutual information enhancement processing is performed on the RGB attention-enhanced feature tensor, HSV attention-enhanced feature tensor, and Lab attention-enhanced feature tensor. The channel mutual information enhancement factor between each pair of color spaces is calculated. The channel mutual information enhancement factor measures the significant difference between channels of different color spaces. The calculation of the mutual information enhancement factor includes calculating the joint probability distribution and marginal probability distribution of the channel features at the corresponding position for each pair of RGB, HSV, and Lab as a unit. The information gain is measured by the logarithmic relationship. The obtained mutual information enhancement factor is used as the fusion weight coefficient to adjust the feature response of each of the three color spaces.

[0159] The RGB attention-enhanced feature tensor, HSV attention-enhanced feature tensor, and Lab attention-enhanced feature tensor, which have been adjusted by mutual information enhancement, are concatenated along the channel dimension to obtain a preliminary concatenated feature tensor. The concatenation operation is to stack the features in the channel order while keeping the pixel spatial positions completely consistent to form a multi-channel concatenated feature tensor.

[0160] The initial spliced ​​feature tensor is input into the multi-channel interactive fusion module. By setting multiple convolution kernels with different parameters, convolution operations are performed on different channel combinations of the spliced ​​feature tensor to enhance the interaction between channels in different color spaces, resulting in a channel interactive enhanced feature tensor.

[0161] The channel interaction enhancement feature tensor is subjected to convolutional fusion processing to compress the number of channels to a preset output channel dimension, generating fused feature data. The convolutional fusion processing integrates the high-dimensional features of the channel interaction enhancement feature tensor through one or more one-dimensional or two-dimensional convolution operations. The fused feature data contains complementary features of the three color spaces and also enhances the ability to express spatial boundaries and salient regions, which can be used for the task of identifying extremely subtle color differences and edge segmentation in the color development area of ​​urine glucose test strips.

[0162] The fused feature data is input into the backbone feature encoding network to obtain deep fused feature data. The deep fused feature data is then input into the classification branch to output urine glucose concentration level data. Simultaneously, it is input into the regression branch to output urine glucose concentration numerical data. The urine glucose concentration level data and urine glucose concentration numerical data are combined with the standard color chart mapping relationship data to generate standardized test result data.

[0163] In this embodiment, the generation of standardized test result data includes:

[0164] The fused feature data is input into the backbone feature encoding network to generate deep fused feature data;

[0165] The backbone feature encoding network includes multi-layer convolutional modules and residual connection units. By alternately stacking convolutional kernels and residual connection units, multi-scale feature extraction is performed on the fused feature data to generate deep fused feature data. The deep fused feature data expresses the deep spatial structure relationship of the color development area of ​​the urine glucose test strip at different color levels and boundary features.

[0166] Input the deep fusion feature data into the classification branch and output the urine glucose concentration level data;

[0167] In Example 1, the classification branch is a fully connected neural network structure. It performs channel compression and linear transformation on the deep fusion feature data and outputs a set of probability values ​​equal to the number of preset urine glucose concentration level categories. Each probability value corresponds to a urine glucose concentration level interval. The concentration level interval with the highest probability is used as the urine glucose concentration level data output. The output space of the urine glucose concentration level data is {negative, weakly positive, 1+, 2+, 3+, 4+}.

[0168] Input the deeply fused feature data into the regression branch, and output the numerical data of urine glucose concentration;

[0169] In Example 1, the regression branch is a fully connected neural network structure. It performs channel compression and linear transformation on the deeply fused feature data and outputs a real value as the urine glucose concentration data. The urine glucose concentration data is a continuous variable and reflects the estimated actual glucose concentration corresponding to the reaction area of ​​the test strip.

[0170] By combining urine glucose concentration level data with urine glucose concentration numerical data with standard color chart mapping data, standardized test result data is generated.

[0171] The standard color chart mapping data is a pre-defined table of colorimetric levels and concentration values ​​for urine glucose test strips. It includes each colorimetric level and its corresponding urine glucose concentration range, standard color space Lab value, and colorimetric threshold range. The standardized test results are output by the following logic:

[0172] If the urine glucose concentration level data is negative and the urine glucose concentration value is less than the negative upper limit threshold in the standard color chart, the standardized test result data will be output as negative and the corresponding value and threshold range will be given.

[0173] If the urine glucose concentration level data is weakly positive, and the urine glucose concentration value data is within the concentration range corresponding to weak positive in the standard color card, then the standardized test result data will output as weakly positive and provide an explanation of the range of the corresponding value and threshold.

[0174] If the urine glucose concentration level data is 1+ or higher, and the urine glucose concentration values ​​fall within the corresponding concentration range of their respective standard color cards, then the standardized test result data will be output at the corresponding level, along with the actual value, level range, and concentration description.

[0175] If the urine glucose concentration level data is inconsistent with the urine glucose concentration numerical data, or if the numerical data falls within the critical range of any colorimetric level, the standardized test result will be output as critical or uncertain, and a repeat test or manual verification will be required. Example

[0176] Patient A (62 years old, with an 8-year history of diabetes) performed a home urine glucose test using his first morning urine as instructed by his doctor. The living room in Mr. A's home was dimly lit (the actual brightness measured by a light meter was only 63 Lux), and he was using a Xiaomi 13 mobile phone. Mr. A used a urine glucose test strip to collect fresh first morning urine, waited 90 seconds, and then placed the test strip horizontally on a white napkin for photographing. Because the curtains were partially drawn and there were some miscellaneous items on the table, there were localized shadows around the test strip and reflections of the blue pattern.

[0177] Mr. A's initial image was deemed insufficient in quality by the image quality assessment module of this invention, with a blur score of 0.61 (threshold 0.8). The system automatically prompted him to retake the image after adding light. Mr. A increased the brightness of the desk lamp and retaken the image; the platform score was 0.91, allowing him to proceed to the next step.

[0178] During the automatic analysis, the HSV adaptive segmentation module calculates the saturation and brightness histograms of the entire image, detecting that the overall brightness is low, but the saturation distribution in the local reaction area is significantly higher than that of the background. The system performs dynamic segmentation on areas with a mean saturation of 0.41 and a mean brightness of 0.37 based on local adaptive thresholds, accurately extracting the test strip reaction area. The segmentation IoU compared to the gold standard is 0.94. When the traditional Otsu global thresholding method processes the same image, due to interference from reflections at the edges of the napkin, the ROI segmentation IoU is only 0.76, some test strip edge areas are incorrectly segmented into the background, and the reference color band on the left side of the test strip is mistakenly truncated due to shadows.

[0179] The system processes the segmented reaction area in three color spaces: RGB, HSV, and Lab.

[0180] In the RGB branch, the system detected an abnormal decrease in the intensity of the G channel on the left side of the reaction area, which was determined to be due to shadow effects. Through edge-contrast enhancement, the color integrity score improved from 0.79 to 0.92.

[0181] The HSV branch captures a small abrupt change in the S channel at the center of the reaction zone (maximum change ΔS=0.11), which the system identifies as a color gradient region. The feature response is dynamically adjusted using pixel-level gating weights.

[0182] A comparison of the Lab branch with the standard color chart revealed that the ΔE value in the center of the reaction zone was 1.56, while the ΔE value at the edge was 2.03. The Lab color difference between the center and the standard "1+" concentration color chart was 1.53, which was significantly smaller than the ΔE value of 4.19 for the standard "2+" color chart.

[0183] After the three-branch output features are fused through multi-head attention, the backbone feature encoding network completes deep feature extraction. The probabilities of each level output by the classification branch are as follows: negative 0.08, weakly positive 0.14, 1+ 0.67, 2+ 0.09, 3+ 0.01, 4+ 0.01, and finally judged as "1+". The regression branch outputs a urine glucose concentration of 4.62 mmol / L. Checking the standard color chart, the interval corresponding to "1+" is 4.2~6.1 mmol / L, and the system automatically outputs "1+ (4.62 mmol / L, 4.2~6.1 mmol / L)" with a judgment confidence level of 92%.

[0184] On the same day, Mr. A analyzed the same test strip using a traditional APP (which only supports RGB segmentation and SVM classification). The IoU between the APP segmentation ROI and the manual label was only 0.82, and the left side of the color development area was classified as background. The SVM classification output probability distribution was: weak positive 0.29, 1+ 0.51, 2+ 0.17, and the final result was "1+". However, the concentration regression value was 5.47 mmol / L, which deviated from the median value of the standard color card by 0.85 mmol / L.

[0185] On that day, the hospital database was automatically synchronized, and the laboratory technician used a fully automated urine analyzer to measure Mr. A's morning urine glucose at 4.74 mmol / L (the clinical standard is 4.2~6.1 mmol / L as "1+"). The error of the method of this invention is 0.12 mmol / L, while the error of the traditional method is 0.73 mmol / L.

[0186] In 24 cases of complex scenarios involving home users in the same week (low light at night, strong backlight, desktop noise, and blurred images due to hand tremors), the method of this invention had a mean segmentation IoU of 0.93, a missegmentation rate of 1.9%, a concentration level determination accuracy of 96.4%, and a mean square error of 0.13 mmol / L for the concentration value; while the traditional method had a mean segmentation IoU of 0.79, a missegmentation rate of 11.7%, a concentration level accuracy of 79.5%, and a mean square error of 0.29 mmol / L for the concentration value.

[0187] Taking patient number "20250511017" as an example, the test strip was photographed at night under an incandescent light in the kitchen using an iPhone 14 Plus. Due to strong light reflection in some areas, the test strip showed strong light reflection, resulting in a system quality assessment score of 0.87 (pass). After HSV segmentation, the ROI localization IoU reached 0.96. In the Lab branch ΔE comparison, the color difference between the central area and the standard color card for the 1+ range was 1.62, and for 2+ it was 3.95. The classification output was "1+", and the regression output was 5.11 mmol / L, highly consistent with the instrument's actual measurement of 5.06 mmol / L. The traditional method, due to strong light reflection, blurred the boundary between the background and the reaction area, resulting in an ROI segmentation IoU of only 0.71, ultimately classifying the patient as 2+, with a regression output of 7.28 mmol / L, indicating a misinterpretation.

[0188] During a two-month hospital follow-up, a total of 6,420 samples were collected. The consistency of the traditional method in the "weak positive / 1+" critical zone was 63%, while the consistency of the method of this invention reached 91%. In the model training process, 80% of the samples were used for training and 20% for testing. After 8 rounds of iteration, the accuracy of the model of this invention on the test set reached 96.7%, and the IoU was stable at 0.94~0.96. The segmentation, classification and regression performance were comprehensively superior to the traditional method.

[0189] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A rapid method for detecting urinary glucose in diabetic patients based on image recognition, characterized in that, include: Acquire urine glucose test strip image data and perform image preprocessing to generate quality control image data; The RGB color space image data of the quality control image data is retained, and the quality control image data is converted into HSV color space image data and Lab color space image data respectively, resulting in a set of three color space image data; Perform HSV adaptive segmentation on the HSV color space image data to obtain the final location data of the reaction area; Based on the final location data of the reaction zone, the data is simultaneously cropped from the three-color space image dataset to generate three-color space image data of the reaction zone. An improved DCPNet three-color-space perception network is constructed, including an RGB color space branch feature encoder, an HSV color space branch feature encoder, and a Lab color space branch feature encoder. The three color space image data of the reaction area are input into the corresponding color space branch feature encoders to obtain RGB branch feature data, HSV branch feature data, and Lab branch feature data. The RGB color space branch feature encoder includes: The RGB color space image data of the reaction area is subjected to grayscale fusion processing to obtain a grayscale color image; A weighted edge map is obtained by performing multi-scale Sobel gradient operator operations on the grayscale color image; Global-local contrast processing is performed on the RGB color space image data of the reaction area to obtain local contrast map and global contrast map. The local contrast map and global contrast map are combined into a multi-channel contrast feature map by channel splicing and then max pooling is performed to obtain the spliced ​​pooled multi-channel contrast feature map. Color uniformity detection was performed on the RGB color space image data of the reaction area to obtain a color shift map; The weighted edge map, multi-channel contrast feature map and color shift map are multi-scale feature stitched and channel fused, and then input into the backbone convolutional layer of the RGB color space branch feature encoder to obtain RGB branch feature data. The HSV color space branch feature encoder includes: Extract the saturation channel value and brightness channel value of each pixel in the HSV color space image data of the reaction area, and calculate the pixel-level saturation-brightness joint response factor. Divide the brightness channel value of the current pixel by the global mean of the brightness channel of the reaction area to obtain the normalized matrix of the overall brightness distribution of the reaction area. Perform channel recalibration on the input HSV color space image data and calculate the color constancy residual map; The pixel-level saturation-luminance joint response factor, luminance distribution normalization matrix and color constancy residual map are remapped in a multi-scale space and used as a gate weight matrix in the backbone feature extraction channel of the HSV color space branch feature encoder. Pixel-level weight modulation is performed on the output features of each convolution layer, and HSV branch feature data is generated after pixel-level weight modulation. The Lab color space branch feature encoder includes: Channel decomposition processing was performed on the Lab color space image data of the reaction area to extract the lightness channel value, red-green channel value and yellow-blue channel value of each pixel, forming a lightness channel map, a red-green channel map and a yellow-blue channel map; Multi-scale spatial convolution is performed on the brightness channel image, red-green channel image, and yellow-blue channel image respectively to obtain brightness perception feature map, red-green perception feature map, and yellow-blue perception feature map; The dynamic weighted pooling weight matrix is ​​obtained by calculating the ΔE color difference between the brightness channel value, red-green channel value, and yellow-blue channel value of each pixel and the Lab reference color value at the corresponding position on the clinical standard color chart. The brightness perception feature map, red-green perception feature map, and yellow-blue perception feature map are multiplied pixel by pixel with the dynamic weighted pooling weight matrix to obtain the brightness pooling feature map, red-green pooling feature map, and yellow-blue pooling feature map after color difference perception enhancement. The brightness pooling feature map, red-green pooling feature map and yellow-blue pooling feature map after color difference perception enhancement are concatenated according to the channel dimension to form a multi-channel Lab color difference enhancement feature map. The multi-channel Lab color difference enhancement feature map is then input into the backbone convolutional layer of the Lab color space branch feature encoder to generate Lab branch feature data. The RGB branch feature data, HSV branch feature data, and Lab branch feature data are input into the cross-color space attention fusion module to generate fused feature data. The fused feature data is input into the backbone feature encoding network to obtain deep fused feature data, which is then input into the classification and regression branches to output urine glucose concentration level data and urine glucose concentration numerical data. The urine glucose concentration level data and urine glucose concentration numerical data are combined with the standard color card mapping relationship data to generate standardized test result data.

2. The rapid detection method for diabetic urine glucose based on image recognition according to claim 1, characterized in that, The construction of the three-color space image data set includes: Perform a color space decomposition operation on the quality control image data to preserve the original RGB color space image data of the quality control image data; Convert quality control image data from RGB color space image data to HSV color space image data; Convert quality control image data from RGB color space image data to Lab color space image data; Image data in RGB color space, HSV color space, and Lab color space are stored together to form a set of image data in three color spaces.

3. The rapid detection method for diabetic urine glucose based on image recognition according to claim 1, characterized in that, The extraction of the final location data of the reaction zone includes: Based on HSV color space image data, calculate the adaptive threshold in HSV space for each pixel; The saturation and brightness channel values ​​in the HSV color space image data are compared with the corresponding adaptive thresholds in the HSV space for each pixel. When the saturation channel value is greater than or equal to the average value of the saturation channel values ​​in the local neighborhood and the luminance channel value is greater than or equal to the average value of the luminance channel values ​​in the local neighborhood, and the sum of the saturation channel value and the luminance channel value is greater than or equal to the adaptive threshold in HSV space, the corresponding pixel is assigned a value of 1; otherwise, it is assigned a value of 0, thus obtaining the preliminary binary mask data. Based on the initial binary mask data, morphological structural constraint operations are performed to obtain morphologically optimized mask data; Perform connected component analysis on morphologically optimized masked data to extract a set of connected regions; For each connected region in the set of connected regions, calculate its boundary rectangle; Based on the geometric prior rules of the urine glucose test strip, screening criteria are set, including area threshold, aspect ratio threshold range and position constraint range. The boundary rectangles of each connected region in the connected region set are screened to obtain a set of candidate regions that meet the conditions and their corresponding boundary rectangles. For each region in the candidate region set, calculate the boundary sharpness index based on the corresponding boundary rectangle; All regions in the candidate region set are sorted according to the boundary sharpness index. The region with the highest boundary sharpness index and its corresponding boundary rectangle are selected as the final location region of the reaction area. The coordinate data of the boundary rectangle of the candidate region are output as the final location data of the reaction area.

4. The rapid detection method for diabetic urine glucose based on image recognition according to claim 1, characterized in that, The generation of the three-color space image data of the reaction region includes: Based on the coordinates of the boundary rectangle recorded in the final positioning data of the reaction area, all pixels within the boundary rectangle are cropped from the RGB color space image data, HSV color space image data and Lab color space image data respectively, to obtain the RGB color space image data, HSV color space image data and Lab color space image data of the reaction area. The RGB color space image data, HSV color space image data, and Lab color space image data of the reaction zone are uniformly packaged and stored to form a three-color space image data set for the reaction zone.

5. The rapid detection method for diabetic urine glucose based on image recognition according to claim 1, characterized in that, The improved DCPNet three-color space perception network includes: Construct differentiated RGB color space branch feature encoders, HSV color space branch feature encoders, and Lab color space branch feature encoders. Input the RGB color space image data, HSV color space image data, and Lab color space image data of the reaction area into the differentiated RGB color space branch feature encoders, HSV color space branch feature encoders, and Lab color space branch feature encoders, respectively, and output RGB branch feature data, HSV branch feature data, and Lab branch feature data, respectively.

6. The rapid detection method for diabetic urine glucose based on image recognition according to claim 5, characterized in that, The cross-color space attention fusion module includes: Spatial and channel alignment are performed on the RGB branch feature data, HSV branch feature data, and Lab branch feature data to obtain the RGB aligned feature tensor, HSV aligned feature tensor, and Lab aligned feature tensor. Local color space response features and global color space statistical features are extracted from the RGB alignment feature tensor, HSV alignment feature tensor, and Lab alignment feature tensor, respectively. The RGB attention weight tensor, HSV attention weight tensor, and Lab attention weight tensor are then calculated. The RGB alignment feature tensor, HSV alignment feature tensor, and Lab alignment feature tensor are weighted and reconstructed to generate the RGB attention-enhanced feature tensor, HSV attention-enhanced feature tensor, and Lab attention-enhanced feature tensor, respectively. Cross-spatial difference enhancement fusion is performed on RGB attention-enhanced feature tensors, HSV attention-enhanced feature tensors, and Lab attention-enhanced feature tensors to generate fused feature data.

7. A rapid method for detecting diabetic urine glucose based on image recognition according to claim 6, characterized in that, The generation of the standardized test result data includes: The fused feature data is input into the backbone feature encoding network to generate deep fused feature data; Input the deep fusion feature data into the classification branch and output the urine glucose concentration level data; Input the deeply fused feature data into the regression branch, and output the numerical data of urine glucose concentration; By combining urine glucose concentration level data with urine glucose concentration numerical data and standard color chart mapping data, standardized test result data is generated. The standardized test result data is output by the following logic: If the urine glucose concentration level data is negative and the urine glucose concentration value is less than the negative upper limit threshold in the standard color chart, the standardized test result data will be output as negative and the corresponding value and threshold range will be given. If the urine glucose concentration level data is weakly positive, and the urine glucose concentration value data is within the concentration range corresponding to weak positive in the standard color card, then the standardized test result data will output as weakly positive and provide an explanation of the range of the corresponding value and threshold. If the urine glucose concentration level data is 1+ or higher, and the urine glucose concentration values ​​fall within the corresponding concentration range of their respective standard color cards, then the standardized test result data will be output at the corresponding level, along with the actual value, level range, and concentration description. If the urine glucose concentration level data is inconsistent with the urine glucose concentration numerical data, or if the numerical data falls within the critical range of any colorimetric level, the standardized test result will be output as critical or uncertain, and a repeat test or manual verification will be required.

Citation Information

Patent Citations

  • Medical image analysis method and system based on multi-modal image fusion

    CN119693365A

  • Stress injury automatic detection method based on YOLO neural network

    CN121190414A