Search

CN-121599963-B - Diabetes urine glucose rapid detection method based on image recognition

CN121599963BCN 121599963 BCN121599963 BCN 121599963BCN-121599963-B

Abstract

The invention discloses a diabetes urine glucose rapid detection method based on image recognition, which comprises the steps of generating quality control image data, obtaining a three-color space image data set, obtaining final positioning data of a reaction area, generating three-color space image data of the reaction area, constructing an improved DCPNet three-color space perception network, obtaining RGB branch characteristic data, HSV branch characteristic data and Lab branch characteristic data, inputting the RGB branch characteristic data, the HSV branch characteristic data and the Lab branch characteristic data into a cross-color space attention fusion module to generate fusion characteristic data, inputting the fusion characteristic data into a trunk characteristic coding network to obtain deep fusion characteristic data, inputting a classification branch and a regression branch to generate standardized detection result data. The invention better meets the automatic detection requirements in the home self-test, basic medical treatment and remote health management scenes.

Inventors

  • SUN JINGRU

Assignees

  • 辽宁省金秋医院

Dates

Publication Date
20260508
Application Date
20260116

Claims (7)

  1. 1. The rapid detection method for the diabetes urine glucose based on image recognition is characterized by comprising the following steps of: acquiring image data of urine glucose test paper, performing image preprocessing, and generating quality control image data; the RGB color space image data of the quality control image data are reserved, and the quality control image data are respectively converted into HSV color space image data and Lab color space image data to obtain a three-color space image data set; Performing HSV self-adaptive segmentation on the HSV color space image data to obtain final positioning data of the reaction area; Synchronously cutting out the final positioning data of the reaction area in the three-color space image data set to generate three-color space image data of the reaction area; Constructing an improved DCPNet three-color space perception network, which comprises an RGB color space branch characteristic encoder, an HSV color space branch characteristic encoder and a Lab color space branch characteristic encoder, and respectively inputting three-color space image data of a reaction area into the corresponding color space branch characteristic encoder to obtain RGB branch characteristic data, HSV branch characteristic data and Lab branch characteristic data; the RGB color space branching feature encoder includes: carrying out gray fusion processing on the RGB color space image data of the reaction area to obtain a gray color map; Carrying out multi-scale Sobel gradient operator operation on the gray color map to obtain a weighted edge map; performing global-local contrast processing on the RGB color space image data of the reaction area to obtain a local contrast image and a global contrast image, combining the local contrast image and the global contrast image into a multi-channel contrast characteristic image according to a channel splicing mode, and performing maximum pooling processing to obtain a multi-channel contrast characteristic image after splicing pooling; Detecting color rendering non-uniformity of the RGB color space image data of the reaction area to obtain a color rendering offset chart; Carrying out multi-scale feature splicing and channel fusion on the weighted edge graph, the multi-channel contrast feature graph and the color rendering offset graph, and inputting the multi-scale feature splicing and channel fusion into a trunk convolution layer of an RGB color space branch feature encoder to obtain RGB branch feature data; the HSV color space branching feature encoder includes: extracting the saturation channel value and the brightness channel value of each pixel point in the HSV color space image data of the reaction area, and calculating a pixel level saturation-brightness joint response factor; Dividing the brightness channel value of the current pixel point by the global average value of the brightness channels of the reaction area to obtain an integral brightness distribution normalization matrix of the reaction area; Performing channel recalibration operation on input HSV color space image data, and calculating a color constancy residual map; Performing multi-scale space remapping on the pixel-level saturation-brightness joint response factor, the brightness distribution normalization matrix and the color constancy residual map, acting on a trunk feature extraction channel of an HSV color space branch feature encoder as a gating weight matrix, performing pixel-level weight modulation on each layer of convolution output features, and generating HSV branch feature data after the pixel-level weight modulation; the Lab color space branching feature encoder comprises: Carrying out channel decomposition processing on Lab color space image data of the reaction area, and respectively extracting brightness channel values, red-green channel values and yellow-blue channel values of each pixel point to form a brightness channel diagram, a red-green channel diagram and a yellow-blue channel diagram; respectively performing multi-scale spatial convolution on the brightness channel diagram, the red-green channel diagram and the yellow-blue channel diagram to obtain a brightness perception feature diagram, a red-green perception feature diagram and a yellow-blue perception feature diagram; obtaining a dynamic weighted pooling weight matrix by calculating delta E color difference among the brightness channel value, the red-green channel value and the yellow-blue channel value of each pixel point relative to the Lab reference color value at the corresponding position of the clinical standard color card; Respectively carrying out pixel-by-pixel weighted multiplication processing on the brightness perception feature map, the red-green perception feature map and the yellow-blue perception feature map and the dynamic weighted pooling weight matrix to obtain a brightness pooled feature map, a red-green pooled feature map and a Huang Lanchi pooled feature map after color difference perception enhancement; Splicing the brightness pooling feature map, the red-green pooling feature map and the Huang Lanchi pooling feature map subjected to color difference perception enhancement according to channel dimensions to form a multi-channel Lab color difference enhancement feature map, inputting the multi-channel Lab color difference enhancement feature map to a main convolution layer of a Lab color space branch feature encoder to generate Lab branch feature data; inputting RGB branch characteristic data, HSV branch characteristic data and Lab branch characteristic data into a cross-color space attention fusion module to generate fusion characteristic data; And inputting the fusion characteristic data into a trunk characteristic coding network to obtain deep fusion characteristic data, inputting a classification branch and a regression branch, outputting urine glucose concentration grade data and urine glucose concentration numerical value data, and combining the urine glucose concentration grade data and the urine glucose concentration numerical value data with standard color card mapping relation data to generate standardized detection result data.
  2. 2. The method for rapidly detecting diabetes mellitus urine glucose based on image recognition according to claim 1, wherein the construction of the three-color space image data set comprises the following steps: performing a color space decomposition operation on the quality control image data, preserving original RGB color space image data of the quality control image data; converting the quality control image data from RGB color space image data to HSV color space image data; converting the quality control image data from RGB color space image data to Lab color space image data; And uniformly storing the RGB color space image data, the HSV color space image data and the Lab color space image data to form a three-color space image data set.
  3. 3. The method for rapidly detecting diabetes urine glucose based on image recognition according to claim 1, wherein the extraction of final positioning data of the reaction region comprises the steps of: Calculating an HSV space down-adaptive threshold of each pixel point based on the HSV color space image data; Comparing the saturation channel value and the brightness channel value in the HSV color space image data with the HSV space self-adaptive threshold value of the corresponding pixel point respectively: When the saturation channel value is larger than or equal to the average value of the saturation channel values in the local neighborhood and the brightness channel value is larger than or equal to the average value of the brightness channel values in the local neighborhood, and the sum of the saturation channel value and the brightness channel value is larger than or equal to the adaptive threshold value under the HSV space, the corresponding pixel point is assigned to be 1, otherwise, the value is assigned to be 0, and preliminary binary mask data are obtained; performing morphological structure constraint operation based on the preliminary binary mask data to obtain morphological optimization mask data; Performing connected domain analysis operation on the morphological optimization mask data, and extracting a connected region set; Calculating boundary rectangles of each connected region in the connected region set respectively; setting screening criteria according to geometric priori rules of the urine glucose test paper, wherein the screening criteria comprise an area threshold value, an aspect ratio threshold value range and a position constraint range, and screening boundary rectangles of each communication area in the communication area set to obtain a candidate area set meeting the conditions and corresponding boundary rectangles thereof; Calculating a boundary definition index for each region in the candidate region set based on the corresponding boundary rectangle; And sequencing all the regions in the candidate region set according to the boundary definition index, selecting the region with the maximum boundary definition index and the corresponding boundary rectangle as a final positioning region of the reaction region, and outputting the coordinate data of the boundary rectangle of the candidate region as final positioning data of the reaction region.
  4. 4. The method for rapidly detecting diabetes mellitus urine glucose based on image recognition according to claim 1, wherein the generation of the three-color space image data of the reaction area comprises the following steps: Cutting all pixel points within the boundary rectangle range from RGB color space image data, HSV color space image data and Lab color space image data according to boundary rectangle coordinates recorded in final positioning data of the reaction area to obtain RGB color space image data of the reaction area, HSV color space image data of the reaction area and Lab color space image data of the reaction area; And uniformly packaging and storing the RGB color space image data of the reaction area, the HSV color space image data of the reaction area and the Lab color space image data of the reaction area to form a three-color space image data set of the reaction area.
  5. 5. The method for rapid detection of diabetes mellitus urine glucose based on image recognition according to claim 1, wherein said improved DCPNet three-color space-aware network comprises: The method comprises the steps of constructing a differential RGB color space branch characteristic encoder, an HSV color space branch characteristic encoder and a Lab color space branch characteristic encoder, respectively inputting reaction area RGB color space image data, reaction area HSV color space image data and reaction area Lab color space image data into the differential RGB color space branch characteristic encoder, the differential HSV color space branch characteristic encoder and the differential Lab color space branch characteristic encoder, and respectively outputting RGB branch characteristic data, HSV branch characteristic data and Lab branch characteristic data.
  6. 6. The method for rapid detection of diabetes mellitus glucose based on image recognition according to claim 5, wherein the cross-color space attention fusion module comprises: performing space alignment and channel alignment on the RGB branch characteristic data, the HSV branch characteristic data and the Lab branch characteristic data to obtain an RGB alignment characteristic tensor and an HSV alignment characteristic tensor and Lab alignment characteristic tensor; Extracting local color space response characteristics and global color space statistical characteristics from the RGB alignment characteristic tensor, the HSV alignment characteristic tensor and the Lab alignment characteristic tensor respectively, and calculating an RGB attention weight tensor, an HSV attention weight tensor and a Lab attention weight tensor; Weighting and reconstructing the RGB alignment feature tensor, the HSV alignment feature tensor and the Lab alignment feature tensor respectively to generate an RGB attention enhancement feature tensor, an HSV attention enhancement feature tensor and a Lab attention enhancement feature tensor; and performing cross-space difference enhancement fusion on the RGB attention enhancement feature tensor, the HSV attention enhancement feature tensor and the Lab attention enhancement feature tensor to generate fusion feature data.
  7. 7. The method for rapidly detecting diabetes mellitus glucose in urine based on image recognition according to claim 6, wherein the generation of the standardized detection result data comprises the following steps: inputting the fusion characteristic data into a trunk characteristic coding network to generate depth fusion characteristic data; inputting the deep fusion characteristic data into a classification branch, and outputting urine glucose concentration grade data; inputting the deep fusion characteristic data into a regression branch, and outputting urine glucose concentration numerical data; combining the urine glucose concentration grade data with the urine glucose concentration numerical value data to generate standardized detection result data by combining the standard color card mapping relation data, wherein the standardized detection result data is output by the following logic: If the urine glucose concentration grade data is negative and the urine glucose concentration numerical value data is smaller than the negative upper limit threshold value in the standard color card, outputting the standardized detection result data to be negative and giving interval description of the corresponding numerical value and the threshold value; if the urine glucose concentration grade data is weak positive and the urine glucose concentration numerical value data is located in a concentration interval corresponding to the weak positive in the standard color card, outputting the weak positive by the standardized detection result data and giving interval description of the corresponding numerical value and the threshold value; If the urine glucose concentration grade data is 1+ or higher, and the urine glucose concentration numerical data respectively fall into the concentration interval corresponding to the standard color card, outputting the corresponding grade by the standardized detection result data, and giving out the actual numerical value, the grade interval and the concentration specification; If the urine glucose concentration grade data is inconsistent with the urine glucose concentration numerical data or the numerical data falls in a critical section of any color development grade, outputting the standardized detection result data in a critical or uncertain way, and prompting that repeated detection or manual review is needed.

Description

Diabetes urine glucose rapid detection method based on image recognition Technical Field The invention relates to the technical field of diabetes, in particular to a rapid detection method for diabetes urine glucose based on image recognition. Background Along with the popularization of mobile health detection and home self-help medical monitoring, a method for shooting and automatically identifying and analyzing urine glucose test paper images based on a portable terminal is widely focused in the field of diabetes auxiliary diagnosis and management, urine glucose test paper is used as an in-vitro diagnosis chemical colorimetric carrier, automatic segmentation, color development discrimination and concentration output of a reaction area are required to be realized through image acquisition equipment, and technical bottlenecks generally exist in the prior art under the actual application conditions of complex shooting environments, equipment differences and color development subtle changes. Most of the existing urine glucose test paper image identification methods adopt global threshold segmentation or simple feature extraction under a single color space, are difficult to effectively cope with color distortion and brightness fluctuation caused by multi-source heterogeneous factors in a family or base layer scene, lead to the reduction of the degree of distinction between a reaction area and a background and reference color band, and are easy to cause over-segmentation, under-segmentation or fuzzy boundary misjudgment of the area. The traditional flow based on fixed segmentation, manual characteristics and static grade mapping is limited in distinguishing tiny differences of urine glucose test paper color grades, and because the color change of a urine glucose test paper reaction area presents multistage gradual change and saturation difference is tiny, high-precision end-to-end closed-loop identification is difficult to realize between weak positive and low concentration grades only by single-channel or coarse granularity characteristics, and the existing end-to-end model is mostly single-task, single-space input lacks a cross-color space fusion and color development specificity enhancement mechanism, so that identification reliability under the difficult points of small targets, strong interference and extremely fine micro chromatic aberration is difficult to ensure. Disclosure of Invention The invention aims to provide a rapid detection method for diabetes urine glucose based on image recognition, which better meets the automatic detection requirements in the fields of home self-test, primary medical treatment and remote health management. According to the embodiment of the invention, the method for rapidly detecting the diabetes urine glucose based on image recognition comprises the following steps: acquiring image data of urine glucose test paper, performing image preprocessing, and generating quality control image data; the RGB color space image data of the quality control image data are reserved, and the quality control image data are respectively converted into HSV color space image data and Lab color space image data to obtain a three-color space image data set; Performing HSV self-adaptive segmentation on the HSV color space image data to obtain final positioning data of the reaction area; Synchronously cutting out the final positioning data of the reaction area in the three-color space image data set to generate three-color space image data of the reaction area; Constructing an improved DCPNet three-color space perception network, which comprises an RGB color space branch characteristic encoder, an HSV color space branch characteristic encoder and a Lab color space branch characteristic encoder, and respectively inputting three-color space image data of a reaction area into the corresponding color space branch characteristic encoder to obtain RGB branch characteristic data, HSV branch characteristic data and Lab branch characteristic data; inputting RGB branch characteristic data, HSV branch characteristic data and Lab branch characteristic data into a cross-color space attention fusion module to generate fusion characteristic data; And inputting the fusion characteristic data into a trunk characteristic coding network to obtain deep fusion characteristic data, inputting a classification branch and a regression branch, outputting urine glucose concentration grade data and urine glucose concentration numerical value data, and combining the urine glucose concentration grade data and the urine glucose concentration numerical value data with standard color card mapping relation data to generate standardized detection result data. Optionally, the constructing of the three-color space image data set includes: performing a color space decomposition operation on the quality control image data, preserving original RGB color space image data of the quality control image data; converting the quality control i