A vision-based method and device for urine detection in a smart toilet.
By using visual inspection technology and deep learning models, smart toilets have achieved non-contact detection of multi-dimensional urine health indicators, solving the problems of high material consumption and complex operation of existing equipment, and improving the comprehensiveness and accuracy of detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI ROYALSTAR ELECTRONIC APPLIANCE GROUP CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-06-30
AI Technical Summary
Existing smart toilet urine detection devices rely on chemical sensors and test strips, which have problems such as high consumable costs, complicated user operation, and limited detection items.
A vision-based smart toilet urine detection method is adopted, which uses a multispectral camera to collect urine images and combines them with a deep learning model for feature extraction and analysis, so as to realize non-contact detection of multi-dimensional health indicators.
It enables accurate detection of multiple urine health indicators, reduces consumable costs, simplifies user operation, improves the comprehensiveness and accuracy of detection, and ensures user safety and convenience in health management.
Smart Images

Figure CN122306688A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart toilet technology, specifically relating to a vision-based smart toilet urine detection method and device. Background Technology
[0002] With the continuous improvement of public health awareness, routine health monitoring in the home setting has become a new trend in the industry. As a core home facility that comes into close contact with the human body, smart bathroom equipment is gradually upgrading towards a multi-functional integration of "bathroom + health detection". Urine, as an important biological sample reflecting the metabolic state of the human body, has indicators such as pH, urine protein, urine sugar, and sediment that are directly related to various health problems such as urinary system diseases, diabetes, and abnormal kidney function. Therefore, the integration of urine detection function has become one of the core upgrade directions of smart toilets, enabling convenient health screening without having to go to a medical institution, and providing basic data support for family health management.
[0003] Existing smart toilet products and related technologies with urine detection functions mainly adopt a contact-based detection architecture, which can be divided into two core solutions: The first is chemical sensor contact detection, which embeds specialized chemical sensors such as pH, protein, and glucose sensors inside the toilet, allowing the sensors to directly contact the urine sample and utilize the changes in electrical signals generated by the chemical reaction to achieve indicator detection; the second is test strip-assisted detection, which uses a mechanical structure built into the toilet to push replaceable test strips to the urine receiving area. The test strip reacts with the urine, producing a color change, which is then read by an optical sensor and converted into a detection result. However, both of these contact-based detection solutions have inherent drawbacks that are difficult to overcome: both the chemical sensors and the test strips are disposable or... Periodic consumables are a significant issue. Chemical sensors typically have a lifespan of only 3-6 months, and test strips need to be replaced after each test, resulting in continuous consumable procurement costs over the long term. Furthermore, test strip replacement requires manual operation by the user or reliance on complex mechanical pushing mechanisms. The former increases the user's workload, while the latter increases the complexity of the equipment structure. A single chemical sensor can only specifically detect one or a few urine indicators. To achieve multi-indicator detection, multiple sensors need to be densely arranged inside the toilet bowl. Due to space constraints within the toilet bowl, the actual number of integrated detection items is usually limited to no more than three. Test strips also have limitations; a single test strip can only match specific indicator detection, and multi-indicator detection requires multiple test strips and corresponding pushing and reading mechanisms, further increasing equipment costs and failure rates. Summary of the Invention
[0004] The purpose of this invention is to provide a vision-based smart toilet urine detection method and device to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a vision-based smart toilet urine detection method, comprising the following steps: S1. Detection Preparation: Upon receiving the user's detection trigger signal, the smart toilet's lid assembly drives the urine receiving component to unfold to the preset detection position, ensuring stable urine sample reception and guaranteeing the sample validity for subsequent testing. Simultaneously, the lighting module inside the toilet is adjusted to preset detection lighting parameters to create a uniform and stable lighting environment, eliminating the impact of lighting interference on the quality of subsequent image acquisition. Once fully unfolded, the receiving component receives a positioning signal from a position sensor to ensure accurate placement, allowing urine to smoothly enter the receiving component during urination. After the lighting module is activated, the lighting sensor collects lighting data in real time and performs closed-loop calibration to ensure the stability of lighting parameters.
[0006] S2. Image Acquisition: Simultaneous image acquisition is achieved by deploying at least three multispectral cameras at different positions inside the toilet bowl, realizing full-dimensional coverage of the surface, sides, and bottom of the urine sample. This obtains a multi-band raw image set covering the visible light and near-infrared bands, providing comprehensive data support for subsequent multi-dimensional feature extraction. During the acquisition process, the camera adjustment unit adjusts the focal length and shooting angle in real time to ensure image clarity, while recording timestamps to form a dynamic image sequence to meet the needs of dynamic feature analysis.
[0007] S3. Image Preprocessing: Perform denoising, correction, alignment, and region of interest extraction on the original image set. Denoising is used to eliminate interference noise such as dust and light reflection in the bathroom environment. Image correction is used to correct image distortion caused by shooting angle. Multi-frame image alignment ensures the spatial consistency of the image sequence. Region of interest extraction achieves accurate separation of urine area from background, and finally obtains standardized urine image, which improves the accuracy and reliability of subsequent feature extraction.
[0008] S4. Feature Extraction and Quantization: Multi-dimensional features reflecting the health status of urine are extracted from standardized urine images, including color features, transparency features, foam features, and sediment features. The above qualitative features are transformed into quantifiable feature parameters through a preset feature quantification model, realizing the standardized expression of feature information and providing calculable basic data for subsequent detection and analysis. Among them, color features are used to characterize the basic physicochemical properties of urine, foam features and sediment features are used to reflect abnormal components in urine, and transparency features help to judge the purity of urine.
[0009] S5. Detection and Analysis: Input the quantitative feature parameters into the pre-trained urine detection model. Through the model's intelligent analysis of the feature parameters and comparison with the preset health threshold range, the model can accurately determine the key health indicators of urine and output the detection results, including urine pH, urine protein content level, urine sugar content level, and abnormal sediment judgment, thus completing the transformation from image data to health indicators.
[0010] S6. Results Feedback and Data Storage: The test results are fed back to the user in real time through various interactive methods, ensuring that the user can quickly obtain the test information; at the same time, the test results and corresponding quantitative characteristic parameters are stored locally and in the cloud, and synchronized to the user's bound mobile terminal, so as to realize the long-term retention and traceability of test data and provide data support for the user's long-term health management.
[0011] Preferably, in step S1, the acquisition of the detection trigger signal includes triggering by the user through the physical button of the smart toilet, triggering by voice command, remote triggering by a mobile terminal, or automatic triggering after the human body sensing module detects that the user has sat down, realizing convenient triggering in multiple scenarios and adapting to the usage habits of different users; the illumination module adopts a ring light source, the function of which is to ensure uniform illumination without shadows on the surface of the urine sample, avoid image acquisition deviation caused by local illumination differences, and ensure the authenticity of image features.
[0012] Preferably, in step S4, the construction process of the feature quantization model includes: collecting a large number of urine sample images under different health conditions, manually labeling the feature parameters of each sample and the corresponding actual detection results, training the feature quantization model based on the labeled data and optimizing the model parameters through the gradient descent algorithm; the core function of this model is to establish a precise mapping relationship between urine image features and quantization parameters, realize the standardization and computable conversion of feature information, and provide reliable input for the accurate analysis of the detection model.
[0013] Preferably, in step S5, the training process of the urine detection model includes: constructing a training dataset containing at least 10,000 sets of quantitative feature parameters of urine samples and corresponding actual detection results; using a convolutional neural network (CNN) as the basic network structure; training the network using the training dataset; and optimizing the network hyperparameters using cross-validation. The function of this model is to utilize the feature learning and classification capabilities of deep learning algorithms to achieve accurate analysis of quantitative feature parameters and determination of health indicators, thereby ensuring the accuracy and comprehensiveness of the detection results.
[0014] Preferably, in step S5, the urine test results include urine pH (accuracy ±0.2), urine protein content level (negative, weakly positive, positive, strongly positive), urine glucose content level (negative, weakly positive, positive, strongly positive), urine bilirubin content level, and the presence of abnormal precipitates (particles with a diameter ≥0.5mm or an area percentage ≥5% are considered abnormal). These test results can comprehensively reflect the core health-related indicators of urine, providing multi-dimensional basic data for user health screening and enabling preliminary warnings of health problems such as urinary system diseases and diabetes.
[0015] To achieve the above objectives, the present invention also provides the following technical solution: a vision-based smart toilet urine detection device, comprising: Trigger module: Used to receive the user's detection trigger signal and transmit the trigger signal to the control module to start the detection process. Its core function is to adapt to the operating habits of different users and provide convenient and diversified detection start methods. The trigger module includes at least one of physical buttons, voice recognition unit, wireless communication unit and human body sensing unit.
[0016] Control module: As the core scheduling unit of the device, it is electrically connected to the trigger module, urine receiving module, light illumination module, image acquisition module, image processing module, detection module, feedback module and storage module respectively. It is used to coordinate and control each module to perform detection-related operations in a coordinated manner according to the trigger signal, so as to ensure the orderly and efficient progress of the detection process.
[0017] Urine receiving module: includes a retractable receiving tray and a drive unit. Its core function is to stably receive urine samples and retract them after testing to prevent urine from contaminating the toilet body. The drive unit drives the receiving tray to unfold to the preset testing position or retract to the storage position under the control of the control module. The receiving tray is made of transparent and corrosion-resistant material, and the surface of the tray is marked with scale marks to facilitate image correction and sample volume judgment.
[0018] Illumination module: Includes a ring light source and a light source adjustment unit. Its core function is to provide a uniform and stable lighting environment for image acquisition and eliminate the impact of lighting interference on image quality. The light source adjustment unit adjusts the light intensity, color temperature and light angle of the light source under the control of the control module to ensure uniform illumination on the surface of the urine sample and ensure clear presentation of image features.
[0019] Image acquisition module: includes at least two multispectral cameras and a camera adjustment unit. Its core function is to acquire multi-angle, multi-band image data of urine samples, providing comprehensive and accurate raw data for subsequent feature extraction. The cameras are deployed at different positions inside the toilet (including the front, rear, and side of the toilet). The camera adjustment unit adjusts the shooting angle, focal length, and shooting parameters of the cameras under the control of the control module to ensure the clarity and coverage of the acquired images.
[0020] Image processing module: Its core function is to preprocess and extract and quantize features from the original image set, transforming the original image data into standardized feature parameters that can be used for detection and analysis. Specifically, it is used to denoise, correct, align, and extract regions of interest from the original image set acquired by the image acquisition module to obtain standardized urine images. It then extracts the color, transparency, foam, and sediment features of urine from the standardized urine images and transforms each feature into quantized feature parameters through a preset feature quantization model.
[0021] Detection module: It has a built-in pre-trained urine detection model. Its core function is to intelligently analyze quantitative feature parameters and determine health indicators, and output accurate urine detection results. Specifically, it receives quantitative feature parameters transmitted by the image processing module, analyzes the quantitative feature parameters through the detection model, and outputs detection results including key health indicators such as urine pH and urine protein content level.
[0022] Feedback module: Its core function is to provide the test results to the user in an intuitive and convenient way, ensuring that the user can quickly obtain the test information; specifically, it is used to receive the test results output by the test module and provide the test results to the user; the feedback module includes at least one of the following: a display unit (deployed on the inside of the toilet lid or on the control panel), a voice broadcast unit, and a wireless communication unit (for communicating with a mobile terminal).
[0023] Storage module: Includes local storage unit and cloud storage unit. Its core function is to achieve long-term retention and secure storage of test-related data, supporting data traceability and subsequent health analysis. Specifically, it is used to store the original image set, standardized urine images, quantitative feature parameters and test results, ensuring the integrity and accessibility of the data.
[0024] Preferably, the surface of the urine receiving module's receiving tray is coated with a superhydrophobic coating with a contact angle of not less than 150°. This coating reduces urine residue, simplifies cleaning, and prevents bacterial growth from residual urine, thus mitigating hygiene risks. The urine receiving module also includes a cleaning unit comprising a spray head and a drainage channel. Its core function is to automatically clean the receiving tray comprehensively after testing, without requiring manual intervention from the user, ensuring the device's hygiene. The cleaning unit is controlled by a control module to spray and clean the receiving tray, and the cleaning wastewater is discharged through the drainage channel.
[0025] Preferably, the multispectral camera of the image acquisition module adopts an industrial-grade CMOS image sensor with autofocus function, and the camera surface is equipped with a waterproof and dustproof protective cover. Its function is to ensure the stable operation of the camera in the humid and dusty environment of the bathroom, while improving the clarity and color reproduction of the image acquisition. The camera adjustment unit is driven by a stepper motor to achieve precise adjustment of the shooting angle with an adjustment accuracy of 0.5°. Its function is to ensure that the camera can be accurately aimed at the urine sample area, ensuring the relevance and effectiveness of image acquisition.
[0026] Preferably, the control module uses an ARM Cortex-A series processor, which has multi-tasking capabilities. Its function is to simultaneously control multiple operations such as image acquisition, image processing, and result feedback, ensuring the efficient advancement of the detection process and improving detection efficiency. The local storage unit of the storage module uses a solid-state drive, which enables fast reading and writing and stable storage of detection data. The cloud storage unit synchronizes data with the local storage unit through a 5G or WiFi network, which enables remote backup and cross-terminal access to data, ensuring data security and traceability.
[0027] Preferably, the device also includes a calibration module. The core function of the calibration module is to periodically calibrate the image acquisition module, the illumination module, and the detection model to ensure the stability of the detection accuracy during long-term operation. The calibration module includes a standard color chart, standard transparency samples, and a standard feature parameter dataset. By comparing the feature parameters of the actual acquired standard sample images with the standard feature parameter dataset, the threshold range of the image acquisition parameters, illumination parameters, and detection model is adjusted to ensure that the detection results remain accurate and reliable under different usage environments and equipment wear and tear conditions.
[0028] Compared with the prior art, the beneficial effects of the present invention are: (1) By adopting a non-contact visual detection solution, urine detection is completed through image acquisition and analysis. There is no need for contact consumables such as chemical sensors and test strips, which avoids the risk of biological contamination caused by contact detection from the root, eliminates the hygiene hazards of residual urine breeding microorganisms, and ensures user safety. At the same time, the consumable-free design saves users the operational burden of regularly purchasing and replacing consumables, and also avoids the continuous consumable costs generated by long-term use, which significantly improves the economic efficiency of the product.
[0029] (2) By using a multispectral camera and a multi-angle deployment method, the visible light and near-infrared band images of urine can be collected simultaneously. Not only can static appearance features such as color and transparency be extracted, but dynamic features such as foam dissipation and sedimentation can also be captured through dynamic image sequences with timestamps. The synergistic analysis of static and dynamic features can realize the simultaneous detection of multiple key health indicators such as urine pH, urine protein, urine sugar, and sediment. This breaks the limitation of the single detection items of existing technologies and can more comprehensively and accurately reflect the metabolic state of the human body, providing richer basic data support for family health monitoring.
[0030] (3) By using a ring LED light source in combination with a closed-loop illumination calibration mechanism, the illumination on the surface of the urine sample is ensured to be uniform and stable. At the same time, the image preprocessing algorithm is optimized, which can effectively remove environmental noise, correct shooting distortion, accurately extract the region of interest in the urine, and reduce the impact of background interference on feature analysis. In addition, the device has a built-in calibration module that can periodically calibrate the image acquisition parameters, illumination parameters and detection model, further ensuring the stability and reliability of the detection results in complex environments.
[0031] (4) After the test is completed, the device can automatically start the cleaning process to clean the urine receiving components in all directions without the need for manual intervention by the user, taking into account both hygiene and convenience. At the same time, the test results can be displayed intuitively on the screen and broadcast by voice. They can also be synchronized to the mobile terminal to realize historical data traceability, making it convenient for users to track their health status for a long time and build a convenient health management experience throughout the entire process. Attached Figure Description
[0032] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a block diagram of the device module of the present invention. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installed," "equipped with," "sleeved with," "connected," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. For those skilled in the art, the specific meaning of the above terms in this invention can be understood according to the specific circumstances.
[0035] Please see Figures 1 to 2 The present invention provides a technical solution; Example: This embodiment provides a vision-based method and device for detecting feces in a smart toilet: 1. Detection Preparation: The user sends a detection trigger command via a mobile app. The wireless communication unit in the trigger module (supporting WiFi 802.11ac protocol) receives the command and transmits it to the control module (ARM Cortex-A72 processor) via a UART interface at a baud rate of 9600bps. The control module parses the command and outputs a PWM control signal to the 28BYJ-48 stepper motor of the urine receiving module, driving the receiving tray to unfold from its storage position along the linear guide to the preset detection position (10cm above the toilet bowl). The stepper motor has a step angle of 5.625° / 64 and a gear reduction ratio of 1:64. Alternatively, after the user sits down, the human body sensor detects the user's seating (detection time 3.2s, meeting the trigger condition of >3s) and sends a low-level trigger signal to the control module. The control module then controls the stepper motor of the urine receiving module via the PWM signal. Calculate the unfolding displacement of the receiving pallet using the formula: in, This represents the actual rotation angle of the stepper motor (unit: °). The radius of the drive gear (in this embodiment) =5mm), in this step, the motor rotation angle = 2304°, substituting into the formula, we get = 200mm, which just allows the receiving tray to reach the preset position. At the same time, the control module controls the LM317 constant current drive chip of the lighting module through the I2C interface to adjust the light intensity of the ring LED light source to 600 lux and the color temperature to 6000K. The light sensor (accuracy ±5%) collects the light data in real time and feeds it back to the control module.
[0036] 2. Image Acquisition: Three multispectral cameras (using IMX385 CMOS sensors, 2.4μm pixel size) deployed at the front, rear, and side of the toilet are started synchronously. Shutter synchronization is achieved through the GPIO interface of the control module (shooting time difference ≤ 0.5ms). The shooting resolution is set to 1920×1080, the frame rate is 15fps, and the acquisition time is 4s, acquiring a total of 60 frames per camera in raw image set, covering the visible light band (400-760nm) and the near-infrared band (760-1100nm). In this embodiment, the spatial resolution of image acquisition is calculated using a formula to ensure clear capture of foam and sediment details. in, The pixel size is 2.4μm. This refers to the lens focal length (10mm). The vertical distance between the camera and the urine-receiving surface is 18cm. Substituting this distance into the calculation, we get (R = 0.133mm pixels). This means that a single pixel can correspond to an object with an actual size of 0.133mm, which meets the recognition requirements for foam particle size (1-3mm) and sediment particle size (≥0.5mm). During the acquisition process, a timestamp is recorded every 0.5s to form a dynamic image sequence with time stamps, which is used for subsequent dynamic feature analysis.
[0037] 3. Image Preprocessing: ① Noise Reduction: A 3×3 Gaussian filter algorithm is used, with the Gaussian kernel function shown in the formula below, to filter and denoise the original image, removing dust noise and light reflection interference in the bathroom environment. in, = 1.2 (optimized value in this embodiment), The 3×3 Gaussian kernel matrix {-1,0,1} is calculated, and noise reduction is achieved through convolution operation; ② Image Correction: A perspective transformation algorithm is used, with the four preset scale marks on the receiving component as the reference point pixel coordinates. The corresponding world coordinates are The perspective transformation matrix is solved using formulas. : Substituting the coordinates of the reference point, we obtain the solution. Then, perspective transformation is performed on the image to eliminate distortion caused by the shooting angle; ③ Image Alignment: The SIFT feature point matching algorithm is used to calculate feature point matching pairs between different frames of images. The affine transformation parameters are calculated using a formula to achieve multi-frame image alignment, ensuring that the positional deviation of the urine area does not exceed 2 pixels. in, , The coordinates of the feature points in the original image. , The coordinates of the feature points after alignment. , , , , , These are the affine transformation parameters; ④ Region of Interest Extraction: The Otsu adaptive threshold segmentation algorithm is used to calculate the optimal threshold using a formula. : in, , Thresholds The pixel percentages of the segmented foreground (urine) and background regions. Given the average gray values of the two regions, find the one that makes... The largest After segmenting the urine region using a segmentation threshold, a morphological opening operation (erosion followed by dilation) is used to remove small noise regions, resulting in a standardized urine image.
[0038] 4. Feature Extraction and Quantization: Multi-dimensional features are extracted from standardized urine images and quantized using formulas to obtain feature parameters, as follows: ① Color Features: The mean values of the RGB three channels and the parameters of each HSV channel are extracted, where color uniformity is calculated using the following formula: in, These represent the standard deviations of the grayscale values for the three RGB channels, as described in this embodiment. = 8、 = 6、 = 5, substituting into the calculation, we get = 0.85; ② Transparency characteristics: This is achieved by calculating the difference in grayscale values between the urine area and the standard transparent sample. Quantify transparency levels using formulas : in, = 180 (average gray value of urine area). = 240 (average gray value of standard transparent sample), calculated as follows = 85%; ③ Foam characteristics: The number of bubbles is counted using a connected component labeling algorithm, and the bubble density is calculated using a formula: in, = 144 (number of bubbles). = 0.0177mm^2 (actual area corresponding to a single pixel). = 20000 (Actual area of urine) Substitute to get = 0.12, the foam dissipation rate is calculated using the formula: in, = 144 (number of bubbles in the first second). = 136 (number of bubbles in the 2nd second). = 1s, calculated = 0.05 / s; ④ Sediment characteristics: The area ratio of sediment is calculated using the formula: in, = 230 (number of pixels in the sediment), substituting, we get = 0.02; the equivalent diameter of the precipitate particle size is calculated by the morphological skeleton extraction algorithm, which is 0.5 mm in this embodiment; the uniformity of precipitate distribution is calculated to be 0.7 by the entropy method. The above feature parameters are input into the feature quantization model, and the model outputs standardized quantization values (mapped to the [0,1] interval).
[0039] 5. Detection and Analysis: Standardized and quantized feature parameters are input into the trained CNN detection model. The model employs four convolutional layers (kernel sizes of 3×3, 3×3, 5×5, and 5×5), two max-pooling layers (pooling kernel size of 2×2), and two fully connected layers (128 and 64 neurons respectively). The output layer uses the Softmax activation function. The predicted probability of each detection metric is calculated using the following formula: in, This is the input to the i-th neuron in the output layer. The number of categories (e.g., urine protein levels are divided into 4 categories), =4), the category with the highest predicted probability is used as the detection result, and it is verified in combination with a preset health threshold range: the urine pH value is calculated by mapping the color feature quantification value to the pH value, and the mapping formula is shown in the figure: in, = 0.571 (normalized value of color feature), calculated as follows = 6.5 (normal range 4.5-8.0); urine protein and urine glucose were both negative (predicted probabilities of 0.92 and 0.95 respectively, both greater than the negative threshold of 0.8); no abnormalities in the precipitate (particle size of 0.5mm is the critical value, and the area ratio of 0.02 < 5%).
[0040] 6. Results Feedback and Data Storage: The 2.4-inch OLED display (320×240 resolution) of the display unit shows the test results and health advice: "Current urine indicators are normal. It is recommended to maintain good drinking habits (1500-2000ml per day)". The voice broadcast unit (8Ω / 0.5W speaker) uses TTS voice synthesis technology to broadcast the test results. At the same time, the test results, quantitative feature parameters and original image set are uploaded to the Alibaba Cloud server through the 5G communication unit. After the test is completed, the control module controls the cleaning unit to start: first spraying warm water with a pressure of 0.2MPa for 4 seconds, then spraying warm water containing 0.8ml of neutral detergent for 2.5 seconds, and finally rinsing with clean water for 4 seconds, and then receiving the tray and returning it to the storage position.
[0041] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A vision-based method for urine detection in a smart toilet, characterized in that, Includes the following steps: S1. Detection Preparation: After receiving the user's detection trigger signal, the smart toilet's lid-opening assembly is driven by a stepper motor to unfold the urine receiving assembly along the preset guide rail to the preset detection position 8-12cm above the toilet bowl. After the receiving assembly is fully unfolded, the position sensor feeds back the positioning signal. When the user urinates, the urine enters the receiving assembly. At the same time, the control module outputs a PWM signal to adjust the lighting module inside the toilet to the preset detection lighting parameters. After the lighting module is activated, the lighting sensor collects the lighting data in real time and performs closed-loop calibration. S2. Image Acquisition: Simultaneous image acquisition is performed using at least three multispectral cameras deployed at the front, rear, and side of the toilet bowl. During the acquisition process, the cameras adjust their focus in real time using an autofocus module. This acquires multi-angle images covering the surface, sides, and bottom of the urine, while simultaneously acquiring a multi-band raw image set in the visible light and near-infrared bands. S3. Image preprocessing: The original image set is preprocessed, including denoising based on Gaussian filtering, image correction based on perspective transformation, multi-frame image alignment, and extraction of urine region of interest based on threshold segmentation to obtain a standardized urine image. S4. Feature Extraction and Quantization: Extract color features, transparency features, foam features, and sediment features from the standardized urine image. Convert each feature into quantifiable feature parameters using a preset feature quantification model. The color features include RGB mean, HSV channel peak values, and color uniformity. The foam features include foam density, foam particle size distribution, and foam dissipation rate. The sediment features include sediment area ratio, sediment particle size, and sediment distribution uniformity. S5. Detection and Analysis: The quantitative feature parameters are input into a pre-trained urine detection model. The detection model is built based on a convolutional neural network. By comparing the quantitative feature parameters with a preset health threshold range, the urine detection results are output. The detection results include urine pH, urine protein content level, urine sugar content level, and the judgment of whether there are abnormal precipitates. S6. Result Feedback and Data Storage: The detection results are fed back in real time through the display module and voice module of the smart toilet. At the same time, the detection results and corresponding quantitative feature parameters are uploaded to the cloud server for storage and can be synchronized to the user's bound mobile terminal.
2. The method for urine detection in a vision-based smart toilet according to claim 1, characterized in that: In step 1, the detection trigger signal is acquired in the following ways: triggered by the user through the physical button of the smart toilet, triggered by voice command, triggered remotely by a mobile terminal, or automatically triggered after the human body sensing module detects that the user has sat down; the illumination module adopts a ring light source to ensure that the urine sample surface is uniformly illuminated without shadows.
3. The method for urine detection in a vision-based smart toilet according to claim 1, characterized in that: In step 4, the construction process of the feature quantization model includes: collecting a large number of urine sample images under different health conditions, manually labeling the feature parameters of each sample and the corresponding actual detection results, training the feature quantization model based on the labeled data, and optimizing the model parameters through the gradient descent algorithm.
4. The method for urine detection in a vision-based smart toilet according to claim 1, characterized in that: In step 5, the training process of the urine detection model includes: constructing a training dataset containing at least 10,000 sets of quantitative feature parameters of urine samples and corresponding actual detection results; using a convolutional neural network as the basic network structure; training the network using the training dataset; and optimizing the network hyperparameters using cross-validation.
5. The method for urine detection in a vision-based smart toilet according to claim 1, characterized in that: In step 5, the urine test results include urine pH, urine protein content level, urine glucose content level, urine bilirubin content level, and the determination of whether there are abnormal precipitates.
6. A vision-based smart toilet urine detection device, characterized in that, include: Detection preparation module: After receiving the user's detection trigger signal, the smart toilet's lid-opening assembly is driven by a stepper motor to unfold the urine receiving assembly along a preset guide rail to a preset detection position 8-12cm above the toilet bowl. After the receiving assembly is fully unfolded, a position sensor feeds back a signal indicating that it has reached its position. When the user urinates, urine enters the receiving assembly. At the same time, the control module outputs a PWM signal to adjust the lighting module inside the toilet to the preset detection lighting parameters. After the lighting module is activated, it collects lighting data in real time through a lighting sensor and performs closed-loop calibration. Image acquisition module: used to simultaneously acquire images from at least three multispectral cameras deployed at the front, rear and side of the toilet bowl. During the acquisition process, the cameras adjust the focus in real time through an autofocus module; acquire multi-angle images covering the surface, sides and bottom of the urine, and simultaneously acquire a multi-band raw image set in the visible light band and near-infrared band. Image preprocessing module: used to preprocess the original image set, the preprocessing includes Gaussian filtering-based denoising, perspective transformation-based image correction, multi-frame image alignment, and threshold segmentation-based extraction of urine region of interest to obtain a standardized urine image; Feature extraction and quantization module: This module extracts color, transparency, foam, and sediment features from the standardized urine image. It then converts each feature into quantifiable parameters using a pre-defined feature quantification model. The color features include RGB mean, HSV channel peak values, and color uniformity. The foam features include foam density, foam particle size distribution, and foam dissipation rate. The sediment features include sediment area percentage, sediment particle size, and sediment distribution uniformity. Detection and analysis module: used to input the quantitative feature parameters into a pre-trained urine detection model. The detection model is built based on a convolutional neural network. By comparing the quantitative feature parameters with a preset health threshold range, it outputs urine detection results. The detection results include urine pH, urine protein content level, urine sugar content level, and a judgment on the presence of abnormal precipitates. The result feedback and data storage module is used to provide real-time feedback of the detection results through the smart toilet's display module and voice module. At the same time, it uploads the detection results and corresponding quantitative feature parameters to the cloud server for storage and can be synchronized to the user's bound mobile terminal.
7. A vision-based smart toilet urine detection device according to claim 6, characterized in that: The urine receiving assembly has a receiving tray surface coated with a superhydrophobic coating. The urine receiving assembly is also equipped with a cleaning unit, which includes a spray head and a drainage channel. After the test is completed, the control module controls the cleaning unit to spray and clean the receiving tray, and discharges the cleaning wastewater through the drainage channel.
8. A vision-based smart toilet urine detection device according to claim 6, characterized in that: The multispectral camera of the image acquisition module uses an industrial-grade CMOS image sensor with autofocus and a waterproof and dustproof protective cover on the camera surface; the camera adjustment unit is driven by a stepper motor to achieve precise adjustment of the shooting angle.
9. A vision-based smart toilet urine detection device according to claim 6, characterized in that: The detection preparation module uses an ARM Cortex-A series processor, which has multi-tasking capabilities and can simultaneously control operations such as image acquisition, image processing, and result feedback. The local storage unit of the result feedback and data storage module uses a solid-state drive, and the cloud storage unit synchronizes data with the local storage unit via a 5G or WiFi network.
10. A vision-based smart toilet urine detection device according to claim 6, characterized in that: The detection preparation module also includes a calibration component, which is used to periodically calibrate the image acquisition module, the illumination module, and the detection model. The calibration module includes a standard color chart, standard transparency samples, and a standard feature parameter dataset. By comparing the feature parameters of the actual acquired standard sample images with the standard feature parameter dataset, the image acquisition parameters, illumination parameters, and threshold range of the detection model are adjusted to ensure detection accuracy.