Medicine adding control method for hospital water treatment based on machine vision

Through the dosing control method based on machine vision, water quality is analyzed using high-resolution cameras and machine learning models, combined with PID control algorithms, the problems of inaccurate and lag in the hospital water treatment system are solved, and accurate analysis of water quality and real-time dosing control are achieved.

CN120383405APending Publication Date: 2025-07-29CHINA NORTHEAST ARCHITECTURAL DESIGN & RES INST CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510469155.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

In existing hospital water treatment systems, dosing control relies on manual experience or sensor monitoring, resulting in inaccurate and lagging dosing, making it difficult to respond to water quality changes in real time.

Method used

Using a dosing control method based on machine vision, a high-resolution industrial camera is used to collect water body images in real time, analyze water quality through image processing and machine learning models, and dynamically adjust the dosing amount in combination with a PID control algorithm.

Benefits of technology

It realizes accurate analysis of water quality and real-time dosing control, ensures that the water quality meets standards, adapts to complex water quality environments, and improves the accuracy and response speed of dosing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120383405A_ABST
    Figure CN120383405A_ABST
Patent Text Reader

Abstract

The invention discloses a dosing control method for hospital water treatment based on machine vision, which comprises an image acquisition module, an image processing module, a water quality analysis module, a dosing control module and a data storage and communication module, comprising the following steps: S1, acquiring a water body image of a water treatment key node in real time through an industrial camera contained in an image acquisition module; s2, the collected image is subjected to preprocessing and feature extraction, preprocessing comprises denoising, enhancement and image segmentation, and feature extraction comprises calculation of turbidity, chromaticity and suspended matter concentration. According to the dosing control method for hospital water treatment based on machine vision, the structure is reasonable, the water body image is collected in real time through the industrial camera, the water quality is accurately analyzed through the image processing algorithm and the machine learning technology, the dosing device is automatically controlled according to the analysis result, intelligent and accurate dosing control is achieved, and the dosing control method is worthy of popularization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of water treatment, and particularly relates to a dosing control method for hospital water treatment based on machine vision. Background Art

[0002] The hospital water treatment system is an important link to ensure the safety of hospital water use. Its core goal is to remove pollutants in water (such as organic matter, pathogenic microorganisms, heavy metals, etc.) through physical, chemical or biological methods to ensure that the water quality meets the medical water use standards. Dosing control is a key step in the water treatment process, and its purpose is to purify the water quality by adding appropriate amounts of chemicals (such as disinfectants, flocculants, pH regulators, etc.).

[0003] Some hospital water treatment systems rely on the experience of operators for dosing control. Operators judge the dosing amount by observing the appearance of water quality (such as color, turbidity) or simple detection data (such as pH value, residual chlorine concentration). This method is highly subjective and is prone to inaccurate dosing due to insufficient experience or misjudgment of operators. Some water treatment systems use sensors to monitor water quality and control the dosing amount according to preset thresholds. Although this method has improved compared to manual control, there are still the following problems: the types of sensors are limited and it is difficult to comprehensively reflect the water quality situation, and the sensor data feedback speed is slow, making it difficult to respond to water quality changes in real time, resulting in dosing lag.

[0004] Therefore, corresponding technical solutions need to be designed to solve this problem. Summary of the Invention

[0005] The present invention provides a dosing control method for hospital water treatment based on machine vision, which solves the above problems.

[0006] To achieve the above object, the present invention provides the following technical solution: A dosing control method for hospital water treatment based on machine vision, including an image acquisition module, an image processing module, a water quality analysis module, a dosing control module, and a data storage and communication module, comprising the following steps:

[0007] S1. The water body image of the key node of water treatment is collected in real time through the industrial camera included in the image acquisition module;

[0008] S2. The collected image is preprocessed and feature extracted. The preprocessing includes denoising, enhancement, and image segmentation, and the feature extraction includes the calculation of turbidity, chromaticity, and suspended solid concentration;

[0009] S3. Based on the machine learning model included in the water quality analysis module, the extracted features are classified or regression analyzed to judge the water quality state in real time;

[0010] S4. According to the water quality analysis results, dynamically adjust the chemical dosing amount of the chemical dosing device through a control algorithm to ensure that the water quality meets the standards.

[0011] Preferably, in S1, the image acquisition module uses a high-resolution industrial camera with a frame rate of not less than 30fps and a resolution of 1080P or higher. It is installed at key node positions such as sedimentation tanks, filtration tanks, and disinfection tanks in the hospital water treatment system. The camera captures water body images at a set time interval, such as once every 5 seconds, and transmits the captured images to the image processing module in real time.

[0012] Preferably, in S2, for the captured images, the image processing module uses the Gaussian filtering algorithm to remove Gaussian noise in the images by setting an appropriate Gaussian kernel size, uses the histogram equalization algorithm to enhance the images, expands the gray dynamic range of the images, improves the overall contrast of the images, and uses the OTSU (Otsu) threshold segmentation algorithm to automatically calculate an optimal threshold according to the gray characteristics of the images and segment the water body area from the background.

[0013] Preferably, in S3, the water quality analysis module uses a convolutional neural network (CNN) to build a water quality analysis model. The model structure includes multiple convolutional layers, and different numbers of convolutional kernels are set in each convolutional layer. The size of the convolutional kernels is generally 3×3 or 5×5. Image features are extracted through convolutional operations, then a pooling layer is connected to downsample the feature maps, and finally a fully connected layer is connected for classification and regression. The model is trained according to the training data to judge in real time whether the water quality meets the standards, and predict the change trend of the water quality in the future for a period of time through methods such as time series analysis.

[0014] Preferably, in S4, the chemical dosing control module, based on the results of the water quality analysis module, uses the PID control algorithm to adjust the proportional coefficient (Kp), integral coefficient (Ki), and derivative coefficient (Kd) in real time to dynamically adjust the flow rate of the chemical dosing pump and achieve precise chemical dosing.

[0015] Preferably, the data storage and communication module uses a database management system to store historical water quality data and chemical dosing records. The data storage format adopts a structured data table form, which is convenient for data query and statistical analysis.

[0016] The beneficial effects of the present invention are as follows:

[0017] 1. This chemical dosing control method for hospital water treatment based on machine vision can, through machine vision technology, capture water body images in real time and extract high-precision features (such as color, turbidity, suspended solid concentration, etc.), and accurately analyze the water quality in combination with machine learning algorithms, so as to accurately control the chemical dosing amount and ensure that the water treatment effect reaches the optimal.

[0018] 2. The chemical dosing control method for hospital water treatment based on machine vision can extract deep features in images through deep learning algorithms (such as convolutional neural network CNN), and combined with multi-class machine learning models (such as support vector machine SVM, random forest, etc.), it can accurately identify the types and concentrations of different pollutants and adapt to complex water quality environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a schematic structural diagram of the present invention;

[0020] Figure 2 is a flowchart of image processing of the present invention;

[0021] Figure 3 is a flowchart of training of the water quality analysis model of the present invention;

[0022] Figure 4 is a flowchart of chemical dosing control of the present invention.

[0023] In the figure: 1, image acquisition module; 2, image processing module; 3, water quality analysis module; 4, chemical dosing control module; 5, data storage and communication module. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] The present invention will be described in detail below with reference to the accompanying drawings in the embodiments of the present invention. However, the protection scope of the present invention is not limited to the following embodiments, that is, any simple equivalent changes and modifications made based on the scope of the patent application of the present invention and the content of the specification still fall within the scope covered by the patent of the present invention.

[0025] As Figures 1-4 shown, it includes an image acquisition module 1, an image processing module 2, a water quality analysis module 3, a chemical dosing control module 4, and a data storage and communication module 5, and includes the following steps:

[0026] S1. The industrial camera included in the image acquisition module is used to collect the water body image of the key node of water treatment in real time;

[0027] S2. The collected image is preprocessed and feature extracted. The preprocessing includes denoising, enhancement, and image segmentation, and the feature extraction includes the calculation of turbidity, chromaticity, and suspended solid concentration;

[0028] S3. Based on the machine learning model included in the water quality analysis module, the extracted features are classified or regression analyzed to judge the water quality status in real time;

[0029] S4. According to the water quality analysis result, the chemical dosing amount of the chemical dosing device is dynamically adjusted through the control algorithm to ensure that the water quality meets the standard.

[0030] Based on the above description, further elaborated, in S1, the image acquisition module 1 uses a high-resolution industrial camera with a frame rate of not less than 30fps and a resolution of 1080P or above. It is installed at key node positions such as sedimentation tanks, filtration tanks, and disinfection tanks in the hospital water treatment system. The camera collects water body images at a set time interval, such as once every 5 seconds, and transmits the collected images to the image processing module 2 in real time. The image sensor of the industrial camera converts the optical signal into an electrical signal to obtain the water body image. By using the automatic focus and automatic exposure functions of the camera, clear imaging can be ensured under different lighting and distance conditions. After shooting, the images are transmitted to the image processing module in real time through a high-speed data transmission interface (such as USB3.0 or Gigabit Ethernet).

[0031] Based on the above description, further elaborated, in S2, for the collected images, the image processing module 2 uses the Gaussian filtering algorithm to remove Gaussian noise in the image by setting an appropriate Gaussian kernel size, uses the histogram equalization algorithm to enhance the image, expands the gray dynamic range of the image, and improves the overall contrast of the image. The OTSU (Otsu) threshold segmentation algorithm is adopted to automatically calculate an optimal threshold according to the gray characteristics of the image to segment the water body area from the background. At the same time, the pixel values in the neighborhood (such as 3×3 neighborhood) of each pixel point in the image are sorted, and the median value is taken as the new value of the pixel point, which has a good suppression effect on discrete noises such as salt-and-pepper noise and can retain the edges and details of the image.

[0032] Based on the above description, further elaborated, in S3, the water quality analysis module 3 uses a convolutional neural network (CNN) to build a water quality analysis model. The model structure includes multiple convolutional layers, and different numbers of convolutional kernels are set in each convolutional layer. The size of the convolutional kernel is generally 3×3 or 5×5. Image features are extracted through convolutional operations, then a pooling layer is connected to downsample the feature map, and finally a fully connected layer is connected for classification and regression. The model is trained according to the training data to judge in real time whether the water quality meets the standard, and the change trend of the water quality in the future period is predicted through methods such as time series analysis. In the training stage, a large number of image data with accurate water quality labels (such as meeting the standard / not meeting the standard, specific turbidity, chromaticity, suspended solid concentration and other parameter values) are collected. The data set is divided into a training set, a validation set, and a test set. The model is trained using the training set, and the weight parameters of the model are continuously adjusted through the backpropagation algorithm to minimize the error between the prediction result of the model and the real label.

[0033] Based on the above description, further elaborated, in S4, the chemical dosing control module 4, according to the results of the water quality analysis module, adopts the PID control algorithm. By adjusting the proportional coefficient (Kp), integral coefficient (Ki), and derivative coefficient (Kd), it dynamically adjusts the flow rate of the chemical dosing pump in real time to achieve precise chemical dosing. First, it calculates the deviation e between the current water quality parameters (such as residual chlorine concentration, pH value, etc.) and the set target value. The proportional link (Kp×e) proportionally adjusts the control quantity according to the magnitude of the deviation, enabling the flow rate of the chemical dosing pump to quickly respond to the water quality deviation. The integral link (Ki×∫edt) integrates the deviation, accumulates the past deviation information, and eliminates the steady-state error of the system. The derivative link (Kd×de / dt) adjusts the control quantity according to the rate of change of the deviation, predicting the change trend of the deviation in advance, so that the system has better dynamic response performance.

[0034] Based on the above description, further elaborated, in S5, the data storage and communication module 5 uses a database management system to store historical water quality data and chemical dosing records. The data storage format adopts a structured data table form, which is convenient for data query and statistical analysis.

[0035] Working principle: When using this chemical dosing control method for hospital water treatment based on machine vision, an industrial camera with high resolution (≥1080P) and high frame rate (≥30fps) is selected. The camera is installed at key node positions such as sedimentation tanks, filtration tanks, and disinfection tanks in the hospital water treatment system. During installation, environmental factors such as water flow and light need to be fully considered to ensure that the camera's field of view can completely cover the key area, and it is firmly fixed through a mounting bracket to prevent image acquisition quality from being affected by vibration or displacement. The camera's autofocus function uses phase autofocus or contrast autofocus technology to automatically adjust the lens focal length according to the distance between the water body and the camera to ensure clear imaging. The automatic exposure function dynamically adjusts the exposure time and aperture size by analyzing the brightness distribution of the image to adapt to different lighting conditions. The shooting interval is set to 3 - 5 seconds, which can be achieved through the internal timer of the camera or an external trigger signal for timed shooting. When the acquired image data is transmitted through the USB3.0 interface, its high-speed data transmission capability is utilized to achieve a data transmission rate of several GB per second, ensuring that the image can be transmitted to the image processing module in real time and stably. If Gigabit Ethernet is used for transmission, the image data is encapsulated into data packets through network protocols and quickly transmitted in the network to ensure the integrity and accuracy of the data;

[0036] The image processing module 2 sets the standard deviation (e.g., σ = 1.5) according to the noise characteristics, generates a corresponding Gaussian kernel matrix. Taking the 3×3 Gaussian kernel matrix as an example, the weight of the central element is the largest, and the weights of the surrounding elements gradually decrease. The weighted sum of each pixel point in the image and its 8 neighboring pixels is performed to smooth the image, effectively removing the noise conforming to the Gaussian distribution. At the same time, the pixel values within the neighborhood (e.g., 3×3 neighborhood) of each pixel point in the image are sorted, and the median value is taken as the new value of this pixel point, which has a good inhibitory effect on discrete noises such as salt-and-pepper noise and can retain the edges and details of the image;

[0037] Secondly, count the number of pixels at each gray level in the image, calculate the cumulative distribution function, map the gray values of the original image to a new gray range according to the cumulative distribution function, making the gray distribution of the image more uniform, thereby enhancing the contrast of the image, highlighting the detailed features of the water body, and setting the lower and upper limits of stretching according to the gray characteristics of the image to perform a linear transformation on the gray values of the image;

[0038] Then traverse all possible gray thresholds. For each threshold, divide the image into a foreground and a background, calculate the between-class variance of the foreground and the background. The between-class variance reflects the degree of difference between the two parts. Select the threshold that maximizes the between-class variance as the segmentation threshold to accurately separate the water body from the background;

[0039] At the same time, delimit a representative area in the image, calculate the standard deviation or variance of the pixel gray values within this area, establish a mapping relationship model between turbidity and gray statistical values through a large number of experimental data. For example, adopt a linear regression model y = ax + b, where y is the turbidity value, x is the gray statistical value, and a and b are model parameters determined through experiments, so as to convert the gray statistical value into a turbidity value, and analyze the distribution of pixel values in the three channels R, G, and B of the image, calculate the proportional relationship of the R, G, and B components. For example, by calculating the proportional values of R / (R+G+B), G / (R+G+B), B / (R+G+B) and comparing them with the proportional values of the standard chromaticity samples, determine the chromaticity of the water body;

[0040] And calculate the gray-level co-occurrence matrix of the image in different directions (e.g., 0°, 45°, 90°, 135°), extract the characteristic parameters of the matrix, such as contrast, correlation, energy, entropy, etc. Establish a regression model between these characteristic parameters and the suspended sediment concentration through experiments, such as a multiple linear regression model y = a1x1 + a2x2 + a3x3 + a4x4 + b, where y is the suspended sediment concentration, x1 - x4 are the characteristic parameters such as contrast, correlation, energy, entropy, etc., and a1 - a4 and b are model parameters, and use this to predict the suspended sediment concentration;

[0041] When the water quality analysis module 3 constructs a water quality analysis model using a convolutional neural network (CNN), the model structure usually includes multiple convolutional layers, pooling layers, and fully connected layers. The convolutional kernel size of the convolutional layer is generally 3×3 or 5×5. Through convolutional operations, feature extraction is performed on the image. Different convolutional kernels learn different features, such as edges, textures, etc. The pooling layer uses max pooling or average pooling, and the pooling window size is generally 2×2. By downsampling, the size of the feature map is reduced, the computational amount is reduced, and at the same time, the main features are retained. The fully connected layer performs classification and regression calculations on the pooled feature vectors and outputs the judgment result of the water quality. In the training stage, a large amount of image data with accurate water quality labels (such as up to standard / not up to standard, specific turbidity, chromaticity, suspended solid concentration and other parameter values) is collected. The data set is divided into a training set, a validation set, and a test set. The training set is used to train the model, and the weight parameters of the model are continuously adjusted through the backpropagation algorithm to minimize the error between the prediction result of the model and the true label. During the training process, the validation set is used to evaluate the model to prevent overfitting. After training, the test set is used to finally test the performance of the model;

[0042] Taking the PID control algorithm as an example, the data storage and communication module of the chemical dosing control module 4 first calculates the deviation e between the current water quality parameters (such as residual chlorine concentration, pH value, etc.) and the set target value. The proportional link (Kp×e) adjusts the control amount proportionally according to the size of the deviation, so that the flow rate of the chemical dosing pump can quickly respond to the water quality deviation. The integral link (Ki×∫edt) integrates the deviation, accumulates the past deviation information, and eliminates the steady-state error of the system. The derivative link (Kd×de / dt) adjusts the control amount according to the change rate of the deviation, predicts the change trend of the deviation in advance, and enables the system to have better dynamic response performance. By adjusting the values of the three parameters Kp, Ki, and Kd, the PID controller can adapt to different water quality control requirements, and sends the calculated control amount to the driving device of the chemical dosing pump. The driving device adjusts the motor speed or stroke of the chemical dosing pump according to the control signal, so as to accurately control the chemical dosing amount;

[0043] The data storage and communication module 5 uses a relational database such as MySQL for data storage, creates corresponding data tables, and the table structure includes fields such as time, location (such as sedimentation tank, filter tank, etc.), water quality parameters (turbidity, chromaticity, suspended solid concentration, pH value, residual chlorine concentration, etc.), and chemical dosing amount. Structured Query Language (SQL) is used for data insertion, query, update, and deletion operations. For example, the INSERT INTO statement is used to insert real-time collected water quality data and chemical dosing records into the data table, and the SELECT statement is used to query historical data for data analysis and report generation.

[0044] It should be noted that the present invention is a dosing control method for hospital water treatment based on machine vision. The above-mentioned electrical components and system modules are all products of the prior art. Those skilled in the art can select, install and complete the circuit debugging operations according to the needs of use to ensure that each electrical appliance can work normally. The components are all common standard parts or parts known to those skilled in the art, and their structures and principles can all be known by those skilled in the art through technical manuals or obtained through conventional experimental methods. The applicant does not make specific restrictions here.

[0045] Finally, it should be noted that the above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A dosing control method for hospital water treatment based on machine vision, comprising an image acquisition module (1), an image processing module (2), a water quality analysis module (3), a dosing control module (4) and a data storage and communication module (5), characterized in that: It includes the following steps: S1. Use an industrial camera included in the image acquisition module to collect real-time water body images of key water treatment nodes; S2. Preprocess and extract features from the collected images. The preprocessing includes denoising, enhancement, and image segmentation. The feature extraction includes the calculation of turbidity, chromaticity, and suspended solid concentration; S3. Based on the machine learning model included in the water quality analysis module, perform classification or regression analysis on the extracted features to judge the water quality status in real time; S4. According to the water quality analysis results, dynamically adjust the dosing amount of the dosing device through a control algorithm to ensure that the water quality meets the standards.

2. The dosing control method for hospital water treatment based on machine vision according to claim 1, characterized in that: In S2, for the collected images, the image processing module (2) uses the Gaussian filtering algorithm to remove Gaussian noise in the image by setting an appropriate Gaussian kernel size (such as 3×3 or 5×5), uses the histogram equalization algorithm to enhance the image, expands the gray dynamic range of the image, and improves the overall contrast of the image. The OTSU (Otsu) threshold segmentation algorithm is used to automatically calculate an optimal threshold according to the gray characteristics of the image to segment the water body area from the background.

3. The chemical dosing control method for hospital water treatment based on machine vision according to claim 1, characterized in that: In S3, the water quality analysis module (3) uses a convolutional neural network (CNN) to build a water quality analysis model. The model structure includes multiple convolutional layers. Each convolutional layer is set with a different number of convolutional kernels. The convolutional kernel size is generally 3×3 or 5×5. Image features are extracted through convolutional operations, and then a pooling layer is connected to downsample the feature map. Finally, a fully connected layer is connected for classification and regression. The model is trained according to the training data to judge in real time whether the water quality meets the standards, and the change trend of the water quality in the next period of time is predicted through methods such as time series analysis.

4. A chemical dosing control method for hospital water treatment based on machine vision according to claim 1, characterized in that: In S4, the dosing control module (4) adopts the PID control algorithm according to the results of the water quality analysis module, and adjusts the proportional coefficient (Kp), integral coefficient (Ki), and differential coefficient (Kd) to dynamically adjust the flow rate of the dosing pump in real time to achieve precise dosing.

5. The dosing control method for hospital water treatment based on machine vision according to claim 1, characterized in that: The data storage and communication module (5) uses a database management system to store historical water quality data and dosing records. The data storage format adopts a structured data table form, which is convenient for data query and statistical analysis.

Citation Information

Patent Citations

  • Propellant slurry leveling property detection and analysis system

    CN112986055A

  • Method for predicting and controlling dosage of high-density clarification tank based on multi-dimensional scoring model

    CN114781249A

  • Online monitoring and control system and method for water treatment agent based on polyaluminum chloride

    CN118458908A

  • Heavy metal wastewater treatment device

    CN222064287U

  • Intelligent dosing setting method for wastewater treatment system

    WO2024198228A1