A Smart PAC Dosing System Based on Visual Recognition of Alum Flowers and Multi-layer Fuzzy Rules

The intelligent PAC dosing system based on floc visual recognition and multi-layer fuzzy rules solves the instability and adaptability problems of coagulant dosing control in water treatment plants, realizes dynamic and precise control of PAC dosage, and improves coagulation effect and system response capability.

CN120398236BActive Publication Date: 2025-10-31FUJIAN UNIV OF TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510909259.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-10-31
Estimated Expiration
2045-07-02

AI Technical Summary

Technical Problem

Existing methods for controlling coagulant dosing in water treatment plants suffer from problems such as unstable sensor feedback, difficulty in responding to sudden changes in water quality, lack of intuitive assessment methods, and lack of systematic integration solutions, resulting in poor coagulation effects and waste of chemicals.

Method used

An intelligent PAC dosing system based on alum floc visual recognition and multi-layer fuzzy rules is adopted. It combines water quality parameter acquisition, alum floc image acquisition, data preprocessing, SVR feedforward prediction, improved YOLOv8 alum floc recognition, XGBoost turbidity prediction and fuzzy control feedback module to achieve dynamic and precise control of PAC dosing.

Benefits of technology

It achieves precise adaptation to different water quality conditions, reduces chemical waste, improves coagulation effect, ensures stable effluent quality, has a fast system response, reliable operation, and provides a scientific basis for decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120398236B_ABST
    Figure CN120398236B_ABST
Patent Text Reader

Abstract

This invention relates to the field of automatic control technology for water treatment, and in particular to an intelligent PAC dosing system based on visual recognition of floc and multi-layer fuzzy rules. The system includes: a data acquisition unit that collects and preprocesses water quality parameters and floc images in real time; an algorithm processing unit that predicts the initial dosage using SVR, identifies floc using an improved YOLOv8 algorithm, predicts turbidity using XGBoost, and generates adjustment coefficients using fuzzy control; a control decision unit that combines the initial dosage and adjustment coefficients to generate the final dosing command, while simultaneously monitoring the system status; and an execution display unit that administers the dosing command according to the command and visualizes the data. This invention achieves dynamic optimization of PAC dosing through multi-algorithm collaboration and precise control, effectively improving coagulation performance and avoiding reagent waste. The visual interface facilitates real-time monitoring and decision analysis, enhancing system reliability and ease of use, and providing an efficient and intelligent dosing control solution for the water treatment field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water treatment automatic control technology, specifically to an intelligent PAC dosing system based on alum floc visual recognition and multi-layer fuzzy rules. Background Technology

[0002] Coagulation technology is a core component of water treatment processes. By adding coagulants (such as polyaluminum chloride, PAC) to water, suspended particles, colloidal substances, and dissolved pollutants in the water aggregate into larger flocs (flocculation), facilitating the removal of these pollutants in subsequent solid-liquid separation processes such as sedimentation and filtration. The coagulation effect directly impacts effluent quality, reagent costs, and the risk of secondary pollution, and precise control of the coagulant dosage is a key factor in ensuring effective coagulation.

[0003] Currently, there are three main types of methods for controlling coagulant dosing in water treatment plants: manual control, automatic control, and basic intelligent control.

[0004] Manual control relies primarily on operator experience and periodic beaker tests to adjust coagulant dosage. For example, Wang et al. (2022) and Liu and Chen (2022) conducted extensive beaker tests to study the optimal PAC dosage under different water quality conditions, establishing empirical formulas for operator reference. However, this method suffers from high subjectivity, slow response, heavy workload, and difficulty in handling sudden changes in water quality. According to a research report by the U.S. Environmental Protection Agency (EPA), in water plants with significant water quality fluctuations, manual control can lead to overdosing of coagulants exceeding 30%, increasing operating costs and raising the risk of coagulant residue in the effluent.

[0005] Automatic control methods primarily rely on online sensors to collect water quality parameters and then automatically adjust the coagulant dosage using pre-defined control algorithms. Park and Son (2023) developed an automatic control system based on flowing current, enabling real-time adjustment of PAC dosage. Li et al. (2023) applied fuzzy PID control to a coagulation dosing system, improving the system's adaptability to water quality changes through adaptive adjustment of PID parameters. Zhang and Wang (2023) established a multiple linear regression model for coagulant dosage based on parameters such as influent turbidity, pH, and temperature. However, these automatic control methods still have limitations, including relatively simple control algorithms, difficulty in handling nonlinear relationships, insufficient adaptability to sudden water quality changes, and a lack of direct feedback on the actual effects of the coagulation process.

[0006] In recent years, basic 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 PAC dosage. Zhao et al. (2023) compared the performance of various machine learning algorithms in coagulant dosing prediction and found that the XGBoost algorithm performed best in terms of prediction accuracy and stability. Chen et al. (2023) developed a floc recognition system based on convolutional neural networks (CNN), and established a correlation model between floc morphology and settling performance by extracting the morphological features of floc. Wang et al. (2023) proposed a hybrid control system based on water quality parameter prediction and floc image feedback. However, these methods are usually applications of single technologies and lack the ability to integrate multi-source heterogeneous data and systematic engineering implementation schemes.

[0007] The main problems existing in the prior art include:

[0008] Single-sensor feedback control cannot adapt to complex changes in water quality and is easily affected by sensor failure, signal fluctuations, etc., leading to instability in the control system.

[0009] Most existing control methods are ill-equipped to cope with sudden changes in water quality, resulting in delayed responses and untimely adjustments.

[0010] There is a complex nonlinear relationship between water quality parameters and coagulation effect, which is difficult to describe accurately using traditional linear control algorithms;

[0011] The lack of intuitive means to evaluate the coagulation effect makes it impossible to achieve precise feedback control based on the actual coagulation effect.

[0012] Most existing intelligent algorithms are used as independent modules, lacking systematic integration solutions, making it difficult to achieve engineering applications.

[0013] Therefore, to address the above problems, an intelligent PAC dosing system based on visual recognition of alum flowers and multi-layer fuzzy rules is proposed. Summary of the Invention

[0014] The purpose of this invention is to provide an intelligent PAC dosing system based on alum flower visual recognition and multi-layer fuzzy rules to solve the problems mentioned in the background art.

[0015] To achieve the above objectives, the present invention provides the following technical solution:

[0016] A smart PAC (Pharmacopoeia lanceolata) dosing system based on visual recognition of alum flowers and multi-layer fuzzy rules includes:

[0017] The data acquisition unit includes:

[0018] The water quality parameter acquisition module collects the raw water quality parameters in real time through turbidity sensors, pH sensors, temperature sensors, and conductivity sensors.

[0019] The alum flower image acquisition module is used to acquire images of the alum flower morphology.

[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 to filter and enhance image data.

[0021] The algorithm processing unit includes:

[0022] The SVR feedforward prediction module, based on the support vector regression algorithm, predicts the initial PAC dosage using water quality parameters as input.

[0023] The improved YOLOv8 alum flower 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 alum flower targets and output alum flower region images.

[0024] The alum flower feature extraction module extracts equivalent diameter, roundness, solidity, GLCM contrast, and fractal dimension features from the alum flower region image. The fractal dimension is calculated using the box counting method to determine the alum flower boundary complexity.

[0025] The XGBoost turbidity prediction module takes the characteristics of floc and water quality parameters as input, and dynamically adjusts hyperparameters through the particle swarm optimization (PSO) algorithm to predict the turbidity after sedimentation.

[0026] The fuzzy control feedback module generates a dosage adjustment coefficient based on influent turbidity, turbidity control error, error change rate, and equivalent diameter of floc through a three-layer rule structure. The defuzzification adopts an improved centroid method and introduces a regional weighting factor.

[0027] The control decision-making unit includes:

[0028] The dosing decision engine combines 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 diagnostic module detects the operating status of the sensors and algorithm modules in real time and triggers robust rules when anomalies occur;

[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 visual interface includes a control panel, a floc analysis and data statistics interface, which displays water quality parameters, floc characteristics, predicted dosage, and control process trend charts in real time.

[0033] As a preferred solution, the improved YOLOv8 alum flower recognition module includes:

[0034] The MobileNetV3 backbone network uses an improved ECA attention module, the calculation process of which is as follows:

[0035] ,in, The feature map is input to the ECA attention module; This represents the global average pooling operation, used to perform average pooling on the input feature map along the spatial dimension: It is an adaptive one-dimensional convolution kernel; The Sigmoid activation function is used to perform a non-linear transformation on the convolution result;

[0036] The Slim-Neck feature fusion module includes the GSConv module and the VoV-GSCSP module. The GSConv module processes features in parallel using ordinary convolution and depthwise separable convolution. The output channels are then concatenated and rearranged before fusion.

[0037] The ASFF detector head achieves adaptive weighted fusion of multi-scale features using the following formula:

[0038] ,in, Indicates the first Layer output feature map at position Eigenvalues ​​at; , , They are normalized weights and satisfy the following conditions: This is used to weight the feature values ​​after mapping feature maps at different scales; Indicates the first After the layer feature map is mapped, it reaches the 1st... Layer position The eigenvalue at that location.

[0039] As a preferred option, in the fuzzy control feedback module:

[0040] Membership functions for input variables include:

[0041] The influent turbidity domain is [0,5]NTU, which is divided into three fuzzy subsets: low, medium, and high.

[0042] The universe of discourse for turbidity control error is -1,1, and the universe of discourse for the rate of change of error is -0.5,0.5, which are divided into seven fuzzy subsets.

[0043] The domain of discourse for the equivalent diameter of alum flowers is [0,50] μm, which is divided into three fuzzy subsets: small, medium, and large.

[0044] The three-tier rule structure includes:

[0045] The main rule base contains 49 rules, with influent turbidity, error, and error change rate as antecedent variables.

[0046] The compensation rule base contains 12 rules, with the equivalent diameter and roundness of the alum flower as antecedent variables;

[0047] The robust rule base is triggered when a sensor fails, and the average of historical data is used to replace abnormal parameters.

[0048] Defuzzification employs an improved centroid method, the formula of which is:

[0049] ,in, It is the precise output value obtained after defuzzification. For the first The membership degree of a fuzzy subset represents the degree to which an input value belongs to that fuzzy subset; For the values ​​in the corresponding fuzzy subset universe; As a regional weighting factor, in the drug application area , maintain area Reduced medication area .

[0050] As a preferred option, the XGBoost turbidity prediction module includes:

[0051] Input features are filtered for key parameters through recursive feature elimination (RFE) and the Boruta algorithm. Key parameters include equivalent diameter of floc, PAC dosage, roundness, influent turbidity, and pH value.

[0052] An improved regularization objective function is adopted, and the formula is as follows:

[0053] , This represents the actual measured value of the turbidity after precipitation. The turbidity value after precipitation is predicted by the XGBoost model. These are the weight parameters in the XGBoost model; and It is a dynamically adjusted regularization coefficient used to control the complexity of the model and prevent overfitting; This represents the number of training samples; This represents the number of weight parameters;

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

[0055] As a preferred option, in the SVR feedforward prediction module:

[0056] The kernel function uses a modified hybrid kernel function, and the formula is as follows:

[0057] ,in, An improved hybrid kernel function for measuring samples and The similarity between them; , is the radial basis kernel function. For kernel parameters, Indicates sample and The square of the Euclidean distance between them; , is a polynomial kernel function. Let the degree be the polynomial. , is a dynamic weighting factor, determined through genetic algorithm optimization, used to balance the effects of the radial basis kernel function and the polynomial kernel function.

[0058] As a preferred option, the visual interface includes:

[0059] The control panel interface displays real-time water quality parameters, predicted dosage, floc quality rating, and system logs in separate areas.

[0060] The alum flower analysis interface adopts a split-screen design, with the original image and detection box displayed on the left and the alum flower feature parameter table displayed on the right.

[0061] The data statistics interface provides parameter trend charts, quality distribution pie charts, and statistical information tables, and supports historical data backtracking and export.

[0062] As can be seen from the technical solution provided by the present invention above, the intelligent PAC dosing system based on alum flower visual recognition and multi-layer fuzzy rules provided by the present invention has the following beneficial effects:

[0063] Precise dosing enhances treatment effectiveness: The initial PAC dosage is predicted by combining the SVR feedforward prediction module 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 equivalent diameter of floc. The synergistic effect of the two achieves dynamic and precise control of PAC dosage. Compared with traditional dosing methods, it can more accurately adapt to different water quality conditions, effectively avoid waste or insufficient dosing of chemicals, significantly improve coagulation effect, and ensure stable compliance of effluent water quality.

[0064] Intelligent identification and optimized control strategy: The improved YOLOv8 floc identification module, combined with the MobileNetV3 backbone network, Slim-Neck feature fusion module, and ASFF technology, can quickly and accurately detect and classify floc targets; the floc feature extraction module further acquires 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 dosing control strategy and enhancing the system's adaptability to complex water quality changes;

[0065] High-efficiency processing ensures system responsiveness: Each module of the system has excellent response performance. The SVR feedforward prediction module has a response time of <1 second, the improved YOLOv8 module has a single-frame image processing time of <0.5 seconds, the fuzzy control feedback module has a defuzzification calculation time of <0.2 seconds, and the entire control cycle is ≤30 seconds. This high-efficiency data processing and decision-making speed ensures that the system can track water quality changes in real time, adjust the dosing plan in a timely manner, and ensure the efficient and stable operation of the entire dosing control system.

[0066] Real-time monitoring enhances system reliability: The system monitoring and diagnostic module in the control decision unit monitors the sensor and algorithm modules in real time. Once an anomaly occurs, robust rules are immediately triggered to maintain system operation using alternative data or backup strategies, and alarms are issued in a timely manner. At the same time, the visual interface displays the system's operating status and key data in real time, making it easier for operators to discover and handle problems in a timely manner, greatly enhancing the reliability and stability of system operation.

[0067] Data visualization aids scientific decision-making: The visualization interface, through the control panel, floc analysis, and data statistics interface, displays information such as water quality parameters, floc characteristics, predicted dosage, and control process trends in the form of intuitive charts, data, and images; operators can grasp the overall system operation in real time, deeply analyze data change patterns, and review historical data to provide a scientific basis for optimizing dosing strategies and adjusting system parameters, thereby improving the accuracy and efficiency of decision-making;

[0068] Advanced algorithms enhance technical capabilities: By employing a variety of advanced algorithms such as support vector regression, improved YOLOv8, XGBoost, and fuzzy control, as well as optimization techniques such as genetic algorithms and particle swarm optimization, the system achieves higher technical levels in areas such as dosage prediction, floc identification, turbidity estimation, and control strategy generation. This promotes the intelligent development of coagulation dosing control technology and provides innovative technical solutions for the water treatment industry. Attached Figure Description

[0069] Figure 1 This is a schematic diagram of the overall structure of an intelligent PAC dosing system based on alum flower visual recognition and multi-layer fuzzy rules according to the present invention. Detailed Implementation

[0070] To make the objectives, technical solutions, and advantages of this invention clearer, the 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 merely illustrative and not intended to limit the invention.

[0071] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific embodiments.

[0072] like Figure 1 As shown, this embodiment of the invention provides an intelligent PAC (Pharmacopoeia truncatula) dosing system based on visual recognition of alum flowers and multi-layer fuzzy rules, comprising:

[0073] The data acquisition unit includes:

[0074] The water quality parameter acquisition module collects the raw water quality parameters in real time through turbidity sensors, pH sensors, temperature sensors, and conductivity sensors.

[0075] The alum flower image acquisition module is used to acquire images of the alum flower morphology.

[0076] 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 to filter and enhance image data.

[0077] The algorithm processing unit includes:

[0078] The SVR feedforward prediction module, based on the support vector regression algorithm, predicts the initial PAC dosage using water quality parameters as input.

[0079] The improved YOLOv8 alum flower 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 alum flower targets and output alum flower region images.

[0080] The alum flower feature extraction module extracts equivalent diameter, roundness, solidity, GLCM contrast, and fractal dimension features from the alum flower region image. The fractal dimension is calculated using the box counting method to determine the alum flower boundary complexity.

[0081] The XGBoost turbidity prediction module takes the characteristics of floc and water quality parameters as input, and dynamically adjusts hyperparameters through the particle swarm optimization (PSO) algorithm to predict the turbidity after sedimentation.

[0082] The fuzzy control feedback module generates a dosage adjustment coefficient based on influent turbidity, turbidity control error, error change rate, and equivalent diameter of floc through a three-layer rule structure. The defuzzification adopts an improved centroid method and introduces a regional weighting factor.

[0083] The control decision-making unit includes:

[0084] The dosing decision engine combines 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).

[0085] The system monitoring and diagnostic module detects the operating status of the sensors and algorithm modules in real time and triggers robust rules when anomalies occur;

[0086] The execution display unit includes:

[0087] The dosing execution module controls the metering pump to add PAC according to the final dosing instruction;

[0088] The visual interface includes a control panel, a floc analysis and data statistics interface, which displays water quality parameters, floc characteristics, predicted dosage, and control process trend charts in real time.

[0089] In this embodiment, the data acquisition unit is an important component of an intelligent PAC dosing system based on alum floc visual recognition and multi-layer fuzzy rules for acquiring basic data. Through the collaborative operation of multiple modules, it achieves accurate acquisition and preprocessing of raw water quality and alum floc image data. The following is a detailed description of the data acquisition unit:

[0090] Overall Function Overview:

[0091] The data acquisition unit is responsible for collecting various data related to raw water and floc in real time and accurately, and performing preliminary processing on the collected data to provide a reliable data foundation for subsequent algorithm analysis and dosing control. Through the division of labor and cooperation of different functional modules, it comprehensively acquires data information at key nodes when raw water enters the treatment process, ensuring that the collected data can truly reflect the water quality and floc morphology characteristics, thereby meeting the system's requirements for data timeliness and accuracy.

[0092] Subsystem composition and functions:

[0093] Water quality parameter acquisition module:

[0094] The water quality parameter acquisition module is a crucial component of the data acquisition unit. It utilizes turbidity sensors, pH sensors, temperature sensors, and conductivity sensors to acquire raw water quality parameters in real time. The turbidity sensor employs the principle of light scattering, accurately measuring the turbidity value of the raw water by detecting the degree of light scattering by suspended particles in the water. This value directly reflects the content of suspended impurities in the water. The pH sensor monitors the acidity or alkalinity of the raw water in real time by utilizing the correlation between the potential difference between the glass electrode and the reference electrode and the pH value of the solution. The temperature sensor accurately acquires the temperature data of the raw water based on the temperature-resistance / voltage characteristics of a resistance temperature detector (RTD) or thermocouple. The conductivity sensor measures the conductivity of ions in the solution to obtain the conductivity value of the raw water, which indirectly reflects the concentration and types of ions in the water. These sensors convert the acquired analog signals into digital signals, which are then transmitted in real time to the data preprocessing module via data transmission lines.

[0095] Image acquisition module for alum flowers:

[0096] The alum flower image acquisition module is located at the beginning of the horizontal sedimentation tank and consists of an underwater camera, an LED light source system, and a self-cleaning device. The underwater camera uses high-resolution, waterproof, and dustproof industrial-grade equipment, which can clearly capture images of the alum flower morphology in the underwater environment. The LED light source system provides stable and uniform illumination for the underwater camera, ensuring clear imaging of the alum flower under different lighting conditions and avoiding image blurring or loss of detail due to insufficient light. The self-cleaning device regularly cleans the underwater camera lens and the surface of the LED light source through mechanical scraping or high-pressure water washing to prevent impurities in the water from affecting image quality. The alum flower image data acquired by this module is transmitted in digital image format to the data preprocessing module for further processing.

[0097] Data preprocessing module:

[0098] The data preprocessing module performs targeted processing on water quality data and image data respectively. For water quality data, the 3σ criterion is first used for outlier detection. By calculating the mean and standard deviation of the data, data exceeding the mean ± 3 times the standard deviation are identified as outliers and marked or removed. Next, the KNN (K-Nearest Neighbors) algorithm is used to impute missing data. Based on the values ​​of the K nearest neighbor data points with similar characteristics to the missing data points, the missing values ​​are estimated using a weighted average. Finally, Z-score standardization 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: (in, These are the standardized data values; The original data value; The mean of the original data; (where is the standard deviation of the original data). For image data, the data preprocessing module uses filtering algorithms to remove noise from the image, such as Gaussian filtering, which reduces random noise in the image by weighting the image pixels and their neighborhoods. At the same time, enhancement algorithms are used to improve the contrast and clarity of the image, such as histogram equalization, which makes the image details more obvious by adjusting the gray distribution of the image pixels, making it easier for subsequent alum flower recognition and feature extraction.

[0099] In this embodiment, the algorithm processing unit is the core "brain" of an intelligent PAC dosing system based on alum flower visual recognition and multi-layer fuzzy rules. Through the collaborative operation of multiple functional modules, it deeply analyzes the data provided by the data acquisition unit to achieve accurate prediction and intelligent control of the PAC dosing amount. The following is a detailed description of the algorithm processing unit:

[0100] Overall Function Overview:

[0101] Based on the raw water quality parameters and floc morphology images obtained by the data acquisition unit, the algorithm processing unit uses a variety of advanced algorithms to predict the initial PAC dosage, identify and extract floc characteristics, estimate the turbidity after sedimentation, and generate dosage adjustment coefficients according to real-time conditions. This provides the control decision-making unit with accurate and reliable decision-making basis, ensuring that the PAC dosage can adapt to changes in water quality, achieve the best coagulation effect, and ensure stable effluent quality.

[0102] Subsystem composition and functions:

[0103] SVR feedforward prediction module:

[0104] The SVR feedforward prediction module is based on the support vector regression algorithm, using raw water quality parameters (such as turbidity, pH, temperature, conductivity, etc.) as input variables to predict the initial PAC dosage. This module employs an improved hybrid kernel function, the formula of which is:

[0105] ,in, An improved hybrid kernel function for measuring samples and The similarity between them; , is the radial basis kernel function. For kernel parameters, Indicates sample and The square of the Euclidean distance between them; , is a polynomial kernel function. Let the degree be the polynomial. , is a dynamic weighting factor, determined through genetic algorithm optimization, used to balance the effects of the radial basis kernel function and the polynomial kernel function;

[0106] Kernel parameters were evaluated using a genetic algorithm. Regularization parameters and insensitive loss parameters Optimization was performed to enable the SVR model to better fit the complex relationship between water quality parameters and PAC dosage; under high turbidity (>1000 NTU) conditions, the prediction error of this module can be controlled within ≤8%, providing the system with a relatively accurate initial dosage reference value;

[0107] Improved YOLOv8 alum flower recognition module:

[0108] This module employs 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 *Hemiberlesia lataniae* targets.

[0109] The MobileNetV3 backbone network uses an improved ECA attention module, the calculation process of which is as follows:

[0110] ,in, The feature map is input to the ECA attention module; This represents the global average pooling operation, used to perform average pooling on the input feature map along the spatial dimension: It is an adaptive one-dimensional convolution kernel; The Sigmoid activation function is used to perform a non-linear transformation on the convolution result; through this module, the network can automatically learn the importance of features in different channels, enhancing its ability to extract alum flower features;

[0111] The Slim-Neck feature fusion module includes the GSConv module and the VoV-GSCSP module. The GSConv module processes features in parallel using ordinary convolution and depthwise separable convolution. The output channels are concatenated and rearranged before fusion. This design effectively fuses feature information at different scales while reducing computation.

[0112] ASFF detector head uses the following formula:

[0113] (in, Indicates the first Layer output feature map at position Eigenvalues ​​at; , , They are normalized weights and satisfy the following conditions: This is used to weight the feature values ​​after mapping feature maps at different scales; Indicates the first After the layer feature map is mapped, it reaches the 1st... Layer position The feature values ​​at the location are used to achieve multi-scale feature adaptive weighted fusion, which can dynamically adjust the weight of each scale feature according to the different shapes and sizes of alum flowers, improve the accuracy and robustness of alum flower recognition, and finally output the alum flower region image.

[0114] Feature extraction module for alum flowers:

[0115] This module extracts features such as equivalent diameter, roundness, solidity, GLCM contrast, and fractal dimension from the alum flower region image output by the improved YOLOv8 alum flower recognition module. The equivalent diameter is calculated by measuring the diameter of the circle equivalent to the area of ​​the alum flower region, and is used to measure the size of the alum flower. Roundness is determined by the formula:

[0116] (in, For roundness, The area of ​​the alum flower region. The perimeter of the alum flower area reflects how close the shape of the alum flower is to a circle; the solidity is the ratio of the area of ​​the alum flower area to the area of ​​the smallest bounding rectangle, reflecting the fullness of the alum flower.

[0117] GLCM contrast is calculated using the gray-level co-occurrence matrix to describe the drastic changes in gray levels within the alum flower image; fractal dimension is calculated using box counting, by changing the size of the boxes covering the alum flower boundary, counting the required number of boxes, and then calculating the alum flower boundary complexity. The formula is as follows: (in, For fractal dimension, For box dimensions, The required dimensions to cover the edge of the alum flower are (Number of boxes); These features describe the morphological characteristics of alum flowers from multiple dimensions, providing key basis for subsequent turbidity prediction and dosage adjustment;

[0118] XGBoost Turbidity Prediction Module:

[0119] This module takes alum floc characteristics and water quality parameters as input, and dynamically adjusts hyperparameters using the Particle Swarm Optimization (PSO) algorithm to predict post-sedimentation turbidity. First, it uses Recursive Feature Elimination (RFE) and the Boruta algorithm to filter out 18 key parameters from numerous input parameters, including alum floc equivalent diameter, PAC dosage, roundness, influent turbidity, and pH value. An improved regularized objective function is then employed.

[0120] ,in, This represents the actual measured value of the turbidity after precipitation. The turbidity value after precipitation is predicted by the XGBoost model. These are the weight parameters in the XGBoost model; and It is a dynamically adjusted regularization coefficient used to control the complexity of the model and prevent overfitting; This represents the number of training samples; The number of weight parameters; the hyperparameters dynamically adjusted by the Particle Swarm Optimization (PSO) algorithm include: n_estimators=120 (number of trees), max_depth=5 (maximum depth of trees), gamma=0.1 (minimum loss reduction required for leaf node splitting) and lambda=1.2 (L2 regularization coefficient), enabling the XGBoost model to accurately predict the turbidity after sedimentation based on different water quality and floc conditions, providing an important reference for adjusting the dosage;

[0121] Fuzzy control feedback module:

[0122] Based on parameters such as influent turbidity, turbidity control error, error change rate, and equivalent diameter of floc, this module generates a dosage adjustment coefficient through a three-layer regular structure.

[0123] The membership function of the input variables is set as follows:

[0124] The influent turbidity domain is [0,5]NTU, which is divided into three fuzzy subsets: low, medium, and high.

[0125] The universe of discourse for turbidity control error is [-1, 1], and the universe of discourse for the rate of change of error is [-0.5, 0.5], which are divided into seven fuzzy subsets.

[0126] The domain of discourse for the equivalent diameter of alum flowers is [0,50] μm, which is divided into three fuzzy subsets: small, medium, and large. The precise input parameters are converted into fuzzy linguistic variables through the membership function, which facilitates fuzzy reasoning.

[0127] The three-tier rule structure includes:

[0128] The main rule base contains 49 rules, with influent turbidity, error, and error change rate as antecedent variables, used to initially determine the direction and magnitude of dosage adjustment based on water quality changes and turbidity control targets;

[0129] The compensation rule base contains 12 rules, which use the equivalent diameter and roundness of alum flowers as antecedent variables to supplement and correct the results of the main rule base, and further refine the adjustment of the dosage.

[0130] The robust rule base is triggered when a sensor fails, and uses the average of historical data to replace abnormal parameters to ensure that the system can still operate stably under abnormal conditions.

[0131] Defuzzification employs an improved centroid method, the formula of which is:

[0132] ,in, It is the precise output value obtained after defuzzification. For the first The membership degree of a fuzzy subset represents the degree to which an input value belongs to that fuzzy subset; For the values ​​in the corresponding fuzzy subset universe; As a regional weighting factor, in the drug application area , maintain area Reduced medication area The fuzzy inference results are converted into precise dosage adjustment coefficients to achieve accurate control of PAC dosage.

[0133] In this embodiment, the control decision unit is the "nerve center" of an intelligent PAC dosing system based on alum flower 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 unit:

[0134] Overall Function Overview:

[0135] The control decision unit performs comprehensive analysis and decision-making based on the initial PAC dosage prediction, dosage adjustment coefficient, and sensor and algorithm module operating status information provided by the algorithm processing unit. On the one hand, it generates the final dosing instruction to precisely control the PAC dosage; on the other hand, it monitors the operating status of each part of the system in real time and responds quickly when abnormal situations occur to ensure system stability and reliability, providing a solid guarantee for achieving the best coagulation effect and ensuring water quality safety.

[0136] Subsystem composition and functions:

[0137] Drug administration decision engine:

[0138] The dosing decision engine is the core component of the control decision 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, and calculates it using the following formula:

[0139] The final dosage = initial dosage × (1 + adjustment coefficient) (where "final dosage" refers to the actual amount of PAC agent finally determined by the system to be added to the water; "initial dosage" is the baseline dosage predicted by the SVR feedforward prediction module based on the raw water quality parameters; "adjustment coefficient" is a coefficient used to correct the initial dosage, obtained by the fuzzy control feedback module based on parameters such as influent turbidity, turbidity control error, error change rate, and equivalent diameter of floc, through a three-layer rule structure and an improved centroid method for fuzzy calculation). The engine calculates the final dosage instruction. Through precise mathematical calculations and logical judgments, the engine fully considers factors such as changes in raw water quality and floc morphology to achieve dynamic optimization and adjustment of PAC dosage, ensuring that the added agent meets the coagulation requirements while avoiding agent waste, achieving the best treatment effect and economic benefits.

[0140] System monitoring and diagnostic module:

[0141] The system monitoring and diagnostic module plays a crucial role in real-time monitoring of the system's operational status and timely detection and handling of anomalies. Regarding sensor monitoring, it continuously monitors the operational status of water quality parameter acquisition sensors such as turbidity sensors, pH sensors, temperature sensors, and conductivity sensors, as well as floc image acquisition equipment such as underwater cameras. It acquires information such as sensor operating voltage, signal transmission stability, and data acquisition frequency in real time to determine if the sensors are functioning correctly. Once anomalies in sensor data are detected (such as sudden data changes or prolonged periods without data updates), the module immediately marks the faulty sensor and triggers robustness rules, using historical data averages or other reliable alternative data to maintain system operation. Simultaneously, it issues a fault alarm to alert maintenance personnel for timely handling.

[0142] Regarding algorithm module monitoring, the system monitoring and diagnostic module tracks the running status of each module in the algorithm processing unit, such as the SVR feedforward prediction module, the improved YOLOv8 alum flower recognition module, and the XGBoost turbidity prediction module, in real time. It monitors indicators such as algorithm computation time, resource utilization (e.g., CPU and memory usage), and the rationality of output results. When an algorithm module is detected to be experiencing running lag or abnormal calculation results (e.g., predicted values ​​exceeding the reasonable range), the module quickly analyzes the cause of the anomaly and attempts to automatically repair it by restarting the module or adjusting algorithm parameters. If the problem cannot be resolved, robustness rules are immediately triggered to activate backup algorithms or adopt preset conservative control strategies to ensure that the system can maintain basic dosing control functions during algorithm failures, thus ensuring the continuity and stability of system operation.

[0143] In this embodiment, the visualization interface is an important window for users to interact with an intelligent PAC dosing system based on alum flower visual recognition and multi-layer fuzzy rules. Through an intuitive and clear interface design and functional layout, key information during system operation is presented to users in a visual manner, facilitating real-time monitoring of system status, data analysis, and operational decision-making. The following is a detailed description of the visualization interface:

[0144] Overall Function Overview:

[0145] The visual interface integrates various data and information during system operation, including real-time water quality parameters, floc characteristic analysis results, predicted dosage, and system operating status. Through different functional zones and diverse chart display formats, it transforms complex data into intuitive and easy-to-understand visual content. Users can use this interface to monitor the system's operation in real time, manage the dosing process, and also perform retrospective analysis of historical data, providing strong support for system optimization and decision-making.

[0146] Subsystem composition and functions:

[0147] Control panel interface:

[0148] The control panel interface is primarily used to centrally display key real-time information about the system's operation and to perform basic operational controls. The interface is laid out in sections, prominently displaying water quality parameters such as turbidity, pH, temperature, and conductivity of the raw water in real-time. These parameters are presented in dynamic numerical and dashboard formats, allowing users to intuitively understand the current water quality status. Simultaneously, the interface displays the predicted dosage and the final dosage adjusted based on actual operating conditions, helping users monitor the system's operational status. Furthermore, the control panel includes a floc quality rating area. Based on indicators such as equivalent diameter, roundness, and solidity obtained from the floc feature extraction module, the floc quality is comprehensively rated (e.g., excellent, good, medium, poor), displayed using color-coded indicators and text descriptions, facilitating quick assessment of coagulation effectiveness. Regarding operational control, the control panel provides a system log viewing function. Users can view key operation records, alarm information, and algorithm status changes during system operation through a scrolling list or search box, facilitating the tracing of system operation history and troubleshooting.

[0149] Analysis interface for alum flowers:

[0150] The floc analysis interface adopts a split-screen design, providing users with a comprehensive and detailed display of floc images and feature analysis. The left area mainly displays the original floc images and detection boxes. 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 boxes of different colors, allowing users to intuitively observe the shape, size, and distribution of flocs at the beginning of the sedimentation tank. The right area is the floc feature parameter table, which lists in detail the feature data extracted from the floc images, including equivalent diameter, roundness, solidity, GLCM contrast, and fractal dimension. Each parameter is accompanied by clear unit labels and brief explanations for easy user understanding. At the same time, this area also allows users to filter and sort the feature data, facilitating in-depth analysis of the changing patterns of floc characteristics under different time periods or water quality conditions, providing a basis for optimizing dosing strategies.

[0151] Data statistics interface:

[0152] The data statistics interface is designed to help users perform macro-level analysis and historical backtesting of system operation data. This interface offers various visualization charts, including a parameter trend chart with time as the horizontal axis, displaying the changing trends of water quality parameters (such as turbidity, pH), dosage, and floc characteristic parameters over time. Users can slide the time axis or select a specific time period to view the dynamic changes in the data and intuitively understand the stability and patterns of system operation. A quality distribution pie chart statistically displays the quantity or proportion of floc at different quality levels, helping users quickly grasp the overall distribution of coagulation effects. In addition, the data statistics interface includes a statistical information table, detailing statistical indicators for various data types, such as average, maximum, minimum, and standard deviation, providing users with precise quantitative basis for data analysis. Simultaneously, the interface supports historical data backtesting and export functions. Users can set time ranges, select data types, and other conditions to query historical data within a specified time period and export the data in common formats such as Excel and CSV, facilitating further data processing and analysis, or generating professional reports and documents.

[0153] 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 intelligent PAC (Pharmacopoeia truncatula) dosing system based on visual recognition of alum flowers and multi-layer fuzzy rules, characterized in that: include: The data acquisition unit includes: The water quality parameter acquisition module collects the raw water quality parameters in real time through turbidity sensors, pH sensors, temperature sensors, and conductivity sensors. The alum flower image acquisition module is used to acquire images of the alum flower morphology. 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 to filter and enhance image data. The algorithm processing unit includes: The SVR feedforward prediction module, based on the support vector regression algorithm, predicts the initial PAC dosage using water quality parameters as input. The improved YOLOv8 alum flower 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 alum flower targets and output alum flower region images. The alum flower feature extraction module extracts equivalent diameter, roundness, solidity, GLCM contrast, and fractal dimension features from the alum flower region image. The fractal dimension is calculated using the box counting method to determine the alum flower boundary complexity. The XGBoost turbidity prediction module takes the characteristics of floc and water quality parameters as input, and dynamically adjusts hyperparameters through the particle swarm optimization (PSO) algorithm to predict the turbidity after sedimentation. The fuzzy control feedback module generates a dosage adjustment coefficient based on influent turbidity, turbidity control error, error change rate, and equivalent diameter of floc through a three-layer rule structure. The defuzzification adopts an improved centroid method and introduces a regional weighting factor. The control decision-making unit includes: The dosing decision engine combines 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). The system monitoring and diagnostic module detects the operating status of the sensors and algorithm modules in real time and triggers robust rules when anomalies occur; The execution display unit includes: The dosing execution module controls the metering pump to add PAC according to the final dosing instruction; The visual interface includes a control panel, a floc analysis and data statistics interface, which displays water quality parameters, floc characteristics, predicted dosage and control process trend charts in real time. In the improved YOLOv8 alum flower recognition module: The MobileNetV3 backbone network uses an improved ECA attention module, the calculation process of which is as follows: ,in, The feature map is input to the ECA attention module; This represents the global average pooling operation, used to perform average pooling on the input feature map along the spatial dimension: It is an adaptive one-dimensional convolution kernel; The Sigmoid activation function is used to perform a non-linear transformation on the convolution result; The Slim-Neck feature fusion module includes the GSConv module and the VoV-GSCSP module. The GSConv module processes features in parallel using ordinary convolution and depthwise separable convolution. The output channels are then concatenated and rearranged before fusion. The ASFF detector head achieves adaptive weighted fusion of multi-scale features using the following formula: ,in, Indicates the first Layer output feature map at position Eigenvalues ​​at; , , They are normalized weights and satisfy the following conditions: This is used to weight the feature values ​​after mapping feature maps at different scales; Indicates the first After the layer feature map is mapped, it reaches the 1st... Layer position The eigenvalue at that location.

2. The intelligent PAC dosing system based on alum flower visual recognition and multi-layer fuzzy rules according to claim 1, characterized in that: In the fuzzy control feedback module: Membership functions for input variables include: The influent turbidity domain is [0,5]NTU, which is divided into three fuzzy subsets: low, medium, and high. The universe of discourse for turbidity control error is -1,1, and the universe of discourse for the rate of change of error is -0.5,0.5, which are divided into seven fuzzy subsets. The domain of discourse for the equivalent diameter of alum flowers is [0,50] μm, which is divided into three fuzzy subsets: small, medium, and large. The three-tier rule structure includes: The main rule base contains 49 rules, with influent turbidity, error, and error change rate as antecedent variables. The compensation rule base contains 12 rules, with the equivalent diameter and roundness of the alum flower as antecedent variables; The robust rule base is triggered when a sensor fails, and the average of historical data is used to replace abnormal parameters. Defuzzification employs an improved centroid method, the formula of which is: ,in, It is the precise output value obtained after defuzzification. For the first The membership degree of a fuzzy subset represents the degree to which an input value belongs to that fuzzy subset; For the values ​​in the corresponding fuzzy subset universe; As a regional weighting factor, in the drug application area , maintain area Reduced medication area .

3. The intelligent PAC dosing system based on alum flower visual recognition and multi-layer fuzzy rules according to claim 1, characterized in that: In the XGBoost turbidity prediction module: Input features are filtered for key parameters through recursive feature elimination (RFE) and the Boruta algorithm. Key parameters include equivalent diameter of floc, PAC dosage, roundness, influent turbidity, and pH value. An improved regularization objective function is adopted, and the formula is as follows: , This represents the actual measured value of the turbidity after precipitation. The turbidity value after precipitation is predicted by the XGBoost model. These are the weight parameters in the XGBoost model; and It is a dynamically adjusted regularization coefficient used to control the complexity of the model and prevent overfitting; This represents the number of training samples; This represents 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.

4. The intelligent PAC dosing system based on alum flower visual recognition and multi-layer fuzzy rules according to claim 1, characterized in that: In the SVR feedforward prediction module: The kernel function uses a modified hybrid kernel function, and the formula is as follows: ,in, An improved hybrid kernel function for measuring samples and The similarity between them; , is the radial basis kernel function. For kernel parameters, Indicates sample and The square of the Euclidean distance between them; , is a polynomial kernel function. Let the degree be the polynomial. , is a dynamic weighting factor, determined through genetic algorithm optimization, used to balance the effects of the radial basis kernel function and the polynomial kernel function.

5. The intelligent PAC dosing system based on alum flower visual recognition and multi-layer fuzzy rules according to claim 1, characterized in that: In the visual interface: The control panel interface displays real-time water quality parameters, predicted dosage, floc quality rating, and system logs in separate areas. The alum flower analysis interface adopts a split-screen design, with the original image and detection box displayed on the left and the alum flower feature parameter table 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

  • Coagulation clarification tank accurate dosing method and system based on machine learning and image recognition

    CN118579911A