Intelligent PAC dosing system based on alumen ustum visual identification and multi-layer fuzzy rule
Through an intelligent PAC drug administration system based on the visual identification of alum flowers and multi-layer fuzzy rules, the instability and adaptability problems of coagulant administration control in the water treatment plant are solved, and accurate drug administration and efficient coagulation effects are achieved to ensure the stability of the effluent water quality.
Patent Information
- Application Number
- CN202510909259.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-02
AI Technical Summary
The coagulant injection control methods in existing water treatment plants have problems such as unstable sensor feedback, difficulty in dealing with water quality changes, lack of intuitive evaluation methods and lack of systematic integration solutions, resulting in poor coagulation and waste of agents.
An intelligent PAC drug administration system based on alum flower visual recognition and multi-layer fuzzy rules is adopted to achieve accurate coagulant injection through the coordinated work of data collection, algorithm processing and control decision-making units. The system includes water quality parameter collection, alum flower image recognition, support vector regression prediction, fuzzy control feedback and visual interface, and dynamically adjusts the dosage of drugs with multiple advanced algorithms and fuzzy rules.
It has achieved accurate adaptation to different water quality conditions, reduced waste of medicine, improved coagulation effect, ensured stable water quality of the effluent, fast system response, reliable operation, and provided scientific decision-making basis.
Smart Images

Figure CN120398236A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automatic control of water treatment, and specifically to an intelligent PAC dosing system based on visual recognition of flocs and multi-layer fuzzy rules. Background Art
[0002] Coagulation technology is a core link in the water treatment process. By adding a coagulant (such as polyaluminum chloride PAC) to water, suspended particles, colloidal substances, and dissolved pollutants in the water are aggregated into larger flocs, facilitating the subsequent solid-liquid separation processes such as sedimentation and filtration to remove these pollutants. The coagulation effect directly affects the effluent water quality, chemical cost, and the risk of secondary pollution, and the precise control of the coagulant dosage is a key factor to ensure the coagulation effect.
[0003] Currently, there are mainly three types of methods for controlling the dosing of coagulants in water treatment plants: manual control, automatic control, and primary intelligent control.
[0004] Manual control mainly relies on the empirical judgment of operators and regularly conducted beaker tests to adjust the coagulant dosage. For example, Wang et al. (2022) and Liu and Chen (2022) studied the optimal dosage of PAC under different water quality conditions through a large number of beaker tests and established empirical formulas for operators to refer to. However, this method has problems such as strong subjectivity, response lag, heavy workload, and difficulty in coping with sudden water quality changes. According to a research report by the US Environmental Protection Agency (EPA), in water treatment plants with large water quality fluctuations, the over-dosing of coagulants caused by manual control methods can reach more than 30%, which not only increases the operating cost but also raises the risk of coagulant residues in the effluent.
[0005] Automatic control methods mainly collect water quality parameters based on on-line sensors and automatically adjust the coagulant dosage in combination with preset control algorithms. Park and Son (2023) developed an automatic control system based on streaming current to achieve real-time adjustment of the PAC dosage. Li et al. (2023) applied fuzzy PID control to the coagulation dosing system and improved the adaptability of the system to water quality changes by adaptively adjusting the PID parameters. Zhang and Wang (2023) established a multiple linear regression model for the coagulant dosage based on parameters such as influent turbidity, pH value, and temperature. However, these automatic control methods still have limitations such as relatively simple control algorithms, difficulty in dealing with non-linear relationships, insufficient adaptability to sudden water quality changes, and lack of direct feedback on the actual effect of the coagulation process.
[0006] In recent years, primary intelligent control methods have begun to be applied to coagulant dosing control. Wu et al. (2024) used the support vector regression (SVR) method to construct a mapping model between water quality parameters and the optimal dosage of PAC. Zhao et al. (2023) compared the performance of various machine learning algorithms in coagulant dosing prediction and found that the XGBoost algorithm showed the best performance in terms of prediction accuracy and stability. Chen et al. (2023) developed a floc recognition system based on convolutional neural network (CNN), and established an association model between floc morphology and sedimentation performance by extracting the morphological characteristics of flocs. Wang et al. (2023) proposed a hybrid control system based on water quality parameter prediction and floc image feedback. However, these methods are usually the application of single technology, lacking the ability to integrate multi-source heterogeneous data and a systematic engineering implementation scheme.
[0007] The main problems existing in the prior art include:
[0008] Single-sensor feedback control cannot adapt to complex water quality change conditions, and is easily affected by sensor failures, signal fluctuations, etc., resulting in unstable control systems;
[0009] Most existing control methods are difficult to cope with sudden changes in water quality, with a lag in response and untimely adjustment;
[0010] There is a complex non-linear relationship between water quality parameters and coagulation effect, which is difficult to accurately describe by traditional linear control algorithms;
[0011] Lack of an intuitive evaluation method for coagulation effect, and unable to achieve precise feedback control based on the actual coagulation effect;
[0012] Most existing intelligent algorithms are applied as independent modules, lacking a systematic integration scheme and being difficult to achieve engineering applications.
[0013] Therefore, an intelligent PAC dosing system based on floc vision recognition and multi-layer fuzzy rules is proposed to solve the above problems. Summary of the Invention
[0014] The purpose of the present invention is to provide an intelligent PAC dosing system based on floc vision recognition and multi-layer fuzzy rules to solve the problems raised in the above background technology.
[0015] To achieve the above purpose, the present invention provides the following technical solutions:
[0016] An intelligent PAC dosing system based on floc vision recognition and multi-layer fuzzy rules, comprising:
[0017] A data acquisition unit, comprising:
[0018] The water quality parameter acquisition module collects the water quality parameters of raw water in real time through a turbidity sensor, a pH sensor, a temperature sensor, and a conductivity sensor;
[0019] The floc image acquisition module is used to obtain the floc morphology image;
[0020] The data preprocessing module is used to perform 3σ criterion outlier detection, KNN imputation of missing values, and Z-score standardization on water quality data, and filter and enhance image data;
[0021] The algorithm processing unit includes:
[0022] The SVR feedforward prediction module, based on the support vector regression algorithm, uses water quality parameters as input to predict the initial PAC dosage;
[0023] The improved YOLOv8 floc recognition module adopts the MobileNetV3 backbone network, the Slim-Neck feature fusion module, and the adaptive spatial feature fusion ASFF technology to realize the detection and classification of floc targets and output the floc region image;
[0024] The floc feature extraction module extracts features such as equivalent diameter, circularity, solidity, GLCM contrast, and fractal dimension from the floc region image, where the fractal dimension calculates the complexity of the floc boundary through the box-counting method;
[0025] The XGBoost turbidity prediction module takes floc features and water quality parameters as input, dynamically adjusts hyperparameters through the particle swarm optimization PSO algorithm, and predicts the turbidity after precipitation;
[0026] The fuzzy control feedback module generates a dosage adjustment coefficient based on the influent turbidity, turbidity control error, error change rate, and floc equivalent diameter through a three-layer rule structure. Among them, defuzzification adopts an improved centroid method and introduces a regional weighting factor;
[0027] The control decision unit includes:
[0028] The dosing decision engine is used to combine the initial dosing amount predicted by SVR with the fuzzy control adjustment coefficient to generate the final dosing instruction. The calculation formula is: Final dosing amount = Initial dosing amount × (1 + adjustment coefficient);
[0029] The system monitoring and diagnosis module detects the operating status of sensors and algorithm modules in real time and triggers robustness rules in case of anomalies;
[0030] The execution display unit includes:
[0031] The dosing execution module controls the metering pump to add PAC according to the final dosing instruction;
[0032] The visualization interface includes a control panel, a floc analysis and a data statistics interface, and real-time displays water quality parameters, floc characteristics, predicted chemical dosage, and a control process trend chart.
[0033] As an optimal solution, in the improved YOLOv8 floc recognition module: The MobileNetV3 backbone network adopts an improved ECA attention module, and its calculation process is as follows: , where is the feature map input to the ECA attention module; represents the global average pooling operation, which is used to perform average pooling on the input feature map in the spatial dimension: is the adaptive one-dimensional convolution kernel; is the Sigmoid activation function, which is used to perform a non-linear transformation on the convolution result; The Slim-Neck feature fusion module includes a GSConv module and a VoV-GSCSP module. Among them, the GSConv module processes features in parallel by ordinary convolution and depthwise separable convolution, and the output channels are fused after splicing and rearrangement; The ASFF detection head realizes multi-scale feature adaptive weighted fusion through the following formula: , where represents the feature value of the output feature map of the th layer at the position ; , , are the normalized weights and satisfy , and are used to weight the feature values after mapping of feature maps with different scales; represents the feature value of the th layer feature map at the position of the th layer after mapping.
[0034] As an optimal solution, in the fuzzy control feedback module:
[0035] The membership functions of the input variables include:
[0036] The domain of the influent turbidity is [0, 5] NTU, which is divided into three fuzzy subsets: low, medium, and high;
[0037] The domain of the turbidity control error is -1, 1, and the domain of the error change rate is -0.5, 0.5, both of which are divided into seven fuzzy subsets;
[0038] The domain of the equivalent diameter of the floc is [0, 50] μm, which is divided into three fuzzy subsets: small, medium, and large;
[0039] The three - layer rule structure includes:
[0040] The main rule library contains 49 rules, with the influent turbidity, error, and error change rate as the antecedent variables;
[0041] The compensation rule library contains 12 rules, with the equivalent diameter of flocs and circularity as the antecedent variables;
[0042] The robustness rule library is triggered during sensor failures and uses the historical data mean to replace abnormal parameters;
[0043] Defuzzification uses an improved centroid method, and the formula is: , where is the precise output value obtained after defuzzification processing; is the membership degree of the -th fuzzy subset, indicating the degree to which the input value belongs to this fuzzy subset; is the value in the domain of the corresponding fuzzy subset; is the regional weighting factor, in the chemical addition area , the maintenance area , the chemical reduction area .
[0044] As an optimal solution, in the XGBoost turbidity prediction module:
[0045] The input features are screened for key parameters through the recursive feature elimination (RFE) and Boruta algorithms. The key parameters include the equivalent diameter of flocs, PAC dosage, circularity, influent turbidity, and pH value;
[0046] An improved regularization objective function is adopted, and the formula is: , is the true value of the post - precipitation turbidity obtained through actual measurement; is the post - precipitation turbidity value predicted by the XGBoost model; is the weight parameter in the XGBoost model; and are dynamically adjusted regularization coefficients used to control the complexity of the model and prevent overfitting; is the number of training samples; is the number of weight parameters;
[0047] The hyperparameters dynamically adjusted by the particle swarm optimization (PSO) algorithm include: n_estimators = 120, max_depth = 5, gamma = 0.1, and lambda = 1.2.
[0048] As an optimal solution, in the SVR feed - forward prediction module:
[0049] The kernel function adopts an improved hybrid kernel function, and the formula is: , where is the improved hybrid kernel function, which is used to measure the similarity between samples and ; , is the radial basis kernel function, is the kernel parameter, represents the square of the Euclidean distance between samples and ; , is the polynomial kernel function, is the degree of the polynomial; , is the dynamic weight factor, which is optimized and determined by the genetic algorithm and is used to balance the effects of the radial basis kernel function and the polynomial kernel function.
[0050] As a preferred solution, in the visualization interface:
[0051] The control panel interface displays real-time water quality parameters, predicted chemical dosage, floc quality rating, and system logs in different regions;
[0052] The floc analysis interface adopts a split-screen design. The original image and detection frames are displayed on the left, and the floc feature parameter table is displayed on the right;
[0053] The data statistics interface provides parameter trend charts, quality distribution pie charts, and statistical information tables, and supports historical data backtracking and export.
[0054] It can be seen from the technical solutions provided by the present invention described above that an intelligent PAC dosing system based on floc vision recognition and multi-layer fuzzy rules provided by the present invention has the following beneficial effects:
[0055] Precise dosing and improved treatment effect: The initial PAC dosing amount is predicted by the SVR feedforward prediction module in combination with water quality parameters, and the adjustment coefficient is generated by the fuzzy control feedback module based on factors such as influent turbidity, turbidity control error, error change rate, and floc equivalent diameter. The two work together to achieve dynamic and precise regulation of the PAC dosing amount; compared with traditional dosing methods, it can more precisely adapt to different water quality conditions, effectively avoid waste or insufficient dosing of chemicals, significantly improve the coagulation effect, and ensure the stable compliance of the effluent water quality;
[0056] Intelligent recognition and optimized control strategy: The improved YOLOv8 floc recognition module combines the MobileNetV3 backbone network, the Slim-Neck feature fusion module, and the ASFF technology, which can quickly and accurately detect and classify floc targets; the floc feature extraction module further obtains multi-dimensional features such as equivalent diameter and roundness, providing rich data for the XGBoost turbidity prediction module, enabling the system to comprehensively predict the turbidity after sedimentation based on floc morphology and water quality parameters, thereby formulating a more scientific chemical dosing control strategy and enhancing the system's adaptability to complex water quality changes;
[0057] Efficient processing to ensure system response: Each module of the system has excellent response performance. The response time of the SVR feedforward prediction module is <1 second, the single-frame image processing time of the improved YOLOv8 module is <0.5 second, and the defuzzification calculation time of the fuzzy control feedback module is <0.2 second, with the entire control cycle ≤30 seconds; this efficient data processing and decision-making speed ensure that the system can track water quality changes in real time, adjust the chemical dosing plan in a timely manner, and guarantee the efficient and stable operation of the entire chemical dosing control system;
[0058] Real-time monitoring to enhance system reliability: The system monitoring and diagnosis module in the control decision unit monitors the sensors and algorithm modules in real time. Once an abnormality occurs, it immediately triggers the robustness rules, uses alternative data or backup strategies to maintain the system operation, and issues an alarm in a timely manner; at the same time, the visualization interface displays the system operation status and key data in real time, facilitating operators to discover and handle problems in a timely manner, greatly enhancing the reliability and stability of the system operation;
[0059] Data visualization to facilitate scientific decision-making: The visualization interface, through the control panel, floc analysis, and data statistics interfaces, displays information such as water quality parameters, floc characteristics, predicted chemical dosages, and control process trends in the form of intuitive charts, data, and images; operators can grasp the overall situation of the system operation in real time, deeply analyze the data change rules, and retrieve historical data, providing a scientific basis for optimizing the chemical dosing strategy and adjusting system parameters, and improving the accuracy and efficiency of decision-making;
[0060] Advanced algorithms to improve the technical level: By applying a variety of advanced algorithms such as support vector regression, improved YOLOv8, XGBoost, and fuzzy control, as well as optimization technologies such as genetic algorithms and particle swarm optimization algorithms, the system has a higher technical level in aspects such as chemical dosage prediction, floc recognition, turbidity estimation, and control strategy generation, promoting the intelligent development of the coagulation chemical dosing control technology and providing an innovative technical solution for the water treatment industry. Description of the Drawings
[0061] Figure 1 It is a schematic diagram of the overall structure of an intelligent PAC dosing system based on floc vision recognition and multi-layer fuzzy rules of the present invention. Detailed implementation manners
[0062] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0063] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in conjunction with the specification drawings and specific implementation manners.
[0064] As Figure 1 shown, an intelligent PAC dosing system based on floc visual recognition and multi-layer fuzzy rules provided by an embodiment of the present invention includes:
[0065] A data acquisition unit, including:
[0066] A water quality parameter acquisition module that collects the water quality parameters of raw water in real time through a turbidity sensor, a pH sensor, a temperature sensor, and a conductivity sensor;
[0067] A floc image acquisition module for obtaining floc morphology images;
[0068] A data preprocessing module for performing 3σ criterion outlier detection, KNN imputation of missing values, and Z-score normalization on water quality data, and filtering and enhancing image data;
[0069] An algorithm processing unit, including:
[0070] An SVR feedforward prediction module that predicts the initial PAC dosage with water quality parameters as inputs based on the support vector regression algorithm;
[0071] An improved YOLOv8 floc recognition module that uses a MobileNetV3 backbone network, a Slim-Neck feature fusion module, and an adaptive spatial feature fusion ASFF technology to implement the detection and classification of floc targets and output floc region images;
[0072] A floc feature extraction module that extracts features such as equivalent diameter, circularity, solidity, GLCM contrast, and fractal dimension from the floc region image, where the fractal dimension calculates the complexity of the floc boundary through the box counting method;
[0073] An XGBoost turbidity prediction module that takes floc features and water quality parameters as inputs, dynamically adjusts hyperparameters through the particle swarm optimization PSO algorithm, and predicts the turbidity after precipitation;
[0074] The fuzzy control feedback module generates the chemical dosage adjustment coefficient through a three-layer rule structure based on the influent turbidity, turbidity control error, error change rate, and equivalent diameter of flocs. Among them, defuzzification adopts an improved centroid method and introduces a regional weighting factor;
[0075] The control decision-making unit includes:
[0076] The chemical dosage decision-making engine is used to combine the initial chemical dosage predicted by SVR with the fuzzy control adjustment coefficient to generate the final chemical dosage instruction. The calculation formula is: Final chemical dosage = Initial chemical dosage × (1 + adjustment coefficient);
[0077] The system monitoring and diagnosis module real-time detects the operating status of sensors and algorithm modules and triggers the robustness rule in case of abnormalities;
[0078] The execution and display unit includes:
[0079] The chemical dosage execution module controls the metering pump to add PAC according to the final chemical dosage instruction;
[0080] The visualization interface includes a control panel, floc analysis, and data statistics interfaces, and real-time displays water quality parameters, floc characteristics, predicted chemical dosage, and the control process trend chart.
[0081] In this embodiment, the data acquisition unit is an important part of an intelligent PAC chemical dosing system based on floc vision recognition and multi-layer fuzzy rules to obtain basic data. Through the coordinated operation of multiple modules, it realizes the accurate acquisition and preprocessing of raw water quality and floc image data. The following is a detailed description of the data acquisition unit:
[0082] Overall function overview:
[0083] The data acquisition unit is responsible for collecting various data related to raw water and flocs in real time and accurately, and preliminarily processing the collected data to provide a reliable data basis for subsequent algorithm analysis and chemical dosing control. It collaborates through modules with different functions, and obtains data information comprehensively at key nodes where raw water enters the treatment process, ensuring that the collected data can truly reflect the water quality status and floc morphological characteristics, so as to meet the requirements of the system for data timeliness and accuracy;
[0084] Subsystem composition and functions:
[0085] The water quality parameter acquisition module:
[0086] The water quality parameter acquisition module is an important part of the data acquisition unit. It realizes the real-time acquisition of raw water quality parameters through a turbidity sensor, a pH sensor, a temperature sensor, and a conductivity sensor. The turbidity sensor uses the principle of light scattering to accurately measure the turbidity value of raw water by detecting the degree of light scattering by suspended particles in the water. This value can intuitively reflect the content of suspended impurities in the water. The pH sensor uses the correspondence between the potential difference between the glass electrode and the reference electrode and the pH value of the solution to monitor the acidity and alkalinity of the raw water in real time. The temperature sensor is based on the temperature-resistance / voltage characteristics of a thermal resistor or a thermocouple to accurately obtain the temperature data of the raw water. The conductivity sensor obtains the conductivity value of the raw water by measuring the conductivity of ions in the solution. This value can indirectly reflect the concentration and type of ions in the water. These sensors convert the collected analog signals into digital signals and transmit them to the data preprocessing module in real time through a data transmission line.
[0087] Floc image acquisition module:
[0088] The floc image acquisition module is set at the starting end of the horizontal flow sedimentation tank and consists of an underwater camera, an LED light source system, and a self-cleaning device. The underwater camera uses a high-resolution, waterproof and dustproof industrial-grade device, which can clearly capture the morphological images of flocs in the underwater environment. The LED light source system provides stable and uniform lighting for the underwater camera to ensure that the floc images can be clearly imaged under different lighting conditions, avoiding image blurring or detail loss due to insufficient light. The self-cleaning device regularly cleans the surface of the underwater camera lens and the LED light source by means of mechanical scraping or high-pressure water flushing to prevent the adhesion of impurities in the water from affecting the imaging quality. The floc image data collected by this module is transmitted to the data preprocessing module in digital image format for further processing.
[0089] Data preprocessing module:
[0090] The data preprocessing module conducts targeted processing on water quality data and image data respectively. For water quality data, first, the 3σ criterion is used for outlier detection. By calculating the mean and standard deviation of the data, the data outside the range of mean ± 3 times the standard deviation is determined as an outlier and marked or removed. Then, the KNN (K-Nearest Neighbor) algorithm is used to interpolate the missing data. According to the values of the K nearest neighbor data points similar to the characteristics of the missing data point, the missing value is estimated by weighted averaging. Finally, Z-score standardization processing is performed to convert the data into a standard normal distribution with a mean of 0 and a standard deviation of 1. The formula is: (where is the standardized data value; is the original data value; is the mean of the original data; (i.e., the standard deviation of the original data); for image data, the data preprocessing module uses a filtering algorithm to remove noise in the image. For example, Gaussian filtering reduces random noise in the image by performing weighted averaging on image pixels and their neighborhoods; at the same time, an enhancement algorithm is used to improve the contrast and clarity of the image. For example, the histogram equalization algorithm makes image details more obvious by adjusting the gray distribution of image pixels, facilitating subsequent floc recognition and feature extraction.
[0091] In this embodiment, the algorithm processing unit is the core "brain" of an intelligent PAC dosing system based on floc visual recognition and multi-layer fuzzy rules. It deeply analyzes the data provided by the data acquisition unit through the coordinated operation of multiple functional modules to achieve accurate prediction and intelligent control of the PAC dosing amount; the following is a detailed description of the algorithm processing unit:
[0092] Overall function overview:
[0093] Based on the raw water quality parameters, floc morphology images and other data obtained by the data acquisition unit, the algorithm processing unit uses a variety of advanced algorithms to achieve prediction of the initial PAC dosing amount, recognition and extraction of floc characteristics, estimation of the turbidity after precipitation, and generation of a dosing amount adjustment coefficient according to the real-time situation, providing accurate and reliable decision-making basis for the control decision-making unit to ensure that the PAC dosing amount can adapt to water quality changes, achieve the best coagulation effect, and ensure stable effluent water quality;
[0094] Subsystem composition and functions:
[0095] SVR feedforward prediction module:
[0096] The SVR feedforward prediction module is based on the support vector regression algorithm, using the raw water quality parameters (such as turbidity, pH value, temperature, conductivity, etc.) as input variables to predict the initial PAC dosing amount; this module uses an improved hybrid kernel function, and the formula is: , where is the improved hybrid kernel function, used to measure the similarity between samples and ; , is the radial basis kernel function, is the kernel parameter, represents the square of the Euclidean distance between samples and ; , is the polynomial kernel function, is the degree of the polynomial; , is the dynamic weight factor, determined by genetic algorithm optimization, used to balance the roles of the radial basis kernel function and the polynomial kernel function;
[0097] The kernel parameter , the regularization parameter and the insensitive loss parameter are optimized so that the SVR model can better fit the complex relationship between water quality parameters and PAC dosage; under the condition of high turbidity (>1000 NTU), the prediction error of this module can be controlled within ≤8%, providing a relatively accurate initial dosage reference value for the system;
[0098] Improved YOLOv8 floc recognition module:
[0099] This module adopts the MobileNetV3 backbone network, the Slim-Neck feature fusion module and the adaptive spatial feature fusion (ASFF) technology to achieve efficient detection and classification of floc targets;
[0100] The MobileNetV3 backbone network adopts an improved ECA attention module, and its calculation process is: , where is the feature map input to the ECA attention module; represents the global average pooling operation, which is used to perform average pooling on the input feature map in the spatial dimension: is the adaptive one-dimensional convolution kernel; is the Sigmoid activation function, which is used to perform non-linear transformation on the convolution result; through this module, the network can automatically learn the importance of different channel features and enhance the ability to extract floc features;
[0101] The Slim-Neck feature fusion module includes the GSConv module and the VoV-GSCSP module. Among them, the GSConv module processes features in parallel by ordinary convolution and depthwise separable convolution, and the output channels are fused after splicing and rearrangement. This design effectively fuses feature information of different scales while reducing the computational amount;
[0102] The ASFF detection head uses the formula: (where represents the feature value at the position of the output feature map of the th layer; , , are the normalized weights and satisfy , and are used to weight the feature values after mapping of feature maps of different scales; represents the feature map of the th layer after mapping at the position of the The eigenvalue at [specific location] is used to achieve multi-scale feature adaptive weighted fusion, which can dynamically adjust the weights of features at different scales according to the different shapes and sizes of flocs, improve the accuracy and robustness of floc recognition, and finally output the floc area image;
[0103] Floc feature extraction module:
[0104] This module extracts features such as equivalent diameter, circularity, solidity, GLCM contrast, and fractal dimension from the floc area image output by the improved YOLOv8 floc recognition module. Among them, the equivalent diameter is calculated by computing the diameter of the equivalent circle of the floc area, which is used to measure the size of the floc. Circularity is calculated by the formula: (where is circularity, is the area of the floc area, is the perimeter of the floc area), which reflects the degree of closeness between the floc shape and a circle. Solidity is the ratio of the floc area to the area of the minimum circumscribed rectangle, reflecting the fullness of the floc;
[0105] GLCM contrast is calculated through the gray-level co-occurrence matrix and is used to describe the severity of gray-level changes in the floc image. The fractal dimension is calculated using the box-counting method. By changing the size of the boxes covering the floc boundary, the number of required boxes is counted, and then the complexity of the floc boundary is calculated. Its calculation formula is: (where is the fractal dimension, is the box size, is the number of boxes with size required to cover the floc boundary); These features describe the morphological characteristics of flocs from multiple dimensions and provide key basis for subsequent turbidity prediction and dosing adjustment;
[0106] XGBoost turbidity prediction module:
[0107] This module takes floc features and water quality parameters as inputs, dynamically adjusts hyperparameters through the particle swarm optimization (PSO) algorithm, and predicts the turbidity after sedimentation. First, 18 key parameters are screened out from numerous input parameters using the recursive feature elimination (RFE) and Boruta algorithms, including the equivalent diameter of flocs, PAC dosage, circularity, influent turbidity, and pH value, etc. An improved regularization objective function is adopted: , where is the true value of the turbidity after sedimentation measured actually; is the turbidity value after sedimentation predicted by the XGBoost model; are the weight parameters in the XGBoost model; and is a dynamically adjusted regularization coefficient used to control the complexity of the model and prevent overfitting; is the number of training samples; is the number of weight parameters; The hyperparameters dynamically adjusted by the Particle Swarm Optimization (PSO) algorithm include: n_estimators = 120 (the number of trees), max_depth = 5 (the maximum depth of the tree), gamma = 0.1 (the minimum loss reduction required for leaf node splitting), and lambda = 1.2 (the L2 regularization coefficient), enabling the XGBoost model to accurately predict the turbidity after sedimentation according to different water qualities and floc conditions, providing an important reference for adjusting the chemical dosage;
[0108] Fuzzy control feedback module:
[0109] Based on parameters such as the influent turbidity, turbidity control error, error change rate, and equivalent diameter of the floc, this module generates a chemical dosage adjustment coefficient through a three-layer rule structure;
[0110] The membership functions of the input variables are set as follows:
[0111] The domain of the influent turbidity is [0, 5] NTU, divided into three fuzzy subsets: low, medium, and high;
[0112] The domain of the turbidity control error is [-1, 1], and the domain of the error change rate is [-0.5, 0.5], both divided into seven fuzzy subsets;
[0113] The domain of the equivalent diameter of the floc is [0, 50] μm, divided into three fuzzy subsets: small, medium, and large; Through the membership function, the precise input parameters are converted into fuzzy linguistic variables for fuzzy reasoning;
[0114] The three-layer rule structure includes:
[0115] The main rule base contains 49 rules, with the influent turbidity, error, and error change rate as the antecedent variables, used to initially determine the direction and amplitude of the chemical dosage adjustment according to water quality changes and turbidity control objectives;
[0116] The compensation rule base contains 12 rules, with the equivalent diameter and circularity of the floc as the antecedent variables, to supplement and correct the results of the main rule base and further refine the chemical dosage adjustment;
[0117] The robustness rule base is triggered in case of sensor failures, using the mean value of historical data to replace abnormal parameters to ensure the stable operation of the system under abnormal conditions;
[0118] Defuzzification uses an improved centroid method, with the formula: , where, is the precise output value obtained after defuzzification processing; is the membership degree of the th fuzzy subset, representing the degree to which the input value belongs to this fuzzy subset; is the value in the domain of the corresponding fuzzy subset; is the regional weighting factor. In the chemical dosing area , the maintenance area , the chemical dosage reduction area ; it converts the fuzzy inference result into an accurate chemical dosing adjustment coefficient to achieve precise control of the PAC dosing amount.
[0119] In this embodiment, the control decision-making unit is the "nerve center" of an intelligent PAC dosing system based on floc visual recognition and multi-layer fuzzy rules. It receives the data results output by the algorithm processing unit and ensures the stable and efficient operation of the entire dosing system through scientific decision-making and precise control; the following is a detailed description of the control decision-making unit:
[0120] Overall function overview:
[0121] Based on information such as the initial PAC dosing amount prediction value, dosing amount adjustment coefficient, and the operating status of sensors and algorithm modules provided by the algorithm processing unit, the control decision-making unit conducts comprehensive analysis and decision-making; on the one hand, it generates the final dosing instruction to precisely control the dosing amount of PAC chemicals; on the other hand, it monitors the operating conditions of each part of the system in real time and responds quickly in case of abnormal situations to ensure the stability and reliability of the system, providing a solid guarantee for achieving the best coagulation effect and ensuring water quality safety;
[0122] Subsystem composition and functions:
[0123] Dosing decision-making engine:
[0124] The dosing decision-making engine is the core component for the control decision-making unit to achieve precise dosing control; it combines the initial PAC dosing amount output by the SVR feedforward prediction module with the dosing amount adjustment coefficient generated by the fuzzy control feedback module through the calculation formula:
[0125] Final dosing amount = Initial dosing amount × (1 + adjustment coefficient) (where "Final dosing amount" refers to the actual amount of PAC chemical finally determined to be added to the water by the system; "Initial dosing amount" is the baseline dosing amount predicted by the SVR feedforward prediction module based on raw water quality parameters; "Adjustment coefficient" is the coefficient used to correct the initial dosing amount calculated by the fuzzy control feedback module based on parameters such as influent turbidity, turbidity control error, error change rate, and equivalent diameter of flocs through a three-layer rule structure and an improved centroid method for defuzzification), and the final dosing instruction is calculated; through precise mathematical calculations and logical judgments, this engine fully considers factors such as changes in raw water quality and floc morphology characteristics, realizes the dynamic optimization and adjustment of PAC dosing amount, ensures that the added chemical can not only meet the coagulation requirements but also avoid chemical waste, and achieves the best treatment effect and economic benefits;
[0126] System monitoring and diagnosis module:
[0127] The system monitoring and diagnosis module undertakes the important responsibility of monitoring the system operation status in real time, detecting and handling abnormal situations in a timely manner; in terms of sensor monitoring, it continuously detects the operation status of water quality parameter acquisition sensors such as turbidity sensors, pH sensors, temperature sensors, conductivity sensors, as well as floc image acquisition devices such as underwater cameras, and obtains information such as the working voltage of the sensors, signal transmission stability, and data acquisition frequency in real time to judge whether the sensors are working properly; once abnormal sensor data (such as data mutation, no data update for a long time, etc.) is found, the faulty sensor is immediately marked, and the robustness rule is triggered, and the historical data mean value or other reliable alternative data is used to maintain the system operation, and at the same time a fault alarm message is sent to remind the maintenance personnel to handle it in a timely manner;
[0128] In terms of algorithm module monitoring, the system monitoring and diagnosis module tracks the operation status of each module in algorithm processing units such as the SVR feedforward prediction module, the improved YOLOv8 floc recognition module, and the XGBoost turbidity prediction module in real time, and monitors indicators such as the calculation time consumption, resource occupancy rate (such as CPU and memory usage rates), and rationality of output results of the algorithms; when it detects situations such as running jams and abnormal calculation results (such as predicted values exceeding the reasonable range) in the algorithm module, it quickly analyzes the reasons for the abnormalities and tries to perform automatic repair by restarting the module, adjusting algorithm parameters, etc.; if the problem cannot be solved, the robustness rule is immediately triggered, and the backup algorithm is enabled or the preset conservative control strategy is adopted to ensure that the system can still maintain the basic dosing control function during the algorithm failure period, and the continuity and stability of the system operation are guaranteed.
[0129] In this embodiment, the visualization interface is an important window for users to interact with an intelligent PAC dosing system based on floc visual recognition and multi-layer fuzzy rules. Through intuitive and clear interface design and function layout, key information during the system operation is presented to users in a visual manner, facilitating users to monitor the system status in real time, analyze data, and make operation decisions. The following is a detailed description of the visualization interface:
[0130] Overall function overview:
[0131] The visualization interface integrates various data information during the system operation, including real-time water quality parameters, floc feature analysis results, predicted dosing amounts, and system operation status, etc. Through different functional partitions and diverse chart display forms, complex data is transformed into intuitive and understandable visual content. Users can grasp the system operation situation in real time through this interface, monitor and manage the dosing process, and at the same time, can also conduct retrospective analysis on historical data, providing strong support for system optimization and decision-making.
[0132] Sub-system composition and functions:
[0133] Control panel interface:
[0134] The control panel interface is mainly used to centrally display key real-time information of the system operation and perform basic operation controls. This interface is laid out in regions, and water quality parameters such as turbidity, pH value, temperature, and conductivity of the raw water are displayed in real time at prominent positions. These parameters are presented in the form of dynamic numbers and dashboards, enabling users to intuitively understand the current water quality status of the raw water. At the same time, the interface will display the predicted dosing amount and the final dosing amount adjusted according to the actual operation situation in real time, helping users master the working state of the dosing system. In addition, the control panel is also equipped with a floc quality rating area, which comprehensively rates the floc quality (such as excellent, good, medium, poor) according to indicators such as equivalent diameter, circularity, and solidity analyzed by the floc feature extraction module, and is displayed in the form of color identification and text description, facilitating users to quickly judge the coagulation effect. In terms of operation control, the control panel provides a system log viewing function. Users can view key operation records, alarm information, algorithm operation status changes, etc. during the system operation through a scrolling list or search box, facilitating tracing the system operation history and troubleshooting problems.
[0135] Floc analysis interface:
[0136] The floc analysis interface adopts a split-screen design, providing users with comprehensive and detailed floc image and feature analysis displays. The left area mainly shows the original floc image and detection frames. The floc images captured by the underwater camera are displayed here in real time. The floc targets detected by the improved YOLOv8 floc recognition module are marked with detection frames of different colors, allowing users to intuitively observe the shape, size, and distribution of flocs at the starting end of the sedimentation tank. The right area is the floc feature parameter table, which details various feature data extracted from the floc images, including equivalent diameter, circularity, solidity, GLCM contrast, and fractal dimension, etc. Each parameter is accompanied by a clear unit annotation and a brief description for easy user understanding. At the same time, this area also supports users to perform operations such as filtering and sorting on the feature data, facilitating users to deeply analyze the variation laws of floc features under different time periods or different water quality conditions, providing a basis for optimizing the dosing strategy.
[0137] Data statistics interface:
[0138] The data statistics interface is designed to help users conduct macroscopic analysis and historical backtracking of the system operation data. This interface provides various visualization chart display methods. Among them, the parameter trend chart uses time as the horizontal axis to show the variation trends of water quality parameters (such as turbidity, pH value, etc.), dosing amount, floc feature parameters, etc. over time. Users can view the dynamic changes of the data by sliding the time axis or selecting a specific time period, intuitively understanding the stability and variation laws of the system operation. The quality distribution pie chart statistically displays the quantity or proportion of flocs of different quality grades, helping users quickly grasp the overall distribution of the coagulation effect. In addition, the data statistics interface also has a statistical information table, which details the statistical indicators of various types of data, such as average value, maximum value, minimum value, standard deviation, etc., providing an accurate quantitative basis for users to conduct data analysis. At the same time, this interface supports the historical data backtracking and export functions. Users can query the historical data within a specified time period by setting conditions such as time range and selecting data types, and export the data in common formats such as Excel and CSV, facilitating users to perform further data processing and analysis, or generate professional reports and documents.
[0139] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An intelligent PAC dosing system based on visual recognition of flocs and multi-layer fuzzy rules, characterized in that: Including: Data acquisition unit, including: Water quality parameter acquisition module, which acquires the water quality parameters of raw water in real time through a turbidity sensor, a pH sensor, a temperature sensor and a conductivity sensor; Floc image acquisition module, used to obtain the floc morphology image; Data preprocessing module, used to perform 3σ criterion outlier detection, KNN imputation of missing values and Z-score standardization on water quality data, and filter and enhance image data; Algorithm processing unit, including: SVR feedforward prediction module, based on the support vector regression algorithm, using water quality parameters as input to predict the initial PAC dosage; Improved YOLOv8 floc recognition module, adopting the MobileNetV3 backbone network, the Slim-Neck feature fusion module and the adaptive spatial feature fusion ASFF technology to realize the detection and classification of floc targets and output the floc region image; Floc feature extraction module, which extracts features such as equivalent diameter, circularity, solidity, GLCM contrast and fractal dimension from the floc region image, where the fractal dimension calculates the boundary complexity of the floc by the box-counting method; XGBoost turbidity prediction module, using floc features and water quality parameters as input, dynamically adjusting hyperparameters through the particle swarm optimization PSO algorithm to predict the turbidity after sedimentation; Fuzzy control feedback module, based on the influent turbidity, turbidity control error, error change rate and floc equivalent diameter, generating a dosage adjustment coefficient through a three-layer rule structure, where defuzzification uses an improved centroid method and introduces a regional weighting factor; Control decision-making unit, including: Dosing decision-making engine, used to combine the initial dosing amount predicted by SVR with the fuzzy control adjustment coefficient to generate the final dosing instruction, and the calculation formula is: final dosing amount = initial dosing amount × (1 + adjustment coefficient); System monitoring and diagnosis module, which real-time detects the operating status of sensors and algorithm modules and triggers robustness rules in case of anomalies; Execution display unit, including: Dosing execution module, which controls the metering pump to add PAC according to the final dosing instruction; Visualization interface, including a control panel, a floc analysis and a data statistics interface, which real-time displays water quality parameters, floc features, predicted dosing amounts and control process trend charts.
2. The intelligent PAC dosing system based on floc visual recognition and multi-layer fuzzy rules according to claim 1, characterized in that: In the improved YOLOv8 floc recognition module: The MobileNetV3 backbone network adopts an improved ECA attention module, and its calculation process is: , where is the feature map input to the ECA attention module; represents the global average pooling operation, which is used to perform average pooling on the input feature map in the spatial dimension: is the adaptive one-dimensional convolutional kernel; is the Sigmoid activation function, which is used to perform a non-linear transformation on the convolution result; The Slim-Neck feature fusion module includes a GSConv module and a VoV-GSCSP module, where the GSConv module processes features in parallel by ordinary convolution and depthwise separable convolution, and the output channels are fused after splicing and rearrangement; The ASFF detection head realizes multi-scale feature adaptive weighted fusion through the following formula: , where represents the feature value of the -th layer output feature map at position ; , , are normalized weights and satisfy , and are used to weight the feature values after mapping of feature maps at different scales; represents the feature value of the -th layer feature map after mapping at the position of the -th layer .
3. An intelligent PAC dosing system based on visual recognition of flocs and multi-layer fuzzy rules according to claim 1, characterized in that: In the fuzzy control feedback module: The membership functions of the input variables include: The domain of influent turbidity is [0, 5] NTU, which is divided into three fuzzy subsets: low, medium and high; The domain of turbidity control error is -1, 1, and the domain of error change rate is -0.5, 0.5, both of which are divided into seven fuzzy subsets; The domain of floc equivalent diameter is [0, 50] μm, which is divided into three fuzzy subsets: small, medium and large; The three-layer rule structure includes: The main rule base contains 49 rules, with the influent turbidity, error, and error change rate as the antecedent variables; The compensation rule base contains 12 rules, with the equivalent diameter and circularity of the floc as the antecedent variables; The robustness rule base is triggered when sensor failures occur, and the historical data mean is used to replace abnormal parameters; Defuzzification uses an improved center of gravity method, and the formula is: , where is the exact output value obtained after defuzzification; is the membership degree of the -th fuzzy subset, indicating the degree to which the input value belongs to this fuzzy subset; is the value in the domain of the corresponding fuzzy subset; is the regional weighting factor, in the dosing area , the maintenance area , the drug reduction area .
4. An intelligent PAC dosing system based on visual recognition of flocs and multi-layer fuzzy rules according to claim 1, characterized in that: In the XGBoost turbidity prediction module: The input features are used to screen key parameters through the recursive feature elimination (RFE) and Boruta algorithms. The key parameters include the equivalent diameter of the floc, PAC dosage, circularity, influent turbidity, and pH value; An improved regularization objective function is adopted, and the formula is: , is the true value of the turbidity after sedimentation obtained from actual measurement; is the turbidity value after sedimentation predicted by the XGBoost model; is the weight parameter in the XGBoost model; and are dynamically adjusted regularization coefficients used to control the complexity of the model and prevent overfitting; is the number of training samples; is the number of weight parameters; The hyperparameters dynamically adjusted by the particle swarm optimization (PSO) algorithm include: n_estimators = 120, max_depth = 5, gamma = 0.1, and lambda = 1.
2.
5. An intelligent PAC dosing system based on visual recognition of flocs and multi-layer fuzzy rules according to claim 1, characterized in that: In the SVR feedforward prediction module: The kernel function uses an improved hybrid kernel function, and the formula is: , where is an improved hybrid kernel function used to measure the similarity between samples and ; , is a radial basis kernel function, is the kernel parameter, represents the square of the Euclidean distance between samples and ; , is a polynomial kernel function, is the degree of the polynomial; , is a dynamic weight factor determined by genetic algorithm optimization, used to balance the effects of the radial basis kernel function and the polynomial kernel function.
6. An intelligent PAC dosing system based on visual recognition of flocs and multi-layer fuzzy rules according to claim 1, characterized in that: In the visualization interface: The control panel interface displays real-time water quality parameters, predicted chemical dosage, floc quality rating, and system logs in different regions; The floc analysis interface adopts a split-screen design. The original image and detection frame are displayed on the left, and the floc feature parameter table is displayed on the right; The data statistics interface provides parameter trend charts, quality distribution pie charts, and statistical information tables, and supports historical data backtracking and export.
Citation Information
Patent Citations
Intelligent flocculation dosing control system and control method
CN112456621A
Colloidal pattern image recognition and dosing control system
CN117115438A
Coagulation clarification tank accurate dosing method and system based on machine learning and image recognition
CN118579911A
Coagulant throwing control method and system
CN1673114A
Operation control method of water or sludge treatment system
JP2020187770A
Cited By
Water plant intelligent dosage prediction method based on data preprocessing
CN121189940A
Water plant intelligent dosing amount prediction method based on data preprocessing
CN121189940B