Disease prediction system and method based on urine image recognition
By using a combination technology of annular array LED group and polarization filter in the urine analysis system, the specular reflection of the urine liquid surface is separated and suppressed in real time, solving the problem of reflected noise in an open environment, and achieving high-precision and real-time urine analysis.
Patent Information
- Application Number
- CN202510286147.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing urine analysis system is difficult to effectively suppress dynamic liquid surface specular noise in an open environment, resulting in color feature distortion, and traditional solutions rely on mechanical structure or algorithmic post-processing, increasing costs and misjudgment rates.
Multiple LED groups arranged in a ring array are used as light source modules. By turning on different LED groups and image sensors integrating polarization filters in time, the specular reflection components are separated in real time and the light source is turned off. Combined with differential operations, the ambient light interference is eliminated, and the execution cycle of the reflection suppression excitation mode is dynamically adjusted.
It realizes the source elimination of dynamic liquid surface reflected noise in an open environment, improves detection accuracy and real-time, reduces the dependence on user operation specifications, and maintains the system's stable operation under non-blind box conditions.
Smart Images

Figure CN119804326A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a disease prediction system and method based on urine image recognition, belonging to the technical field of urine image detection using polarized light. Background Art
[0002] Urine analysis systems are important tools in the field of medical testing. They predict diseases by collecting urine samples’ color, turbidity and other characteristics. Traditional systems usually use uniform fill light or a closed dark box design, using multi-wavelength light sources to illuminate samples and collect images. However, the specular reflection of the dynamic liquid surface can cause color feature distortion (RGB deviation exceeds 15%), especially in portable home devices. Improper user operation (such as tilting the sample container) can further aggravate reflection interference.
[0003] In the prior art, the following methods are usually used to suppress reflection noise: 1. Multi-angle light source switching: light sources at different angles are switched through mechanical structures, but dynamic liquid level fluctuations make the reflection path unpredictable, fixed angle switching cannot adapt to real-time changes, and the mechanical structure increases costs and failure rates; 2. Image algorithm post-processing: compensation for reflection noise through filtering or deep learning algorithms, but algorithm processing will lose detail information, resulting in an increase in the misjudgment rate of disease prediction models; 3. Physical isolation of ambient light: relying on dark box design to eliminate external interference, but sacrificing system portability, and unable to meet the open environment detection requirements of home scenes. In addition, some solutions attempt to introduce phase modulation devices (such as liquid crystal phase plates) to optimize the light field distribution, but such devices are expensive and have poor mass production consistency, making them difficult to popularize in home appliances. Therefore, how to achieve dynamic liquid surface reflection suppression in an open environment while taking into account detection accuracy, real-time performance and low cost has become a technical problem to be solved in this field. Summary of the invention
[0004] The present invention provides a disease prediction system and method based on urine image recognition, the main purpose of which is to solve the problems of color distortion caused by dynamic liquid surface mirror reflection noise and insufficient compatibility with open environments.
[0005] To achieve the above-mentioned purpose, the present invention provides a disease prediction system based on urine image recognition, comprising a light source module, an image acquisition module and a control module, wherein the light source module is composed of a plurality of LED groups arranged in a circular array, each group comprising at least three LEDs with different wavelengths, and the light source module is configured to turn on different LED groups in a time-sharing manner to suppress dynamic liquid surface reflection; the different LED groups include a first group of LEDs and a second group of LEDs; the image acquisition module includes an image sensor with an integrated polarization filter, configured to respectively collect first image data and second image data in a reflection suppression excitation mode and an ambient light compensation mode; the control module includes a reflection suppression control unit and an ambient light compensation unit, wherein the reflection suppression control unit is configured The invention discloses a method for controlling a light source module to turn on a first group of LEDs in a reflection suppression excitation mode, irradiate a liquid surface with a first light intensity and obtain first image data; determine a light source group set that causes mirror reflection based on the liquid surface profile and polarization state information in the first image data; turn off the LEDs in the light source group set, and turn on a second group of LEDs to irradiate the liquid surface; an ambient light compensation unit is configured to turn off all LED groups and collect second image data in the ambient light compensation mode; eliminate ambient light interference according to a differential operation between the first image data and the second image data; and a dynamic adjustment module is configured to adjust the execution cycle of the reflection suppression excitation mode in real time based on the degree of liquid surface fluctuation, and the degree of liquid surface fluctuation is calculated by the curvature change rate of the liquid surface profile.
[0006] As a further embodiment of the present invention, the first group of LEDs and the second group of LEDs respectively include LEDs with wavelengths of 450nm, 520nm and 630nm, and the light intensity of the second group of LEDs is 3 to 5 times that of the first group of LEDs.
[0007] As a further embodiment of the present invention, in the plurality of LED groups arranged in the circular array, the interval between two adjacent LED groups is 20° to 45°, and the angle between the optical axis of each LED group and the normal direction of the liquid surface is less than 15°.
[0008] As a further embodiment of the present invention, the polarizing filter is a wire grid polarizing filter, and the transmission axis direction thereof forms an angle of 45°±5° with the pixel arrangement direction of the image sensor.
[0009] As a further embodiment of the present invention, the determination of the set of light source groups for mirror reflection is performed by the following rules: when the transmittance of the urine sample is greater than or equal to 70%, the polarization threshold is set to 75% to 85%; when the transmittance is less than 70%, the polarization threshold is set to 55% to 65%; wherein the transmittance is calculated by the ratio of the G channel pixel mean to the R channel pixel mean of the second image data.
[0010] As a further implementation of the present invention, the formula for the differential operation is: , in, is the ambient light attenuation coefficient, which is set to 0.8 to 1.2 through a calibration experiment, and the calibration experiment includes: setting an ambient light intensity gradient of 200-1000 lux under a standard light source, collecting a matching reflection suppression pattern image and ambient light compensation mode images , fitting the equation by the least squares method Calculate the α value, where Refers to the raw image data matrix acquired in reflection suppression mode, Refers to the raw image data matrix collected in the ambient light compensation mode, both of which are 8-bit RGB image data.
[0011] As a further embodiment of the present invention, the curvature change rate is calculated by the following formula: , in, and They are the first-order derivative and the second-order derivative of the liquid surface contour, respectively, and are calculated from the discrete point set of the liquid surface contour by the cubic spline interpolation method. The cubic spline interpolation method adopts natural boundary conditions, and the discrete point set is extracted by the Canny edge detection algorithm.
[0012] As a further implementation of the present invention, the dynamic adjustment rule of the execution cycle is: When the execution cycle is set to 15ms to 25ms; when When the execution cycle is shortened to 8ms to 15ms; when The execution cycle is further shortened to less than 5ms. The dynamic adjustment rule is verified by simulating liquid surface vibration experiments, where K<5%, 5%≤K<10%, and K≥10% correspond to liquid surface fluctuation frequencies of <20Hz, 20-50Hz, and >50Hz, respectively, and the execution cycle meets the requirements of the Nyquist sampling theorem.
[0013] As a further embodiment of the present invention, the control module is connected to the light source module and the image acquisition module via a data communication bus, the transmission delay of the data communication bus is less than 2ms, and the priority of the light source control instruction is higher than the image data transmission.
[0014] A method for using a disease prediction system based on urine image recognition, the method comprising the following steps: step S1: sample placement, placing a urine sample container below an image acquisition module to ensure that the verticality deviation between the liquid surface and the optical axis of a light source module is less than 10°; step S2: mode switching and image acquisition, starting a reflection suppression excitation mode, irradiating the liquid surface with a first light intensity through a first group of LEDs, and acquiring first image data; based on polarization state information, turning off an LED group that causes mirror reflection, switching to a second group of LEDs to acquire second image data with a second light intensity; step S3: ambient light compensation, turning off all LED groups, acquiring third image data within 1 ms, and eliminating ambient light interference through differential operations; step S4: dynamic cycle adjustment, shortening or extending the execution cycle of the reflection suppression excitation mode in real time according to the rate of change of liquid surface curvature; step S5: disease prediction, inputting the processed urine image into a pre-trained convolutional neural network model, and outputting disease risk probability and classification results.
[0015] Compared with the problems described in the background technology, the beneficial effects of the present invention are: real-time separation of mirror reflection components through polarization filters, direct driving of light source shutdown decisions, and combination of time-sharing excitation modes (low light intensity prediction to high light intensity suppression) to form a real-time closed loop from optical perception to light source control, breaking through the logical separation problem of traditional solutions relying on algorithm post-processing, and achieving source elimination of dynamic liquid surface reflection noise; dynamically adjusting the detection frequency based on the rate of change of liquid surface contour curvature, reducing the sampling rate to save power consumption when the liquid level is stable, and automatically increasing the response speed to achieve optimal resource distribution when the liquid level fluctuates violently; using differential operations to eliminate ambient light interference, combined with the coordinated calibration of polarization filters and light source angles, the system can still work stably under non-dark box conditions (such as natural light, indoor lighting), and allowing the sample container to have a tilt deviation of ≤15°, reducing dependence on user operation norms. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic diagram of the structure of the disease prediction system based on urine image recognition of the present invention.
[0017] Figure 2 This is a flow chart of dynamic period adjustment of the disease prediction system based on urine image recognition of the present invention.
[0018] Figure 3 It is a comparison diagram of the principles of light path reflection suppression of the traditional solution and the present invention.
[0019] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0020] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0021] The embodiment of the present application provides a disease prediction system and method based on urine image recognition. It includes a light source module, an image acquisition module and a control module, wherein the light source module is composed of a plurality of LED groups arranged in a circular array, each group includes at least three LEDs with different wavelengths, and the light source module is configured to turn on different LED groups in time-sharing to suppress dynamic liquid surface reflection; different LED groups include a first group of LEDs and a second group of LEDs; the image acquisition module includes an image sensor with an integrated polarization filter, configured to respectively collect first image data and second image data in a reflection suppression excitation mode and an ambient light compensation mode; the control module includes a reflection suppression control unit and an ambient light compensation unit, wherein the reflection suppression control unit is configured to: in the reflection suppression excitation mode, control the light The source module turns on the first group of LEDs, illuminates the liquid surface with a first light intensity and obtains the first image data; determines the light source group set that causes the mirror reflection based on the liquid surface profile and polarization state information in the first image data; turns off the LEDs in the light source group set, and turns on the second group of LEDs to illuminate the liquid surface; the ambient light compensation unit is configured as follows: in the ambient light compensation mode, turns off all LED groups and collects the second image data; eliminates the ambient light interference according to the differential operation of the first image data and the second image data; the dynamic adjustment module is configured to adjust the execution cycle of the reflection suppression excitation mode in real time based on the degree of liquid surface fluctuation, and the degree of liquid surface fluctuation is calculated by the curvature change rate of the liquid surface profile.
[0022] The first group of LEDs and the second group of LEDs include LEDs with wavelengths of 450nm, 520nm and 630nm, respectively, and the light intensity of the second group of LEDs is 3 to 5 times that of the first group of LEDs; this light intensity difference helps to ensure that the second group of LEDs can effectively compensate for image distortion caused by specular reflection during reflection suppression. Increasing the light intensity of the second group of LEDs may, for example: 1. Enhance image contrast: The higher light intensity of the second group of LEDs can provide stronger illumination, help obtain higher quality image data, especially when it is necessary to overcome reflection interference, and provide a stronger signal; 2. Effectively suppress reflection noise: The stronger light intensity helps to reduce the impact of liquid surface specular reflection, making image acquisition clearer and less susceptible to interference from dynamic liquid surface fluctuations; 3. Compensate for image distortion in the reflective area: The first group of LEDs may be used for lower light intensity illumination in the reflection suppression mode, and the second group of LEDs can further illuminate the liquid surface after the light intensity is increased, so as to obtain more complete and accurate image data, especially after the reflection source is eliminated. And in the multiple LED groups arranged in a shape array, the interval between two adjacent LED groups is 20° to 45°, and the angle between the optical axis of each group of LEDs and the normal direction of the liquid surface is less than 15°; the polarization filter is a wire grid polarizer, and its transmission axis direction is at an angle of 45°±5° with the pixel arrangement direction of the image sensor; the determination of the set of light source groups for mirror reflection is performed according to the following rules: when the transmittance of the urine sample is greater than or equal to 70%, the polarization threshold is set to 75% to 85%; when the transmittance is less than 70%, the polarization threshold is set to 55% to 65%; wherein the transmittance is calculated by the ratio of the G channel pixel mean to the R channel pixel mean of the second image data.
[0023] As a further implementation of the present invention, the formula for the differential operation is: ,in, is the ambient light attenuation coefficient, which is set to 0.8 to 1.2 through a calibration experiment, and the calibration experiment includes: setting an ambient light intensity gradient of 200-1000 lux under a standard light source, collecting a matching reflection suppression pattern image and ambient light compensation mode images , fitting the equation by the least squares method Calculate the α value, where Refers to the raw image data matrix acquired in reflection suppression mode, Refers to the original image data matrix collected in the ambient light compensation mode, both of which are 8-bit RGB image data; the curvature change rate is calculated by the following formula: ,in, and are the first-order derivative and second-order derivative of the liquid surface contour, respectively, and are calculated from the discrete point set of the liquid surface contour by the cubic spline interpolation method. The cubic spline interpolation method adopts the natural boundary condition (the second-order derivative of the endpoint is zero), and the discrete point set is extracted by the Canny edge detection algorithm, that is, the liquid surface contour is the two-dimensional projection of the liquid surface edge on the imaging plane. The discrete point set is extracted by the Canny edge detection algorithm, and the continuous contour curve is constructed by cubic spline interpolation; the dynamic adjustment rule of the execution cycle is: when When the execution cycle is set to 15ms to 25ms; when When the execution cycle is shortened to 8ms to 15ms; when The execution cycle is further shortened to less than 5ms. The dynamic adjustment rule is verified by simulating liquid surface vibration experiments, where K<5%, 5%≤K<10%, and K≥10% correspond to liquid surface fluctuation frequencies of <20Hz, 20~50Hz, and >50Hz, respectively, and the execution cycle meets the requirements of the Nyquist sampling theorem; and in the dynamic adjustment, the curvature change rate Defined as the current frame contour curvature Curvature with previous frame The relative rate of change is: The control module is connected to the light source module and the image acquisition module through a data communication bus. The transmission delay of the data communication bus is less than 2ms, and the priority of the light source control instruction is higher than the image data transmission.
[0024] A method for using a disease prediction system based on urine image recognition, the method comprising the following steps: step S1: sample placement, placing a urine sample container below an image acquisition module to ensure that the verticality deviation between the liquid surface and the optical axis of a light source module is less than 10°; step S2: mode switching and image acquisition, starting a reflection suppression excitation mode, irradiating the liquid surface with a first light intensity through a first group of LEDs, and acquiring first image data; based on polarization state information, turning off an LED group that causes mirror reflection, switching to a second group of LEDs to acquire second image data with a second light intensity; step S3: ambient light compensation, turning off all LED groups, acquiring third image data within 1 ms, and eliminating ambient light interference through differential operations; step S4: dynamic cycle adjustment, shortening or extending the execution cycle of the reflection suppression excitation mode in real time according to the rate of change of liquid surface curvature; step S5: disease prediction, inputting the processed urine image into a pre-trained convolutional neural network model, and outputting disease risk probability and classification results.
[0025] Figure 1The structural flow diagram of the disease prediction system based on urine image recognition is shown. First, the light source module provides light through a circular LED array and operates according to the reflection suppression control instruction. The image acquisition module is responsible for collecting ambient light data and image data, and is used in conjunction with polarizers and sensors. The collected image data is differentially calculated through the ambient light compensation unit to eliminate ambient light interference and obtain more accurate image data. The control module controls the reflection suppression excitation mode according to the image data, turns off the LED group that produces mirror reflection, and then adjusts the execution cycle. The dynamic adjustment module adjusts the execution cycle of the reflection suppression excitation mode in real time based on the liquid level fluctuation to adapt to changes in liquid level fluctuations and ensure stable operation of the system.
[0026] Figure 2 The dynamic cycle adjustment process in the disease prediction system based on urine image recognition is demonstrated. First, the system starts running and collects liquid surface contour data through the image acquisition module. Next, discrete edge points are extracted and cubic spline interpolation is performed to obtain the curve value of the liquid surface contour. Subsequently, the curvature change rate K is calculated, and according to the value of the curvature change rate, the system will dynamically adjust the execution cycle according to different K values. If K is less than 5%, the execution cycle is set to 20ms; when K is between 5% and 10%, the execution cycle is shortened to 10ms; when K is greater than or equal to 10%, the execution cycle is further shortened to 5ms. Finally, the system ends this cycle after completing the adjustment.
[0027] Figure 3 The diagram shows a comparison of the principles of light path reflection suppression between the traditional solution and the solution of the present invention. For example, in the traditional solution, the system uses a fixed light source and a single-angle illumination surface, which enters the sensor through mirror reflection and then enters the image noise area, resulting in unstable light source illumination and image noise interference. In the solution of the present invention, low light intensity is first predicted, and the liquid surface contour is detected to determine whether the light source needs to be turned off; if it is judged to be low light intensity, the mirror reflection light source is turned off, and the remaining light sources and sub-reflection light sources are turned on to improve system stability. Finally, the sensor receives a valid signal, thereby improving image quality and the accuracy of disease prediction.
[0028] Embodiment 1: In terms of system hardware configuration, the light source module includes, for example, 6 groups of LEDs, each group includes 1 LED of 450nm, 520nm, and 630nm wavelengths, adjacent groups are spaced 30° apart, and the optical axis is installed perpendicular to the horizontal plane; each group of LEDs in the driving circuit is independently controlled, supports PWM dimming (0-100% duty cycle), and the switching delay is <0.1ms; in the image acquisition module, the polarization filter, such as a wire grid polarizer, is installed on the sensor surface with a transmission axis at an angle of 45° to the CMOS pixel direction, and the selected sensor parameters can be, for example, global shutter, resolution 1920×1080, frame rate 100fps, and support RAW12 format output. In the control module, its main control chip, such as a microcontroller, has a built-in FPU that supports floating-point operations, and dynamic memory is used for image buffering, including 512MB Flash storage control algorithms.
[0029] In the reflection suppression control process, the reflection suppression excitation mode (RSE): Step 1, turn on all LED groups, set the light intensity to 20% (first light intensity), and collect the liquid surface contour image (first image data); Step 2, extract the liquid surface contour through Canny edge detection and calculate the normal direction; turn off the LED group with a symmetrical angle to the normal (for example: the liquid surface tilts 10° to the right, turn off the 30° light source on the right); Step 3: turn on the remaining LED groups to 100% light intensity (second light intensity), collect the second image number, and record the mirror reflection area (pixels with polarization degree>75%). And in the ambient light compensation mode (ACE), step 1, turn off all LEDs and collect the third image data within 1ms.
[0030] Step 2: Perform the difference operation: , where the attenuation coefficient α=0.95 is determined by calibration experiments (calibration method: under standard light source D65, 10 sets of ambient light data are collected to fit the linear regression model). Its dynamic period adjustment mechanism is, such as the curvature change rate calculation, its data source: liquid surface contour discrete point set (200 edge points are extracted per frame); cubic spline interpolation: after generating a continuous curve, calculate the first-order derivative and the second-order derivative , substitute into the formula: , the execution cycle rule is, <5% → Cycle 20ms, 5% ≤ <10% with a cycle of 10ms, ≥ 10% of its cycle is 5ms. In terms of priority control, the communication bus: CAN bus protocol, the priority of the light source control instruction is set to the highest (hardware interrupt preemption), delay test: when transmitting 1080p images, the control instruction delay is <1.5ms (actual measured data). In terms of the deployment of its disease prediction model, the model architecture: ResNet-18 convolutional neural network, the input image size is 224×224, and the output is the probability of 5 types of diseases (diabetes, kidney disease, urinary tract infection, etc.); if the training data uses urine images, the data enhancement includes rotation of ±15° and brightness adjustment of ±20%. Its reasoning process is from the corrected image to normalization (0-255 scaled to 0-1) to the model reasoning to the output of the Top-3 disease probability and confidence, which are all extended implementation methods that can be known to ordinary technicians in this field.
[0031] Embodiment 2: The light source module of this embodiment adopts multiple LED groups to form a circular array. Each group of LEDs contains at least three LEDs with different wavelengths, such as LEDs with wavelengths of 450nm, 520nm and 630nm. The configuration of each LED group can achieve control of different light intensities through PWM dimming (duty cycle of 0-100%). By time-sharing the excitation of LED groups with different wavelengths, the interference of dynamic liquid surface reflection is effectively avoided. In this embodiment, the light intensity ratio of the first group of LEDs to the second group of LEDs is 3:1, and the light intensity of the second group of LEDs is set to 3 to 5 times that of the first group. The image acquisition module integrates a polarizing filter and a high-resolution image sensor, adopts a global shutter method, has a resolution of 1920×1080, and a frame rate of 100fps. A polarizing filter is installed on the surface of the sensor, and the transmission axis is at a 45° angle to the pixel arrangement direction of the image sensor to minimize the mirror reflection. The image acquisition module works in two modes, namely, reflection suppression excitation mode: turn on the first group of LEDs, the light intensity is low to medium, collect the first image data, analyze the liquid surface profile and polarization state information, and determine the light source group that may produce reflection; ambient light compensation mode: turn off all LED groups, collect the second image data, and eliminate the interference of ambient light through differential operation.
[0032] The control module includes a reflection suppression control unit, an ambient light compensation unit, and a dynamic adjustment module. The specific steps are as follows: In the reflection suppression excitation mode, the liquid surface profile image is collected by the sensor, and the light source that generates the mirror reflection is identified based on the polarization state information. Compare the first image data with the liquid surface profile, and based on the calculated normal direction, turn off the LED group that causes the reflection and switch to the second group of LEDs to illuminate the liquid surface and collect the second image data. Differential operation: Eliminate ambient light interference through the following formula: , in, is the image data in reflection suppression mode, is the image data collected in the ambient light mode. is the ambient light attenuation coefficient, obtained through calibration experiments, with a typical value of 0.95; the calibration experiment collects multiple sets of data under different ambient light intensities, and fits the linear regression model to determine that the attenuation coefficient ranges from 0.8 to 1.2; dynamic cycle adjustment: dynamically adjust the execution cycle of the reflection suppression excitation mode based on the degree of liquid surface fluctuation (i.e., the curvature change rate of the liquid surface profile). The liquid surface profile is calculated by the cubic spline interpolation method, and the curvature change rate formula is: ,in, and are the first-order derivative and second-order derivative of the liquid surface profile, respectively. The discrete point set of the liquid surface profile is used for calculation. The specific steps are: when When the execution cycle is set to 20ms; when When the execution cycle is 10ms; when The execution cycle is further shortened to less than 5ms.
[0033] Finally, the processed urine image will be input into a pre-trained convolutional neural network model (such as ResNet-18), which is trained with urine image data and can identify and predict the probability of disease risk. Specific steps include: image preprocessing: normalize the image and scale the pixel value of the image from 0-255 to 0-1 for neural network reasoning; disease classification: analyze the processed image through a convolutional neural network and output the risk probability and classification results of the top 3 types of diseases. For example, predict the possibility of diseases such as diabetes, kidney disease, and urinary tract infection. And in this embodiment, the hardware configuration is as follows: the light source module includes 6 groups of LEDs, each group contains LEDs with wavelengths of 450nm, 520nm and 630nm, the spacing between adjacent LED groups is 30°, and the angle between the optical axis and the normal to the liquid surface is less than 15°. Each group of LEDs achieves output of different light intensities through PWM dimming, and supports a maximum of 100% light intensity; The image acquisition module includes a global shutter image sensor with a resolution of 1920×1080, a frame rate of 100fps, and supports RAW12 format output. A wire grid polarization filter is installed on the sensor surface, and the transmission axis is at a 45° angle to the pixel arrangement direction of the image sensor; the control module includes a main control chip that is a microcontroller, supports floating-point operations, and has built-in dynamic memory (512MB Flash), which can store control algorithms and process image data in real time. The data communication bus uses the CAN bus protocol, and the transmission delay is less than 2ms.
[0034] Embodiment 3: This embodiment adopts a disease prediction system based on urine image recognition, which includes a light source module, an image acquisition module and a control module. The light source module is composed of a plurality of LED groups arranged in a circular array, and each group of LEDs contains at least three LEDs with different wavelengths, such as 450nm, 520nm and 630nm. According to different reflection suppression requirements, the light source module excites different LED groups by time-sharing. Specific steps include: low-intensity illumination mode: the first group of LEDs is used to illuminate the liquid surface with low light intensity, collect image data, and identify possible mirror reflection sources by analyzing the liquid surface contour and polarization information in the image; high-intensity illumination mode: based on the liquid surface contour and polarization state information, after determining the reflection source, turn off the LED group corresponding to the reflection source, enable the second group of LEDs (with higher light intensity) to continue to irradiate the liquid surface, and collect the second group of image data. This process achieves reflection suppression through the collaborative work of hardware control and image processing to ensure image acquisition quality.
[0035] The image acquisition module is equipped with a high-resolution image sensor and combined with a polarizing filter to further improve the image quality. In the reflection suppression mode, the image acquisition module filters the mirror reflection component through polarized light technology. For example, in the reflection suppression excitation mode, the image acquisition module obtains the first image data after reflection suppression through the polarizing filter and the sensor. In the ambient light compensation mode, all LED groups are turned off, and the second image data is only collected through the image sensor. The interference of ambient light is eliminated by differential operation. Through this dual-mode acquisition and subsequent processing, the accuracy of the image and the reliability of disease prediction can be significantly improved. The control module includes a reflection suppression control unit, an ambient light compensation unit and a dynamic adjustment module. The dynamic adjustment module adjusts the execution cycle of the reflection suppression excitation mode in real time based on the rate of change of the liquid surface curvature. Specific implementation steps include: liquid surface curvature calculation: the liquid surface contour is analyzed through the collected image data, and the continuous curve of the liquid surface contour is calculated using the cubic spline interpolation method. Curvature change rate The calculation formula is: ,in, and They are the first and second derivatives of the liquid surface profile, respectively, which are calculated from the discrete point data of the liquid surface profile using the spline interpolation method; Dynamic period adjustment: based on the rate of change of liquid surface curvature , dynamically adjust the execution cycle of the reflection suppression excitation mode. When the value is low), the cycle is extended to save power consumption; when the liquid level fluctuates greatly ( When the value is high, shorten the cycle to improve the response speed. Specific rules are as follows: , the period is 20ms; when , the period is 10ms; when , with a cycle of 5ms. This mechanism can dynamically optimize the execution efficiency of the reflection suppression mode according to the actual liquid level fluctuations.
[0036] The urine image data processed by reflection suppression and ambient light compensation will be input into the pre-trained convolutional neural network model for disease prediction. After being trained on urine images, the neural network model can effectively identify and analyze the features in the image, and output the risk probability and classification results of disease prediction. Common diseases include diabetes, kidney disease, urinary tract infection, etc. The system provides the risk probability of each disease based on the processed images, thereby achieving early warning of diseases.
[0037] Ambient light attenuation coefficient Source: In the differential operation formula, is the ambient light attenuation coefficient. This coefficient is obtained through calibration experiments. The specific steps are as follows: by setting different ambient light intensities, multiple sets of image data are collected; the data are fitted using a linear regression model to obtain the ambient light attenuation coefficient. The optimal value of this coefficient ranges from 0.8 to 1.2, and the specific value varies depending on the ambient light intensity. Through calibration experiments, it can be ensured that the compensation algorithm still maintains a good compensation effect under different ambient light intensities. Liquid surface curvature change rate Application: Liquid surface curvature change rate It reflects the degree of liquid surface fluctuation and directly affects the execution period of the reflection suppression excitation mode. The value of is calculated from the liquid surface profile in the image data, using the formula: , the derivative of the liquid surface profile is calculated from the discrete points in the image data by cubic spline interpolation. Used to dynamically adjust the cycle of the reflection suppression mode, thereby optimizing the response time and power consumption of the system. The specific operation path of this embodiment is as follows: configure the light source module, adjust the reflection suppression mode and the ambient light compensation mode by controlling the opening timing of the LED group; set the image acquisition module and install the polarization filter to ensure that the image acquisition is not interfered by the external light source; adjust the dynamic adjustment mechanism in the control module, and dynamically adjust the cycle of the reflection suppression mode based on the liquid level fluctuation; input the processed image data into the convolutional neural network model for disease risk prediction, and output the classification result.
[0038] Embodiment 4: The disease prediction system based on urine image recognition in this embodiment improves the stability and accuracy of the system by improving the technical links such as image acquisition, light source control, reflection suppression and dynamic cycle adjustment. In particular, the system can maintain a high working performance under the condition of ambient light interference and liquid level fluctuation. For example, the light source module adopts multiple LED groups arranged in a circular array, and each group of LEDs includes at least three LEDs with different wavelengths (such as 450nm, 520nm and 630nm). The light source module turns on different LED groups in time to control the light intensity of the irradiated liquid surface. The specific implementation path is as follows: low light intensity mode: the first group of LEDs is turned on at a lower light intensity, and the image acquisition module obtains the first group of image data. Through the analysis of liquid surface profile and polarization information, the possible mirror reflection source is identified; high light intensity mode: based on the polarization data and liquid surface profile, after the reflection source is determined, the control system turns off the LED group that may cause reflection, and turns on the second group of LEDs (with higher light intensity) to continue irradiating the liquid surface and collect the second group of image data; this time-sharing control technology ensures the accuracy of reflection suppression and reduces the interference of mirror reflection.
[0039] The image acquisition module is equipped with a high-resolution sensor, combined with a polarizing filter, to effectively suppress specular reflection. Image data is collected in two modes, namely, reflection suppression mode: in this mode, the image acquisition module combines with a polarizing filter to obtain image data to eliminate liquid surface reflection interference; ambient light compensation mode: in this mode, all LED groups are turned off, and only ambient light data is collected through the image sensor, and the influence of ambient light is removed by differential operation; image processing ensures image quality and prediction accuracy through dual data filtering of reflection suppression and ambient light compensation.
[0040] The control module dynamically adjusts the execution cycle of the reflection suppression excitation mode based on the liquid surface fluctuation in the image data. The following are the detailed steps, including the liquid surface curvature calculation: the curvature is calculated by the cubic spline interpolation method through the liquid surface contour extracted from the image data. Curvature change rate Reflects the degree of liquid surface fluctuation. The specific calculation method is, for example, to extract the liquid surface contour through image processing algorithm and calculate its first-order derivative based on the contour. and the second-order derivative , use cubic spline interpolation to smooth the liquid surface data to reduce noise interference, and use the formula , calculate the curvature change rate .
[0041] In its dynamic period adjustment, according to the curvature change rate Dynamically adjust the detection cycle: When it is less than 5%, the cycle is set to 20ms; when When the rate is between 5% and 10%, the cycle is shortened to 10ms; when When the value is greater than 10%, the cycle is further shortened to 5ms. This process can significantly improve the system response speed, especially when the liquid level fluctuates greatly. At the same time, in order to ensure the accuracy of image data under different ambient light conditions, the ambient light attenuation coefficient It needs to be obtained through calibration experiments. The experimental process is as follows: select multiple experimental conditions with different ambient light intensities and collect multiple sets of image data; use a linear regression model to fit the ambient light intensity and the collected image data to obtain the ambient light attenuation coefficient The optimal value of is in the range of 0.8 to 1.2; by adjusting value to ensure that the ambient light interference in the image data is effectively compensated.
[0042] Embodiment 5: The light source module of this embodiment is composed of multiple LED groups, each group includes at least three LEDs with different wavelengths (such as 450nm, 520nm and 630nm). These LED groups are arranged in a circular array to ensure the uniformity of the light source, and reduce the interference of liquid surface reflection on image acquisition through time-sharing excitation. The design of the system allows different LED groups to be turned on according to the reflection suppression requirements. Specifically, the first group of LEDs is turned on at low light intensity to collect images after liquid surface reflection; while the second group of LEDs is turned on at higher light intensity to ensure that the details of the liquid surface image can be fully captured. In this process, the on and off strategies of the light source are adjusted by real-time monitoring of liquid level changes and polarization state information.
[0043] The image acquisition module integrates a polarization filter and a high-resolution image sensor. It adopts a global shutter method with a resolution of 1920×1080 and a frame rate of 100fps. The transmission axis of the polarization filter is at a 45° angle to the pixel arrangement direction of the image sensor to effectively filter the specular reflection component. In the reflection suppression mode, the image acquisition module first collects the liquid surface profile image and identifies the specular reflection source by analyzing the polarization state information. By comparing with the liquid surface profile, the system can determine which light source groups will produce unnecessary reflections, and then turn off these light sources and switch to the second light source group to obtain a clear image. In the ambient light compensation mode, the image acquisition module turns off all LED groups and only collects ambient light data through the image sensor. The interference of ambient light on the image is eliminated by differential operation to ensure the accuracy of the image data. In this process, the ambient light attenuation coefficient (α) is determined by experimental calibration. The calibration process involves collecting image data under different ambient light intensity conditions and determining the attenuation coefficient using a linear regression model. The final attenuation coefficient ranges from 0.8 to 1.2 to adapt to changes under different ambient light conditions. The degree of liquid level fluctuation has a direct impact on the response speed and power consumption of the system. To this end, the system calculates the curvature change rate of the liquid surface profile. The liquid surface contour is calculated by extracting edge points from the image data, and a continuous curve is generated by using the cubic spline interpolation method, and its first-order derivative is calculated. and the second-order derivative . Curvature change rate Then the calculation is carried out through the following steps. First, the second-order derivative of the liquid surface profile is calculated: and the first-order derivative , according to the derivative value, the curvature change rate is calculated using the formula , The higher the value, the more violent the liquid level fluctuations, and according to the curvature change rate, the system adjusts the execution cycle of the reflection suppression mode. The specific rules are as follows: <5%, the execution cycle is set to 20ms. <10%, the execution cycle is shortened to 10ms. When the liquid level is ≥10%, the execution cycle is further shortened to less than 5ms. This dynamic adjustment mechanism can adjust the sampling frequency according to the actual situation of the liquid level fluctuation, thereby improving the response speed of the system and reducing power consumption when the liquid level is relatively stable, achieving optimal resource allocation.
[0044] The image data after reflection suppression and ambient light compensation is input into a pre-trained convolutional neural network (CNN) for disease prediction. The image data is first pre-processed and normalized to ensure the quality of the input data and the prediction accuracy of the model. The model analyzes the features in the image and outputs the predicted probability of each disease. Common diseases include diabetes, kidney disease, and urinary tract infection. The convolutional neural network model (such as ResNet-18) is trained with a large amount of urine image data, and can efficiently identify image features and continuously optimize the prediction accuracy through the training algorithm. Data enhancement techniques (such as rotation ±15°, brightness adjustment ±20%) are also used to improve the generalization ability of the model. In terms of system hardware configuration, the hardware configuration of this embodiment includes the following main components, namely, a light source module: composed of multiple LED groups, each group of LEDs includes 450nm, 520nm and 630nm LEDs, supports PWM dimming technology, and has high flexibility and accuracy. The LED group is controlled by time-sharing excitation to reduce liquid surface reflection. Image acquisition module: Equipped with a high-resolution global shutter image sensor with a resolution of 1920×1080 and a frame rate of 100fps, it supports RAW12 format output and is equipped with a polarizing filter to ensure image quality. Control module: The main control chip is a microcontroller that supports floating-point operations and has a built-in 512MB dynamic memory for image processing and control algorithm storage. Data communication is carried out through the CAN bus protocol, with a transmission delay of less than 2ms to ensure efficient system response.
[0045] In the specific implementation, the system operation process is as follows: Step S1: Place the urine sample container under the image acquisition module to ensure that the vertical deviation between the liquid surface and the optical axis of the light source module is less than 10°. Step S2: Start the reflection suppression excitation mode, illuminate the liquid surface with a first light intensity through the first group of LEDs, and collect the first image data; turn off the LED group that causes mirror reflection according to the polarization state information, and switch to the second group of LEDs to collect the second image data. Step S3: Switch to the ambient light compensation mode, turn off all LED groups, and collect the third image data; eliminate ambient light interference through differential operations. Step S4: According to the change rate of the liquid surface curvature, adjust the execution cycle of the reflection suppression excitation mode in real time. Step S5: Input the processed image data into the pre-trained convolutional neural network model, and output the disease risk probability and classification results.
[0046] Embodiment 6: In order to effectively suppress the mirror reflection noise generated by the dynamic liquid surface, this embodiment adopts a multiple group LED configuration with time-sharing excitation, and further optimizes the control logic of the light source module. In the light source module, multiple LED groups are arranged in a ring array, and each group of LEDs is composed of LEDs with different wavelengths (for example, 450nm, 520nm and 630nm) to ensure that light sources with different wavelengths can be adjusted according to the reflection conditions.
[0047] In this embodiment, by controlling the light source module to dynamically switch between different LED groups with low light intensity and high light intensity, the system can effectively avoid color distortion caused by liquid surface reflection. In the specific implementation process, the control module of the light source module dynamically adjusts the working state of each group of LEDs, collects the liquid surface image after the first group of LEDs provides low light intensity illumination, and identifies possible mirror reflection sources by analyzing the liquid surface contour and polarization state information in the image. Then, based on the polarization state information, the LED group that needs to be turned off is determined, and the second group of LEDs is switched to continue irradiating the liquid surface with higher light intensity to collect clearer image data. This time-sharing excitation control method eliminates reflection noise from the source by avoiding direct irradiation of the mirror reflection area, thereby effectively improving the image acquisition quality. This technical solution avoids unnecessary reflection interference by ensuring that the angular relationship between each LED group and the liquid surface is always maintained within an appropriate range.
[0048] When processing images, the interference of ambient light on image quality cannot be ignored. In order to eliminate the interference of ambient light, this embodiment introduces an ambient light compensation mode. By turning off all LED groups and collecting background environment image data, image data differential operation is performed on this basis, thereby effectively eliminating the interference of ambient light. Specifically, the differential operation formula is: compare the image data collected in the reflection suppression mode with the image data collected in the ambient light mode to obtain the compensated target image data. This operation ensures that the system can still work stably under different lighting conditions by accurately controlling the timing of turning on and off the light source. In addition, this embodiment sets the ambient light attenuation coefficient and performs calibration under different ambient light intensities to ensure that the ambient light compensation process always meets the experimental requirements. The value range of the ambient light attenuation coefficient 𝛼 is from 0.8 to 1.2, which is obtained through actual measurement and adjusted according to the ambient light intensity to ensure the accuracy of the compensation effect.
[0049] When the liquid level of the urine sample fluctuates, in order to maintain the efficiency and accuracy of image data acquisition, this embodiment dynamically tracks the degree of liquid level fluctuation and adjusts the image acquisition cycle by the rate of change of liquid surface curvature. When the liquid level fluctuates violently, the system shortens the acquisition cycle to improve the response speed; when the liquid level is relatively stable, the acquisition cycle is extended to save power consumption. In the specific implementation process, the rate of change of liquid surface curvature is calculated by the liquid surface contour extracted from the image data. First, the system extracts the liquid surface contour through the image acquisition module and uses the cubic spline interpolation method to smooth the data to obtain a continuous curve. The curvature change rate is obtained by calculating the second-order derivative and the first-order derivative of the curve. According to the value of the liquid surface curvature change rate 𝐾, the system dynamically adjusts the execution cycle of the reflection suppression mode. When the curvature change rate is small (such as 𝐾<5%), the execution cycle is long and the system response is slow; when the curvature change rate is large (such as 𝐾≥ 10%), the execution cycle is shortened and the system response speed is accelerated.
[0050] After image acquisition and ambient light compensation, the data will be input into a pre-trained convolutional neural network (CNN) model for disease prediction. The network has been trained with a large amount of urine image data, and can identify key features in the image and predict the risk of potential diseases. In order to improve the accuracy of the model, this embodiment introduces data enhancement technology during the training process, such as rotation of ±15°, brightness adjustment of ±20%, etc., to enhance the generalization ability of the model. Before the image data is input into the neural network, the data will be standardized, that is, the pixel value will be scaled from the range of 0-255 to 0-1 to ensure the uniformity and stability of the data. After training, the convolutional neural network can output the prediction results of the disease. Common diseases include diabetes, kidney disease, urinary tract infection, etc. The output of the model is the risk probability of each disease, which helps users to warn of early diseases.
[0051] The hardware configuration of this embodiment includes the following main components, namely, the light source module: composed of multiple LED groups, each group of LEDs contains at least three different wavelengths of LEDs (450nm, 520nm, 630nm), and supports PWM dimming technology. Through time-sharing excitation, the liquid surface reflection is effectively reduced; image acquisition module: equipped with a high-resolution global shutter image sensor with a resolution of 1920×1080, a frame rate of 100fps, supports RAW12 format output, and cooperates with a polarization filter to ensure image quality; control module: uses a microcontroller as the main control chip, supports floating-point operations, and has a built-in 512MB dynamic memory for real-time image processing and control algorithm storage.
[0052] Data communication is carried out through the CAN bus protocol, and the transmission delay is less than 2ms, ensuring efficient response of the system. Through this hardware configuration, the system can work stably under different operating conditions, and adjust the execution cycle of the reflection suppression mode according to the liquid level fluctuation, optimize resource allocation, which not only enhances the operability of the technical solution, but also effectively reduces the system's dependence on user operations, making the system more conducive to home health monitoring.
[0053] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0054] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A disease prediction system based on urine image recognition, characterized in that: The invention comprises a light source module, an image acquisition module and a control module, wherein the light source module is composed of a plurality of LED groups arranged in a circular array, each group comprising at least three LEDs with different wavelengths, and the light source module is configured to turn on different LED groups in different time periods to suppress dynamic liquid surface reflection; the different LED groups include a first group of LEDs and a second group of LEDs; The image acquisition module includes an image sensor with an integrated polarization filter, configured to respectively acquire first image data and second image data in a reflection suppression excitation mode and an ambient light compensation mode; The control module includes a reflection suppression control unit and an ambient light compensation unit, wherein the reflection suppression control unit is configured to: in a reflection suppression excitation mode, control the light source module to turn on a first group of LEDs, illuminate the liquid surface with a first light intensity and obtain first image data; determine a light source group set that causes specular reflection based on the liquid surface profile and polarization state information in the first image data; turn off the LEDs in the light source group set, and turn on a second group of LEDs to illuminate the liquid surface; The ambient light compensation unit is configured to: in the ambient light compensation mode, turn off all LED groups and collect the second image data; eliminate ambient light interference based on the differential operation of the first image data and the second image data; the dynamic adjustment module is configured to adjust the execution cycle of the reflection suppression excitation mode in real time based on the degree of liquid level fluctuation, and the degree of liquid level fluctuation is calculated by the curvature change rate of the liquid surface contour.
2. The disease prediction system based on urine image recognition according to claim 1, characterized in that: The first group of LEDs and the second group of LEDs include LEDs with wavelengths of 450 nm, 520 nm and 630 nm respectively, and the light intensity of the second group of LEDs is 3 to 5 times that of the first group of LEDs.
3. The disease prediction system based on urine image recognition according to claim 1, characterized in that: In the plurality of LED groups arranged in the circular array, the interval between two adjacent LED groups is 20° to 45°, and the angle between the optical axis of each LED group and the normal direction of the liquid surface is less than 15°.
4. The disease prediction system based on urine image recognition according to claim 1, characterized in that: The polarizing filter is a wire grid polarizing filter, and the transmission axis direction thereof forms an angle of 45°±5° with the pixel arrangement direction of the image sensor.
5. The disease prediction system based on urine image recognition according to claim 1, characterized in that: The determination of the light source group set of mirror reflection is performed according to the following rules: when the transmittance of the urine sample is greater than or equal to 70%, the polarization threshold is set to 75% to 85%; when the transmittance is less than 70%, the polarization threshold is set to 55% to 65%; wherein the transmittance is calculated by the ratio of the G channel pixel mean to the R channel pixel mean of the second image data.
6. The disease prediction system based on urine image recognition according to claim 1, characterized in that: The formula for the difference operation is: , in, is the ambient light attenuation coefficient, which is set to 0.8 to 1.2 through a calibration experiment, and the calibration experiment includes: setting an ambient light intensity gradient of 200-1000 lux under a standard light source, collecting a matching reflection suppression pattern image and ambient light compensation mode images , fitting the equation by the least squares method Calculate the α value, where Refers to the raw image data matrix acquired in reflection suppression mode, Refers to the raw image data matrix collected in the ambient light compensation mode, both of which are 8-bit RGB image data.
7. The disease prediction system based on urine image recognition according to claim 1, characterized in that: The curvature change rate is calculated by the following formula: , in, and They are the first-order derivative and the second-order derivative of the liquid surface contour, respectively, and are calculated from the discrete point set of the liquid surface contour by the cubic spline interpolation method. The cubic spline interpolation method adopts natural boundary conditions, and the discrete point set is extracted by the Canny edge detection algorithm.
8. The disease prediction system based on urine image recognition according to claim 1, characterized in that: The dynamic adjustment rule of the execution cycle is: When the execution cycle is set to 15ms to 25ms; when When the execution cycle is shortened to 8ms to 15ms; when The execution cycle is further shortened to less than 5ms. The dynamic adjustment rule is verified by simulating liquid surface vibration experiments, where K<5%, 5%≤K<10%, and K≥10% correspond to liquid surface fluctuation frequencies of <20Hz, 20~50Hz, and >50Hz, respectively.
9. The disease prediction system based on urine image recognition according to claim 1, characterized in that: The control module is connected with the light source module and the image acquisition module via a data communication bus. The transmission delay of the data communication bus is less than 2ms, and the priority of the light source control instruction is higher than that of the image data transmission.
10. A method for using a disease prediction system based on urine image recognition, characterized in that: The method of use comprises the following steps: step S1: sample placement, placing the urine sample container under the image acquisition module, ensuring that the verticality deviation between the liquid surface and the optical axis of the light source module is less than 10°; step S2: mode switching and image acquisition, starting the reflection suppression excitation mode, irradiating the liquid surface with a first light intensity through a first group of LEDs, and acquiring first image data; based on polarization state information, turning off the LED group that causes mirror reflection, switching to the second group of LEDs to acquire second image data with a second light intensity; step S3: ambient light compensation, turning off all LED groups, acquiring third image data within 1ms, and eliminating ambient light interference through differential operation; step S4: dynamic cycle adjustment, shortening or extending the execution cycle of the reflection suppression excitation mode in real time according to the liquid surface curvature change rate; step S5: disease prediction, inputting the processed urine image into a pre-trained convolutional neural network model, and outputting the disease risk probability and classification results.
Citation Information
Patent Citations
Automatic identification system for urinary sediment visible components based on support vector machine
CN101900737A
Polarized optics for optical diagnostic device
CN102216745A
Urine cell image classification and identification system and method
CN103018247A
Method for determining risk early warning model of potential improper prescription of cardiovascular disease
CN114530248A
Kidney image processing method and system based on convolutional neural network
CN116453657A
Cited By
Cow fly knot unhairing detection device and detection method
CN119969974A