A method for correcting the spectral color feature range of secretion test strip images

By constructing an SVM model with spectral color feature range, the inconsistency problem caused by differences in ambient light and equipment in the comparison of secretion test strip images was solved, achieving high-precision color correction and comparison, and improving the accuracy and reliability of medical testing.

CN123118789APending Publication Date: 2026-11-17THE WEST CHINA SECOND UNIV HOSPITAL OF SICHUAN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411118463.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, the color comparison of secretion test strips is affected by ambient light, equipment differences, and user operation, resulting in inconsistent comparison results. Furthermore, it fails to effectively handle complex backgrounds and noise interference, affecting the accuracy of the test.

Method used

A spectral color feature range calibration model was constructed using the support vector machine (SVM) method. Through standard data acquisition, feature extraction, label generation, and model training, image segmentation and color correction were performed to achieve accurate comparison of secretion test strip images.

Benefits of technology

It improves the accuracy and stability of color matching, reduces the impact of changes in ambient lighting, ensures the consistency and reliability of matching results, adapts to complex color management needs, supports multiple color space conversions, and reduces subjective judgment errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118789A_ABST
    Figure CN123118789A_ABST
Patent Text Reader

Abstract

This invention discloses a method for correcting the spectral color feature range of secretion test strip images, comprising the following steps: Step 1, standard data acquisition; Step 2, data preparation; Step 3, feature extraction; Step 4, label generation; Step 5, training an SVM model; Step 6, segmentation using the SVM model; Step 7, reconstructing the segmented image. This invention employs the Support Vector Machine (SVM) method for the colors generated by these special reactions. By constructing a calibration model suitable for the spectral color feature range of secretion test strip images, such as the color changes of different test areas corresponding to different chemical reactions, the color card of the test strip image is divided into regions based on the corresponding color changes after special reactions. The true colors are restored, and each region is compared with the standard color card corresponding to its respective region for modeling and correction, which helps improve the accuracy and reliability of medical testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to a method for correcting the spectral color feature range of secretion test strip images. Background Technology

[0002] Secretion test strips are widely used in clinical diagnosis and home self-testing, offering advantages such as low cost, ease of use, and rapid response. Traditional test strip color comparison relies heavily on manual visual comparison, comparing the test strip color with a standard color chart to obtain qualitative or semi-quantitative results. With the development of digital image processing technology, more and more applications are utilizing smartphone cameras and image analysis software for color comparison, improving accuracy and repeatability. However, this technology is affected by ambient light; different light sources, light intensities, and angles can all lead to changes in color perception, affecting the accuracy of the comparison results. Furthermore, batch-to-batch color differences may exist during the test strip manufacturing process, and the colors on the standard color chart may also change over time, resulting in inconsistent comparison results. Different devices (such as smartphone cameras) have varying color capture capabilities, and the colors in captured images may differ from the actual colors, thus requiring color calibration. However, complex backgrounds, noise, and shadows can all interfere with color extraction and comparison; the accuracy of the image processing and color comparison algorithms directly affects the comparison results. In addition, the user's actions when capturing test strip images (such as shooting angle, distance, and lighting conditions) also affect image quality and comparison results.

[0003] Standard color charts for test strips typically possess known color and spectral characteristics. The goal of calibration models is to adjust the colors of captured test strip images to match those of the standard color chart. Spectral color characteristics provide more detailed spectral information, enabling the detection and analysis of minute color differences. They also ensure the consistency and reliability of color comparisons by correcting and compensating for changes in ambient lighting conditions, unaffected by external light variations. This spectral data can be digitally stored, maintaining long-term stability and avoiding the aging or deterioration issues of traditional color charts. Furthermore, it adapts to more complex color management needs, handling complex color systems and supporting multiple color space conversions and comparisons. These advantages give spectral color characteristics higher accuracy, stability, and applicability in color comparisons, reducing errors caused by subjective judgment. Currently, in medical testing of secretions, it is necessary to consider the color changes of the test strips after specific chemical reactions in the secretions. Calibration models need to model and correct for these specific color changes. Besides the different color characteristics of different detection areas on the test strip, the color feature range covered by other test strips differs from that covered by secretion test strips due to different chemical reactions being tested, resulting in lower recognition accuracy of current secretion test strips in clinical biochemical testing.

[0004] To address the aforementioned issues, further improvements are needed in image processing and color comparison algorithms to enhance their anti-interference capabilities and increase comparison accuracy. Machine learning and artificial intelligence technologies can be employed to improve the accuracy of comparison results. Simultaneously, a dedicated mobile application model should be developed, integrating color calibration, image processing, and result comparison functions to provide users with a convenient and accurate test strip color comparison tool. To this end, we propose a correction method for the spectral color feature range of secretion test strip images to solve the above problems. Summary of the Invention

[0005] The purpose of this invention is to provide a method for correcting the spectral color feature range of secretion test strip images, so as to solve the problems mentioned in the background art.

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

[0007] A method for correcting the spectral color feature range of a secretion test strip image, comprising the following steps:

[0008] Step 1: Standard Data Acquisition

[0009] The laboratory collects spectral color characteristic data of secretion test strips, including the spectral color characteristic range of each detection indicator.

[0010] Step 2: Data Preparation

[0011] Acquire images of secretion test strips from the training set, extract color information from the images, where the color information is represented in RGB color space, and extract the RGB value of each pixel from the image as a feature.

[0012] Step 3: Feature Extraction

[0013] The color value of each pixel is used as a feature vector [R,G,B], and the color of each pixel is represented by the feature vector: x i =[R i G i B i R i G i B i Let i represent the red, green, and blue components of the i-th pixel, respectively. First, select a specific band and choose the band corresponding to the red, green, and blue bands from the spectral image to generate an RGB image. Then, use the information from multiple bands to synthesize and create an RGB image that simulates visible light.

[0014] Step 4: Tag Generation

[0015] To train an SVM, a label needs to be assigned to each pixel. A clustering algorithm is used to perform preliminary segmentation of the image. The standard data results are used as reference labels for the training data. The reaction images of the secretion test strips in the training set are then labeled according to the standard data.

[0016] Step 5: Train the SVM model

[0017] The SVM model is trained using labeled spectral color features.

[0018] ① Support Vector Machine Formula: SVM separates pixels of different categories by finding a hyperplane. For binary classification problems, the hyperplane formula is: w·x+b=0, where w is the weight vector and b is the bias term.

[0019] ② Optimization objective: The objective of SVM is to maximize the classification margin, that is, to ensure that all training samples satisfy: y i (w·x i +b)≥1-ξ i , where ξ i These are slack variables used to allow some samples to violate the margin condition (soft-margin SVM) while minimizing the following loss function: Where C is the regularization parameter, which controls the degree of penalty for violating the interval.

[0020] ③ Using kernel functions: To handle non-linear classification problems, the kernel function K(x) can be used. i ,x j This maps the data to a higher-dimensional feature space.

[0021] Step 6: Apply SVM model for segmentation

[0022] The new image is segmented using a trained SVM model. For each pixel in the new image, its RGB features are extracted and predicted.

[0023] Step 7: Reconstruct the segmented image

[0024] Converting the predicted labels back to image format, with each label corresponding to a segmented region, enables color correction that includes the range of spectral color features.

[0025] In a further embodiment, the image collection in step 1 must ensure that the collected data has sufficient diversity and representativeness to cover a variety of possible color variations and lighting conditions.

[0026] In a further embodiment, the images collected in step 1 are subjected to denoising, enhancement, cropping, and localization processing.

[0027] In a further embodiment, step 5 requires the use of a portion of independent test data to quantitatively evaluate the performance of the SVM model, and experts are invited to conduct a visual qualitative evaluation of the corrected image to ensure that the correction result meets the requirements of medical diagnosis.

[0028] Furthermore, the test data used to evaluate the SVM model includes mean squared error (MSE), root mean squared error (RMSE), or other regression performance metrics.

[0029] In a further embodiment, the kernel function may employ one or more combinations of the following:

[0030] Linear kernel: K(x) i ,x j )=x i ·x j ;

[0031] Polynomial kernel: K(x) i ,x j )=(x i ·x j +1) d ;

[0032] Gaussian kernel (RBF kernel): K(x) i ,x j )=exp(-γ||x i -x j || 2 ).

[0033] Compared with the prior art, the beneficial effects of the present invention are:

[0034] This invention employs Support Vector Machine (SVM) to analyze the spectral images generated by these specific reactions. By constructing a calibration model suitable for the spectral color feature range of secretion test strip images—for example, recognizing the color changes of different test areas corresponding to different chemical reactions—the color card of the test strip image is segmented into regions based on the corresponding color changes after specific reactions. The true colors are then restored, and each region is compared with the corresponding standard color card for modeling and correction. This allows for accurate identification and quantification of chemical components and provides a basis for clinical diagnosis. Spectral color features provide more detailed spectral information, enabling the detection and analysis of minute color differences. Furthermore, by correcting and compensating for changes in ambient lighting conditions, the consistency and reliability of color comparisons are ensured, unaffected by changes in external lighting. This spectral data can also be digitally stored, maintaining long-term stability and avoiding the aging or deterioration problems of traditional color cards. It also adapts to the more complex color management needs of the medical field, handling complex color systems, supporting multiple color space conversions and comparisons, reducing errors caused by subjective judgment, and improving the accuracy and reliability of medical testing. This model can be used to develop and construct a standardized and high-precision storage and analysis system based on color card-based test strips. Attached Figure Description

[0035] Figure 1 This is a schematic diagram showing the corresponding color feature indicators of the present invention;

[0036] Figure 2 This is a schematic flowchart illustrating the label of the present invention;

[0037] Figure 3 This is a flowchart of the present invention. Detailed Implementation

[0038] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are used only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0039] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.

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

[0041] Please see Figure 3 A method for correcting the spectral color feature range of secretion test strip images, comprising the following steps:

[0042] Step 1: Standard Data Acquisition

[0043] The laboratory collects spectral color feature data of secretion test strips, including the spectral color feature range of each detection index. The collected images must ensure that the collected data has sufficient diversity and representativeness to cover all possible color changes and lighting conditions. The collected images need to be denoised, enhanced, cropped and positioned to enhance the image quality. As shown in Figure (1), taking the pH value as an example, color 1, color 2, color 3 and color 4 may appear, corresponding to result 1, result 2, result 3 and result 4 respectively. The color of each color block corresponds to the accurate measurement index of the laboratory.

[0044] Step 2: Data Preparation

[0045] Acquire images of secretion test strips from the training set, extract color information from the images, where the color information is represented in RGB color space, and extract the RGB value of each pixel from the image as a feature.

[0046] Step 3: Feature Extraction

[0047] The color value of each pixel is used as a feature vector [R,G,B], and the color of each pixel is represented by the feature vector: x i =[R i G i B i R i G i B iLet i represent the red, green, and blue components of the i-th pixel, respectively. First, select a specific band and choose the band corresponding to the red, green, and blue bands from the spectral image to generate an RGB image. Then, use the information from multiple bands to synthesize and create an RGB image that simulates visible light.

[0048] Step 4: Tag Generation

[0049] To train the SVM, as shown in Figure (2), it is necessary to assign a label to each pixel, use a clustering algorithm to perform preliminary segmentation of the image, use the standard data results as the reference label of the training data, and assign labels to the reaction of the secretion test strip image in the training set according to the standard data.

[0050] Step 5: Train the SVM model

[0051] The SVM model is trained using labeled spectral color features.

[0052] ① Support Vector Machine Formula: SVM separates pixels of different categories by finding a hyperplane. For binary classification problems, the hyperplane formula is: w·x+b=0, where w is the weight vector and b is the bias term.

[0053] ② Optimization objective: The objective of SVM is to maximize the classification margin, that is, to ensure that all training samples satisfy: y i (w·x i +b)≥1-ξ i , where ξ i These are slack variables used to allow some samples to violate the margin condition (soft-margin SVM) while minimizing the following loss function: Where C is the regularization parameter, which controls the degree of penalty for violating the interval.

[0054] ③ Using kernel functions: To handle non-linear classification problems, the kernel function K(x) can be used. i ,x j To map data to a higher-dimensional feature space, the kernel function can be one or more combinations of the following:

[0055] Linear kernel: K(x) i ,x j )=x i ·x j ;

[0056] Polynomial kernel: K(x) i ,x j )=(x i ·x j +1) d ;

[0057] Gaussian kernel (RBF kernel): K(x) i ,xj )=exp(-γ||x i -x j || 2 ).

[0058] During the training phase, since one detection metric may correspond to multiple color categories, a binary SVM classifier is trained for each category. If there are K categories, K classifiers are trained. Each classifier treats samples of its current category as positive and samples of the other categories as negative. During prediction, for a new sample, prediction is performed using all classifiers, and the category corresponding to the classifier with the highest confidence is selected.

[0059] During the training phase, for each class i, an SVM classifier f is trained. i Each classifier solves

[0060] The following optimization issues:

[0061] Where y k (w i ·x k +b i )≥1-ξ k , and ξ k ≥0, here y k A value of 1 indicates the current category, and -1 indicates that it belongs to another category.

[0062] In the prediction phase, for a new sample x, each classifier f i Give the confidence score d i Select the category corresponding to the classifier with the highest confidence score:

[0063] Where d i =f i (x).

[0064] To ensure the correction effect, it is necessary to use test data such as mean squared error (MSE), root mean square error (RMSE) or other regression performance indicators to quantitatively evaluate the performance of the SVM model, and invite experts to conduct visual qualitative evaluation of the corrected images to ensure that the correction results meet the requirements of medical diagnosis.

[0065] Step 6: Apply SVM model for segmentation

[0066] The new image is segmented using a trained SVM model. For each pixel in the new image, its RGB features are extracted and predicted.

[0067] Step 7: Reconstruct the segmented image

[0068] Converting the predicted labels back to image format, with each label corresponding to a segmented region, enables color correction that includes the range of spectral color features.

[0069] The method of this invention uses the Support Vector Machine (SVM) method to divide the color card of the test paper into regions according to the corresponding color changes after the special reaction, restore the true color, and compare it with the standard color card corresponding to each region to perform modeling and correction, so as to accurately identify and quantify chemical components and provide clinical diagnostic basis, which is conducive to improving the accuracy and reliability of medical testing.

[0070] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0071] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A method for correcting the spectral color feature range of a secretion test strip image, characterized in that, Includes the following steps: Step 1: Standard Data Acquisition The laboratory collects spectral color characteristic data of secretion test strips, including the spectral color characteristic range of each detection indicator. Step 2: Data Preparation Acquire images of secretion test strips from the training set, extract color information from the images, where the color information is represented in RGB color space, and extract the RGB value of each pixel from the image as a feature. Step 3: Feature Extraction The color value of each pixel is taken as a feature vector [R, G, B], and the color of each pixel is represented by a feature vector: x i = [R i , G i , B i ] where R i , G i , B i represent the red, green, and blue components of the ith pixel, respectively. First, a specific waveband is selected, and wavebands corresponding to the red, green, and blue wavebands are selected from the spectral image to generate an RGB image. Then, information from multiple wavebands is used for synthesis to create an RGB image that simulates visible light. Step 4: Tag Generation To train an SVM, a label needs to be assigned to each pixel. A clustering algorithm is used to perform preliminary segmentation of the image. The standard data results are used as reference labels for the training data. The reaction images of the secretion test strips in the training set are then labeled according to the standard data. Step 5: Train the SVM model The SVM model is trained using labeled spectral color features. ① Support Vector Machine Formula: SVM separates pixels of different categories by finding a hyperplane. For binary classification problems, the hyperplane formula is: w·x+b=0, where w is the weight vector and b is the bias term. ② Optimization objective: The objective of SVM is to maximize the classification margin, that is, to ensure that all training samples satisfy: y i (w·x i +b)≥1-ξ i Where ξi is a slack variable used to allow some samples to violate the margin condition (soft-margin SVM), while minimizing the following loss function: Where C is the regularization parameter, which controls the degree of penalty for violating the interval. ③ Using kernel functions: To handle non-linear classification problems, the kernel function K(x) can be used. i ,x j This maps the data to a higher-dimensional feature space. Step 6: Apply SVM model for segmentation The new image is segmented using a trained SVM model. For each pixel in the new image, its RGB features are extracted and predicted. Step 7: Reconstruct the segmented image Converting the predicted labels back to image format, with each label corresponding to a segmented region, enables color correction that includes the range of spectral color features.

2. The method for correcting the spectral color feature range of a secretion test strip image according to claim 1, characterized in that: In step 1, the collected images must ensure that the collected data is sufficiently diverse and representative to cover a wide range of possible color variations and lighting conditions.

3. The method for correcting the spectral color feature range of a secretion test strip image according to claim 1, characterized in that: The images collected in step 1 are subjected to denoising, enhancement, cropping, and localization processing.

4. The method for correcting the spectral color feature range of a secretion test strip image according to claim 1, characterized in that: In step 5, a portion of independent test data is needed to quantitatively evaluate the performance of the SVM model, and experts are invited to conduct a visual qualitative evaluation of the corrected image to ensure that the correction results meet the requirements of medical diagnosis.

5. The method for correcting the spectral color feature range of a secretion test strip image according to claim 4, characterized in that: Test data used to evaluate SVM models include mean squared error (MSE), root mean squared error (RMSE), or other regression performance metrics.

6. The method for correcting the spectral color feature range of a secretion test strip image according to claim 1, characterized in that: Kernel functions can be one or more combinations of the following: Linear kernel: K(x) i ,x j )=x i ·x j ; Polynomial kernel: K(x) i ,x j )=(x i ·x j +1) d ; Gaussian kernel (RBF kernel): K(x) i ,x j )=exp(-γ||x i -x j || 2 ).