Medical index detection method, system and equipment based on test strip image

By preprocessing and extracting feature values ​​from test strip images, and combining them with single-factor or multi-factor deep learning models, the problems of low detection accuracy and poor anti-interference ability of test strips are solved, achieving high-precision and robust detection of medical indicators.

CN121860976APending Publication Date: 2026-04-14CHENGDU ONE CHIP BIOTECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing test strip detection methods have low accuracy and poor anti-interference ability, and cannot achieve high-precision and robust medical indicator detection.

Method used

By acquiring test strip images, preprocessing them, extracting the cumulative distribution of pixel intensity, identifying feature regions, and using single-factor or multi-factor deep learning models to quantitatively predict medical indicators, including image correction, grayscale conversion, background removal, and feature value calculation.

Benefits of technology

It significantly improves the accuracy and robustness of detection, enables continuous prediction of medical indicators, and enhances the model's precision and tolerance to image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860976A_ABST
    Figure CN121860976A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of medical detection, and particularly relates to a medical index detection method and system based on a test strip image. The method specifically comprises the following steps: acquiring a test strip image, and carrying out preprocessing including background removal; calculating line cumulative intensity along the vertical direction of the strip based on the preprocessed image; identifying at least two feature regions corresponding to different reaction strips according to the intensity distribution; determining a feature value based on the pixel intensity of the feature region; and inputting the characteristic value into a preset prediction model to obtain a medical index quantification result. According to the method, global feature extraction and modeling mapping are adopted to replace a traditional color table look-up method, so that the defects of low precision and poor image interference resistance in the prior art are effectively overcome, and the detection robustness and accuracy are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical testing technology, and in particular to a method, system and device for detecting medical indicators based on test strip images. Background Technology

[0002] Medical indicator testing is a core component of disease screening, health monitoring, and clinical diagnosis. With the popularization of medical technology and the increasing demand for home testing, test strip technology, which is easy to operate, inexpensive, and fast, has been widely used in various medical testing scenarios such as urine analysis, biochemical indicator testing, and pathogen screening. The core principle of test strip testing is to utilize the color change produced by the chemical reaction between specific reagents on the test strip and the sample to be tested (such as urine or blood). The color information is used to quantify and analyze the corresponding medical indicator values. Its characteristics of not requiring complex instruments and being able to be completed quickly on-site greatly meet the needs of primary healthcare and family self-health management.

[0003] To achieve accurate extraction of test strip color information and quantification of medical indicators, various related detection algorithms have emerged in existing technologies. For example, using LAB color space components to calculate test strip color can achieve more accurate testing results. This involves the following steps: Step 1: Converting RGB color components to LAB color components by establishing a channel XYZ color space; Step 2: Defining the value range of X, Y, Z, and t variables as [0,1]; Step 3: Defining the value range of the L component as [0,100], and the A and B components as [-127,127]; Step 4: Optimizing the floating-point results of each LAB component: optimizing the function f(t); converting the RGB color space to the LAB color space, and performing corresponding conversions on the L, A, and B values ​​using appropriate algorithms; and then comparing the obtained floating-point values ​​of L, A, and B using a lookup table method after further conversion and rounding, thereby greatly reducing the error in obtaining the test strip color. However, this method requires lookup table comparison, which limits its accuracy.

[0004] Therefore, there is an urgent need to develop an automatic detection technology for test strip images with higher accuracy, stronger anti-interference ability, and better robustness. Summary of the Invention

[0005] The technical problem to be solved by this invention is to design a method, system and device for detecting medical indicators based on test strip images. This invention identifies key information based on photographs of the test strips being tested, and calculates the corresponding medical indicators through a model, thereby solving the existing technical problems.

[0006] To address the aforementioned technical problems, this invention provides a method for detecting medical indicators based on test strip images, comprising the following steps:

[0007] Step S1: Acquire the image of the test strip and perform preprocessing operations on the image, including image correction, conversion to grayscale, and removal of background interference.

[0008] Step S2: Extract image information from the preprocessed image, specifically including:

[0009] Step S21: Calculate the cumulative distribution of pixel intensity along the extension direction of the reaction zone strip of the test strip.

[0010] Step S22: Identify at least two feature regions corresponding to different reaction bands based on the cumulative pixel intensity distribution.

[0011] Step S23: Based on the pixel intensity of the at least two feature regions, determine the feature value used to indicate the degree of reaction. .

[0012] Step S3: Set the feature value Input a preset prediction model to obtain the quantitative results of medical indicators output by the prediction model. The prediction model is used to build a model from the feature values. To medical indicators The mapping relationship.

[0013] Furthermore, in step S1 of this invention, the image correction includes translation, rotation, and cropping.

[0014] Furthermore, in step S1 of this invention, the formula for converting the color image of the test strip into a grayscale image is:

[0015] ;

[0016] in, The row index of the pixels in the image. The column index for the pixels of the image. For the blue channel array, For the green channel array, This is the red channel array.

[0017] Furthermore, in step S1 of this invention, the background removal is performed using a rolling ball algorithm, specifically including:

[0018] Background estimation is performed using the following formula:

[0019] ;

[0020] in, Let be the radius of the rolling ball window.

[0021] Then extract the foreground and remove the background, using the following formula:

[0022] ;

[0023] in, For the threshold, .

[0024] In a further step of this invention, in step S21, the pixel values ​​of each row are accumulated to generate a row intensity vector, and the calculation formula is as follows:

[0025] ;

[0026] in, The row index of the pixels in the image. The column index of the image's pixels.

[0027] Furthermore, in step S22 of this invention, the positions of the two horizontal lines are located based on the vector of the cumulative row intensity, and the bimodal position is identified from the line graph of the cumulative row intensity.

[0028] ;

[0029] .

[0030] In a further step of this invention, in step S23, based on the bimodal position, the complete bimodal peaks are extracted respectively, and the ratio of their cumulative intensities is calculated as the characteristic value. The calculation formula is as follows:

[0031] ;

[0032] ;

[0033] ;

[0034] in, This is the window width.

[0035] Furthermore, in step S3 of this invention, the prediction model is a single-factor linear model, and the expression of the single-factor linear model is:

[0036] ;

[0037] Among them, The slope This is the intercept.

[0038] Furthermore, in step S3 of this invention, the prediction model is a multi-factor deep learning model, and the expression of the multi-factor deep learning model is:

[0039] ;

[0040] in, As an auxiliary indicator, the multi-factor deep learning model includes a Multi-HeadAttention core structure, which can adaptively learn the effects of different factors on medical indicators. The influence weights are determined by the model's working process, which involves dividing the original input vector into multiple independent attention heads. Each attention head independently learns different attention weights to achieve multi-dimensional attention to different features in the input sequence, and then outputs medical indicators through nonlinear mapping.

[0041] The present invention also provides a medical indicator detection system based on test strip images, which performs the aforementioned medical indicator detection method based on test strip images, including:

[0042] The image preprocessing module is used to acquire images of the test strips and preprocess the acquired images. The preprocessing operations include correction, conversion to grayscale, and removal of background interference.

[0043] The information extraction module is used to process the preprocessed image to obtain the cumulative distribution of pixel intensity along the extension direction of the reaction zone of the test strip, and to identify at least two feature regions corresponding to different reaction zones based on the distribution, and then determine the feature value based on the pixel intensity of the feature regions.

[0044] The indicator prediction module stores a preset prediction model, which is used to receive the feature values ​​and output the quantitative results of medical indicators.

[0045] This embodiment also provides an electronic device, including:

[0046] At least one processor; and

[0047] At least one memory communicatively connected to the processor;

[0048] The memory stores instructions that can be executed by a processor, which, when executed by the processor, causes the electronic device to perform the aforementioned medical indicator detection method based on test strip images.

[0049] This invention provides a medical indicator detection method and system based on test strip images. By using global feature extraction and model-based mapping, it replaces the traditional color lookup table method, effectively overcoming the shortcomings of low accuracy and poor resistance to image interference in existing technologies. This significantly improves the robustness and accuracy of the detection, with the following specific beneficial effects:

[0050] (1) Based on machine learning, statistical patterns are statistically analyzed and systematically identified. This allows for continuous prediction of indicators, and the accuracy of the model theory is higher than that of the table lookup method.

[0051] (2) Based on the background removal operation, more information can be extracted from the image more stably, with strong robustness and higher tolerance for image quality;

[0052] (3) When mapping the model, a multi-factor model can be selected. Deep learning models have strong nonlinear mapping capabilities, which can effectively improve the accuracy of indicator prediction. Attached Figure Description

[0053] The specific embodiments of the present invention will be further explained below with reference to the accompanying drawings.

[0054] Figure 1 This is a flowchart of the medical indicator detection method based on test strip images according to the present invention.

[0055] Figure 2 This is a picture of the test strip taken in this invention.

[0056] Figure 3 This is a schematic diagram illustrating the identification of bimodal positions in this invention.

[0057] Figure 4 This is a model structure diagram of the multi-factor deep learning model in the medical indicator detection method based on test strip images of the present invention.

[0058] Figure 5 This is a system block diagram of the medical indicator detection system based on test strip images according to the present invention. Detailed Implementation

[0059] Example 1

[0060] Combination Figure 1 As shown, the medical indicator detection method based on test strip images in this embodiment specifically includes the following steps:

[0061] Step S1: Acquire an image of the test strip, such as... Figure 2 As shown, the image is preprocessed. For the captured test strip image, there may be cluttered backgrounds or the test strip may not be aligned in the image, which is not conducive to the extraction of image information. Therefore, preprocessing is required. Preprocessing operations include image correction, conversion to grayscale, and removal of background interference.

[0062] In this embodiment, preferably, in step S1, the image correction includes translation, rotation and cropping. The image is corrected based on software interactive measures, and the corrected image is a color image with a resolution of M (rows) * N (columns).

[0063] In this embodiment, preferably, in step S1, the formula for converting the color image of the test strip into a grayscale image is:

[0064] ;

[0065] in, The row index of the pixels in the image. The column index for the pixels of the image. For the blue channel array, For the green channel array, This is the red channel array.

[0066] Due to factors such as the manufacturing process and imaging effect of the test strip, the background of the image is uneven, which affects the extraction of image information. Therefore, it is necessary to remove background interference. In this embodiment, preferably, in step S1, a rolling ball algorithm is used for background removal, specifically including:

[0067] Background estimation is performed using the following formula:

[0068] ;

[0069] in, The radius of the scrolling ball window is used to control the smoothness of the background. The larger the background size, the coarser the image appears; adjustments need to be made based on the scene.

[0070] Then extract the foreground and remove the background, using the following formula:

[0071] ;

[0072] in, The threshold value is used to suppress noise. , It can adapt and adjust automatically; There is no threshold processing at this time.

[0073] Step S2: Extract image information from the preprocessed image, specifically including:

[0074] Step S21: Calculate the cumulative distribution of pixel intensity along the extension direction of the reaction zone strip of the test strip.

[0075] In this embodiment, preferably, in step S21, the pixel values ​​of each row are accumulated to generate a row intensity vector, and the calculation formula is as follows:

[0076] ;

[0077] in, The row index of the pixels in the image. The column index of the image's pixels.

[0078] Step S22: Identify at least two feature regions corresponding to different reaction bands based on the cumulative pixel intensity distribution.

[0079] In this embodiment, the horizontal line at the top of the test strip is the reference line, and the horizontal line at the bottom is the detection line. Preferably, in step S22, the positions of the two horizontal lines are located based on the vector of the cumulative row intensity, and the bimodal position is identified from the line graph of the cumulative row intensity. Figure 3 As shown:

[0080] ;

[0081] .

[0082] Step S23: Based on the pixel intensity of the at least two feature regions, determine the feature value used to indicate the degree of reaction. .

[0083] In this embodiment, preferably, in step S23, based on the bimodal position, the complete bimodal peaks are extracted respectively, and the ratio of their cumulative intensities is calculated as the characteristic value. The calculation formula is as follows:

[0084] ;

[0085] ;

[0086] ;

[0087] in, The width of the window is chosen to minimize background interference; it is generally a safe value that is slightly larger than the actual peak width.

[0088] Step S3: Set the feature value Input a preset prediction model to obtain the quantitative results of medical indicators output by the prediction model. The prediction model is used to build a model from the feature values. To medical indicators The mapping relationship.

[0089] In this embodiment, preferably, the final predicted medical indicators and Approximately linear relationship. In step S3, the prediction model is a single-factor linear model, and the expression of the single-factor linear model is:

[0090] ;

[0091] Among them, The slope This is the intercept.

[0092] Example 2

[0093] The medical indicator detection method based on test strip images in this embodiment differs from the medical indicator detection method based on test strip images in Embodiment 1 in that the preset prediction model is different, while the other technical features are the same.

[0094] In this embodiment, preferably, in step S3, the prediction model is a multi-factor deep learning model, and the expression of the multi-factor deep learning model is:

[0095] ;

[0096] in, As an auxiliary indicator, the multi-factor deep learning model incorporates a Multi-HeadAttention core structure, which allows the model to simultaneously focus on information from different locations. By segmenting the original input vector into multiple heads, each head can independently learn different attention weights, thereby enhancing the model's ability to focus on different parts of the input sequence. In specific implementation, a mapping is constructed using a deep learning model, which can adaptively learn different factors for medical indicators. The influence weights are determined by the model's working process, which involves dividing the original input vector into multiple independent attention heads. Each attention head independently learns different attention weights to achieve multi-dimensional attention to different features in the input sequence, and then outputs medical indicators through nonlinear mapping.

[0097] In this embodiment, the model structure is specifically as follows: Figure 4 As shown, this deep learning model is a nonlinear mapping network built on a multi-head attention mechanism. After standardization, the input features are fed into multiple parallel scaled dot-product attention heads for computation, with each head independently learning the correlation weights between different features. The outputs of each head are concatenated, projected through a linear layer, and then stabilized through residual connections and layer normalization. Subsequently, a feedforward network further enhances the nonlinear expressive power; this structure can be stacked in multiple layers. Finally, the network maps the learned high-dimensional features into continuous predicted values ​​of the target medical indicators through the output layer.

[0098] Example 3

[0099] Combination Figure 5 As shown, the medical indicator detection system based on test strip images in this embodiment executes the medical indicator detection method based on test strip images in Embodiment 1, specifically including the following modules:

[0100] The image preprocessing module is used to acquire images of the test strips and preprocess the acquired images. The preprocessing operations include correction, conversion to grayscale, and removal of background interference.

[0101] In this embodiment, the image preprocessing module specifically includes an image acquisition unit, an image correction unit, a grayscale conversion unit, and a background removal unit. The image acquisition unit is used to acquire images of the test strip. The image correction unit is used to automatically rotate and translate images with tilt or positional offset, and then crop out sub-images containing only the main reaction area of ​​the test strip. The grayscale conversion unit converts the cropped color sub-images into grayscale images. The background removal unit uses a rolling ball algorithm to estimate and subtract the background of the grayscale image to eliminate interference caused by uneven test strip substrate or lighting shadows.

[0102] The information extraction module is used to process the preprocessed image to obtain the cumulative distribution of pixel intensity along the extension direction of the reaction zone of the test strip, and to identify at least two feature regions corresponding to different reaction zones based on the distribution, and then determine the feature value based on the pixel intensity of the feature regions.

[0103] In this embodiment, the information extraction module specifically includes a row cumulative intensity calculation unit, a bimodal recognition unit, and a feature value calculation unit. The row cumulative intensity calculation unit is used to accumulate the pixel values ​​of each row to generate a row intensity vector. The bimodal recognition unit smooths the row intensity vector, finds its local maxima, and identifies the two most significant peaks, which correspond to the row coordinates of the reference line (upper horizontal line) and the detection line (lower horizontal line) on the test strip in the image, respectively. The feature value calculation unit selects a window with a width of D (slightly larger than the actual strip width) centered on each peak position and calculates the sum of the cumulative intensities of all rows within the two windows. Then, it calculates the ratio of the cumulative intensity of the detection line window to the cumulative intensity of the reference line window to obtain the core feature value. .

[0104] The indicator prediction module stores a preset prediction model and is used to receive the feature values. It also outputs quantitative results of medical indicators. .

[0105] Example 4

[0106] The electronic device in this embodiment includes:

[0107] At least one processor; and

[0108] At least one memory communicatively connected to the processor;

[0109] The memory stores instructions that can be executed by a processor, which are then executed by the processor to cause the electronic device to perform the medical indicator detection method based on test strip images in Embodiment 1.

[0110] Many specific details have been set forth in the foregoing description to provide a thorough understanding of the present invention. However, the above description is merely a preferred embodiment of the present invention, and the present invention can be implemented in many other ways different from those described herein. Therefore, the present invention is not limited to the specific embodiments disclosed above. Furthermore, any person skilled in the art can make many possible variations and modifications to the technical solutions of the present invention, or modify them into equivalent embodiments, using the methods and techniques disclosed above, without departing from the scope of the present invention. Any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention, without departing from the content of the present invention, shall still fall within the protection scope of the present invention.

Claims

1. A method for detecting medical indicators based on test strip images, characterized in that: Includes the following steps: Step S1: Acquire the image of the test strip and perform preprocessing operations on the image, including image correction, conversion to grayscale, and removal of background interference; Step S2: Extract image information from the preprocessed image, specifically including: Step S21: Calculate the cumulative distribution of pixel intensity along the extension direction of the reaction zone strip on the test strip; Step S22: Identify at least two feature regions corresponding to different reaction bands based on the cumulative pixel intensity distribution; Step S23: Based on the pixel intensity of the at least two feature regions, determine the feature value used to indicate the degree of reaction. ; Step S3: Set the feature value Input a preset prediction model to obtain the quantitative results of medical indicators output by the prediction model. The prediction model is used to build a model from the feature values. To medical indicators The mapping relationship.

2. The medical indicator detection method based on test strip images according to claim 1, characterized in that: In step S1, the image correction includes translation, rotation, and cropping.

3. The method for detecting medical indicators based on test strip images according to claim 1, characterized in that: In step S1, the formula for converting the color image of the test strip to a grayscale image is: ; in, The row index of the pixels in the image. The column index for the pixels of the image. For the blue channel array, For the green channel array, This is the red channel array.

4. The medical indicator detection method based on test strip images according to claim 1, characterized in that: In step S1, the rolling ball algorithm is used for background removal, specifically including: Background estimation is performed using the following formula: ; in, The radius of the rolling ball window; Then extract the foreground and remove the background, using the following formula: ; in, For the threshold, .

5. The medical indicator detection method based on test strip images according to claim 1, characterized in that: In step S21, the pixel values ​​of each row are accumulated to generate a row intensity vector, calculated using the following formula: ; in, The row index of the pixels in the image. The column index of the image's pixels.

6. The medical indicator detection method based on test strip images according to claim 5, characterized in that: In step S22, the positions of the two horizontal lines are located based on the vector of the row cumulative intensity, and the bimodal position is identified from the line graph of the row cumulative intensity: ; 。 7. The method for detecting medical indicators based on test strip images according to claim 6, characterized in that: In step S23, based on the bimodal position, the complete bimodal peaks are extracted respectively, and the ratio of their cumulative intensities is calculated as the eigenvalue. The calculation formula is as follows: ; ; ; in, This is the window width.

8. The method for detecting medical indicators based on test strip images according to claim 1, characterized in that: In step S3, the prediction model is a single-factor linear model, and the expression of the single-factor linear model is: ; Among them, The slope This is the intercept.

9. The method for detecting medical indicators based on test strip images according to claim 1, characterized in that: In step S3, the prediction model is a multi-factor deep learning model, and the expression of the multi-factor deep learning model is: ; in, As an auxiliary indicator, the multi-factor deep learning model includes a core structure of Multi-Head Attention. The model works by dividing the original input vector into multiple independent attention heads, each of which independently learns different attention weights to achieve multi-dimensional attention to different features in the input sequence, and then outputting medical indicators through nonlinear mapping.

10. A medical indicator detection system based on test strip images, characterized in that: The medical indicator detection method based on test strip images according to any one of claims 1-9 includes: The image preprocessing module is used to acquire images of the test strips and preprocess the acquired images. The preprocessing operations include correction, conversion to grayscale, and removal of background interference. The information extraction module is used to process the preprocessed image to obtain the cumulative distribution of pixel intensity along the extension direction of the reaction zone of the test strip, and to identify at least two feature regions corresponding to different reaction zones based on the distribution, and then to determine the feature value based on the pixel intensity of the feature regions. The indicator prediction module stores a preset prediction model, which is used to receive the feature values ​​and output the quantitative results of medical indicators.

11. An electronic device, characterized in that: include: At least one processor; as well as At least one memory communicatively connected to the processor; The memory stores instructions that can be executed by a processor, which are executed by the processor to cause the electronic device to perform the medical indicator detection method based on test strip images as described in any one of claims 1-9.