A coagulant dosing control method and system based on image processing and simulation
By using image processing and simulation methods, water quality is monitored in real time and the coagulant ratio and stirring parameters are optimized. This solves the problems of inaccurate water quality monitoring and insufficient parameter optimization in traditional methods, and improves treatment efficiency and the stability of effluent water quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN UNIV OF SCI & TECH
- Filing Date
- 2026-05-08
- Publication Date
- 2026-06-05
Smart Images

Figure CN122157831A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water treatment technology, and in particular to a coagulation dosing control method and system based on image processing and simulation. Background Technology
[0002] The field of water treatment technology improves water quality, controls pollution, and achieves water resource recycling and reuse through various engineering technologies and scientific principles. Coagulation and chemical dosing control, as a key aspect of water treatment processes, involves automatically controlling the dosage of coagulants. Coagulants alter the chemical properties of the water, causing tiny suspended particles to aggregate into flocs. Combined with sedimentation and filtration, these flocs remove suspended solids and pollutants from the water, playing a crucial role in ensuring effluent quality.
[0003] However, existing methods for controlling coagulation dosing have the following shortcomings: In terms of water quality monitoring, traditional methods mainly rely on periodic manual sampling and testing, lacking real-time analysis methods for water impurities based on image processing technology. This makes it difficult to quickly and accurately obtain information on the particle size, quantity, and density distribution of suspended impurities in water, and thus difficult to provide real-time data support for the precise addition of coagulants.
[0004] In terms of coagulation process optimization, traditional methods lack systematic analysis methods based on simulation, making it impossible to effectively predict and evaluate the reaction effects of different coagulants under different water quality conditions. This makes it difficult to achieve synergistic optimization of coagulant ratio, dosing sequence, and stirring parameters, resulting in low treatment efficiency and excessive consumption of chemicals.
[0005] In terms of coagulation effect evaluation, traditional methods lack the ability to monitor and analyze the changes in floc morphology during the coagulation process in real time, making it impossible to evaluate the coagulation effect in a timely manner and dynamically adjust control parameters. This results in poor performance when dealing with complex and changing water quality conditions, increases operating costs, and makes it difficult to meet environmental standards. Summary of the Invention
[0006] The purpose of this invention is to provide a coagulation dosing control method and system based on image processing and simulation, which solves the problems of existing coagulation dosing control methods lacking real-time water impurity analysis methods based on image processing technology, lacking a method for synergistic optimization of coagulant ratio and stirring parameters based on simulation, and lacking the ability to monitor images and adjust dynamic parameters in real time during the coagulation process.
[0007] To achieve the above objectives, the present invention provides a coagulation dosing control method based on image processing and simulation, comprising the following steps: Step 100: Acquire real-time images of the water body to be treated, preprocess the real-time images, identify impurity particle regions through edge detection algorithm and connected component analysis, extract the geometric morphological features of each impurity particle region, and construct an impurity particle size distribution histogram to obtain impurity particle size distribution feature data. Step 200: Collect the physicochemical environmental parameters of the water body to be treated, and fuse the physicochemical environmental parameters and impurity particle size distribution characteristic data in multiple dimensions according to the preset feature dimension mapping rules to construct a comprehensive water quality feature vector. Step 300: Input the comprehensive water quality feature vector into the pre-constructed chemical reaction kinetics simulation model, calculate the flocculation efficiency index and floc prediction morphology parameters corresponding to each candidate coagulant, and obtain the coagulant reaction effect evaluation data and floc morphology prediction baseline. Step 400: The comprehensive water quality feature vector is synchronously input into the pre-constructed fluid dynamics simulation model. A two-way coupled iterative calculation is established between the chemical reaction kinetics simulation model and the fluid dynamics simulation model. The control parameters are jointly determined by a multi-objective optimization algorithm. The control parameters include coagulant dosing control parameters and stirring control parameters. Step 500: Set the segmentation threshold for floc image detection and the scale range parameters for morphological feature extraction, and generate floc image detection calibration parameters that match the current water quality conditions. Step 600: Perform coagulation dosing according to control parameters, collect water image sequences of each stage of coagulation reaction, segment the water image sequences, extract the floc region in each frame of water image, calculate the morphological feature parameters of the floc region, compare the deviation of the morphological feature parameters with the floc morphology prediction baseline, adjust the control parameters according to the preset calculation formula based on the deviation value, and use the deviation value as a model correction factor to update the chemical reaction kinetics simulation model; the morphological feature parameters include floc equivalent particle size, fractal dimension and density.
[0008] Further, in step 100, acquiring real-time images of the water body to be treated, preprocessing the real-time images, identifying impurity particle regions through edge detection algorithms and connected component analysis, extracting the geometric morphological features of each impurity particle region, and constructing an impurity particle size distribution histogram to obtain impurity particle size distribution feature data includes the following steps: Step 101: Perform grayscale conversion and noise filtering preprocessing on the real-time image to obtain a preprocessed grayscale image; Step 102: The Canny edge detection algorithm is used to extract edges from the preprocessed grayscale image. Closed edge regions are marked by connected component analysis. Regions with a projected area less than the preset minimum area threshold are regarded as noise interference and filtered out. Each remaining connected component is marked as an independent impurity particle region. Step 103: Extract geometric morphological features for each impurity particle region, including equivalent particle size, projected area, and shape factor.
[0009] Further, in step 200, the physicochemical environmental parameters of the water body to be treated are collected, and the physicochemical environmental parameters and impurity particle size distribution characteristic data are fused in multiple dimensions according to a preset feature dimension mapping rule to construct a comprehensive water quality feature vector, including: Step 201: Real-time collection of physicochemical environmental parameters of the water body to be treated, including pH value, temperature value and turbidity value, through online sensor array; Step 202: Extract the 10th percentile, 50th percentile, and 90th percentile particle size distribution from the impurity particle size distribution characteristic data as characteristic values of particle size distribution, and extract the average shape factor and total number of particles. Step 203: Combine pH value, temperature value, turbidity value, 10th, 50th, and 90th percentile particle size, average shape factor, and total number of particles into a comprehensive water quality feature vector.
[0010] Furthermore, in step 300, the chemical reaction kinetics simulation model is constructed based on the Smoluchowski population equilibrium equation, the expression of which is: ; in, , and The first , and Particle number concentration at each particle size level; for Rate of change over time; For diameter is and The collision rate function between two particles; For diameter is and The collision rate function between two particles; , and The first , and The representative particle size of each particle size class; The total number of particle size grades; The formula for calculating the collision rate function is: ; in, This represents the initial velocity gradient.
[0011] Further, in step 300, the steps of obtaining coagulant reaction effect evaluation data and floc morphology prediction baseline include: Step 301: Introduce the collision efficiency factor to calculate the effective collision rate. The calculation formula is as follows: ; in, The effective collision rate function taking into account the effect of the coagulant; This is the collision efficiency factor; Step 302: Run the chemical reaction kinetics simulation model for each candidate coagulant, substitute the effective collision rate into the population equilibrium equation for numerical solution, set the simulation duration to the preset coagulation reaction target time, acquire particle size distribution data at the end of the simulation and calculate the floc formation rate, predicted supernatant turbidity, predicted floc particle size range and predicted floc density range; wherein the particle size distribution data includes the particle number concentration of each particle size class; Step 303: Combine the floc formation rate, predicted supernatant turbidity, predicted floc particle size range, and predicted floc density range of all candidate coagulants into reaction effect evaluation data, and encapsulate the predicted floc particle size range and predicted floc density range corresponding to all candidate coagulants into floc morphology prediction baseline.
[0012] Furthermore, in step 400, the fluid dynamics simulation model is based on the geometric parameters and operating conditions of the stirred container to calculate the flow field shear force and collision frequency during the stirring process. The formula for calculating the shear force in the flow field is as follows: ; ; ; ; ; ; in, The turbulent energy dissipation rate, This refers to the stirring speed. This refers to the power rating of the agitator. For water density, The diameter of the agitator is [diameter]. The effective volume of the coagulation tank This represents the solids volume fraction of the suspension. The effective kinematic viscosity of the suspension. The kinematic viscosity of pure water For the velocity gradient, For flow field shear force, The effective dynamic viscosity of the suspension; The formula for calculating collision frequency is as follows: ; in, The collision frequency.
[0013] Further, in step 400, the bidirectional coupled iterative calculation step includes: Step 401: Using the kinematic viscosity of pure water as the initial effective kinematic viscosity, run the fluid dynamics simulation model for multiple sets of stirring parameters within the preset stirring speed candidate range to calculate the initial velocity gradient, collision frequency and flow field shear force for each set; at the same time, run the chemical reaction kinetics simulation model with the initial velocity gradient to obtain the initial flocculation efficiency index and particle size distribution data. Step 402, for the first In the next iteration, the updated effective kinematic viscosity is calculated based on the particle size distribution data output by the previous chemical reaction kinetics simulation model. The updated effective kinematic viscosity is then substituted into the fluid dynamics simulation model to recalculate the velocity gradient, collision frequency, and flow field shear force corresponding to each set of updated stirring parameters. The updated velocity gradient is then substituted into the chemical reaction kinetics simulation model to resolve the population equilibrium equation, thereby obtaining the updated particle number concentration for each particle size class and the updated flocculation efficiency index. Step 403, Iterative Convergence Criterion: Convergence is determined when the relative change in flocculation efficiency index between two adjacent iterations meets the following condition: ; in, This represents the relative change in flocculation efficiency between the two iterations. For the first The floc formation rate obtained from round-iteration calculation; For the first The floc formation rate obtained from round-iteration calculation; This is the preset accuracy threshold.
[0014] Further, in step 400, the method for jointly determining the control parameters using a multi-objective optimization algorithm is as follows: A multi-objective optimization model is established with the dual objective constraints of maximizing purification effect and minimizing reagent consumption. The purification effect is represented by the predicted turbidity value of the supernatant calculated under the decision variables coupled with the simulation model. The reagent consumption is represented by the coagulant consumption under the decision variables, including coagulant type, mixing ratio, single dosage, stirring speed, and stirring time. A non-dominated sorting genetic algorithm is used to solve the multi-objective optimization model to obtain the Pareto optimal solution set. The solution with the predicted turbidity value of the supernatant that meets the effluent water quality standard and has the lowest reagent consumption is selected from the Pareto optimal solution set, thereby determining the control parameters.
[0015] Further, in step 600, the method of using the deviation value as a model correction factor to update the chemical reaction kinetics simulation model is as follows: the deviation value is used as a model correction factor to update the collision efficiency factor of the corresponding coagulant in the chemical reaction kinetics simulation model, and the calculation formula for updating the collision efficiency factor is: ; in, This is the corrected collision efficiency factor. To correct the sensitivity coefficient, This represents the density deviation value.
[0016] A coagulation dosing control system based on image processing and simulation, used to execute any of the above-described coagulation dosing control methods based on image processing and simulation, comprising: The image acquisition and analysis module is used to acquire real-time images of the water body to be treated, preprocess the real-time images, identify impurity particle regions, extract the geometric morphological features of each impurity particle region, and construct an impurity particle size distribution histogram to obtain impurity particle size distribution feature data. The water quality feature fusion module is used to collect the physicochemical environmental parameters of the water body to be treated, and to fuse the physicochemical environmental parameters with the impurity particle size distribution feature data in multiple dimensions according to the preset feature dimension mapping rules to construct a comprehensive water quality feature vector. The reaction simulation module is used to input the comprehensive water quality feature vector into the pre-constructed chemical reaction kinetics simulation model, calculate the flocculation efficiency index and floc prediction morphology parameters corresponding to each candidate coagulant, and obtain coagulant reaction effect evaluation data and floc morphology prediction baseline. The fluid simulation and optimization module is used to input the comprehensive water quality feature vector into the pre-constructed fluid dynamics simulation model, establish a two-way coupled iterative calculation between the chemical reaction kinetics simulation model and the fluid dynamics simulation model, and jointly determine the control parameters through a multi-objective optimization algorithm. The calibration parameter generation module is used to set the segmentation threshold and scale range parameters for floc image detection and morphological feature extraction, and to generate floc image detection calibration parameters that match the current water quality conditions. The feedback and update module is used to execute coagulation dosing according to control parameters, calculate morphological characteristic parameters, compare the deviation of morphological characteristic parameters with the predicted floc morphology baseline, backtrack and adjust control parameters according to the direction and magnitude of the deviation value, and use the deviation value as a model correction factor to feed back and update the chemical reaction kinetics simulation model.
[0017] Therefore, the coagulation dosing control method and system based on image processing and simulation described above have the following beneficial effects: 1. By processing real-time images of water bodies to extract the geometric morphological features of impurity particles and fusing them with physicochemical environmental parameters to construct a comprehensive water quality feature vector, real-time and accurate analysis of the particle size distribution of impurities in water bodies is achieved, solving the problems of information lag and incomplete data caused by the reliance on periodic manual sampling and detection in traditional methods.
[0018] 2. By establishing coupled iterative calculations between the chemical reaction kinetics simulation model and the fluid dynamics simulation model, and jointly determining the control parameters after multiple rounds of iteration convergence, global synergistic optimization of coagulant ratio and stirring parameters is achieved. This solves the problems of low treatment efficiency and excessive chemical consumption caused by the inability of traditional methods to synergistically optimize coagulant ratio and stirring parameters.
[0019] 3. By adaptively calibrating image detection parameters based on the predicted baseline of floc morphology, the floc morphology is monitored in real time and the deviation is compared with the predicted baseline. When the deviation exceeds the allowable range, the control parameters are adjusted retrospectively and the deviation value is fed back to correct the simulation model. This solves the problem that traditional methods lack the ability to evaluate the coagulation effect in real time and adjust dynamic parameters, reduces operating costs and improves the stability of effluent water quality.
[0020] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0021] Figure 1 This is a flowchart of a coagulation dosing control method based on image processing and simulation according to the present invention. Detailed Implementation
[0022] The following detailed description of embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely illustrates selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0023] Please see Figure 1 A method for controlling coagulation dosing based on image processing and simulation includes the following steps: Step 100: Acquire real-time images of the water body to be treated, perform grayscale conversion and noise filtering preprocessing on the real-time images, identify multiple impurity particle regions in the real-time images through edge detection algorithm and connected component analysis, extract the geometric morphological features of each impurity particle region, and obtain impurity particle size distribution feature data.
[0024] Geometric morphological features include equivalent particle size, projected area, and shape factor.
[0025] It is understood that the executing entity of this invention can be a coagulation dosing control system, a terminal, or a server; the specific implementation is not limited here. This embodiment of the invention will be described using a coagulation dosing control system as an example.
[0026] Specifically, an underwater industrial camera is installed at the raw water intake or the inlet of the coagulation tank. The underwater industrial camera has a resolution of 2048×1536 pixels and a frame rate of 5 frames per second. The underwater industrial camera is used to take real-time pictures of the water body to be treated and obtain real-time images of the water body to be treated.
[0027] The real-time image is converted to grayscale by weighted averaging of the red, green, and blue channels of the color image. A Gaussian smoothing filter with a window size of 5×5 is then applied to the grayscale image to suppress random noise, resulting in a preprocessed grayscale image.
[0028] The preprocessed grayscale image is edge-extracted using the Canny edge detection algorithm. In this embodiment, the high threshold is set to 70% of the peak intensity of the grayscale histogram, and the low threshold is set to 40% of the high threshold. Based on the edge extraction results, closed edge regions are marked through connected component analysis. Regions with a projected area smaller than the preset minimum area threshold (10 pixels in this embodiment) are considered noise interference and filtered out. Each remaining connected component is marked as an independent impurity particle region.
[0029] Geometric features, including equivalent particle size, are extracted for each impurity particle region. Projected area and shape factor Among them, the equivalent particle size The calculation formula is: ; in, For the first The equivalent particle size of each impurity particle; The pixel resolution coefficient is obtained through camera calibration, and in this embodiment... =0.005 mm / pixel; For the first The projected area of each impurity particle region is determined by the total number of pixels contained in that region during connected component analysis.
[0030] shape factor The calculation formula is: ; in, For the first The shape factor of each impurity particle ranges from 0 to 1. =1 indicates that the particle is a perfect circle; For the first The perimeter of the boundary of each impurity particle region, in pixels, is calculated by chain code tracing of the boundary pixels of that particle region.
[0031] This embodiment takes the treatment of raw water from a surface water source as an example. After the system acquires one frame of image, it identifies approximately 1200 impurity particles through the above processing. Based on the equivalent particle size of all particles... The particle size range is divided into several intervals (e.g., less than 5 micrometers, 5 to 10 micrometers, 10 to 50 micrometers, 50 to 100 micrometers, 100 to 500 micrometers, and greater than 500 micrometers). The percentage of particles in each interval is calculated to construct an impurity particle size distribution histogram. Simultaneously, the equivalent particle size, projected area, and shape factor of each particle are statistically analyzed (including the proportion of particles in each interval of the particle size distribution histogram and the average shape factor of all particles). and the total number of particles The data is packaged into impurity particle size distribution characteristic data.
[0032] Step 200: Collect the physicochemical environmental parameters of the water body to be treated, and fuse the physicochemical environmental parameters and impurity particle size distribution characteristics data in multiple dimensions according to the preset feature dimension mapping rules to construct a comprehensive water quality feature vector.
[0033] Specifically, online sensor arrays installed at the raw water pipeline or water intake collect real-time physicochemical environmental parameters of the water to be treated, including pH, temperature, and turbidity. The pH sensor measures the acidity or alkalinity of the water. Temperature sensor measures water temperature Turbidity sensor measures water turbidity .
[0034] The aforementioned physicochemical environmental parameters are fused with the impurity particle size distribution characteristic data obtained in step 100 according to a preset feature dimension mapping rule. The specific process of the feature dimension mapping rule is as follows: extract the 10th percentile particle size from the impurity particle size distribution characteristic data. 50th percentile particle size and 90th percentile particle size As a characteristic value representing the granularity distribution, the average shape factor is extracted. and the total number of particles The parameters of each dimension mentioned above are arranged in a preset order to form a comprehensive water quality feature vector. : ; in, pH value; This is the temperature value; This is the turbidity value, measured in NTU. , , These are the particle size values corresponding to the cumulative distribution of impurities reaching 10%, 50%, and 90% in the impurity particle size distribution histogram, respectively. This is the arithmetic mean of the shape factors of all impurity particles; This represents the total number of impurity particles identified.
[0035] In this embodiment, taking the treatment of the aforementioned surface water source as an example, the constructed comprehensive water quality feature vector is as follows: =[7.2, 18, 45, 3.2, 15.6, 78.3, 0.72, 1200].
[0036] It should be noted that before inputting the parameters of each dimension into the subsequent simulation model, the components of each dimension in the comprehensive water quality feature vector need to be normalized based on historical operating data, mapping each component to the interval [0, 1] to eliminate the influence of different physical dimensions on the model calculation. The normalization method is as follows: for each component, subtract the historical minimum value of the component from its current value, and then divide by the difference between the historical maximum value and the historical minimum value of the component.
[0037] Step 300: Input the comprehensive water quality feature vector into the pre-constructed chemical reaction kinetics simulation model, calculate the flocculation efficiency index and floc prediction morphology parameters corresponding to each candidate coagulant, and obtain the coagulant reaction effect evaluation data and floc morphology prediction baseline.
[0038] The flocculation efficiency indicators include the floc formation rate and the predicted turbidity of the supernatant. The predicted floc morphology parameters include the predicted floc particle size range and the predicted floc density range.
[0039] Specifically, the chemical reaction kinetics simulation model is based on the Smoluchowski population equilibrium equation, used to describe the collision and aggregation kinetics of impurity particles of different sizes under the action of coagulants. The expression of the population equilibrium equation is: ; in, For the first The initial value of the particle number concentration for each particle size class is determined by the particle number density of each particle size range in the impurity particle size distribution characteristic data obtained in step 100. for Rate of change over time; For diameter is and The collision rate function between two particles; , and The first , and The representative particle size of each particle size class; Indicates particle size class and After the particles collide and gather, they form the first Hierarchical particles (of which) The generation rate of ); Indicates the first The rate at which a level particle is consumed due to collisions with all other level particles.
[0040] In the orthogonal dynamic collision-dominated mode under stirring conditions, the collision rate function The calculation formula is: ; in, The initial velocity gradient is expressed in seconds. -1 Turbidity from the comprehensive water quality characteristic vector and temperature This is determined through a pre-defined empirical relationship. In this embodiment, The initial value is set to 50s. -1 .
[0041] In chemical reaction kinetics simulation models, the effect of coagulants is expressed through the collision efficiency factor. Introduction. Different coagulants correspond to different... value, This reflects the coagulant's ability to promote effective particle collisions and aggregation under current water quality conditions. The effective collision rate after introducing the collision efficiency factor is: ; in, The effective collision rate function taking into account the effect of the coagulant; The collision efficiency factor ranges from 0 to 1. The larger the value, the stronger the coagulant's effect on particle collision and aggregation.
[0042] Candidate coagulants include polyaluminum chloride (PAC), polyferric sulfate (PFS), and polyacrylamide (PAM). Collision efficiency factors of different candidate coagulants are also discussed. pH value from the comprehensive water quality feature vector and temperature value These parameters are obtained through a pre-defined lookup table. For example, the collision efficiency factor of PAC is obtained under the conditions of pH=7.2 and temperature 18℃. The collision efficiency factor of PFS is 0.65. The collision efficiency factor of PAM is 0.58. It is 0.42.
[0043] For each candidate coagulant, a chemical reaction kinetics simulation model was run separately to determine the effective collision rate. The population equilibrium equation was substituted into the equation for numerical solution. The simulation duration was set to the preset target time for the coagulation reaction. Particle size distribution data was acquired at the end of the simulation, including the number concentration of particles at each particle size level. The following indicators were then calculated: floc formation rate Defined as the ratio of the increase in the volume fraction of particles whose diameter exceeds a preset floc determination threshold (e.g., 100 micrometers) during the simulation to the simulation duration. The higher the value, the faster the coagulant promotes the aggregation of impurity particles to form flocs.
[0044] Predicted turbidity of supernatant The number concentration of residual particles smaller than the preset sedimentation boundary particle size (e.g., 20 micrometers) at the end of the simulation is estimated using a preset turbidity-particle concentration conversion relationship, and the unit is NTU. The lower the value, the lower the residual turbidity of the water after coagulation treatment, and the better the purification effect.
[0045] Predicted floc size range The value is determined by the 5th and 95th percentile particle sizes of the particle population whose particle size exceeds the floc determination threshold at the end of the simulation, in micrometers.
[0046] Predicted range of floc density The value is estimated from the number of aggregated layers and the space filling ratio recorded during particle aggregation in the simulation model. The value ranges from 0 to 1, and the larger the value, the denser the flocs.
[0047] This embodiment takes the treatment of the above-mentioned surface water source as an example, and obtains the following results after simulating PAC: =0.035 / minute =5.2 NTU =[120, 850]、 =[0.35, 0.65]; After simulating PFS, the following was obtained: =0.028 / minute =6.8 NTU =[95, 720]、 =[0.30, 0.58]. The above indicators of all candidate coagulants are summarized and packaged into coagulant reaction effect evaluation data, and the predicted floc particle size range and predicted floc density range corresponding to all candidate coagulants are packaged into floc morphology prediction baseline.
[0048] Step 400: The comprehensive water quality feature vector is synchronously input into the pre-constructed fluid dynamics simulation model. A two-way coupled iterative calculation is established between the chemical reaction kinetics simulation model and the fluid dynamics simulation model. The control parameters are jointly determined through a multi-objective optimization algorithm. The control parameters include coagulant dosing control parameters and stirring control parameters.
[0049] Specifically, the fluid dynamics simulation model calculates the flow field shear force and collision frequency during the stirring process based on the geometric parameters and operating conditions of the stirred vessel. For a given stirring speed... and mixing time Fluid dynamics simulation model calculates the turbulent energy dissipation rate in the coagulation tank. and velocity gradient .
[0050] Turbulent energy dissipation rate The calculation formula is: ; in, The turbulent energy dissipation rate; The power factor of the impeller is determined by its type, such as a standard six-bladed straight-bladed turbine impeller. =5.0; The density of the water is taken as [value missing] in this embodiment. =998kg / m 3 ; The unit is revolutions per minute. Convert the rotational speed to revolutions per second; The diameter of the agitator; This refers to the effective volume of the coagulation tank.
[0051] During the coupling iteration process, as particles collide and aggregate to form flocs, the volume fraction of the solid phase in the suspension changes, thus affecting the effective kinematic viscosity of the suspension. The solid volume fraction of the suspension is defined. for: ; in, This represents the solids volume fraction of the suspension. For the first Particle number concentration at each particle size level; For the first The representative particle size of each particle size class; This represents the total number of particle size grades.
[0052] Based on solid volume fraction The effective kinematic viscosity of the suspension was calculated using the Einstein-Batchelor formula. : ; in, The effective kinematic viscosity of the suspension; The kinematic viscosity of pure water was obtained from a preset temperature-viscosity correlation table. A value of 2.5 represents the Einstein coefficient, reflecting the contribution of a single spherical particle to the viscosity in a dilute suspension; a value of 6.2 represents the Batchelor coefficient, reflecting the higher-order contribution of hydrodynamic interactions between particles to the viscosity. As the chemical reaction kinetics simulation model simulates particle collisions and aggregation to form larger flocs, the particle number concentration at each particle size level... Redistribution occurs, in smaller particle size classes Reduced size and larger particle size Increase, solid volume fraction The effective kinematic viscosity of the suspension changes accordingly. Updated accordingly.
[0053] Calculate the velocity gradient : ; in, This represents the velocity gradient, measured in seconds (s). -1 .
[0054] Further calculation of flow field shear force : ; in, The shear force in the flow field is expressed in Pa. The effective dynamic viscosity of the suspension is expressed in Pa·s, and the effective kinematic viscosity is expressed in Pa·s. and water density The product is determined, that is Flow field shear force Excessive shear force applied to the already formed flocs can cause the flocs to break apart, thus affecting the coagulation effect.
[0055] Collision frequency This represents the number of collisions between particle pairs per unit volume of water per unit time. The calculation formula is as follows: ; in, The collision frequency; The total number of particle size grades; The collision efficiency factor of the current candidate coagulant; and The first and the The representative particle size of each particle size class; and The first and the The particle number concentration for each particle size class is derived from the particle size distribution data output by the chemical reaction kinetics simulation model in the current iteration round.
[0056] It should be noted that the collision frequency and velocity gradient Related to particle concentration, when the stirring speed... As the velocity gradient increases, Correspondingly increased, collision frequency The increased flow field shear force promotes particle aggregation and floc formation; however, it also increases the flow field shear force. This increase can lead to the shearing and breaking of existing flocs. As particles collide and aggregate to form flocs, the volume fraction of solids in the suspension increases. and effective kinematic viscosity Changes occur, causing the velocity gradient to change. Consequently, the changed This, in turn, affects the collision frequency and aggregation rate in the next round of chemical reaction kinetics simulation. Therefore, determining the stirring parameters requires a balance between collision frequency and shear force, and the coupled iteration of chemical simulation and fluid simulation can solve this problem.
[0057] The specific process of bidirectional coupled iterative calculation is as follows: Step 401, Initialization: Using the kinematic viscosity of pure water As the initial effective kinematic viscosity, a fluid dynamics simulation model was run for multiple sets of stirring parameters within a preset candidate range of stirring speeds (e.g., 100 to 300 rpm for the rapid stirring stage and 30 to 80 rpm for the slow stirring stage) to calculate the corresponding initial velocity gradient, collision frequency, and flow field shear force for each set. Simultaneously, a chemical reaction kinetics simulation model was run with the initial velocity gradient to obtain initial flocculation efficiency indices and particle size distribution data.
[0058] Step 402, bidirectional iterative update: For the first... Round iteration ( =1, 2, 3, ...), and perform the following calculations in sequence: (1) Based on the particle size distribution data output by the previous round of chemical reaction kinetics simulation model, calculate the updated solid volume fraction of the suspension according to the solid volume fraction formula, and then calculate the updated effective kinematic viscosity. (2) Substitute the updated effective kinematic viscosity into the fluid dynamics simulation model, and recalculate the velocity gradient corresponding to each set of updated stirring parameters, as well as the corresponding collision frequency and flow field shear force. (3) Substitute the updated velocity gradient into the chemical reaction kinetics simulation model, resolve the population equilibrium equation, and obtain the updated particle number concentration for each particle size class and the updated flocculation efficiency index.
[0059] Step 403, Iterative convergence criterion: The relative change in flocculation efficiency index between two adjacent iterations. Convergence is determined when the following conditions are met: ; in, For the first The floc formation rate obtained from round-iteration calculation; For the first The floc formation rate obtained from round-iteration calculation; This is the preset accuracy threshold.
[0060] After iterative convergence, a multi-objective optimization model is established with the dual objective constraints of maximizing purification effect and minimizing reagent consumption: ; in, =[type of coagulant, proportion, single dosage, stirring speed, stirring time] is the decision variable vector to be optimized; In decision variables The predicted turbidity of the supernatant calculated by the lower-coupled simulation model is expressed in NTU. In decision variables The amount of coagulant consumed.
[0061] The non-dominated sorting genetic algorithm (NSGA-II) was used to solve the multi-objective optimization model, obtaining the Pareto optimal solution set. From the Pareto optimal solution set, the predicted turbidity values of the supernatant were selected to meet the effluent water quality standards (e.g., ...). The solution with the lowest concentration of <3 NTU and the lowest amount of reagent consumption is determined as the coagulant dosing control parameters (including coagulant type, proportion and single dosing amount) and the stirring control parameters (including target stirring speed and target stirring time in the fast stirring stage, and target stirring speed and target stirring time in the slow stirring stage).
[0062] This embodiment takes the treatment of the aforementioned surface water source as an example. The coagulant dosage control parameters, determined through coupled iterative optimization, are as follows: PAC is selected as the main coagulant, with a dosage of 28 mg / L, and PAM is used as a coagulant aid, with a dosage of 0.3 mg / L. The stirring control parameters are: a rapid stirring stage with a rotation speed of 200 rpm for 2 minutes, and a slow stirring stage with a rotation speed of 50 rpm for 12 minutes. The corresponding predicted turbidity value of the supernatant at this time is... =2.1 NTU, total drug consumption =28.3mg / L.
[0063] Step 500: Based on the predicted floc particle size range and predicted floc density range in the floc morphology prediction baseline, set the segmentation threshold for floc image detection and the scale range parameters for morphological feature extraction according to the set rules, and combine the segmentation threshold and scale range parameters to generate floc image detection calibration parameters.
[0064] Specifically, the predicted floc size range is read from the floc morphology prediction baseline output in step 300. and predicted range of floc density .
[0065] Based on the predicted floc size range, the segmentation threshold for floc image detection is adaptively set. Scale range parameters for morphological feature extraction Segmentation threshold The setting rule is: the lower limit of the predicted floc particle size range. Using the pixel resolution coefficient in step 100 Converted to the corresponding pixel area, 80% of that pixel area is taken as the segmentation threshold. This allows for the capture of flocs within the prediction range during image segmentation, while excluding non-flocs with excessively small particle sizes.
[0066] Scale range parameters The setting rules are as follows: Pick 50% of the corresponding pixel area Pick The area outside the corresponding pixel area is not calculated during subsequent morphological feature extraction, thus reducing the probability of false detection.
[0067] It should be noted that the segmentation threshold and scale range parameters are adaptively adjusted according to changes in water quality conditions. When steps 100 to 300 generate a new floc morphology prediction baseline based on newly acquired water images and physicochemical parameters, the floc image detection calibration parameters are updated accordingly, so that the floc image detection in step 600 always matches the current water quality conditions.
[0068] Step 600: Perform coagulation dosing according to control parameters, calculate morphological characteristic parameters, compare the deviation of morphological characteristic parameters with the predicted baseline of floc morphology, adjust control parameters retrospectively according to the direction and magnitude of the deviation value, and use the deviation value as a model correction factor to update the chemical reaction kinetics simulation model.
[0069] Specifically, during the coagulation dosing process, an underwater industrial camera (which may be a different device from the camera in step 100 or the same device in a different installation location) is installed in the slow stirring section of the coagulation tank to continuously collect water image sequences of each stage of the coagulation reaction at preset time intervals (e.g., one frame every 30 seconds).
[0070] The segmentation threshold in the calibration parameters is detected based on the floc image generated in step 500. and scale range parameters After preprocessing each frame of the acquired water body image by grayscale conversion and noise filtering, Binarization segmentation is performed based on the grayscale segmentation threshold, preserving the projected area. Connected domains within the range are considered as floc regions.
[0071] Three morphological characteristic parameters were calculated for each floc region: (1) Equivalent particle size of flocs Using the same equivalent particle size calculation formula as in step 100, the projected area of the floc region is converted into the diameter of the equivalent circle, in micrometers.
[0072] (2) Fractal dimension : Used to characterize the morphological complexity and structural looseness of flocs. The projected area of each floc region... and maximum Feret diameter (That is, the maximum projected width of the flocculent region in all directions) Substitute into the following relationship: ; in, This represents the projected area of the flocculent region, in square pixels. This represents the maximum Feret diameter of the flocculent region, in pixels. It is a proportionality constant, determined by the intercept of the linear regression; The fractal dimension is determined by the slope of the linear regression and typically ranges from 1.0 to 2.0. The closer the value is to 2.0, the denser and more regular the flocs. A value closer to 1.0 indicates a looser flocculent body with more branching. This applies to all flocculent regions within the same image frame. Linear regression was performed on the data points to obtain the overall fractal dimension of the image frame. .
[0073] (3) Density : Used to characterize the compactness of floc filling, the calculation formula is: ; in, This represents density, with a value ranging from 0 to 1. A value closer to 1 indicates that the floc shape is closer to round and the density is higher. The average density of the image frame is obtained by calculating the density of all floc regions in the same frame and then averaging the results. .
[0074] The morphological characteristic parameters are compared with the predicted floc morphology baseline output in step 300. The specific method for deviation comparison is as follows: the deviation between the mean equivalent particle size of the floc and the median of the predicted floc particle size range, and the deviation between the average density and the median of the predicted floc density range are calculated. Taking the density deviation as an example, its calculation method is as follows: ; in, This is the density deviation value; This represents the average density of all flocculent regions in the current frame image; and These are the lower and upper limits of the predicted floc density range in the floc morphology prediction baseline output in step 300, respectively.
[0075] When the absolute value of any deviation exceeds the preset allowable range for the corresponding dimension (e.g., the allowable range for density deviation is ±0.10), the system triggers a control parameter adjustment. The adjustment strategy is as follows: when If the value is negative (meaning the actual floc density is lower than the predicted value, indicating that the flocs are relatively loose), increase the stirring speed or extend the stirring time in the slow stirring stage of the stirring control parameters to promote floc compaction. At the same time, appropriately increase the amount of coagulant added to enhance the bonding force between particles.
[0076] when If the value is positive (meaning the actual floc density is higher than the predicted value, indicating that the flocs are relatively dense), reduce the amount of coagulant added to save on reagent consumption, and at the same time, appropriately reduce the stirring speed to reduce energy consumption.
[0077] It should be noted that the adjustment of control parameters is calculated according to preset formulas. Here, we take adjusting the stirring speed in the slow stirring stage as an example. The calculation formula is as follows: ; ; in, This is the adjustment amount for the stirring speed; Adjust the gain coefficient to adjust the stirring speed; This is the stirring speed during the current slow stirring phase. When... When the value is negative (the flocculent material is relatively loose), A positive value indicates that the stirring speed should be increased to promote floc compaction; when... When the value is positive (the flocculent material is relatively dense), A negative value indicates that the stirring speed should be reduced to decrease energy consumption. This refers to the adjusted stirring speed during the slow stirring phase.
[0078] While adjusting the control parameters, the deviation value is fed back as a model correction factor to the chemical reaction kinetics simulation model in step 300, updating the collision efficiency factor of the corresponding coagulant in the chemical reaction kinetics simulation model. The updated calculation formula is as follows: ; in, This is the corrected collision efficiency factor; The collision efficiency factor before correction; To correct the sensitivity coefficient, it is preset by the system, for example... =0.5. When When it is negative, Less than This indicates that the actual collision efficiency is lower than the model prediction, and subsequent simulations will use a more conservative collision efficiency estimate; when When it is a positive value, Greater than This indicates that the actual collision efficiency is higher than the model prediction, and subsequent simulations will adjust the collision efficiency estimate upwards. Through this feedback mechanism, the chemical reaction kinetics simulation model gradually improves its prediction accuracy during continuous operation, achieving self-evolutionary optimization of the model.
[0079] Record the trigger time, deviation value, control parameter values before and after adjustment, and model correction factor of each parameter adjustment as a complete control parameter optimization adjustment record for subsequent operation analysis and continuous model optimization.
[0080] Taking the treatment of the aforementioned surface water source as an example, the system acquired a water image at the 5th minute of the coagulation and chemical dosing process. The analysis revealed that the average equivalent particle size of the flocs was 95 micrometers, and the fractal dimension was... =1.45, average density =0.38. After comparison with the predicted floc morphology baseline, the density deviation is... =0.38-(0.35+0.65) / 2=-0.12, the absolute value of 0.12 exceeds the allowable range of 0.10, the system triggers parameter adjustment: the slow stirring speed is increased from 50 rpm to 58 rpm, and the collision efficiency factor of PAC is updated from 0.65 to =0.611, and generate a control parameter optimization adjustment record. In subsequent water treatment batches, the chemical reaction kinetics simulation model will use the corrected collision efficiency factor of 0.611 instead of the original value of 0.65 for simulation calculations, so that the prediction results are more in line with actual working conditions.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for controlling coagulation dosing based on image processing and simulation, characterized in that, Includes the following steps: Step 100: Acquire real-time images of the water body to be treated, preprocess the real-time images, identify impurity particle regions through edge detection algorithm and connected component analysis, extract the geometric morphological features of each impurity particle region, and construct an impurity particle size distribution histogram to obtain impurity particle size distribution feature data. Step 200: Collect the physicochemical environmental parameters of the water body to be treated, and fuse the physicochemical environmental parameters and impurity particle size distribution characteristic data in multiple dimensions according to the preset feature dimension mapping rules to construct a comprehensive water quality feature vector. Step 300: Input the comprehensive water quality feature vector into the pre-constructed chemical reaction kinetics simulation model, calculate the flocculation efficiency index and floc prediction morphology parameters corresponding to each candidate coagulant, and obtain the coagulant reaction effect evaluation data and floc morphology prediction baseline. Step 400: The comprehensive water quality feature vector is synchronously input into the pre-constructed fluid dynamics simulation model. A two-way coupled iterative calculation is established between the chemical reaction kinetics simulation model and the fluid dynamics simulation model. The control parameters are jointly determined by a multi-objective optimization algorithm. The control parameters include coagulant dosing control parameters and stirring control parameters. Step 500: Set the segmentation threshold for floc image detection and the scale range parameters for morphological feature extraction, and combine the segmentation threshold and scale range parameters to generate floc image detection calibration parameters that match the current water quality conditions. Step 600: Perform coagulation dosing according to control parameters, collect water image sequences of each stage of coagulation reaction, segment the water image sequences, extract the floc region in each frame of water image, calculate the morphological feature parameters of the floc region, compare the deviation of the morphological feature parameters with the predicted baseline of floc morphology, adjust the control parameters according to the preset calculation formula based on the deviation value, and use the deviation value as a model correction factor to update the chemical reaction kinetics simulation model. Morphological parameters include floc equivalent particle size, fractal dimension, and density.
2. The coagulation dosing control method based on image processing and simulation according to claim 1, characterized in that, In step 100, real-time images of the water body to be treated are acquired, the real-time images are preprocessed, impurity particle regions are identified through edge detection algorithms and connected component analysis, the geometric morphological features of each impurity particle region are extracted, and an impurity particle size distribution histogram is constructed to obtain impurity particle size distribution feature data, including the following steps: Step 101: Perform grayscale conversion and noise filtering preprocessing on the real-time image to obtain a preprocessed grayscale image; Step 102: The Canny edge detection algorithm is used to extract edges from the preprocessed grayscale image. Closed edge regions are marked by connected component analysis. Regions with a projected area less than the preset minimum area threshold are regarded as noise interference and filtered out. Each remaining connected component is marked as an independent impurity particle region. Step 103: Extract geometric morphological features for each impurity particle region, including equivalent particle size, projected area, and shape factor.
3. The coagulation dosing control method based on image processing and simulation according to claim 2, characterized in that, In step 200, the physicochemical environmental parameters of the water body to be treated are collected, and the physicochemical environmental parameters and impurity particle size distribution characteristic data are fused in multiple dimensions according to a preset feature dimension mapping rule to construct a comprehensive water quality feature vector, including: Step 201: Real-time collection of physicochemical environmental parameters of the water body to be treated, including pH value, temperature value and turbidity value, through online sensor array; Step 202: Extract the 10th percentile, 50th percentile, and 90th percentile particle size distribution from the impurity particle size distribution characteristic data as characteristic values of particle size distribution, and extract the average shape factor and total number of particles. Step 203: Combine pH value, temperature value, turbidity value, 10th, 50th, and 90th percentile particle size, average shape factor, and total number of particles into a comprehensive water quality feature vector.
4. The coagulation dosing control method based on image processing and simulation according to claim 3, characterized in that, In step 300, the chemical reaction kinetics simulation model is constructed based on the Smoluchowski population equilibrium equation, the expression of which is: ; in, , and The first , and Particle number concentration at each particle size level; for Rate of change over time; For diameter is and The collision rate function between two particles; For diameter is and The collision rate function between two particles; , and The first , and The representative particle size of each particle size class; The total number of particle size grades; The formula for calculating the collision rate function is: ; in, This represents the initial velocity gradient.
5. The coagulation dosing control method based on image processing and simulation according to claim 4, characterized in that, In step 300, the steps of obtaining coagulant reaction effect evaluation data and floc morphology prediction baseline include: Step 301: Introduce the collision efficiency factor to calculate the effective collision rate. The calculation formula is as follows: ; in, The effective collision rate function taking into account the effect of the coagulant; This is the collision efficiency factor; Step 302: Run the chemical reaction kinetics simulation model for each candidate coagulant, substitute the effective collision rate into the population equilibrium equation for numerical solution, set the simulation duration to the preset coagulation reaction target time, acquire particle size distribution data at the end of the simulation and calculate the floc formation rate, predicted supernatant turbidity, predicted floc particle size range and predicted floc density range; wherein the particle size distribution data includes the particle number concentration of each particle size class; Step 303: Combine the floc formation rate, predicted supernatant turbidity, predicted floc particle size range, and predicted floc density range of all candidate coagulants into reaction effect evaluation data, and encapsulate the predicted floc particle size range and predicted floc density range corresponding to all candidate coagulants into floc morphology prediction baseline.
6. The coagulation dosing control method based on image processing and simulation according to claim 5, characterized in that, In step 400, the fluid dynamics simulation model is based on the geometric parameters and operating conditions of the stirred container to calculate the flow field shear force and collision frequency during the stirring process. The formula for calculating the shear force in the flow field is as follows: ; ; ; ; ; ; in, The turbulent energy dissipation rate, This refers to the stirring speed. This refers to the power rating of the agitator. For water density, The diameter of the agitator is [diameter]. The effective volume of the coagulation tank This represents the solids volume fraction of the suspension. The effective kinematic viscosity of the suspension. The kinematic viscosity of pure water For the velocity gradient, For flow field shear force, The effective dynamic viscosity of the suspension; The formula for calculating collision frequency is as follows: ; in, The collision frequency.
7. The coagulation dosing control method based on image processing and simulation according to claim 6, characterized in that, In step 400, the bidirectional coupled iterative calculation steps include: Step 401: Using the kinematic viscosity of pure water as the initial effective kinematic viscosity, run the fluid dynamics simulation model for multiple sets of stirring parameters within the preset stirring speed candidate range to calculate the initial velocity gradient, collision frequency and flow field shear force for each set; at the same time, run the chemical reaction kinetics simulation model with the initial velocity gradient to obtain the initial flocculation efficiency index and particle size distribution data. Step 402, for the first In the next iteration, the updated effective kinematic viscosity is calculated based on the particle size distribution data output by the previous chemical reaction kinetics simulation model. The updated effective kinematic viscosity is then substituted into the fluid dynamics simulation model to recalculate the velocity gradient, collision frequency, and flow field shear force corresponding to each set of updated stirring parameters. The updated velocity gradient is then substituted into the chemical reaction kinetics simulation model to resolve the population equilibrium equation, thereby obtaining the updated particle number concentration for each particle size class and the updated flocculation efficiency index. Step 403, Iterative Convergence Criterion: Convergence is determined when the relative change in flocculation efficiency index between two adjacent iterations meets the following condition: ; in, This represents the relative change in flocculation efficiency between the two iterations. For the first The floc formation rate obtained from round-iteration calculation; For the first The floc formation rate obtained from round-iteration calculation; This is the preset accuracy threshold.
8. The coagulation dosing control method based on image processing and simulation according to claim 7, characterized in that, In step 400, the method for jointly determining control parameters using a multi-objective optimization algorithm is as follows: A multi-objective optimization model is established with the dual objective constraints of maximizing purification effect and minimizing reagent consumption. The purification effect is represented by the predicted turbidity of the supernatant calculated under the coupled simulation model, and the reagent consumption is represented by the coagulant consumption under the decision variables, including coagulant type, mixing ratio, single dosage, stirring speed, and stirring time. A non-dominated sorting genetic algorithm is used to solve the multi-objective optimization model to obtain the Pareto optimal solution set. The solution with the predicted turbidity of the supernatant that meets the effluent water quality standard and has the lowest reagent consumption is selected from the Pareto optimal solution set, thereby determining the control parameters.
9. The coagulation dosing control method based on image processing and simulation according to claim 8, characterized in that, In step 600, the method of using the deviation value as a model correction factor to update the chemical reaction kinetics simulation model is as follows: the deviation value is used as a model correction factor to update the collision efficiency factor of the corresponding coagulant in the chemical reaction kinetics simulation model, and the calculation formula for updating the collision efficiency factor is as follows: ; in, This is the corrected collision efficiency factor. To correct the sensitivity coefficient, This represents the density deviation value.
10. A coagulation dosing control system based on image processing and simulation, characterized in that, It is used to execute the coagulation dosing control method based on image processing and simulation as described in any one of claims 1-9, comprising: The image acquisition and analysis module is used to acquire real-time images of the water body to be treated, preprocess the real-time images, identify impurity particle regions, extract the geometric morphological features of each impurity particle region, and construct an impurity particle size distribution histogram to obtain impurity particle size distribution feature data. The water quality feature fusion module is used to collect the physicochemical environmental parameters of the water body to be treated, and to fuse the physicochemical environmental parameters with the impurity particle size distribution feature data in multiple dimensions according to the preset feature dimension mapping rules to construct a comprehensive water quality feature vector. The reaction simulation module is used to input the comprehensive water quality feature vector into the pre-constructed chemical reaction kinetics simulation model, calculate the flocculation efficiency index and floc prediction morphology parameters corresponding to each candidate coagulant, and obtain coagulant reaction effect evaluation data and floc morphology prediction baseline. The fluid simulation and optimization module is used to input the comprehensive water quality feature vector into the pre-constructed fluid dynamics simulation model, establish a two-way coupled iterative calculation between the chemical reaction kinetics simulation model and the fluid dynamics simulation model, and jointly determine the control parameters through a multi-objective optimization algorithm. The calibration parameter generation module is used to set the segmentation threshold and scale range parameters for floc image detection and morphological feature extraction, and to generate floc image detection calibration parameters that match the current water quality conditions. The feedback and update module is used to execute coagulation dosing according to control parameters, calculate morphological characteristic parameters, compare the deviation of morphological characteristic parameters with the predicted floc morphology baseline, backtrack and adjust control parameters according to the direction and magnitude of the deviation value, and use the deviation value as a model correction factor to feed back and update the chemical reaction kinetics simulation model.