An image recognition-based urine occult blood classification method and system

By automatically analyzing urine images using image recognition technology, the problem of relying on specialized equipment for existing urine occult blood detection has been solved, enabling convenient, low-cost, and efficient urine occult blood detection.

CN116883739BActive Publication Date: 2026-04-10INST OF BIOMEDICAL ENG CHINESE ACAD OF MEDICAL SCI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Current methods for detecting occult blood in urine rely on specialized equipment and technicians, resulting in low flexibility and convenience, high testing costs, and long testing times, making it difficult to meet the needs of long-term patient monitoring.

Method used

This paper proposes an image recognition-based method for classifying occult blood in urine. By acquiring urine image data, preprocessing it, calculating the average value of color channels and classification parameters, and automatically analyzing the occult blood classification results using urine images captured by a mobile phone, it eliminates the need for specialized equipment and technical support.

Benefits of technology

It enables urine occult blood testing without the need for specialized equipment and technical support, improving the flexibility and convenience of testing, reducing testing costs and time, and increasing testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116883739B_ABST
    Figure CN116883739B_ABST
Patent Text Reader

Abstract

The application discloses a urine occult blood classification method and system based on image recognition, and belongs to the technical field of image recognition and medical diagnosis, and comprises the following steps: acquiring a sample data set; adding classification labels to urine image data in the sample data set; pre-processing the urine image data in the sample data set; calculating color average values of each pre-processed urine image data in each color channel; calculating classification parameter values according to the color average values in each color channel; calculating average values of the classification parameter values of the urine image data under six classification labels; calculating five classification threshold values between the six classification labels according to the average values of the classification parameter values of the urine image data under the six classification labels; acquiring real-time urine image data; calculating a classification parameter value of the real-time urine image data; comparing the classification parameter value of the real-time urine image data with the five classification threshold values, and outputting a urine occult blood classification result of the real-time urine image data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of image recognition and medical diagnosis, and particularly relates to a urine occult blood classification method and system based on image recognition. BACKGROUND

[0002] Urine occult blood detection is an important examination in clinical routine urine examination, which is used for evaluating whether red blood cells exist in urine and diagnosing and monitoring related diseases. Under normal circumstances, urine does not contain red blood cells. Urine occult blood positive may indicate the existence of diseases such as kidney lesions, urinary tract infections, stones and tumors, so early and accurate detection and identification of urine occult blood become an important link for clinicians to diagnose and treat diseases.

[0003] At present, in the clinic, the detection of urine occult blood mainly relies on two methods of urine analyzer and urine microscope. The urine analyzer adopts dry chemical test paper method to detect the hemoglobin content in urine through the color change of the test paper; and the urine microscope detects urine occult blood by observing the number and morphology of red blood cells in urine.

[0004] Although the two methods are widely used in the clinic, there are still some obvious shortcomings.

[0005] Firstly, the existing detection method relies on professional equipment and technical personnel, and needs to use special equipment such as microscopes and test papers for detection, which means that patients must go to medical institutions for urine sample collection, which brings them inconvenience. This dependence limits the flexibility and convenience of urine occult blood detection.

[0006] Secondly, for patients who need long-term monitoring and management of related diseases, frequent hospital visits for examination also bring certain economic burden, and because of the need for appointment and waiting, patients need to spend a considerable amount of time. This situation may affect the timely monitoring of urine occult blood indicators by patients, and thus delay treatment. SUMMARY

[0007] In order to solve the technical problems of the prior art that need to rely on professional equipment and technical personnel, low flexibility and convenience, high detection cost and long detection time, the present application provides a urine occult blood classification method and system based on image recognition.

[0008] First aspect

[0009] The present application provides a urine occult blood classification method based on image recognition, comprising:

[0010] S101: acquiring a sample data set, the sample data set including urine image data of normal people and urine image data of kidney disease patients;

[0011] S102: adding a classification label to the urine image data in the sample data set, wherein the classification label includes: -, +-, +, ++, +++ and ++++, wherein - represents a normal healthy state, +- represents a suspicious positive of urinary occult blood, + represents a weak positive of urinary occult blood, ++ represents a moderate positive of urinary occult blood, +++ represents a strong positive of urinary occult blood, and ++++ represents an ultra positive of urinary occult blood;

[0012] S103: preprocessing the urine image data in the sample data set;

[0013] S104: calculating color average values (r, g, b) of each preprocessed urine image data in each color channel, wherein r represents the color average value of the R channel, g represents the color average value of the G channel, and b represents the color average value of the B channel;

[0014] S105: calculating a classification parameter value δ according to the color average values (r, g, b) in each color channel:

[0015] δ=ρ·r-g-b

[0016] wherein ρ represents a classification coefficient;

[0017] S106: calculating average values of the classification parameter values of the urine image data under the six classification labels, respectively denoted as δ1, δ2, δ3, δ4, δ5 and δ6;

[0018] S107: calculating five classification thresholds between the six classification labels according to the average values of the classification parameter values of the urine image data under the six classification labels, respectively denoted as λ1, λ2, λ3, λ4 and λ5;

[0019] S108: obtaining real-time urine image data;

[0020] S109: repeating S103 to S105 to calculate the classification parameter value δ of the real-time urine image data * ;

[0021] S110: comparing the classification parameter value δ of the real-time urine image data * with the five classification thresholds, and outputting the urinary occult blood classification result of the real-time urine image data.

[0022] The second aspect

[0023] The application provides a urinary occult blood classification system based on image recognition, which is used for executing the urinary occult blood classification method based on image recognition in the first aspect.

[0024] Compared with the prior art, the application has at least the following beneficial technical effects:

[0025] In the present application, by shooting a urine image, the color of the urine image is analyzed, and then the urine occult blood classification result of the patient is determined, without relying on professional equipment such as a urine analyzer and a urine microscope, the urine occult blood classification result can be automatically output, without the support of professional technicians, reducing the subjectivity in the decision-making process, only a mobile phone is needed to shoot a urine image for analysis, improving the flexibility and convenience of urine occult blood detection, with low detection cost and short detection time, improving the efficiency of urine occult blood detection. BRIEF DESCRIPTION OF DRAWINGS

[0026] The above-mentioned characteristics, technical features, advantages and implementation ways of the present application will be further described in the following preferred embodiments in a clear and understandable manner in combination with the accompanying drawings.

[0027] Figure 1 is a flowchart of a urine occult blood classification method based on image recognition provided by the present application. DETAILED DESCRIPTION

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the specific embodiments of the present application will be described in combination with the accompanying drawings. Obviously, the drawings in the following description only represent some embodiments of the present application, and for those skilled in the art, other drawings can be obtained from these drawings without creative labor, and other embodiments can also be obtained.

[0029] In order to make the drawing simple, only the parts related to the present application are shown in each drawing, which does not represent the actual structure of the product. In addition, in order to make the drawing simple and easy to understand, in some drawings, only one of the parts with the same structure or function is shown, or only one of them is marked. In this paper, "one" not only means "only one", but also means "more than one".

[0030] It should be further understood that the term "and / or" used in the specification and the appended claims of the present application means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0031] In this paper, it should be noted that unless otherwise specified and limited, the terms "mounting", "connection" and "connection" should be understood broadly, for example, it can be fixed connection, or detachable connection, or integral connection. It can be mechanical connection or electrical connection. It can be directly connected or indirectly connected through an intermediate medium. It can be the communication inside two elements. For those skilled in the art, the specific meaning of the above-mentioned terms in the present application can be understood according to the specific circumstances.

[0032] In addition, in the description of the present application, the terms "first", "second", etc. are only used for differentiation and cannot be understood as indicating or implying relative importance.

[0033] Embodiment 1

[0034] In one embodiment, reference is made to the drawings attached hereto Figure 1 , a flowchart of a urine occult blood classification method based on image recognition provided by the present application is shown.

[0035] The urine occult blood classification method based on image recognition provided by the present application comprises:

[0036] S101: Obtain a sample data set, which includes urine image data of normal people and urine image data of patients with kidney diseases.

[0037] Specifically, the sample data set can be formed by taking urine images of normal people and urine images of patients with kidney diseases through a camera.

[0038] Alternatively, the urine images of normal people and the urine images of patients with kidney diseases can also be obtained through other image sensors.

[0039] S102: Add a classification label to the urine image data in the sample data set.

[0040] It should be noted that the main basis for the classification label is the severity of urine occult blood.

[0041] Among them, the classification label includes: -, +-, +, ++, +++ and ++++.

[0042] Among them, - represents a normal healthy state, +- represents suspicious positive of urine occult blood, + represents weak positive of urine occult blood, ++ represents moderate positive of urine occult blood, +++ represents strong positive of urine occult blood, and ++++ represents super positive of urine occult blood. For -, +-, +, ++, +++ and ++++, the severity of urine occult blood is gradually increased.

[0043] S103: Preprocess the urine image data in the sample data set.

[0044] Among them, the preprocessing can include normalization, denoising, image enhancement, cropping, background removal, etc.

[0045] In one possible implementation, S103 specifically comprises:

[0046] S1031: Normalize the urine image data in the sample data set:

[0047]

[0048] Among them, (xi , y j , y i , y j , y i , y j , y i , y j , y i , y j , y

[0049] It should be noted that mapping the pixel values of the urine image data to a fixed range can ensure that the pixel values of different images have similar scales, improve the stability and convergence speed of the algorithm, and improve the performance of the classifier.

[0050] In a possible implementation, after S1031 in S103, S103 further includes:

[0051] S1032: performing denoising processing on the normalized urine image data by a median filtering algorithm.

[0052] Specifically, the color value of each pixel point can be updated to the median of the pixels within the 3*3 filter window, to remove the noise points in the image. The median filtering algorithm has the advantage of effectively removing noise while preserving the edge and detail information of the image.

[0053] In a possible implementation, after S1032 in S103, S103 further includes:

[0054] S1033: cropping the denoised urine image data to a preset size.

[0055] The preset size can be 400*400.

[0056] S1034: removing the background image in the cropped urine image.

[0057] The background image refers to a part that does not contain the urine image.

[0058] Specifically, the threshold segmentation method can be used to remove the background image. The image is converted into a grayscale image, and then an appropriate threshold is selected. The part with a pixel value lower than the threshold is set to black (background), and the part with a pixel value higher than the threshold is set to white (foreground). In this way, the separation of the background and the foreground can be achieved. According to the characteristics of the image and the brightness difference of the background, a suitable threshold is selected for segmentation.

[0059] S104: Calculate the color average values (r, g, b) of each pre-processed urine image data in each color channel, where r represents the color average value of the R channel, g represents the color average value of the G channel, and b represents the color average value of the B channel.

[0060] where RGB channel refers to an image channel system composed of three basic color channels of red (Red), green (Green), and blue (Blue). In the RGB color model, all visible colors of light can be represented by different degrees of mixing of red, green, and blue. Each pixel point in an RGB image is represented by three component values, corresponding to the red channel, green channel, and blue channel, respectively. The value range of these three channels is usually 0 to 255, where 0 represents the lowest brightness or no contribution of the color, and 255 represents the highest brightness or the maximum contribution of the color.

[0061] In one possible implementation, S104 specifically includes:

[0062] The color average values of each pre-processed urine image data in each color channel are calculated by the following formula:

[0063]

[0064] where r represents the color average value of the R channel, g represents the color average value of the G channel, and b represents the color average value of the B channel, (x i ,y j ) represents the pixel point at the i-th row and j-th column, RGB(x i ,y j ) represents the RGB color value of the pre-processed urine image at (x i ,y j ), W represents the horizontal pixel number of the pre-processed urine image, and L represents the vertical pixel number of the pre-processed urine image.

[0065] S105: Calculate the classification parameter value δ according to the color average values (r, g, b) in each color channel:

[0066] δ = p·r - g - b

[0067] where p represents the classification coefficient.

[0068] Optionally, the value of the p classification coefficient is 2, and in this case, the classification parameter value δ represents the difference between the red brightness and the blue-green brightness in the image. Generally speaking, for a urine image data, the more severe the urinary occult blood is, the larger the classification parameter value δ is.

[0069] S106: Calculate the average of the classification parameter values of the urine image data under the six classification labels, respectively denoted as δ1, δ2, δ3, δ4, δ5 and δ6.

[0070] S107: Calculate five classification thresholds between the six classification labels according to the average of the classification parameter values of the urine image data under the six classification labels, respectively denoted as λ1, λ2, λ3, λ4 and λ5.

[0071] In a possible implementation, S107 specifically includes:

[0072] The five classification thresholds λ1, λ2, λ3, λ4 and λ5 between the six classification labels are calculated according to the average of the classification parameter values of the urine image data under the six classification labels by the following formula:

[0073]

[0074] S108: Obtain real-time urine image data.

[0075] Specifically, the real-time urine image data can be obtained by an image sensor or a camera.

[0076] S109: Repeat S103 to S105 to calculate the classification parameter value δ * of the real-time urine image data.

[0077] Specifically, the above description of S103 to S105 can be referred to, and the present application will not be repeated here.

[0078] S110: Compare the classification parameter value δ * of the real-time urine image data with the five classification thresholds, and output the urine occult blood classification result of the real-time urine image data.

[0079] In a possible implementation, S110 specifically includes:

[0080] S1101: When δ * < λ1, output the urine occult blood classification result of -.

[0081] S1102: When λ1≤ δ * < λ2, output the urine occult blood classification result of + -.

[0082] S1103: When λ2≤ δ * < λ3, output the urine occult blood classification result of +.

[0083] S1104: When λ3≤ δ * < λ4, output the urine occult blood classification result of + +.

[0084] S1105: When λ4≤δ * <λ5, output the urinary occult blood classification result of +++.

[0085] S1106: When δ * ≥λ5, output the urinary occult blood classification result of ++++.

[0086] In one possible implementation, the image recognition-based urinary occult blood classification method further includes:

[0087] S111: Evaluate the urinary occult blood classification result.

[0088] S112: According to the evaluation result, adjust the values of the classification coefficients ρ, the classification thresholds λ1, λ2, λ3, λ4 and λ5.

[0089] It should be noted that according to the change of the evaluation index, the parameter settings of the classification algorithm can be optimized to better adapt to different urine image data sets and classification requirements. By continuously adjusting the parameters and thresholds, the performance of the classification algorithm can be improved to more accurately identify the urinary occult blood classification result.

[0090] In one possible implementation, S111 specifically includes:

[0091] S1111: Evaluate the urinary occult blood classification result in terms of classification accuracy A:

[0092]

[0093] Wherein, N correct represents the number of correctly classified samples, N total represents the total number of samples.

[0094] S1112: Evaluate the urinary occult blood classification result in terms of F1 index S:

[0095]

[0096] Wherein, precision represents the precision, indicates the proportion of true positive examples in the classified positive examples, and recall represents the recall, indicates the ratio of the number of correctly classified positive examples to the actual number of positive examples.

[0097] Compared with the prior art, the present application has at least the following beneficial technical effects:

[0098] In the present application, by shooting the urine image, the color of the urine image is analyzed, and then the urine occult blood classification result of the patient is determined, without relying on professional equipment such as a urine analyzer and a urine microscope, the urine occult blood classification result can be automatically output, without the support of professional technicians, the subjectivity in the decision-making process is reduced, only the urine image can be analyzed by shooting with a mobile phone, the flexibility and convenience of urine occult blood detection are improved, the detection cost is low, the detection time is short, and the efficiency of urine occult blood detection is improved.

[0099] Embodiment 2

[0100] In one embodiment, the present application provides an image recognition-based urine occult blood classification system for executing the image recognition-based urine occult blood classification method in embodiment 1.

[0101] The image recognition-based urine occult blood classification system provided by the present application can realize the steps and effects of the image recognition-based urine occult blood classification method in embodiment 1 described above, and the present application will not be described again to avoid repetition.

[0102] Compared with the prior art, the present application has at least the following beneficial technical effects:

[0103] In the present application, by shooting the urine image, the color of the urine image is analyzed, and then the urine occult blood classification result of the patient is determined, without relying on professional equipment such as a urine analyzer and a urine microscope, the urine occult blood classification result can be automatically output, without the support of professional technicians, the subjectivity in the decision-making process is reduced, only the urine image can be analyzed by shooting with a mobile phone, the flexibility and convenience of urine occult blood detection are improved, the detection cost is low, the detection time is short, and the efficiency of urine occult blood detection is improved.

[0104] The technical features of the above embodiments can be combined arbitrarily, in order to make the description concise, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0105] The above embodiments only express several embodiments of the present application, the description is more specific and detailed, but it cannot be understood as limiting the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which belong to the protection scope of the present application. Therefore, the protection scope of the present application patent should be subject to the appended claims.

Claims

1. An image recognition-based urine occult blood classification method, characterized by, The method comprises: S101: acquiring a sample data set, the sample data set comprising urine image data of a normal population and urine image data of a patient with kidney disease; S102: adding a classification label to the urine image data in the sample data set, wherein the classification label comprises -, +-, +, ++, +++ and ++++, wherein - represents a normal healthy state, +- represents suspicious positive of urinary occult blood, + represents weak positive of urinary occult blood, ++ represents moderate positive of urinary occult blood, +++ represents strong positive of urinary occult blood, and ++++ represents super positive of urinary occult blood; S103: preprocessing the urine image data in the sample data set; S104: calculating color average values (r, g, b) of each preprocessed urine image data in each color channel, wherein r represents the color average value of the R channel, g represents the color average value of the G channel, and b represents the color average value of the B channel; S105: calculating a classification parameter value δ according to the color average values (r, g, b) in each color channel: δ = ρ·r-g-b wherein ρ represents a classification coefficient; S106: calculating average values of the classification parameter values of the urine image data under the six classification labels, respectively denoted as δ1, δ2, δ3, δ4, δ5 and δ6; S107: calculating five classification thresholds between the six classification labels according to the average values of the classification parameter values of the urine image data under the six classification labels, respectively denoted as λ1, λ2, λ3, λ4 and λ5; S108: acquiring real-time urine image data; S109: repeating S103 to S105, calculating the classification parameter value δ of the real-time urine image data * ; S110: compare the classification parameter value δ of the real-time urine image data with five classification thresholds, output the urine occult blood classification result of the real-time urine image data. * compare the classification parameter value δ of the real-time urine image data with five classification thresholds, output the urine occult blood classification result of the real-time urine image data.

2. The image recognition-based urine hemo classification method according to claim 1, characterized in that, The S103 specifically comprises: S1031: normalizing the urine image data in the sample data set; wherein (x i ,y j ) represents a pixel point of the i-th row and the j-th column, RGB_U(x i ,y j ) represents an RGB color value of the normalized urine image at (x i ,y j ), RGB0(x i ,y j ) represents an RGB color value of the original urine image at (x i ,y j ), W0 represents a horizontal pixel number of the original urine image, and L0 represents a vertical pixel number of the original urine image.

3. The image recognition-based urine hemo classification method according to claim 2, characterized in that, After the S1031, the S103 further comprises: S1032: performing denoising processing on the normalized urine image data by a median filtering algorithm.

4. The image recognition-based urine hemo classification method according to claim 3, characterized in that, After the S1032, the S103 further comprises: S1033: cropping the denoised urine image data to a preset size; S1034: removing the background image in the cropped urine image.

5. The image recognition-based urine hemo classification method according to claim 1, characterized in that, The S104 specifically comprises: The color average values of each preprocessed urine image data in each color channel are calculated by the following formula: wherein r represents the color average value of the R channel, g represents the color average value of the G channel, b represents the color average value of the B channel, (x i ,y j ) represents the pixel point of the i-th row and the j-th column, RGB(x i ,y j ) represents the RGB color value of the preprocessed urine image at (x i ,y j ), W represents the horizontal pixel number of the preprocessed urine image, and L represents the vertical pixel number of the preprocessed urine image.

6. The image recognition-based urine hemo classification method according to claim 1, characterized in that, The S107 specifically comprises: The five classification thresholds λ1, λ2, λ3, λ4 and λ5 between the six classification labels are calculated according to the average values of the classification parameter values of the urine image data under the six classification labels by the following formula:

7. The image recognition-based urine hemo classification method according to claim 1, characterized in that, The S110 specifically comprises: S1101: When δ * When λ1, output the urinary occult blood classification result; S1102: When λ1≤δ * <λ2, output the urinary occult blood classification result of +-. S1103: When λ2≤δ * When <λ3, output the positive urinary occult blood classification result; S1104: When λ3≤δ * When <λ4, output the ++ urinary occult blood classification result; S1105: When λ4≤δ * When <λ5, output the urine occult blood classification result of +++ S1106: When δ * ≥ λ5, output the urine occult blood classification result of ++++.

8. The image recognition-based urine hemo classification method according to claim 1, characterized in that, Further comprising: S111: evaluating the urinary occult blood classification result; S112: adjusting the values of the classification coefficient ρ, the classification thresholds λ1, λ2, λ3, λ4 and λ5 according to the evaluation result.

9. The image recognition-based urine hemo classification method according to claim 8, characterized in that, The S111 specifically comprises: S1111: evaluating the urinary occult blood classification result in terms of classification accuracy A: where N correct represents the number of samples correctly classified, N total represents the total number of samples; S1112: evaluating the urinary occult blood classification result in terms of F1 index S: wherein precision represents the accuracy rate, recall represents the recall rate, and S represents the F1 index.

10. An image recognition-based urine occult blood classification system, characterized by, An image recognition-based urine occult blood classification method for performing any one of claims 1 to 9. An image recognition-based urine occult blood classification method for performing any one of claims 1 to 9.

Citation Information

Patent Citations

  • Urine color detection method and analyzer

    CN112577905A

  • Urine color quantification method and classification standard

    CN114136959A