A brush-free toilet control method and system

CN122522784APending Publication Date: 2026-08-07JIANGXI DONGPENG BATHROOM CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGXI DONGPENG BATHROOM CO LTD
Filing Date
2026-05-27
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0005]针对上述缺陷,本发明的目的在于提出一种免刷马桶控制方法及系统,解决无法有效对具有花纹或者图案的马桶内胆进行污渍识别的问题

Benefits of technology

[0016]上述技术方案中的一个技术方案具有如下优点或有益效果:本发明大幅降低因花纹图案导致的误判率,减少不必要的自动消毒次数,从而节约消毒液用量,降低智能马桶的使用成本;同时由于识别更加精准,可以有效清洁实际污渍区域,提升清洁效率和用户体验 。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122522784A_ABST
    Figure CN122522784A_ABST
Patent Text Reader

Abstract

A brush-free toilet control method comprises the following steps: step S1: collecting different toilet inner tank images in a closed cover state as first images; step S2: using the first images for model training to obtain a first model, wherein the first model is used to identify yellow stains, black spots and / or stains; step S3: calling the first model to identify the toilet inner tank to obtain the positions of the yellow stains, black spots and / or stains; and judging whether the areas of the yellow stains, black spots and / or stains are greater than an area threshold value, and if so, adjusting the angle of a nozzle and motor control parameters based on the positions. The present application greatly reduces the misjudgment rate caused by patterned designs, reduces unnecessary automatic disinfection times, thereby saving disinfectant usage, reducing the use cost of the intelligent toilet; at the same time, since the identification is more accurate, the actual stain area can be effectively cleaned, and the cleaning efficiency and user experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart toilet technology, and in particular to a brushless toilet control method and system. Background Technology

[0002] With the continuous improvement of industrial digitalization and intelligence, various automated intelligent devices are gradually becoming more common in the bathroom industry, such as intelligent cleaning components, automatic drying devices, and intelligent deodorization modules. Although smart toilets have many functions, urine stains or mold inevitably appear after prolonged use. Currently, most smart toilets rely on manual visual inspection to check the cleanliness of the toilet's inner wall, flushing channels, and water outlet components to determine if disinfection and cleaning are needed. During the cleaning process, disinfectant is typically sprayed onto the toilet's interior using a spray device.

[0003] With the continuous development of image recognition, some intelligent detection methods based on image processing technology are gradually being applied to toilet stain detection. One example is threshold segmentation, an image segmentation algorithm that sets one or more fixed thresholds to divide the image into multiple parts. For instance, pixels with grayscale values ​​less than the threshold are considered urine stains or mold, while the rest is considered background.

[0004] However, as people's aesthetic standards rise, they also have higher requirements for the patterns and designs on toilet seats. The inside of the toilet may not only be a clean white porcelain surface, but may also have specific patterns and designs printed on it. Therefore, when using existing threshold segmentation methods to identify stains in this type of toilet, patterns or images inside the toilet may be misidentified as stains, leading to automatic real-time disinfection after each cleaning. This significantly increases the amount of disinfectant used, thereby raising the operating cost of smart toilets. Summary of the Invention

[0005] To address the aforementioned shortcomings, the present invention aims to propose a brushless toilet control method and system that solves the problem of ineffective stain identification for toilet liner with patterns or designs.

[0006] To achieve this objective, the present invention adopts the following technical solution: A method for controlling a brushless toilet includes the following steps: Step S1: Collect different images of the toilet liner with the lid closed, as the first image; Step S2: Use the first image to train the model and obtain the first model, wherein the first model is used to identify yellow stains, black spots and / or dirt; Step S3: Call the first model to identify the toilet liner and obtain the location of yellow stains, black spots and / or dirt; Determine whether the area of ​​yellow stains, black spots, and / or dirt is greater than an area threshold. If it is, adjust the nozzle angle and motor control parameters based on the location.

[0007] Preferably, the working process of the first model is as follows: Step SA21: Crop the first image, retaining the image of the toilet liner, to obtain the first processed image. Step SA22: Convert the first processed image from RGB space to Lab color space; Step SA23: Extract the channel values ​​of several yellow stains and black spots in the Lab color space, and use the average value of the channel values ​​as the channel threshold; Based on the above, yellow stain masks and black spot masks are constructed respectively using thresholds; The yellow stain mask and the black spot mask are fused to obtain the final mask; Step SA24: Combine the final mask with the image to be identified, and perform morphological processing on the combined second image; The morphological processing includes, in sequence, opening operation, closing operation, and contour extraction; Step SA25: Calculate the bounding rectangle based on the contour to obtain the coordinates and area of ​​the yellow stains and / or black spots in the image.

[0008] Preferably, the working process of the first model is as follows: Step SB21: Crop the image to be recognized, retain the image of the toilet liner, and obtain the first processed image correlation; Step SB22: Convert the first processed image from a color image to a grayscale image, and apply Gaussian blur to the grayscale image to obtain the second image; Step SB23: Perform a two-dimensional Fourier transform on the second image to obtain the spectrum; Step SB24: Take the pattern and design in the toilet liner as a low-frequency component, and move the low-frequency component to the center of the spectrum to obtain a processed spectrum. Step SB25: Input the processed spectrum into a preset filter to obtain the final spectrum, wherein the preset filter suppresses low frequencies and preserves high frequencies, and the expression of the preset filter is: , The Euclidean distance from any point (u,v) in the spectrum to the center is given by: The standard deviation of the Gaussian kernel; Step SB26: Perform an inverse Fourier transform on the final spectrogram to obtain the third image; The third image is binarized to obtain the fourth image. The grayscale values ​​of the pixels in the fourth image are judged by grayscale threshold. If there is a region where the grayscale value of a pixel is greater than the preset grayscale value, the region is marked as a stain region, and the coordinates and area of ​​the stain region in the first image are determined.

[0009] Preferably, the training process of the first model is as follows: Data preparation and preprocessing: Determine whether the number of samples of yellow stains, black spots and / or dirt in the first image is less than the number threshold. If it is less, use data augmentation techniques to expand the first image. Several first images are divided into training set, validation set and test set according to a preset ratio, and task labels are defined in the training set, validation set and test set. The task labels include a first task label for judging the type of dirt and a second task label for obtaining the location of dirt. Define the loss function for the first model: The loss function is expressed as follows: ; in These are the weighting coefficients, For cross-entropy loss, This is the mean square error loss; The convergence condition of the loss function is: in several training cycles, the decrease of the loss function is less than the first magnitude threshold, and when the validation set is used for verification, the loss function no longer decreases; Set up a learning strategy: When the loss function no longer decreases during validation using the validation set, the following steps are performed: In the first few consecutive iterations, when using the validation set for validation, it is determined whether the decrease in the loss function is always less than the second magnitude threshold. If the decrease is always less than the second magnitude threshold, the learner's learning rate is multiplied by a decay factor, and it is determined whether the learning rate is less than the learning rate threshold. If the learning rate is less than or equal to the learning rate threshold, the loss function is considered to have converged. If the learning rate is greater than the learning rate threshold, the adjusted learning rate is used to re-train the training set. If the decrease is not always less than the second magnitude threshold, the loss function is considered to have converged.

[0010] Preferably, the step of adjusting the nozzle angle and motor control parameters based on the position is as follows: Step S31: Based on the default angle of the nozzle and the location of the yellow stains, black spots and / or dirt, determine the angle at which the nozzle should spray; Step S32: Confirm the required motor control amount by measuring the motor control amount of the liquid pump in the nozzle at the default angle and the spray angle; Step S33: Obtain the required pressure of the liquid pump based on the required control quantity and pump system parameters; Step S34: Update the required control quantity with the required pressure and the current pump pressure to obtain the final motor control quantity.

[0011] A brushless toilet control system, characterized in that, using the brushless toilet control system, includes: Collection module: Used to collect different images of the toilet liner when the toilet lid is closed, as the first image; Training module: used to train a model using the first image to obtain a first model, wherein the first model is used to identify yellow stains, black spots and / or dirt; Identification and Control Module: Used to call the first model to identify the toilet liner and obtain the location of yellow stains, black spots and / or dirt; Determine whether the area of ​​yellow stains, black spots, and / or dirt is greater than an area threshold. If it is, adjust the nozzle angle and motor control parameters based on the location.

[0012] Preferably, the training module includes a yellow stain and black spot training sub-module, which performs the following steps: The first image is cropped, retaining the image of the toilet liner, to obtain the first processed image. The first processed image is converted from RGB space to Lab color space; Extract the channel values ​​of several yellow stains and black spots in the Lab color space, and use the average value of the channel values ​​as the channel threshold; Based on the above, yellow stain masks and black spot masks are constructed respectively using thresholds; The yellow stain mask and the black spot mask are fused to obtain the final mask; The final mask is combined with the image to be identified, and morphological processing is performed on the combined second image; The morphological processing includes, in sequence, opening operation, closing operation, and contour extraction; Calculate the bounding rectangle based on the contour to obtain the coordinates and area of ​​the yellow stains and / or black spots in the image.

[0013] Preferably, the training module further includes a stain training submodule; the stain training submodule performs the following steps: The image to be identified is cropped, retaining the image of the toilet liner, to obtain the first processed image correlation; The first image is converted from a color image to a grayscale image, and the grayscale image is then subjected to Gaussian blur to obtain the second image; Perform a two-dimensional Fourier transform on the second image to obtain a spectrum. The patterns and designs in the toilet liner are used as low-frequency components, and these low-frequency components are moved to the center of the spectrum to obtain a processed spectrum. The processed spectrum is input into a preset filter to obtain the final spectrum. The preset filter suppresses low frequencies and preserves high frequencies. The expression for the preset filter is: , The Euclidean distance from any point (u,v) in the spectrum to the center is given by: The standard deviation of the Gaussian kernel; Step SB26: Perform an inverse Fourier transform on the final spectrogram to obtain the third image; The third image is binarized to obtain the fourth image. The grayscale values ​​of the pixels in the fourth image are judged by grayscale threshold. If there is a region where the grayscale value of a pixel is greater than the preset grayscale value, the region is marked as a stain region, and the coordinates and area of ​​the stain region in the first image are determined.

[0014] Preferably, the training module further includes a training and testing submodule, which performs the following steps: Data preparation and preprocessing: Determine whether the number of samples of yellow stains, black spots and / or dirt in the first image is less than the number threshold. If it is less, use data augmentation techniques to expand the first image. Several first images are divided into training set, validation set and test set according to a preset ratio, and task labels are defined in the training set, validation set and test set. The task labels include a first task label for judging the type of dirt and a second task label for obtaining the location of dirt. Define the loss function for the first model: The loss function is expressed as follows: ; in These are the weighting coefficients, For cross-entropy loss, This is the mean square error loss; The convergence condition of the loss function is: in several training cycles, the decrease of the loss function is less than the first magnitude threshold, and when the validation set is used for verification, the loss function no longer decreases; Set up a learning strategy: When the loss function no longer decreases during validation using the validation set, the following steps are performed: In the first few consecutive iterations, when using the validation set for validation, it is determined whether the decrease in the loss function is always less than the second magnitude threshold. If the decrease is always less than the second magnitude threshold, the learner's learning rate is multiplied by a decay factor, and it is determined whether the learning rate is less than the learning rate threshold. If the learning rate is less than or equal to the learning rate threshold, the loss function is considered to have converged. If the learning rate is greater than the learning rate threshold, the adjusted learning rate is used to re-train the training set. If the decrease is not always less than the second magnitude threshold, the loss function is considered to have converged.

[0015] Preferably, the identification and control module performs the following steps: Based on the nozzle's default angle and the location of yellow stains, black spots, and / or dirt, determine the angle at which the nozzle should spray; By determining the motor control quantity required for the current motor based on the motor control quantity of the liquid pump in the nozzle at the default angle and the spray angle; The required pressure of the liquid pump is obtained based on the required control quantity and the pump system parameters. The required control quantity is updated using the required pressure and the current pump pressure to obtain the final motor control quantity.

[0016] One of the above technical solutions has the following advantages or beneficial effects: the present invention significantly reduces the misjudgment rate caused by patterns, reduces unnecessary automatic disinfection times, thereby saving disinfectant usage and reducing the cost of using smart toilets; at the same time, due to more accurate recognition, it can effectively clean actual stained areas, improving cleaning efficiency and user experience. Attached Figure Description

[0017] Figure 1 This is a flowchart of one embodiment of the method of the present invention.

[0018] Figure 2 This is a schematic diagram of the structure of one embodiment of the system of the present invention. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0020] In the description of embodiments of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0021] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0022] like Figures 1-2 As shown, a method for controlling a brushless toilet includes the following steps: Step S1: Collect different images of the toilet liner with the lid closed, as the first image; Step S2: Use the first image to train the model and obtain the first model, wherein the first model is used to identify yellow stains, black spots and / or dirt; Step S3: Call the first model to identify the toilet liner and obtain the location of yellow stains, black spots and / or dirt; Determine whether the area of ​​yellow stains, black spots, and / or dirt is greater than an area threshold. If it is, adjust the nozzle angle and motor control parameters based on the location.

[0023] To effectively address the problem of traditional threshold segmentation methods misidentifying toilet bowl patterns or designs as stains, this invention first collects images of different toilet bowl interiors with the lid closed, serving as the first image. This is because disinfection and cleaning are performed with the lid closed; the process can only be completed with the lid closed. Furthermore, with the lid closed, the light inside the toilet bowl is stable, preventing overexposure of the first image due to lighting, thus providing stable data for subsequent model training. The camera can be mounted on the toilet lid.

[0024] The first model can learn high-level features such as texture, shape, and color distribution of yellow stains (urine stains), black spots (mold), and dirt (oil stains or limescale), rather than simply comparing grayscale values. Therefore, it can accurately distinguish real stains from designed patterns, and can accurately locate stains even on porcelain surfaces with complex backgrounds. Once yellow stains, black spots, and / or dirt are identified, their area is calculated to see if it exceeds an area threshold. Only if it exceeds the area threshold will the inside of the toilet be disinfected and cleaned, avoiding frequent disinfection and cleaning and wasting toilet cleaner and other cleaning and disinfecting solutions. Since the location information of yellow stains, black spots, and / or dirt has been identified in advance, the yellow stains, black spots, and / or dirt can be sprayed directly, reducing the amount of disinfectant used and ensuring the cleanliness of the toilet.

[0025] This invention significantly reduces the misjudgment rate caused by patterns, reduces unnecessary automatic disinfection cycles, thereby saving disinfectant usage and lowering the operating cost of smart toilets; at the same time, due to more accurate recognition, it can effectively clean actual stained areas, improving cleaning efficiency and user experience.

[0026] Preferably, the working process of the first model is as follows: Step SA21: Crop the first image, retaining the image of the toilet liner, to obtain the first processed image. Step SA22: Convert the first processed image from RGB space to Lab color space; Step SA23: Extract the channel values ​​of several yellow stains and black spots in the Lab color space, and use the average value of the channel values ​​as the channel threshold; Based on the above, yellow stain masks and black spot masks are constructed respectively using thresholds; The yellow stain mask and the black spot mask are fused to obtain the final mask; Step SA24: Combine the final mask with the image to be identified, and perform morphological processing on the combined second image; The morphological processing includes, in sequence, opening operation, closing operation, and contour extraction; Step SA25: Calculate the bounding rectangle based on the contour to obtain the coordinates and area of ​​the yellow stains and / or black spots in the image.

[0027] When it is necessary to identify yellow stains and black spots, the first image will be cropped to retain only the image of the toilet liner, so as to reduce irrelevant background and reduce the amount of computation, thus obtaining the first processed image.

[0028] The first processed image is then converted to the Lab color space. In the Lab color space, yellow stains show significantly higher values ​​in the b channel and lower values ​​in the L channel, which effectively distinguishes them. Similarly, black spots show higher values ​​in the L channel and lower values ​​in the a and b channels, again effectively distinguishing them. By extracting data from the Lab channels of multiple datasets, channel thresholds for identifying black spots can be obtained. These thresholds are then used to create masks for yellow stains and black spots, which are then fused to obtain the final mask. Since the a and b channel values ​​of printed patterns or designs typically differ significantly from the statistical values ​​of actual yellow stains and black spots, the final mask, when combined with the image to be identified, can accurately pinpoint the yellow stain and black spot areas while eliminating most pattern interference. After identifying the yellow stains and black spots, morphological processing is performed: opening operations (erosion followed by dilation to remove minor noise and break slight adhesions), closing operations (dilation followed by erosion to fill small pores inside the stains and connect adjacent areas), and contour extraction are executed sequentially. Since some patterned points may be identified, the opening operations during morphological processing effectively remove these points, thus avoiding the influence of the patterns. Finally, the bounding rectangle is calculated based on the contours to obtain the precise coordinates and area of ​​the yellow stains and / or black spots in the image. This area is then compared with a preset area threshold; only when the area exceeds the threshold are the nozzle angle and motor control parameters adjusted for targeted disinfection.

[0029] Preferably, the working process of the first model is as follows: Step SB21: Crop the image to be recognized, retain the image of the toilet liner, and obtain the first processed image correlation; Step SB22: Convert the first processed image from a color image to a grayscale image, and apply Gaussian blur to the grayscale image to obtain the second image; Step SB23: Perform a two-dimensional Fourier transform on the second image to obtain the spectrum; Step SB24: Take the pattern and design in the toilet liner as a low-frequency component, and move the low-frequency component to the center of the spectrum to obtain a processed spectrum. Step SB25: Input the processed spectrum into a preset filter to obtain the final spectrum, wherein the preset filter suppresses low frequencies and preserves high frequencies, and the expression of the preset filter is: , The Euclidean distance from any point (u,v) in the spectrum to the center is given by: is the standard deviation of the Gaussian kernel; where Where k is a scaling factor used to adaptively determine the cutoff radius R of the high-pass filter based on the image size, specifically, k represents the cutoff radius R as a fraction of the minimum side length of the image. The high-pass filter significantly attenuates frequency components within a radius R (corresponding to the patterns and textures of the toilet seat liner), thus suppressing low frequencies. Frequency components outside the radius R (corresponding to toilet stains, i.e., grease or limescale) are preserved, thus retaining high frequencies. Generally, the value of k ranges from 0.01 to 0.5. If k is too small, only extremely low frequencies are suppressed; background textures such as changes in overall brightness or periodic stripes on the surface of sewage pipes may still remain, leading to false positives. If k is too large, the suppression range is too wide, potentially weakening the mid-frequency information corresponding to small gaps and reducing the gap detection rate.

[0030] Step SB26: Perform an inverse Fourier transform on the final spectrogram to obtain the third image; The third image is binarized to obtain the fourth image. The grayscale values ​​of the pixels in the fourth image are judged by grayscale threshold. If there is a region where the grayscale value of a pixel is greater than the preset grayscale value, the region is marked as a stain region, and the coordinates and area of ​​the stain region in the first image are determined.

[0031] Since the original acquired image is a real number, after the inverse transformation, the imaginary part should be close to zero. The real part is taken as the high-frequency enhanced image. The third image will retain the original high-frequency components, namely the oil stains or limescale in the toilet liner. This part is in a bright state. Therefore, after binarization, the oil stains or limescale in the toilet liner can be found by setting the grayscale preset value.

[0032] Preferably, the training process of the first model is as follows: Data preparation and preprocessing: Determine whether the number of samples of yellow stains, black spots and / or dirt in the first image is less than the number threshold. If it is less, use data augmentation techniques to expand the first image. Several first images are divided into training set, validation set and test set according to a preset ratio, and task labels are defined in the training set, validation set and test set. The task labels include a first task label for judging the type of dirt and a second task label for obtaining the location of dirt. Define the loss function for the first model: The loss function is expressed as follows: ; in These are the weighting coefficients, For cross-entropy loss, This is the mean square error loss; The convergence condition of the loss function is: in several training cycles, the decrease of the loss function is less than the first magnitude threshold, and when the validation set is used for verification, the loss function no longer decreases; In the data preparation phase, it is determined whether the number of samples of various stains in the first image is less than a threshold. If it is less, data augmentation techniques (such as rotation, scaling, and color dithering) are used to expand the first image. This effectively solves the problems of scarce stain samples and imbalanced positive and negative samples in real-world scenarios. Subsequently, the first image is divided into training, validation, and test sets according to a preset ratio, and two task labels are defined: the first task label is used to determine the type of stain (distinguishing between yellow stains, black spots, etc.), and the second task label is used to obtain the location of the stain (such as bounding box coordinates). This enables the model to both classify and locate stains.

[0033] Set up a learning strategy: When the loss function no longer decreases during validation using the validation set, the following steps are performed: In the first few consecutive iterations, when using the validation set for verification, it is determined whether the decrease in the loss function is always less than the second magnitude threshold. If the decrease is always less than the second magnitude threshold, the learner's learning rate is multiplied by a decay factor, and it is determined whether the learning rate is less than the learning rate threshold. If the learning rate is less than or equal to the learning rate threshold, the loss function is considered to have converged. If the learning rate is greater than the learning rate threshold, the adjusted learning rate is used to re-train the training set. If the decrease is not always less than the second magnitude threshold, the loss function is considered to have converged.

[0034] When the loss on the validation set no longer decreases, the learning strategy further checks whether the loss decrease in the preceding consecutive iterations has been less than a second threshold. If so, the optimizer's learning rate is multiplied by a decay factor, and the learning rate is compared with the learning rate threshold. If the learning rate is still greater than the threshold, training continues; otherwise, convergence occurs. This adaptive learning rate decay mechanism helps the model escape local optima, finely adjust parameters, and thus better distinguish between real stains and patterns with similar colors or textures.

[0035] Preferably, the step of adjusting the nozzle angle and motor control parameters based on the position is as follows: Step S31: Based on the default angle of the nozzle and the location of the yellow stains, black spots and / or dirt, determine the angle at which the nozzle should spray; Step S32: Confirm the required motor control amount by measuring the motor control amount of the liquid pump in the nozzle at the default angle and the spray angle; Step S33: Obtain the required pressure of the liquid pump based on the required control quantity and pump system parameters; Step S34: Update the required control quantity with the required pressure and the current pump pressure to obtain the final motor control quantity.

[0036] In this invention, the nozzle does not directly spray disinfectant onto the entire toilet bowl liner. Since the location of yellow stains, black spots, and / or other dirt has already been identified, it can be sprayed directly onto these stains, reducing the amount of disinfectant used while still ensuring toilet cleanliness. The nozzle is installed on the inner wall of the toilet bowl liner and connected to the liquid pump and tank. In operation, the nozzle is in standby mode at a default angle. Once yellow stains, black spots, and / or other dirt are identified, a coordinate system can be constructed with the nozzle as the origin, easily determining the desired spray angle within the coordinate system.

[0037] Once the spray angle is determined, the required control amount for the motor is determined by the motor control amount of the liquid pump in the nozzle at the default angle and the spray angle. The formula for obtaining the required control amount is as follows: ; in This represents the motor control value of the liquid pump in the nozzle at the default angle. This value can be obtained through experimental calibration. In the experiment, it is necessary to ensure that the disinfectant can be sprayed out at the default angle without splashing. The angle of the spray; When the liquid pump starts, it has a certain pressure to ensure that it can smoothly draw in liquid. Although the control value required by the current motor has been calculated in advance, this control value is the control value of the liquid pump motor when the pressure is 0. Therefore, in this invention, it is necessary to obtain the required pressure to spray to the dirt position by using the current motor control value and the pump system parameters, and then adjust the current motor control value according to the required pressure and the current pressure of the liquid pump, so that the nozzle can smoothly spray to the dirt position.

[0038] The formula for obtaining the pressure required by the liquid pump is as follows: The parameters of the pump system depend on the pump structure, motor torque, etc. The formula for the final motor control quantity is as follows: ; This refers to the proportional control coefficient in PID control. This represents the current pressure of the pump.

[0039] In different spraying processes, it is possible to Re-enter The pressure is controlled in a closed loop during the continuous spraying process, ensuring that the nozzle can successfully spray the dirt onto the target area.

[0040] A brushless toilet control system, comprising: Collection module: Used to collect different images of the toilet liner when the toilet lid is closed, as the first image; Training module: used to train a model using the first image to obtain a first model, wherein the first model is used to identify yellow stains, black spots and / or dirt; Identification and Control Module: Used to call the first model to identify the toilet liner and obtain the location of yellow stains, black spots and / or dirt; Determine whether the area of ​​yellow stains, black spots, and / or dirt is greater than an area threshold. If it is, adjust the nozzle angle and motor control parameters based on the location.

[0041] Preferably, the training module includes a yellow stain and black spot training sub-module, which performs the following steps: The first image is cropped, retaining the image of the toilet liner, to obtain the first processed image. The first processed image is converted from RGB space to Lab color space; Extract the channel values ​​of several yellow stains and black spots in the Lab color space, and use the average value of the channel values ​​as the channel threshold; Based on the above, yellow stain masks and black spot masks are constructed respectively using thresholds; The yellow stain mask and the black spot mask are fused to obtain the final mask; The final mask is combined with the image to be identified, and morphological processing is performed on the combined second image; The morphological processing includes, in sequence, opening, closing operations, and contour extraction; Calculate the bounding rectangle based on the contour to obtain the coordinates and area of ​​the yellow stains and / or black spots in the image.

[0042] Preferably, the training module further includes a stain training submodule; the stain training submodule performs the following steps: The image to be identified is cropped, retaining the image of the toilet liner, to obtain the first processed image correlation; The first image is converted from a color image to a grayscale image, and the grayscale image is then subjected to Gaussian blur to obtain the second image; Perform a two-dimensional Fourier transform on the second image to obtain a spectrum. The patterns and designs in the toilet liner are used as low-frequency components, and these low-frequency components are moved to the center of the spectrum to obtain a processed spectrum. The processed spectrum is input into a preset filter to obtain the final spectrum. The preset filter suppresses low frequencies and preserves high frequencies. The expression for the preset filter is: , The Euclidean distance from any point (u,v) in the spectrum to the center is given by: The standard deviation of the Gaussian kernel; Step SB26: Perform an inverse Fourier transform on the final spectrogram to obtain the third image; Binarization is performed on the third image to obtain the fourth image. The grayscale values ​​of the pixels in the fourth image are judged by grayscale threshold. If there is a region where the grayscale value of a pixel is greater than the preset grayscale value, the region is marked as a stain region, and the coordinates and area of ​​the stain region in the first image are determined.

[0043] Preferably, the training module further includes a training and testing submodule, which performs the following steps: Data preparation and preprocessing: Determine whether the number of samples of yellow stains, black spots and / or dirt in the first image is less than the number threshold. If it is less, use data augmentation techniques to expand the first image. Several first images are divided into training set, validation set and test set according to a preset ratio, and task labels are defined in the training set, validation set and test set. The task labels include a first task label for judging the type of dirt and a second task label for obtaining the location of dirt. Define the loss function for the first model: The loss function is expressed as follows: ; in These are the weighting coefficients, For cross-entropy loss, This is the mean square error loss; The convergence condition of the loss function is: in several training cycles, the decrease of the loss function is less than the first magnitude threshold, and when the validation set is used for verification, the loss function no longer decreases; Set up a learning strategy: When the loss function no longer decreases during validation using the validation set, the following steps are performed: In the first few consecutive iterations, when using the validation set for verification, it is determined whether the decrease in the loss function is always less than the second magnitude threshold. If the decrease is always less than the second magnitude threshold, the learner's learning rate is multiplied by a decay factor, and it is determined whether the learning rate is less than the learning rate threshold. If the learning rate is less than or equal to the learning rate threshold, the loss function is considered to have converged. If the learning rate is greater than the learning rate threshold, the adjusted learning rate is used to re-train the training set. If the decrease is not always less than the second magnitude threshold, the loss function is considered to have converged.

[0044] Preferably, the identification and control module performs the following steps: Based on the nozzle's default angle and the location of yellow stains, black spots, and / or dirt, determine the angle at which the nozzle should spray; By determining the motor control quantity required for the current motor based on the motor control quantity of the liquid pump in the nozzle at the default angle and the spray angle; The required pressure of the liquid pump is obtained based on the required control quantity and the pump system parameters. The required control quantity is updated using the required pressure and the current pump pressure to obtain the final motor control quantity.

[0045] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0046] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for controlling a brushless toilet, characterized in that, Includes the following steps: Step S1: Collect different images of the toilet liner with the lid closed, as the first image; Step S2: Use the first image to train the model and obtain the first model, wherein the first model is used to identify yellow stains, black spots and / or dirt; Step S3: Call the first model to identify the toilet liner and obtain the location of yellow stains, black spots and / or dirt; Determine whether the area of ​​yellow stains, black spots, and / or dirt is greater than an area threshold. If it is, adjust the nozzle angle and motor control parameters based on the location.

2. The method for controlling a brushless toilet according to claim 1, characterized in that, The working process of the first model is as follows: Step SA21: Crop the first image, retaining the image of the toilet liner, to obtain the first processed image. Step SA22: Convert the first processed image from RGB space to Lab color space; Step SA23: Extract the channel values ​​of several yellow stains and black spots in the Lab color space, and use the average value of the channel values ​​as the channel threshold; Based on the above, yellow stain masks and black spot masks are constructed respectively using thresholds; The yellow stain mask and the black spot mask are fused to obtain the final mask; Step SA24: Combine the final mask with the image to be identified, and perform morphological processing on the combined second image; The morphological processing includes, in sequence, opening, closing operations, and contour extraction; Step SA25: Calculate the bounding rectangle based on the contour to obtain the coordinates and area of ​​the yellow stains and / or black spots in the image.

3. A method for controlling a brushless toilet according to claim 1 or 2, characterized in that, The working process of the first model is as follows: Step SB21: Crop the image to be recognized, retain the image of the toilet liner, and obtain the first processed image correlation; Step SB22: Convert the first processed image from a color image to a grayscale image, and apply Gaussian blur to the grayscale image to obtain the second image; Step SB23: Perform a two-dimensional Fourier transform on the second image to obtain the spectrum; Step SB24: Take the pattern and design in the toilet liner as a low-frequency component, and move the low-frequency component to the center of the spectrum to obtain a processed spectrum. Step SB25: Input the processed spectrum into a preset filter to obtain the final spectrum, wherein the preset filter suppresses low frequencies and preserves high frequencies, and the expression of the preset filter is: , The Euclidean distance from any point (u,v) in the spectrum to the center is given by: The standard deviation of the Gaussian kernel; Step SB26: Perform an inverse Fourier transform on the final spectrogram to obtain the third image; Binarization is performed on the third image to obtain the fourth image. The grayscale values ​​of the pixels in the fourth image are judged by grayscale threshold. If there is a region where the grayscale value of a pixel is greater than the preset grayscale value, the region is marked as a stain region, and the coordinates and area of ​​the stain region in the first image are determined.

4. The method for controlling a brushless toilet according to claim 3, characterized in that, The training process of the first model is as follows: Data preparation and preprocessing: Determine whether the number of samples of yellow stains, black spots and / or dirt in the first image is less than the number threshold. If it is less, use data augmentation techniques to expand the first image. Several first images are divided into training set, validation set and test set according to a preset ratio, and task labels are defined in the training set, validation set and test set. The task labels include a first task label for judging the type of dirt and a second task label for obtaining the location of dirt. Define the loss function for the first model: The loss function is expressed as follows: ; in These are the weighting coefficients, For cross-entropy loss, This is the mean square error loss; The convergence condition of the loss function is: in several training cycles, the decrease of the loss function is less than the first magnitude threshold, and when the validation set is used for verification, the loss function no longer decreases; Set up a learning strategy: When the loss function no longer decreases during validation using the validation set, the following steps are performed: In the first few consecutive iterations, when using the validation set for verification, it is determined whether the decrease in the loss function is always less than the second magnitude threshold. If the decrease is always less than the second magnitude threshold, the learner's learning rate is multiplied by a decay factor, and it is determined whether the learning rate is less than the learning rate threshold. If the learning rate is less than or equal to the learning rate threshold, the loss function is considered to have converged. If the learning rate is greater than the learning rate threshold, the adjusted learning rate is used to re-train the training set. If the decrease is not always less than the second magnitude threshold, the loss function is considered to have converged.

5. The method for controlling a brushless toilet according to claim 1, characterized in that, The steps for adjusting the nozzle angle and motor control parameters based on the position are as follows: Step S31: Based on the default angle of the nozzle and the location of the yellow stains, black spots and / or dirt, determine the angle at which the nozzle should spray; Step S32: Confirm the required motor control amount by measuring the motor control amount of the liquid pump in the nozzle at the default angle and the spray angle; Step S33: Obtain the required pressure of the liquid pump based on the required control quantity and pump system parameters; Step S34: Update the required control quantity with the required pressure and the current pump pressure to obtain the final motor control quantity.

6. A brushless toilet control system, characterized in that, Using the brushless toilet control device according to any one of claims 1 to 5, comprising: Collection module: Used to collect different images of the toilet liner when the toilet lid is closed, as the first image; Training module: used to train a model using the first image to obtain a first model, wherein the first model is used to identify yellow stains, black spots and / or dirt; Identification and Control Module: Used to call the first model to identify the toilet liner and obtain the location of yellow stains, black spots and / or dirt; Determine whether the area of ​​yellow stains, black spots, and / or dirt is greater than an area threshold. If it is, adjust the nozzle angle and motor control parameters based on the location.

7. A brushless toilet control system according to claim 6, characterized in that, The training module includes a yellow stain and black spot training sub-module, which performs the following steps: The first image is cropped, retaining the image of the toilet liner, to obtain the first processed image. The first processed image is converted from RGB space to Lab color space; Extract the channel values ​​of several yellow stains and black spots in the Lab color space, and use the average value of the channel values ​​as the channel threshold; Based on the above, yellow stain masks and black spot masks are constructed respectively using thresholds; The yellow stain mask and the black spot mask are fused to obtain the final mask; The final mask is combined with the image to be identified, and morphological processing is performed on the combined second image; The morphological processing includes, in sequence, opening, closing operations, and contour extraction; Calculate the bounding rectangle based on the contour to obtain the coordinates and area of ​​the yellow stains and / or black spots in the image.

8. The brushless toilet control system according to claim 7, characterized in that, The training module further includes a stain training submodule; the stain training submodule performs the following steps: The image to be identified is cropped, retaining the image of the toilet liner, to obtain the first processed image correlation; The first image is converted from a color image to a grayscale image, and the grayscale image is then subjected to Gaussian blur to obtain the second image; Perform a two-dimensional Fourier transform on the second image to obtain a spectrum. The patterns and designs in the toilet liner are used as low-frequency components, and these low-frequency components are moved to the center of the spectrum to obtain a processed spectrum. The processed spectrum is input into a preset filter to obtain the final spectrum. The preset filter suppresses low frequencies and preserves high frequencies. The expression for the preset filter is: , The Euclidean distance from any point (u,v) in the spectrum to the center is given by: The standard deviation of the Gaussian kernel; Step SB26: Perform an inverse Fourier transform on the final spectrogram to obtain the third image; Binarization is performed on the third image to obtain the fourth image. The grayscale values ​​of the pixels in the fourth image are judged by grayscale threshold. If there is a region where the grayscale value of a pixel is greater than the preset grayscale value, the region is marked as a stain region, and the coordinates and area of ​​the stain region in the first image are determined.

9. A brushless toilet control system according to claim 7, characterized in that, The training module further includes a training and testing submodule, which performs the following steps: Data preparation and preprocessing: Determine whether the number of samples of yellow stains, black spots and / or dirt in the first image is less than the number threshold. If it is less, use data augmentation techniques to expand the first image. Several first images are divided into training set, validation set and test set according to a preset ratio, and task labels are defined in the training set, validation set and test set. The task labels include a first task label for judging the type of dirt and a second task label for obtaining the location of dirt. Define the loss function for the first model: The loss function is expressed as follows: ; in These are the weighting coefficients, For cross-entropy loss, This is the mean square error loss; The convergence condition of the loss function is: in several training cycles, the decrease of the loss function is less than the first magnitude threshold, and when the validation set is used for verification, the loss function no longer decreases; Set up a learning strategy: When the loss function no longer decreases during validation using the validation set, the following steps are performed: In the first few consecutive iterations, when using the validation set for verification, it is determined whether the decrease in the loss function is always less than the second magnitude threshold. If the decrease is always less than the second magnitude threshold, the learner's learning rate is multiplied by a decay factor, and it is determined whether the learning rate is less than the learning rate threshold. If the learning rate is less than or equal to the learning rate threshold, the loss function is considered to have converged. If the learning rate is greater than the learning rate threshold, the adjusted learning rate is used to re-train the training set. If the decrease is not always less than the second magnitude threshold, the loss function is considered to have converged.

10. A brushless toilet control system according to claim 6, characterized in that, The identification and control module performs the following steps: Based on the nozzle's default angle and the location of yellow stains, black spots, and / or dirt, determine the angle at which the nozzle should spray; By determining the motor control quantity required for the current motor based on the motor control quantity of the liquid pump in the nozzle at the default angle and the spray angle; The required pressure of the liquid pump is obtained based on the required control quantity and the pump system parameters. The required control quantity is updated using the required pressure and the current pump pressure to obtain the final motor control quantity.