An AI intelligent water dispenser based on deep learning and a liquid level detection method

By using a deep learning-based AI smart water dispenser, combined with image acquisition and filtering technologies, the problems of hygiene hazards, high cost, and insufficient accuracy of existing liquid level detection have been solved, achieving high-precision liquid level detection and stable output for water cups made of various materials.

CN122223604APending Publication Date: 2026-06-16ZHEJIANG SCI-TECH UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG SCI-TECH UNIV
Filing Date
2026-01-27
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing liquid level detection technologies have hygiene risks, high costs, poor versatility, unstable detection, and insufficient accuracy, especially when there are changes in light and fluctuations in the liquid level, making it difficult to achieve accurate quantification.

Method used

An AI-powered smart water dispenser based on deep learning, combined with an image acquisition device, an anti-fog airflow device, a supplementary lighting device, and an edge computing processing unit, achieves real-time detection and accurate quantification of the water level in the cup through a pre-trained target detection model and an improved EWMA filter.

Benefits of technology

It achieves high-precision liquid level detection without hygiene issues and is suitable for water cups made of various materials. It has good environmental adaptability and stability, suppresses detection fluctuations, and provides stable liquid level value output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122223604A_ABST
    Figure CN122223604A_ABST
Patent Text Reader

Abstract

The present application relates to the technical fields of computer vision and intelligent household appliances, and particularly relates to an AI intelligent water dispenser based on deep learning and a liquid level detection method, which comprises a water dispenser main body, an image acquisition device, an anti-fog air flow device, a light supplementing device, an edge computing processing unit and a human-computer interaction module; real-time video streams containing a water cup area are acquired, a cup opening, a cup bottom and a liquid surface area are identified by using an end-side target detection model; the pixel thickness of a cup wall is dynamically calculated; according to whether the cup bottom is detected in a current frame, the absolute liquid level and the relative liquid level calculation logic are switched; an improved EWMA filter is introduced for smoothing processing; finally, the liquid level percentage output by the filter is compared with the input target liquid level threshold value; through the deep fusion of hardware architecture and algorithm logic, the present application effectively solves the unstable detection problem caused by the change of shooting angle and the difference of cup types, and realizes the low-cost, high-precision real-time monitoring and visualized interaction of the liquid level of a water cup.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and smart home appliance technology, specifically to an AI-powered smart water dispenser based on deep learning and a liquid level detection method. Background Technology

[0002] Water is a fundamental element for human life. In daily life, water dispensers play a crucial role in meeting people's drinking water needs and are widely used in various scenarios such as homes, offices, schools, and public places. With the trend of smart home and office equipment, users have put forward higher requirements for the automation and intelligence level of water dispensers, and there is an urgent need for a method that can sense the liquid level in the cup in real time and accurately quantify the liquid level percentage.

[0003] Currently, mainstream liquid level detection technologies are mainly divided into contact and non-contact types. Contact sensors, such as float switches and probes, pose hygiene risks and are not suitable for various types of water cups brought by users. Non-contact sensors are usually more expensive and have strict requirements on container materials or placement. In recent years, computer vision-based liquid level detection methods have gradually emerged. These methods acquire images through cameras and use image processing to identify liquid level lines. However, existing vision methods are often affected by factors such as changes in lighting, liquid surface reflection, diverse container shapes, and liquid surface fluctuations, leading to unstable detection, insufficient accuracy, and most methods rely on the fixed posture of the container, resulting in poor versatility.

[0004] In addition, existing visual detection solutions mostly focus on determining the presence or absence of liquid, lacking precise quantitative calculation of the current liquid level percentage. Especially when the visibility of the water glass changes, a single calculation logic cannot guarantee the continuity and accuracy of the data. Summary of the Invention

[0005] In view of the shortcomings of the existing technology, the purpose of this invention is to provide an AI-powered smart water dispenser and a liquid level detection method based on deep learning.

[0006] To achieve the above objectives, the present invention provides the following technical solution: an AI-powered smart water dispenser based on deep learning, comprising: The water dispenser body, image acquisition device, anti-fog airflow device, supplementary lighting device, edge computing processing unit, and human-computer interaction module; The main body of the water dispenser includes a water receiving platform for placing the water cup to be tested; The image acquisition device is located behind the water outlet of the main body of the water dispenser. Its lens optical axis is set at a preset tilt angle with the normal of the water receiving platform plane, and is used to acquire real-time video streams including the water cup area on the water receiving platform. The aforementioned anti-fog airflow device is located below the front panel of the water dispenser body and is used to form an anti-fog air curtain in front of the image acquisition device; The supplementary lighting device is located on one side of the water outlet of the main body of the water dispenser and is used to provide auxiliary lighting for the water receiving platform area; The edge computing processing unit is built into the main body of the water dispenser and is equipped with a pre-trained target detection model. It is used to receive the real-time video stream and perform inference calculations to obtain the detection frame coordinate information of at least one of the cup mouth, cup bottom, and liquid surface of the water cup. The human-computer interaction module is located above the front panel of the water dispenser and includes a display unit and an instruction input unit. The display unit is used to display the collected real-time images and the processed liquid level information, and the instruction input unit is used to receive the target liquid level setting instruction input by the user.

[0007] In some embodiments, the preset tilt angle of the image acquisition device is 45° to 75°; the anti-fog airflow device includes a miniature silent fan; the supplementary lighting device is an LED supplementary light; the edge computing processing unit is an embedded module containing a neural network processing unit; and the instruction input unit includes buttons and / or a microphone array.

[0008] To achieve the above objectives, the present invention also provides the following technical solution: a method for real-time detection of water cup level in the AI ​​smart water dispenser, comprising the following steps: S1: Acquire real-time video frames and input them into a pre-trained target detection model, and output the category label and detection box coordinate information of at least one of the targets in the cup mouth, cup bottom, and liquid surface; S2: Calculate the pixel thickness of the cup wall from the current viewpoint based on the coordinate information of the detection frame; S3: Depending on whether the bottom of the cup is detected in the current frame, perform different logical calculations to obtain the initial liquid level percentage P1. If the bottom of the cup is detected, calculate the absolute liquid level percentage P. abs P1 k =P abs If the bottom of the cup is not detected, calculate the relative liquid level percentage P. rel P1 k =P rel Where k = 0, 1, 2...., represents the output order of different frames; S4: Set the initial liquid level percentage P1 k The input is processed by an improved EWMA filter for smoothing, and the output is the smoothed liquid level percentage P2. k ; S5: The smoothed liquid level percentage P2 k The water level is compared with the target liquid level threshold P3, and the start and stop of water addition are controlled based on the comparison result.

[0009] In some embodiments, according to step S1, a dataset containing cups of different angles and materials is first constructed. The dataset contains four categories of labels: cup rim, cup bottom, static liquid surface, and dynamic liquid surface. After augmentation processing, the dataset is trained to obtain a target detection model. The static liquid surface and the dynamic liquid surface are both used for liquid surface calculation. The data augmentation processing includes at least one of horizontal flipping, center cropping, random brightness adjustment, random saturation adjustment, Gaussian noise addition, salt noise addition, and pepper noise addition.

[0010] In some embodiments, in step S2, the thickness of the cup wall pixels... The calculation formula is as follows: in, The x-coordinate of the left boundary of the cup rim detection box detected by the model; The x-coordinate of the left boundary of the detection frame inside the water cup is used; when the liquid surface is detected, the x-coordinate of the left boundary of the liquid surface detection frame is used. Otherwise, take the x-coordinate of the left boundary of the cup bottom detection box. .

[0011] In some embodiments, step S3, specifically calculating the absolute liquid level percentage, includes: Calculate the width of the cup rim detection frame based on the difference in geometric coordinates. The aforementioned The calculation formula is as follows: in, The x-coordinate of the right boundary of the cup rim detection frame; Calculate the width W of the liquid level detection frame based on the geometric coordinate difference of the liquid level detection frame. water The W mentioned water The calculation formula is as follows: Among them, X water_R The x-coordinate of the right boundary of the liquid level detection frame; Calculate the width W of the cup bottom detection frame based on the geometric coordinate difference of the cup bottom detection frame. cup_B The W mentioned cup_B The calculation formula is as follows: Among them, X cup_B_R The x-coordinate of the right boundary of the detection frame at the bottom of the cup; Collect W data from the first N frames before the bottom of the cup was detected. cup_B The numerical value is stored in the array W, representing the width of the detection frame at the bottom of the cup. cup_B In [i], the median is taken as the reference width W of the cup bottom.cup_B_Base The W mentioned cup_B The calculation formula is as follows: Where Median is the median value operator. Finally, the absolute liquid level percentage P is calculated using the following formula. abs : Here, max is the maximum value operator.

[0012] In some embodiments, step S3, specifically calculating the relative liquid level percentage, includes: Use the obtained W directly cup_T and W water Calculate the ratio R of the width of the liquid surface detection box in the current frame: The R values ​​of the first M frames before the detection of the liquid surface are collected and stored in the liquid surface detection box width ratio array R[j], and the median is taken as the liquid surface reference width ratio R. Base The R mentioned Base The calculation formula is as follows: Finally, the relative liquid level percentage P is calculated using the following formula. rel : .

[0013] In some embodiments, step S4 of the improved EWMA filter includes a monotonicity limiting step and a smoothing update step; the monotonicity limiting step is used to calculate the effective input value of the current frame. The calculation formula is as follows: Where min is the minimum value operator. To ensure that the filtered liquid level does not decline or abruptly change due to detection errors during water injection or stasis, a maximum allowable incremental threshold is set; the smoothing update step is used to calculate the final filtered output value. The calculation formula is as follows: Where α is the smoothing coefficient, the smaller α is, the smoother the output value, and vice versa.

[0014] In some embodiments, step S5, the signal parsing procedure specifically includes: setting P3 to have three target liquid level threshold types, namely, a specific liquid level threshold with a value range of 0% to 90%, a half-cup corresponding to a preset value of 45%, and a full-cup corresponding to a preset value of 90%; if the input method is key input, the system recognizes the key value, directly extracts the corresponding specific liquid level threshold for the value setting key, and calls the corresponding half-cup or full-cup preset value for the half-cup or full-cup key; if it is voice input, firstly, the system matches the instruction features through a semantic mapping table, parses the instruction containing liquid level value features into a specific liquid level threshold, and parses the instruction containing half-cup or full-cup features into the corresponding preset value.

[0015] To achieve the above objectives, the present invention also provides the following technical solution: a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the real-time water level detection method for a water cup.

[0016] Compared with the prior art, the beneficial effects of the present invention are: (1) It has no hygiene problems and is highly versatile. It only requires a regular camera and does not need to come into contact with liquids. It is suitable for water cups made of various materials.

[0017] (2) By constructing a dedicated dataset containing multidimensional data augmentation, the model is robust to different lighting environments and noise.

[0018] (3) An adaptive dual-branch calculation logic was established to solve the problem of adapting to visual changes under different cup shapes and shooting angles.

[0019] (4) An improved monotonically increasing EWMA filter was introduced, which effectively suppressed the fluctuation of single-frame detection and the jump in liquid level caused by the water level jitter, and showed a steady upward trend during the water injection process.

[0020] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. The embodiments of this application will provide a detailed description and understanding of the application. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the AI ​​smart water dispenser of the present invention; Figure 2 This is a schematic diagram of the liquid level calculation method of the present invention; Figure 3 Illustration of image data augmentation; Figure 4 This is a schematic diagram showing the relationship between the location and geometry of the target detection box; Figure 5 A schematic diagram of the output curve for improving the EWMA filter.

[0022] In the diagram: 1. Water dispenser body; 2. Image acquisition device; 3. Supplemental lighting device; 4. Edge computing processing unit; 5. Human-computer interaction module; 6. Water inlet; 7. Anti-fog airflow device; 8. Display unit; 9. Command input unit. Detailed Implementation

[0023] 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.

[0024] like Figure 1 As shown, an AI-powered smart water dispenser based on deep learning includes a main body 1, an image acquisition device 2, an anti-fog airflow device 7, a supplementary lighting device 3, an edge computing processing unit 4, and a human-computer interaction module 5. The main body 1 has a water inlet 6 on its front and a water receiving platform at its bottom for placing a cup to be tested. The image acquisition device 2 is a high-definition wide-angle camera installed behind the water outlet 6 of the main body 1. To address the issue of the cup wall obscuring the liquid surface at eye level, the optical axis of the lens of the image acquisition device 2 is set at a preset tilt angle to the normal of the water receiving platform plane. The preset tilt angle is preferably between 45° and 75°, ensuring that the acquired real-time video stream simultaneously covers the cup rim, cup wall, and potential bottom area.

[0025] To solve the problem of water mist interference when hot water is dispensed, the anti-fog airflow device 7 is composed of a miniature silent centrifugal fan located below the front panel of the water dispenser body. It is used to form an anti-fog air curtain in front of the image acquisition device 2 to disperse the rising hot steam and avoid condensation caused by temperature difference.

[0026] To address the issue of insufficient lighting inside the water dispenser, the supplementary lighting device 3 is configured as an LED supplementary light, located to the left of the water inlet 6, with its light shining obliquely downwards. In conjunction with the image acquisition device 2, it ensures that the features of the water cup and liquid surface can be clearly captured under different ambient lighting conditions.

[0027] To achieve localized intelligent processing, the edge computing processing unit 4 is built into the main body 1 of the water dispenser and electrically connected to the image acquisition device 2. The edge computing processing unit 4 is configured as an embedded chip RK3576 equipped with a neural network processing unit, which internally stores a pre-trained YOLOv11n object detection model. This model receives real-time video streams, performs real-time inference operations, and outputs the category labels and detection box coordinates for each object. The label categories of the object detection model include the rim of the cup, the bottom of the cup, static liquid surface, and dynamic liquid surface. Figure 2 As shown, the edge computing processing unit 4 is also equipped with a control logic module, which is used to perform geometric calculations, dual-branch logic judgments and filtering processing based on the image reasoning results.

[0028] To intuitively display the test results, the human-computer interaction module 5 is located above the front panel of the water dispenser body 1, and includes a display unit 8 and an instruction input unit 9. The display unit 8 is used to display the real-time image collected and the filtered liquid level percentage value. The instruction input unit 9 includes button input and voice input, and the user can set the target liquid level through button or voice command.

[0029] The pre-trained YOLOv11n object detection model was trained using a self-constructed dataset. The original dataset constructed in this embodiment contains 1162 original images of cups of 26 different shapes and materials. Figure 3 As shown, to improve the model's robustness in complex environments and prevent overfitting, various enhancement processes were performed on the original data, including horizontal flipping, center cropping, random brightness and saturation adjustment, and the addition of Gaussian noise, salt noise, and pepper noise. The enhanced dataset contains a total of 9296 images. To distinguish the water dispenser's water filling status, a labeling tool was used to label the targets in the images, with four categories: cup rim, cup bottom, static liquid surface, and dynamic liquid surface. The static and dynamic liquid surfaces were used for liquid surface calculation.

[0030] like Figure 4 As shown, the control logic module first verifies the validity of the detection result. If no liquid surface or bottom of the cup is detected, it directly outputs a liquid level percentage of 0. If both the cup rim and the liquid surface or bottom of the cup are detected, it calculates the cup wall pixel thickness T at the current viewpoint based on the geometric coordinate difference of the detection frame. wall The formula for calculating the pixel thickness of the cup wall is as follows: Wherein, X cup_T_L X is the x-coordinate of the left boundary of the cup rim detection box detected by the model; inner_L The x-coordinate of the left boundary of the detection frame inside the water cup is used as the reference point. When the liquid surface is detected, the x-coordinate of the left boundary of the liquid surface detection frame is taken.water_L Otherwise, take the x-coordinate of the left boundary of the cup bottom detection box. cup_B_L .

[0031] Furthermore, to adapt to visual changes caused by different types of water cups and different shooting angles, the liquid level percentage P1 is calculated using different logic based on whether the bottom of the cup is detected in the current frame. If the bottom of the cup is detected, the absolute liquid level percentage P is calculated. abs P1 k =P abs If the bottom of the cup is not detected, calculate the relative liquid level percentage P. rel P1 k =P rel , where k=0,1,2.... represents the output order of different frames.

[0032] The calculation of the absolute liquid level percentage specifically includes: Calculate the width W of the cup rim detection frame based on the geometric coordinate difference of the cup rim detection frame. cup_T The W mentioned cup_T The calculation formula is as follows: Among them, X cup_T_R The x-coordinate of the right boundary of the cup rim detection frame; Calculate the width W of the liquid level detection frame based on the geometric coordinate difference of the liquid level detection frame. water The W mentioned water The calculation formula is as follows: Among them, X water_R The x-coordinate of the right boundary of the liquid level detection frame; Calculate the width W of the cup bottom detection frame based on the geometric coordinate difference of the cup bottom detection frame. cup_B The W mentioned cup_B The calculation formula is as follows: Among them, X cup_B_R The x-coordinate of the right boundary of the detection frame at the bottom of the cup; Collect W data from the first N frames before the bottom of the cup was detected. cup_B The numerical value is stored in the array W, representing the width of the detection frame at the bottom of the cup. cup_B In [i], the median is taken as the reference width W of the cup bottom. cup_B_Base The W mentioned cup_B The calculation formula is as follows: Median is the median value operator.

[0033] Finally, the absolute liquid level percentage P is calculated using the following formula. abs : Here, max is the maximum value operator.

[0034] The calculation of the relative liquid level percentage specifically includes: Use the W obtained above directly cup_T and W water Calculate the ratio R of the width of the liquid surface detection box in the current frame: The R values ​​of the first M frames before the detection of the liquid surface are collected and stored in the liquid surface detection box width ratio array R[j], and the median is taken as the liquid surface reference width ratio R. Base The R mentioned Base The calculation formula is as follows: Finally, the relative liquid level percentage P is calculated using the following formula. rel : like Figure 5 As shown, to prevent numerical jumps caused by video jitter and water flow fluctuations, the control logic module is configured with an improved EWMA filter. The improved EWMA filter includes a monotonicity limiting step and a smoothing update step; the monotonicity limiting step is used to calculate the effective input value of the current frame. The calculation formula is as follows: Where min is the minimum value operator, Δ max The maximum allowable incremental threshold can be preset based on the range of liquid level changes corresponding to the maximum water dispensing volume per unit time of the water dispenser, ensuring that the filtered liquid level will not regress or change abruptly due to detection errors when water is being dispensed or the dispenser is stationary; the smoothing update step is used to calculate the final filtered output value. The calculation formula is as follows: Where α is the smoothing coefficient, the smaller α is, the smoother the output value, and vice versa.

[0035] The control logic module inside the edge computing processing unit 4 is equipped with a dedicated signal parsing program to process the command signals transmitted from the command input unit 9 and convert them into target liquid level thresholds P3. In this embodiment, the system sets P3 to have three target liquid level threshold types: a specific liquid level threshold ranging from 0% to 90%, a half-cup threshold corresponding to 45% of the preset value, and a full-cup threshold corresponding to 90% of the preset value. If the input method is key input, the system recognizes the key value, directly extracts the corresponding specific liquid level threshold for the value setting key, and calls the corresponding half-cup or full-cup preset value for the half-cup or full-cup key. If the input method is voice input, the system first matches the command features through a semantic mapping table, parses commands containing liquid level value features into specific liquid level thresholds, and parses commands containing half-cup or full-cup features into corresponding preset values.

[0036] Finally, the control logic module will... A high-frequency comparison was performed with P3. When... When the value is less than P3, the edge computing processing unit 4 outputs a high-level signal to drive the water pump to start and continuously inject water; when... If the value is greater than or equal to P3 or the detection model loses the mouth of the water cup within multiple consecutive frames, the system immediately outputs a low-level signal to shut down the water pump.

[0037] In summary, the AI ​​smart water dispenser, through specific hardware settings and adaptive algorithm logic, solves the problems of hygiene hazards, poor versatility, unstable detection, and large value fluctuations in existing liquid level detection technologies. It achieves low-cost, high-precision real-time monitoring of water cup liquid levels that does not require contact with the liquid and is compatible with various materials of water cups.

[0038] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

[0039] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art 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 appended claims and their equivalents.

Claims

1. An AI-powered smart water dispenser based on deep learning, characterized in that: include: The water dispenser body, image acquisition device, anti-fog airflow device, supplementary lighting device, edge computing processing unit, and human-computer interaction module; The main body of the water dispenser includes a water receiving platform for placing the water cup to be tested; The image acquisition device is located behind the water outlet of the main body of the water dispenser. Its lens optical axis is set at a preset tilt angle with the normal of the water receiving platform plane, and is used to acquire real-time video streams including the water cup area on the water receiving platform. The aforementioned anti-fog airflow device is located below the front panel of the water dispenser body and is used to form an anti-fog air curtain in front of the image acquisition device; The supplementary lighting device is located on one side of the water outlet of the main body of the water dispenser and is used to provide auxiliary lighting for the water receiving platform area; The edge computing processing unit is built into the main body of the water dispenser and is equipped with a pre-trained target detection model. It is used to receive the real-time video stream and perform inference calculations to obtain the detection frame coordinate information of at least one of the cup mouth, cup bottom, and liquid surface of the water cup. The human-computer interaction module is located above the front panel of the water dispenser and includes a display unit and an instruction input unit. The display unit is used to display the collected real-time images and the processed liquid level information, and the instruction input unit is used to receive the target liquid level setting instruction input by the user.

2. The AI ​​smart water dispenser based on deep learning according to claim 1, characterized in that: The preset tilt angle of the image acquisition device is 45° to 75°; the anti-fog airflow device includes a miniature silent fan; the supplementary lighting device is an LED supplementary light; the edge computing processing unit is an embedded module containing a neural network processing unit; the instruction input unit includes buttons and / or a microphone array.

3. A method for real-time detection of water cup level in an AI smart water dispenser as described in claim 1, characterized in that: Includes the following steps: S1: Acquire real-time video frames and input them into a pre-trained target detection model, and output the category label and detection box coordinate information of at least one of the targets in the cup mouth, cup bottom, and liquid surface; S2: Calculate the pixel thickness of the cup wall from the current viewpoint based on the coordinate information of the detection frame; S3: Depending on whether the bottom of the cup is detected in the current frame, perform different logical calculations to obtain the initial liquid level percentage P1. If the bottom of the cup is detected, calculate the absolute liquid level percentage P. abs P1 k =P abs If the bottom of the cup is not detected, calculate the relative liquid level percentage P. rel P1 k =P rel Where k = 0, 1, 2...., represents the output order of different frames; S4: Set the initial liquid level percentage P1 k The input is processed by an improved EWMA filter for smoothing, and the output is the smoothed liquid level percentage P2. k ; S5: The smoothed liquid level percentage P2 k The water level is compared with the target liquid level threshold P3, and the start and stop of water addition are controlled based on the comparison result.

4. The method for real-time detection of water cup level according to claim 3, characterized in that: According to step S1, a dataset containing water cups of different angles and materials is first constructed. The dataset contains four categories of labels: cup rim, cup bottom, static liquid surface, and dynamic liquid surface. After augmentation processing, the dataset is trained to obtain an object detection model. The static liquid surface and the dynamic liquid surface are used for liquid surface calculation. The data augmentation processing includes at least one of the following: horizontal flipping, center cropping, random brightness adjustment, random saturation adjustment, Gaussian noise addition, salt noise addition, and pepper noise addition.

5. The method for real-time detection of water cup level according to claim 3, characterized in that: In step S2, the cup wall pixel thickness The calculation formula is as follows: in, The x-coordinate of the left boundary of the cup rim detection box detected by the model; The x-coordinate of the left boundary of the detection frame inside the water cup is used; when the liquid surface is detected, the x-coordinate of the left boundary of the liquid surface detection frame is used. Otherwise, take the x-coordinate of the left boundary of the cup bottom detection box. .

6. The method for real-time detection of water cup level according to claim 5, characterized in that: In step S3, the calculation of the absolute liquid level percentage specifically includes: Calculate the width of the cup rim detection frame based on the difference in geometric coordinates. The aforementioned The calculation formula is as follows: in, The x-coordinate of the right boundary of the cup rim detection frame; Calculate the width W of the liquid level detection frame based on the geometric coordinate difference of the liquid level detection frame. water The W mentioned water The calculation formula is as follows: Among them, X water_R The x-coordinate of the right boundary of the liquid level detection frame; Calculate the width W of the cup bottom detection frame based on the geometric coordinate difference of the cup bottom detection frame. cup_B The W mentioned cup_B The calculation formula is as follows: Among them, X cup_B_R The x-coordinate of the right boundary of the detection frame at the bottom of the cup; Collect W data from the first N frames before the bottom of the cup was detected. cup_B The numerical value is stored in the array W, representing the width of the detection frame at the bottom of the cup. cup_B In [i], the median is taken as the reference width W of the cup bottom. cup_B_Base The W mentioned cup_B The calculation formula is as follows: Where Median is the median value operator. Finally, the absolute liquid level percentage P is calculated using the following formula. abs : Here, max is the maximum value operator.

7. The method for real-time detection of water cup level according to claim 3, characterized in that: In step S3, the calculation of the relative liquid level percentage specifically includes: Directly use the W obtained from claim 6 cup_T and W water Calculate the ratio R of the width of the liquid surface detection box in the current frame: The R values ​​of the first M frames before the detection of the liquid surface are collected and stored in the liquid surface detection box width ratio array R[j], and the median is taken as the liquid surface reference width ratio R. Base The R mentioned Base The calculation formula is as follows: Finally, the relative liquid level percentage P is calculated using the following formula. rel : 。 8. The method for real-time detection of water cup level according to claim 3, characterized in that: In step S4, the improved EWMA filter includes a monotonicity limiting step and a smoothing update step; the monotonicity limiting step is used to calculate the effective input value of the current frame. The calculation formula is as follows: Where min is the minimum value operator. To ensure that the filtered liquid level does not decline or abruptly change due to detection errors during water injection or stasis, a maximum allowable incremental threshold is set; the smoothing update step is used to calculate the final filtered output value. The calculation formula is as follows: Where α is the smoothing coefficient, the smaller α is, the smoother the output value, and vice versa.

9. The method for real-time detection of water cup level according to claim 3, characterized in that: In step S5, the signal parsing procedure specifically includes: setting P3 to have three target liquid level threshold types, namely, a specific liquid level threshold with a value range of 0% to 90%, a half-cup corresponding to a preset value of 45%, and a full-cup corresponding to a preset value of 90%; if the input method is key input, the system recognizes the key value, directly extracts the corresponding specific liquid level threshold for the value setting key, and calls the corresponding half-cup or full-cup preset value for the half-cup or full-cup key; if it is voice input, firstly, the instruction features are matched through the semantic mapping table, and instructions containing liquid level value features are parsed into specific liquid level thresholds, and instructions containing half-cup or full-cup features are parsed into corresponding preset values.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the real-time water cup level detection method as described in any one of claims 3 to 9.