Coagulant dosing control method and system based on visual recognition of floc dynamic changes
By identifying floc particle boundaries through image acquisition and processing technology and calculating the dosing adjustment coefficient based on historical data, the problem of insufficient perception of the dynamic growth state of flocs in existing technologies has been solved, enabling precise closed-loop control of the flocculation process and improving the adaptability and stability of water treatment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-03-24
AI Technical Summary
Existing water treatment technologies cannot detect the dynamic growth status of flocs in real time, resulting in lag and deviation in coagulant dosing control, which affects water quality and chemical consumption.
By identifying floc particle boundaries through image acquisition and processing technology and calculating the dosage adjustment coefficient based on historical experience, closed-loop optimization control of the flocculation process can be achieved. Image analysis technology can be used to identify floc status online and combine it with real-time flow calculation to optimize the dosage.
It achieves precise closed-loop control of the flocculation process state, improves the response sensitivity and adaptability of the control system, and reduces reagent consumption and operating costs.
Smart Images

Figure CN121377271B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual recognition water treatment technology, and in particular to a method and system for controlling coagulant dosing based on visual recognition of dynamic changes in flocs. Background Technology
[0002] In water treatment processes, controlling the dosage of coagulants is a core element in ensuring the stable performance of subsequent sedimentation and filtration units and reducing operating costs. Achieving precise control of the dosage is of great value in addressing fluctuations in raw water quality, improving treatment efficiency, and reducing chemical consumption and sludge production.
[0003] Currently, the prevailing practices and existing technologies in this field mainly rely on two types of methods: manual control based on operator experience and automatic control systems based on a few online parameters such as influent flow rate and turbidity (e.g., feedforward control or simple feedback control). While these methods achieve automation to some extent, their control basis does not delve into the most critical intrinsic state of the flocculation reaction itself—namely, the real-time growth and aggregation dynamics of floc particles. The size, density distribution, and rate of change of flocs are the most direct representations of coagulation effectiveness. However, existing technologies lack effective and stable online monitoring of these microscopic morphological parameters and their direct application for control. Therefore, when water quality composition undergoes complex changes or the treatment load fluctuates rapidly, existing control systems, unable to perceive the real evolution of the floc state in real time, often exhibit significant lag or deviation in their regulatory response. This can easily lead to insufficient dosage affecting water quality, or excessive dosage causing economic waste and environmental burden.
[0004] Although some studies have explored the application of image analysis technology in floc observation, how to transform the observation results into reliable control signals and construct an automatic dosing control system based on the visual dynamics of floc remains a technical challenge that urgently needs to be solved in this field. Summary of the Invention
[0005] Therefore, the technical problem to be solved by the present invention is to overcome the lag and deviation in the addition control caused by the reliance on indirect parameters and the inability to perceive the dynamic growth state of flocs in real time in the existing technology. The present invention provides a coagulant addition control method and system based on visual recognition of the dynamic changes of flocs. It can identify the floc state online through image technology, and accurately calculate the addition amount by combining historical experience and real-time flow, so as to realize closed-loop optimization control of the inherent nature of the coagulation process, thereby improving the stability of the treatment effect and reducing the consumption of reagents.
[0006] To address the aforementioned technical problems, this invention provides a coagulant dosing control method based on visual recognition of dynamic changes in flocs, applied to the flocculation process section of a water treatment system, comprising the following steps:
[0007] The image acquisition device acquires image data of the flocculation process in water in real time, and performs image enhancement processing on the acquired raw images to highlight the boundaries of floc particles and obtain clear particle distribution images.
[0008] Based on particle distribution images, image analysis technology is used to identify the size and quantity characteristics of floc particles and determine the average diameter and density of particles in the current flocculation stage.
[0009] The deviation from the preset standard value is calculated based on the current average particle diameter and density value. The addition adjustment records under similar water quality conditions are extracted from historical data to obtain a preliminary addition adjustment coefficient that matches the current floc state deviation.
[0010] By combining the initial dosage adjustment coefficient with the real-time monitored water flow data, the optimal dosage for the current working conditions is obtained by calculating and updating the coagulant dosage.
[0011] Based on the optimized dosage, the control command is sent to the dosing pump equipment to adjust the dosing speed or stroke of the pump equipment to change the actual amount of coagulant added per unit time. The updated floc images are continuously monitored to verify the adjustment effect, thereby achieving continuous control of the flocculation process status.
[0012] In one embodiment of the present invention, image enhancement processing is performed on the acquired original image to highlight the boundaries of flocculent particles and obtain a clear particle distribution image, including:
[0013] The original image is denoised and brightness compensated to obtain an initial image with a uniform background;
[0014] The initial image is locally contrast-adaptive enhanced, and the enhancement intensity is dynamically adjusted according to the gray-level distribution of each region of the image to amplify the contour features of the flocculent particles and generate an edge-enhanced image.
[0015] Gradient detection and edge connection are performed on the edge enhancement image to identify and enhance significant boundaries. At the same time, based on the preset geometric continuity rules, incomplete edge segments that meet the conditions are connected into continuous boundaries to obtain a complete floc boundary image.
[0016] The floc boundary image is converted into a binary image, and morphological optimization is performed on the binary image to eliminate noise points and fill gaps within the boundary, outputting a clear particle distribution image for subsequent feature recognition.
[0017] In one embodiment of the present invention, determining the average particle diameter and density values at the current flocculation stage includes:
[0018] Perform particle labeling on the particle distribution image, assign a unique identifier to each individual flocculent particle region, and extract the geometric contour information of each labeled region;
[0019] Based on the geometric contour information of each particle, the maximum inscribed circle diameter of each particle is calculated as the equivalent diameter of the particle, and the total number of effective marked areas within the image field of view is counted.
[0020] Arrange all particles in descending order of equivalent diameter, remove the smallest particle group whose equivalent diameter is less than a preset threshold, calculate the weighted average of the equivalent diameter of the remaining particles, and use it as the average particle diameter of the current flocculation stage.
[0021] The particle density value at the current flocculation stage is calculated by dividing the total number of valid marked areas by the actual water sampling volume corresponding to the image.
[0022] In one embodiment of the present invention, when determining the average particle diameter, the process of removing the smallest particle group with an equivalent diameter less than a preset threshold employs an adaptive threshold method, including:
[0023] All particle equivalent diameters are divided into several levels according to their size.
[0024] Calculate the proportion distribution of particle number in each grade to the total particle number, and find the first obvious local minimum point in the proportion distribution;
[0025] The upper limit of the equivalent diameter range corresponding to the local minimum point is used as the dynamically determined removal threshold.
[0026] Based on a dynamically determined removal threshold, particles with an equivalent diameter smaller than the removal threshold are automatically filtered out, and the weighted average of the remaining particles is recalculated as the final average particle diameter.
[0027] In one embodiment of the present invention, obtaining an initial dosing adjustment coefficient that matches the current floc state deviation includes:
[0028] The calculated average particle diameter and density values are compared with the preset standard diameter range and standard density range, respectively. The absolute deviation values from the midpoint of their respective ranges are calculated, and the two absolute deviation values are combined into a comprehensive deviation index according to the preset weights.
[0029] Based on the comprehensive deviation index, the historical database is searched for operation records with water quality conditions similar to the current water quality parameters. The operation records contain the historical comprehensive deviation index and its corresponding dosage adjustment coefficient.
[0030] From the retrieved operation records, select several records with the smallest difference between the comprehensive deviation index and the current comprehensive deviation index, and extract their corresponding addition adjustment coefficients;
[0031] The extracted multiple addition adjustment coefficients are weighted and averaged, with the weights determined based on the overall similarity between the corresponding historical records and the current operating conditions. The result is the preliminary addition adjustment coefficient.
[0032] In one embodiment of the present invention, the preset standard diameter range and standard density range are established in the following manner;
[0033] During multiple historical periods when the system was operating stably and the effluent quality met the standards, the corresponding average particle diameter and density data sequences were collected and recorded simultaneously.
[0034] Statistical analysis was performed on the data sequences of average particle diameter and density values recorded in each historical period to calculate their respective average values and statistical distribution characteristics;
[0035] Based on the data distribution of each historical period, after removing obviously outlier abnormal data points, the safe and stable operating ranges of the average particle diameter and density values are determined.
[0036] The determined safe and stable operating range of average particle diameter is taken as the preset standard diameter range, and the determined safe and stable operating range of particle density value is taken as the preset standard density range.
[0037] In one embodiment of the present invention, when no operational record similar to the current water quality parameters can be retrieved from the historical database, the method for obtaining the preliminary dosing adjustment coefficient includes:
[0038] The combined deviation index of the current average particle diameter and density values is decomposed into diameter deviation component and density deviation component;
[0039] Retrieve records from the historical database that are similar to the current diameter deviation component and records that are similar to the current density deviation component.
[0040] Select several records with the closest deviation from the two sets of search results, extract the corresponding dosage adjustment coefficients, and classify and statistically analyze the extracted adjustment coefficients.
[0041] Based on the respective contribution ratios of the diameter deviation component and the density deviation component to the overall deviation, the extracted adjustment coefficients are proportionally fused to generate a preliminary addition adjustment coefficient applicable to the current abnormal deviation situation.
[0042] In one embodiment of the present invention, the initial dosage adjustment coefficient is combined with the real-time monitored water flow data to calculate and update the coagulant dosage, including:
[0043] Obtain the benchmark dosing rate of coagulant used for the current system operation and collect water flow data in real time;
[0044] Calculate the flow ratio component of the required amount of coagulant based on the current water flow data;
[0045] The initial addition adjustment coefficient and the flow ratio component are combined to generate a comprehensive addition adjustment factor.
[0046] The theoretical dosage is calculated by applying the comprehensive dosage adjustment factor to the baseline dosage rate.
[0047] The theoretical dosage is rounded down in an engineering manner by combining the minimum adjustment accuracy and maximum adjustment range of the dosing equipment, and the optimized dosage value that can be directly executed is output.
[0048] In one embodiment of the present invention, in the fusion calculation step, when the adjustment direction indicated by the initial adjustment coefficient is inconsistent with the adjustment direction indicated by the flow rate change trend, the following priority decision mechanism is adopted:
[0049] Obtain the severity level of the overall deviation of the current flocculation state;
[0050] If the severity level exceeds the preset first threshold, the adjustment direction indicated by the initial adjustment coefficient will be the primary factor, and the flow change trend will be used as an auxiliary correction factor for integration.
[0051] If the severity level does not exceed the preset first threshold but exceeds the preset second threshold, the initial adjustment coefficient and the flow change trend are given the same weight for balanced integration.
[0052] If the severity level does not exceed the preset second threshold, the adjustment direction indicated by the flow change trend will be the primary factor, and an initial adjustment coefficient will be added as an auxiliary correction item for fusion.
[0053] To address the aforementioned technical problems, this invention also provides a coagulant dosing control system based on visual recognition of dynamic changes in flocs, used to implement the above method, comprising:
[0054] The image acquisition and processing module is used to acquire image data of the flocculation process in water in real time through an image acquisition device, and to perform image enhancement processing on the acquired raw images to highlight the boundaries of floc particles and output clear particle distribution images.
[0055] The floc feature analysis module is connected to the image acquisition and processing module. It is used to identify the size and quantity characteristics of floc particles based on the particle distribution image and to determine the average diameter and density of particles in the current flocculation stage by means of image analysis technology.
[0056] The intelligent decision-making module, connected to the floc feature analysis module, is used to calculate the deviation between the current average particle diameter and density value and the preset standard value, extract the addition adjustment records under similar water quality conditions from historical data, and obtain a preliminary addition adjustment coefficient that matches the current floc state deviation.
[0057] The dosage optimization module, connected to the intelligent decision-making module, is used to combine the initial dosage adjustment coefficient with the real-time monitored water flow data, and calculate and update the coagulant dosage to obtain the optimized dosage for the current working conditions.
[0058] The control execution and feedback module is connected to the dosage optimization module. It is used to generate control commands based on the optimized dosage and send them to the dosing pump equipment. It adjusts the dosing speed or stroke of the dosing pump equipment to change the actual amount of coagulant added per unit time. It also continuously receives the updated floc image data from the image acquisition and processing module to verify the adjustment effect, thus forming a closed-loop continuous control of the flocculation process status.
[0059] The technical solution of the present invention has the following advantages compared with the prior art:
[0060] The coagulant dosing control method based on visual recognition of floc dynamic changes described in this invention achieves precise closed-loop control of the flocculation process state through the synergistic effect of the following technical solutions: First, image acquisition and enhancement processing clarify the boundaries of floc particles, providing a high-quality image data foundation for subsequent analysis; then, image analysis technology is used to quantitatively extract the average diameter and density values of flocs from the particle distribution image, transforming the floc growth state into quantifiable key process parameters; further, by calculating the deviation of the above parameters from the preset standard and associating with effective adjustment records under similar deviations in historical operating data, a preliminary dosing adjustment coefficient is obtained, enabling the control decision to have intelligence based on historical experience; subsequently, this coefficient is combined with real-time water flow data to calculate the optimized dosing amount adapted to the current operating conditions, ensuring that the control command reflects both the essence of the process state and conforms to the actual production scale; finally, the dosing equipment is driven to perform adjustments based on the optimized dosing amount, and a closed-loop feedback is formed through continuous image monitoring, thereby achieving continuous verification and optimization of the dosing strategy.
[0061] The beneficial effects of this invention include: First, by deeply embedding image recognition technology into the control closed loop, online real-time regulation is achieved directly based on the core growth characteristics of flocs, fundamentally improving the sensitivity and directness of the control system's perception of changes in the internal state of the flocculation process, making the regulation basis more scientific and essential; Second, by introducing an adjustment coefficient decision mechanism based on historical deviation data, excellent operating experience can be simulated and solidified, making the control behavior both targeted by case learning and stable in rule execution, effectively reducing the continuous dependence on the experience of senior operators and improving the adaptability and reliability of control under different operating conditions; Third, by integrating the state adjustment coefficient with real-time flow data, the linkage between fine-tuning of the process state and macro-processing scale is realized, ensuring the accuracy and engineering practicality of the dosage adjustment.
[0062] In summary, this method can stabilize the flocculation effect more quickly and accurately when water quality or load fluctuates, and reduce the ineffective addition of chemicals while ensuring the quality of effluent. This achieves the dual goals of improving treatment efficiency and reducing operating costs, providing a practical solution for the intelligent and refined operation of water treatment plants. Attached Figure Description
[0063] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein:
[0064] Figure 1 This is a flowchart of the steps of the coagulant dosing control method based on visual recognition of dynamic changes in flocs according to the present invention;
[0065] Figure 2 This is a flowchart of the steps for image enhancement processing of the acquired raw image according to the present invention;
[0066] Figure 3 This is a flowchart of the steps for determining the average particle diameter and density values at the current flocculation stage according to the present invention.
[0067] Figure 4 This is a flowchart of the steps of obtaining a preliminary addition adjustment coefficient that matches the current floc state deviation of the present invention;
[0068] Figure 5 This is a flowchart of the steps in this invention to calculate and update the coagulant dosage by combining the initial dosage adjustment coefficient with the real-time monitored water flow data;
[0069] Figure 6 This is a structural framework diagram of the coagulant dosing control system based on visual recognition of dynamic changes in flocs according to the present invention. Detailed Implementation
[0070] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0071] Reference Figure 1 As shown, this application of the present invention proposes a coagulant dosing control method based on visual recognition of dynamic changes in flocs, applied to the flocculation process section of a water treatment system, comprising the following steps:
[0072] Image data of the flocculation process in water is acquired in real time by an image acquisition device. The acquired raw images are then enhanced to highlight the boundaries of floc particles and obtain a clear particle distribution image. Based on the particle distribution image, image analysis technology is used to identify the size and quantity characteristics of the floc particles, and to determine the average diameter and density of the particles at the current flocculation stage. The deviation between the current average diameter and density values and the preset standard values is calculated. Dosing adjustment records under similar water quality conditions are extracted from historical data to obtain a preliminary dosing adjustment coefficient that matches the current floc state deviation. The preliminary dosing adjustment coefficient is combined with the real-time monitored water flow data to calculate and update the coagulant dosage, resulting in an optimized dosage for the current operating conditions. Based on the optimized dosage, a control command is generated and sent to the dosing pump equipment to adjust the dosing speed or stroke of the pump equipment to change the actual amount of coagulant added per unit time. The updated floc images are continuously monitored to verify the adjustment effect, thus achieving continuous control of the flocculation process state.
[0073] For ease of understanding, the following explains some key terms in this embodiment:
[0074] Image acquisition devices are hardware devices used to acquire visual information about the flocculation process in water in real time; for example, industrial cameras or high-resolution cameras, which convert continuous physical images into digital image data that can be processed by a computer.
[0075] Image enhancement processing refers to a series of algorithmic operations performed on raw image data to improve the visual quality of the image or make it more suitable for subsequent machine analysis; for example, by adjusting brightness, contrast, sharpening edges, or reducing noise, the features of specific targets (such as flocculent particles) in the image can be highlighted.
[0076] A particle distribution image is an image that, after image enhancement processing, clearly shows the outline, size, and spatial distribution of floc particles; this image is the basis for subsequent quantitative analysis of floc characteristics.
[0077] Image analysis technology refers to methods that use computer vision and digital image processing algorithms to extract, identify, and quantify the features of specific targets from images; for example, it can be used to identify the boundaries of flocculent particles, calculate their geometric dimensions, and count their numbers.
[0078] Floc particles refer to macroscopic particles formed by the aggregation of colloidal particles and suspended solids in water during the flocculation process of water treatment, caused by the action of coagulants; their size, shape and density are key indicators for measuring the coagulation effect.
[0079] The average particle diameter refers to the average value obtained by statistically calculating the size of all effective floc particles within the field of view using image analysis technology; this value reflects the overall growth status of the floc particles.
[0080] Density value refers to the number of flocculent particles per unit volume calculated by statistically analyzing the number of effective flocculent particles within the image field of view and combining this with the sampling volume; this value reflects the degree of aggregation of flocculent particles.
[0081] The initial addition adjustment coefficient is a factor calculated by an intelligent decision-making model based on the deviation between the current floc state and the preset standard state, combined with historical operating data, to initially correct the benchmark dosage of coagulant.
[0082] Optimized dosage refers to the final amount of coagulant to be added, which is determined and sent to the dosing pump after considering various factors such as the dynamic changes of flocs, water flow rate, and equipment adjustment accuracy.
[0083] The specific implementation process of the coagulant dosing control method in this embodiment is as follows:
[0084] First, image data of the flocculation process in the water is acquired in real time using an image acquisition device. This device can be an industrial camera fixed next to the observation window of the flocculation tank, or a mobile underwater camera. The acquired raw image data is then sent to an image processing unit for image enhancement. For example, basic image processing techniques such as global brightness adjustment and contrast stretching can be used to make the boundaries of the floc particles relatively clear in the image, thereby obtaining a preliminary particle distribution image.
[0085] Secondly, based on the obtained particle distribution images, image analysis techniques are used to identify the size and quantity characteristics of the flocculent particles, thereby determining the average particle diameter and density at the current flocculation stage. Specifically, simple connected component analysis can be performed on the particle distribution images to identify individual regions in the image and treat them as flocculent particles. Subsequently, the particle size is estimated by measuring the pixel area or longest axis length of these regions, and the number of regions is counted. The average particle diameter can be obtained by the arithmetic mean of all identified particle sizes, while the density can be calculated by dividing the number of particles by the water volume corresponding to the image field of view.
[0086] Furthermore, based on the currently determined average particle diameter and density values, the deviation from the preset standard values is calculated. The preset standard values can be a set of fixed diameter and density reference values, such as setting an ideal diameter range and an ideal density range based on historical experience. If the current average particle diameter or density value exceeds these ranges, a deviation is considered to exist. Subsequently, dosing adjustment records similar to the current water quality conditions (such as raw water turbidity, pH value, etc.) are extracted from historical data; for example, records that perfectly match the current water quality parameters in the historical database can be easily found, and their corresponding dosing adjustment coefficients can be directly obtained.
[0087] Furthermore, the obtained preliminary dosage adjustment coefficient is combined with the real-time monitored water flow data to calculate and update the coagulant dosage, thereby obtaining the optimized dosage for the current operating conditions. For example, a baseline dosage based on water flow can be determined first, and then the preliminary dosage adjustment coefficient can be directly multiplied by this baseline dosage to obtain the new dosage.
[0088] Finally, based on the calculated optimized dosage, a control command is generated and sent to the dosing pump. Upon receiving the command, the dosing pump adjusts its dosing speed or stroke to change the actual amount of coagulant added per unit time. For example, if the optimized dosage increases, the pump's stroke or frequency will increase accordingly. After the dosage adjustment, the system continuously monitors the updated floc images to verify the effect of the adjustment. This verification can be done by manually observing image changes or by comparing simple image features to determine whether the flocculation effect has improved.
[0089] This application achieves precise optimization of coagulant dosage by using real-time visual recognition of the dynamic changes in floc particles and combining historical data for intelligent decision-making. This effectively overcomes the lag and bias problems of traditional methods in dealing with fluctuations in raw water quality and changes in treatment load, significantly improving the adaptability and stability of the water treatment flocculation process. It avoids substandard effluent quality caused by insufficient dosage, as well as waste of reagents and increased sludge production caused by excessive dosage.
[0090] In the flocculation process section of a water treatment system, image acquisition devices collect real-time image data of the flocculation process in the water. Image enhancement processing is then performed on the acquired raw images to highlight the boundaries of floc particles, obtaining a clear particle distribution image, which is fundamental for subsequent floc feature analysis. However, actual water images are often affected by factors such as uneven lighting, suspended solids interference, and blurred particle edges. Direct image enhancement processing makes it difficult to effectively and stably obtain high-quality particle distribution images, thus affecting the accuracy of subsequent floc feature identification.
[0091] In this regard, refer to Figure 2 As shown, this application further proposes a step for image enhancement processing of the acquired original image to highlight the boundaries of flocculent particles and obtain a clear particle distribution image, including: denoising and brightness compensation of the original image to obtain an initial image with a uniform background; local contrast adaptive enhancement of the initial image, dynamically adjusting the enhancement intensity according to the grayscale distribution of each region of the image to amplify the contour features of the flocculent particle edges and generate an edge-enhanced image; gradient detection and edge connection of the edge-enhanced image to identify and strengthen significant boundaries, while connecting incomplete edge segments that meet the conditions into continuous boundaries based on preset geometric continuity rules to obtain a complete flocculent boundary image; converting the flocculent boundary image into a binary image and performing morphological optimization processing on the binary image to eliminate noise points and fill gaps within the boundaries, outputting a clear particle distribution image for subsequent feature recognition.
[0092] Specifically, denoising and brightness compensation are performed on the original image to eliminate random noise introduced during image acquisition and correct uneven image brightness caused by changes in ambient lighting or equipment limitations. Noise reduction can employ algorithms such as median filtering, Gaussian filtering, or bilateral filtering to smooth the image while preserving edge information as much as possible. Brightness compensation can be achieved through methods such as histogram equalization, gamma correction, or adaptive brightness adjustment to make the background brightness of the image more uniform, providing a more stable foundation for subsequent contrast enhancement and edge detection, thus obtaining an initial image with a uniform background. Based on this, local adaptive contrast enhancement is performed on the initial image. Its purpose is to dynamically adjust the enhancement intensity according to the grayscale distribution characteristics of different regions of the image to more effectively amplify the edge contour features of the flocculent particles. Unlike global contrast enhancement, local adaptive contrast enhancement (e.g., using the Limiting Contrast Adaptive Histogram Equalization (CLAHE) algorithm) avoids over-enhancement or under-enhancement in areas with high or low image brightness, thus presenting the details of the flocculent particles more clearly against complex backgrounds and generating an edge-enhanced image. Subsequently, gradient detection and edge joining are performed on the edge enhancement image to accurately identify and strengthen the significant boundaries of flocculent particles while addressing edge breakage issues. Gradient detection typically employs operators such as Canny, Sobel, or Prewitt, locating potential edges by calculating the grayscale change rate of image pixels. Based on this, edge joining techniques, using predefined geometric continuity rules (such as distance between edge segments, directional similarity, curvature changes, etc.), connect incomplete edge fragments caused by noise or weak contrast, forming continuous and complete flocculent boundaries, resulting in a complete flocculent boundary image. Finally, after converting the flocculent boundary image into a binary image, morphological optimization processing is performed to further refine the shape of the flocculent particles, eliminate isolated noise points in the image, and fill any gaps that may exist inside the particles. Binarization typically uses the Otsu method or adaptive thresholding to divide image pixels into foreground (flocculent) and background. Morphological operations include erosion, dilation, opening, and closing operations. For example, opening operations can effectively remove small isolated points and burrs, while closing operations can fill small holes and broken connection areas, thereby outputting a clear particle distribution image for subsequent feature recognition, ensuring the integrity and accuracy of the particle region.
[0093] In actual water treatment processes, floc particles have complex shapes and uneven size distribution, and there may be noise or incomplete particles in the image. If simple statistical calculations are performed directly, the measurement accuracy of particle diameter and density values may be insufficient, thus affecting the accuracy of subsequent coagulant dosing control.
[0094] In this regard, refer to Figure 3 As shown, this application further proposes a method for determining the average particle diameter and density values at the current flocculation stage, specifically including the following steps:
[0095] First, a particle labeling operation is performed on the particle distribution image, assigning a unique identifier to each individual flocculent particle region and extracting the geometric contour information of each labeled region. This step aims to identify continuous flocculent regions in the image as independent individuals and obtain their boundary information. Particle labeling can be achieved through connected component analysis, i.e., scanning the binarized particle distribution image and labeling interconnected sets of pixels as the same particle. For flocculents that may be adhered or overlapping, more advanced image segmentation techniques such as the watershed algorithm can be used to separate adjacent particles by identifying "basins" and "watersheds" in the image. Extracting geometric contour information typically involves edge detection algorithms, such as the Canny operator or the Sobel operator, to obtain the precise set of boundary pixels for each labeled particle. This contour information is the basis for subsequent calculations of particle size and shape features.
[0096] Secondly, based on the geometric contour information of each particle, the maximum inscribed circle diameter of each particle is calculated as its equivalent diameter, and the total number of valid labeled regions within the image field of view is counted. The maximum inscribed circle diameter is a robust particle size measurement method that effectively reflects the minimum feature size of particles and has good adaptability to irregular particle shapes. During calculation, a distance transformation is performed on the binarized region of each particle, and the maximum value within that region in the distance transformation map is found; this maximum value is the radius of the maximum inscribed circle. All successfully labeled regions with calculated equivalent diameters are included in the total number of valid labeled regions, which will be used for subsequent particle density calculations.
[0097] Next, the equivalent diameters of all particles are arranged in descending order. After removing the smallest particle group whose equivalent diameter is less than a preset threshold, the weighted average of the remaining particle equivalent diameters is calculated and used as the average particle diameter for the current flocculation stage. This step aims to optimize the accuracy of the average diameter calculation. By setting a preset threshold, image noise, incompletely flocculated microparticles, or background impurities can be effectively filtered out, avoiding interference from these irrelevant small particles in the average diameter statistics. For example, a minimum identifiable floc size can be set as the threshold based on experience or historical data. After removing these small particles, the equivalent diameters of the remaining effective floc particles are weighted and averaged. The weighted average can be based on the particle's area, perimeter, or equivalent diameter itself; for example, particles with larger areas can be given higher weights to better reflect their actual contribution to the flocculation process.
[0098] Finally, the particle density value at the current flocculation stage is calculated by dividing the total number of validly marked areas by the actual water sampling volume corresponding to the image. The actual water sampling volume refers to the water space volume actually covered by the image acquisition device in a single imaging operation, which needs to be determined through system calibration. By dividing the total number of validly marked areas (i.e., the number of floc particles identified in the image) by this volume, the number of floc particles per unit volume of water can be obtained, thus accurately quantifying the particle density at the current flocculation stage.
[0099] In some embodiments of this application, when determining the average particle diameter at the current flocculation stage, it is necessary to remove the smallest particle group with an equivalent diameter smaller than a preset threshold. However, in actual water treatment processes, water quality conditions and flocculation states are dynamically changing. If a fixed preset threshold is used to filter out the smallest particle group, it may not accurately reflect the true distribution of effective flocs under different operating conditions, resulting in an inaccurate calculation of the average particle diameter and affecting the accuracy of subsequent coagulant dosing.
[0100] To address this, this application further proposes an adaptive thresholding method for removing the smallest particle groups with equivalent diameters smaller than a preset threshold when determining the average particle diameter. Specifically, the method includes the following steps: First, all particle equivalent diameters are divided into several levels according to their size. This step aims to perform preliminary quantification and classification of the equivalent diameters of flocculent particles identified by image analysis technology. For example, all calculated particle equivalent diameter data can be grouped according to preset diameter ranges (such as 0-10 micrometers, 10-20 micrometers, etc.), and the number of particles within each level can be counted. This division facilitates subsequent statistical analysis of particle size distribution, laying the foundation for identifying the characteristics of particle groups of different sizes.
[0101] Secondly, the proportion of particles within each grade to the total number of particles is calculated, and the first obvious local minimum point in the proportion distribution is identified. After classifying the particles into grades, the percentage of particles within each grade to the total number of particles is calculated, thus obtaining the frequency distribution of particle size. By analyzing this proportion distribution curve, the first significantly decreasing local minimum point in the curve can be identified. This local minimum point usually represents a natural boundary between the small-sized particle group and the effective flocculent particle group. Its appearance indicates that the proportion of particles in this size range decreases significantly, indicating a transition region.
[0102] Next, the upper limit of the equivalent diameter range corresponding to the local minimum point is used as the dynamically determined removal threshold. Once the first obvious local minimum point in the proportional distribution is identified, the upper limit of the particle equivalent diameter class corresponding to that point is determined as the dynamic removal threshold. For example, if the local minimum point appears in the diameter class of 10 to 15 micrometers, then 15 micrometers will be set as the current removal threshold. This approach allows the removal threshold to be adaptively adjusted according to the actual particle distribution, rather than using a fixed empirical value.
[0103] Finally, based on a dynamically determined removal threshold, particles with an equivalent diameter smaller than the threshold are automatically filtered out, and the weighted average of the remaining particles is recalculated as the final average particle diameter. After determining the dynamic removal threshold, the system automatically filters and excludes all particles with an equivalent diameter smaller than that threshold. These filtered-out particles are generally considered to be small particles or impurities that have not yet grown sufficiently or contribute little to the flocculation effect. Subsequently, only the remaining particles with an equivalent diameter greater than or equal to the removal threshold are weighted and averaged to obtain a more representative average particle diameter. The weighted average can be calculated based on factors such as the number, area, or volume of particles to more accurately reflect the overall size characteristics of the effective flocs.
[0104] In practice, the key challenges in ensuring dosing control accuracy lie in accurately quantifying the deviation of the current floc state, efficiently and accurately selecting the best-matching records from a vast amount of historical data, and comprehensively utilizing these records to generate a reliable initial dosing adjustment coefficient. Inaccurate deviation quantification or insufficient utilization of historical data may lead to discrepancies between the initial dosing adjustment coefficient and actual requirements, affecting the optimization of coagulant dosing.
[0105] In this regard, refer to Figure 4 As shown, this application further proposes a method for obtaining a preliminary dosing adjustment coefficient that matches the current floc state deviation, including: comparing the currently calculated average particle diameter and density values with preset standard diameter and standard density ranges respectively, calculating the absolute deviation values from the midpoint of each range, and combining the two absolute deviation values into a comprehensive deviation index according to preset weights; based on the comprehensive deviation index, retrieving operating records with similar water quality conditions to the current water quality parameters from a historical database, the operating records containing historical comprehensive deviation indices and their corresponding dosing adjustment coefficients; selecting several records with the smallest difference between the comprehensive deviation index and the current comprehensive deviation index from the retrieved operating records, and extracting their corresponding dosing adjustment coefficients; performing a weighted average calculation on the extracted multiple dosing adjustment coefficients, where the weights are determined based on the overall similarity between the corresponding historical records and the current operating conditions, and the calculation result is the preliminary dosing adjustment coefficient.
[0106] Specifically, the calculated average particle diameter and density values are compared with preset standard diameter and density ranges, respectively. The absolute deviation from the midpoint of each range is calculated, and the two absolute deviation values are combined according to preset weights to form a comprehensive deviation index. This step aims to quantify the degree of deviation between the current floc state and the ideal or target state. The preset standard diameter and density ranges are typically determined through statistical analysis of data from multiple historical periods of stable system operation and effluent quality compliance, combined with expert experience or experiments. For example, an ideal diameter range [D] can be set. min, D max ] and an ideal density range [P min ,P max When calculating the absolute deviation from the median of their respective ranges, for the average particle diameter D... current Its standard range median value can be set as (D) min +D max The diameter deviation can be calculated as |D) / 2. current -(D min +D max Similarly, calculate the density deviation value. Preset weights can be set based on the importance of diameter and density to the flocculation effect. For example, if diameter has a greater impact on the flocculation effect, a higher weight can be assigned to the diameter deviation. These weights are usually empirical values, but can also be optimized using machine learning models. The composite deviation index can be calculated using a weighted sum, for example: Composite Deviation Index = W D ×Diameter deviation value + W P × Density deviation value, where W D and W P These are preset weights for diameter and density, respectively.
[0107] Based on the comprehensive deviation index, operational records with similar water quality conditions to the current water quality parameters are retrieved from the historical database. These records contain historical comprehensive deviation indices and their corresponding dosing adjustment coefficients. The purpose of this step is to identify past operational experiences from a large amount of historical data that are most similar to the current floc state deviation. The historical database is a database storing long-term operational data, including timestamps, water quality parameters (such as turbidity, pH, temperature, etc.), floc characteristics (average particle diameter, density), comprehensive deviation indices, and actual application dosing adjustment coefficients. Retrieving operational records with similar water quality conditions to the current water quality parameters can be initially filtered by comparing the similarity between the current water quality parameters and those in historical records. For example, a water quality parameter similarity threshold can be set, and only historical records meeting this threshold can be retrieved. Similarity calculation can use methods such as Euclidean distance or cosine similarity.
[0108] From the retrieved operational records, several records with the smallest difference between the overall deviation index and the current overall deviation index are selected, and their corresponding dosage adjustment coefficients are extracted. After initially screening records with similar water quality conditions, this step further refines the matching, focusing on records with the closest degree of floc state deviation. By selecting several records with the smallest difference in the overall deviation index, it can be ensured that the selected historical experience is highly relevant to the current problem. The difference calculation can be performed for each retrieved historical record, calculating the absolute difference between its historical overall deviation index and the current overall deviation index. A fixed number N can be set (e.g., N=3 or N=5), selecting the top N records with the smallest difference. Alternatively, a difference threshold can be set, selecting all records with differences less than the threshold.
[0109] The extracted adjustment coefficients are weighted and averaged. The weights are determined based on the overall similarity between the corresponding historical records and the current operating conditions. The result is the initial adjustment coefficient. This step aims to comprehensively utilize the experience of multiple similar historical records, avoiding the randomness or incomplete matching that may exist in a single historical record, thus generating a more robust and accurate initial adjustment coefficient. Weighted averaging assigns higher influence to historical records more similar to the current operating conditions. The overall similarity can comprehensively consider the similarity of water quality parameters, the closeness of comprehensive deviation indicators, and the similarity of other operating parameters that may affect flocculation (such as temperature, stirring intensity, etc.). For example, a comprehensive similarity function can be defined, which sums or multiplies the above multiple similarity components with weights. When calculating the weighted average, it is assumed that K adjustment coefficients (C1, C2, ..., C...) are extracted. K ) and their corresponding overall similarity weights (W1, W2, ..., W K If the initial adjustment factor C is added, then... preliminary =(W1×C1+W2×C2+...+W K ×C K ) / (W1+W2+...+W K ), similarity weights (W1, W2, ..., W K The weight is usually proportional to the similarity; the higher the similarity, the greater the weight.
[0110] Through the above technical solution, this application can systematically quantify the deviation between the current floc state and the ideal state, and use historical operating data for precise matching and intelligent learning. First, the average particle diameter and density values are compared with preset standard ranges to synthesize a comprehensive deviation index, achieving a comprehensive and quantitative assessment of the degree of floc state deviation, avoiding the potential bias of a single index. Second, based on this comprehensive deviation index and combined with water quality parameter similarity, the most relevant operating records are efficiently retrieved from the historical database, ensuring the effectiveness of the referenced historical experience. Finally, by weighted averaging of the dosage adjustment coefficients of multiple matching records and determining the weights based on the overall similarity between historical records and current operating conditions, multi-source experience is effectively integrated, reducing the errors and randomness that may be caused by single historical data, thereby generating a more robust and targeted preliminary dosage adjustment coefficient. This method significantly improves the accuracy and reliability of the preliminary dosage adjustment coefficient, providing a solid foundation for subsequent optimization of coagulant dosage, thereby improving the control precision of the entire flocculation process and the stability of the effluent water quality.
[0111] In some embodiments described above in this application, a preliminary dosing adjustment coefficient is obtained by comparing the currently calculated average particle diameter and density values with preset standard diameter and density ranges. However, if these preset standard ranges fail to accurately reflect the optimal flocculation state of the system under different operating conditions, or lack dynamic adaptability, the calculated deviations may be inaccurate, thereby affecting the accuracy and stability of coagulant dosing adjustments and failing to consistently ensure that the effluent water quality meets the standards.
[0112] To address this, this application further proposes establishing the preset standard diameter range and standard density range in the following manner: During multiple historical periods when the system is operating stably and the effluent quality meets standards, corresponding particle average diameter and density value data sequences are simultaneously collected and recorded; statistical analysis is performed on the particle average diameter and density value data sequences recorded in each historical period to calculate their respective average values and statistical distribution characteristics; based on the data distribution of each historical period, after removing obviously outlier abnormal data points, the safe and stable operating ranges for particle average diameter and density values are determined; the determined safe and stable operating ranges for particle average diameter are used as the preset standard diameter range, and the determined safe and stable operating ranges for particle density values are used as the preset standard density range.
[0113] Specifically, during multiple historical periods of stable system operation and effluent quality compliance, corresponding data sequences of average particle diameter and density values are synchronously collected and recorded to obtain real operational data representing the ideal flocculation state. "Stable system operation" typically refers to minimal fluctuations in key operating parameters (such as raw water flow rate, raw water quality indicators, and coagulant dosage) over a period of time, while "effluent quality compliance" means that key indicators such as turbidity, color, and COD consistently meet national or industry emission standards. During this period, the average diameter and density values of floc particles are monitored and recorded in real time using image acquisition devices to ensure that the collected data sequences accurately reflect the flocculation characteristics of the system under optimal performance. The data acquisition frequency can be set according to process requirements, such as collecting data every few minutes or hours, to accumulate sufficient data for subsequent analysis.
[0114] Subsequently, statistical analysis was performed on the data sequences of average particle diameter and density values recorded for each historical period, calculating their respective average values and statistical distribution characteristics. The purpose of statistical analysis is to extract meaningful patterns and trends from a large amount of raw data. The average value can intuitively reflect the central trend of floc characteristics within a given period; for example, the arithmetic mean can be calculated. Statistical distribution characteristics can reveal the dispersion and distribution pattern of the data; for example, standard deviation and variance can be calculated to measure data volatility, or histograms and box plots can be used to visualize the data distribution, thereby providing a more comprehensive understanding of the stability of floc state.
[0115] Based on this, and after removing obviously outlier data points according to the data distribution of each historical period, the safe and stable operating ranges for the average particle diameter and density values are determined. Outliers are usually data anomalies caused by abnormal factors such as sensor failure, sudden and drastic changes in operating conditions, or operational errors. They do not represent the normal and stable operating state of the system and therefore need to be identified and removed to avoid interfering with the accuracy of subsequent range determination. Outlier removal methods can employ statistical methods, such as the 3σ criterion (i.e., data points exceeding three standard deviations above and below the mean are considered outliers), methods based on interquartile range (IQR), or more complex machine learning algorithms. After removing outlier data, the safe and stable operating ranges can be determined based on statistical confidence intervals (e.g., 95% or 99% confidence intervals), or by analyzing the upper and lower limits of the data distribution (e.g., the 5th percentile and 95th percentile), thereby defining the ideal range for the average particle diameter and density values while ensuring that the effluent water quality meets standards.
[0116] Ultimately, the determined safe and stable operating range for average particle diameter is used as the preset standard diameter range, and the determined safe and stable operating range for particle density is used as the preset standard density range. These standard ranges, established in this way, are based on real data from the water treatment system operating stably and producing qualified water, rather than empirical or fixed values. These dynamically established standard ranges will serve as the benchmark for the intelligent decision-making module to calculate the current floc state deviation, ensuring that this benchmark accurately reflects the flocculation characteristics of the system under optimal operating conditions.
[0117] In some embodiments described above, the deviation of the current average particle diameter and density from a preset standard value is calculated, and dosing adjustment records under similar water quality conditions are extracted from historical data to obtain a preliminary dosing adjustment coefficient that matches the current floc state deviation. However, in actual operation, there may be situations where operational records highly similar to the current water quality parameters cannot be retrieved from the historical database. This can lead to the inability to effectively obtain the preliminary dosing adjustment coefficient, thereby affecting the accuracy and continuity of coagulant dosing control.
[0118] In response, this application further proposes a method for obtaining a preliminary dosing adjustment coefficient when no operational records similar to the current water quality parameters can be retrieved from the historical database. This method includes: decomposing the comprehensive deviation index of the current average particle diameter and density values into a diameter deviation component and a density deviation component; retrieving records in the historical database that are similar to the current diameter deviation component and records that are similar to the current density deviation component; selecting several records with the closest deviation from the two sets of search results, extracting the corresponding dosing adjustment coefficients, and classifying and statistically analyzing the extracted adjustment coefficients; and performing proportional fusion calculation on the extracted adjustment coefficients according to the contribution ratio of the diameter deviation component and the density deviation component to the comprehensive deviation, thereby generating a preliminary dosing adjustment coefficient suitable for the current abnormal deviation situation.
[0119] Specifically, the comprehensive deviation index is a quantitative value that measures the degree of deviation between the current floc state and the ideal standard state. It is typically a weighted composite of the deviations in average particle diameter and particle density. Decomposing it into diameter deviation and density deviation components means breaking down the overall impact of the comprehensive deviation into two independent, traceable components. For example, if the comprehensive deviation index is a linear combination of diameter and density deviations, then the decomposition involves extracting these two original deviation values or their weighted contribution. The purpose of this is to enable more refined matching and analysis on a single dimension when overall matching data is lacking.
[0120] After decomposing the diameter deviation component and the density deviation component, the system no longer attempts to find historical records that perfectly match the overall deviation index. Instead, it searches the historical database for records that are similar to the current diameter deviation component and records that are similar to the current density deviation component, respectively. This search strategy expands the scope of historical data utilization; even without perfectly matching operating conditions, historical data with similarity on a certain key parameter can be found. For example, a similarity threshold can be set to retrieve all historical records for the diameter deviation component within ±X% of the current value, and all historical records for the density deviation component within ±Y% of the current value.
[0121] Subsequently, from the historical records retrieved from the two sets mentioned above, select several records that are closest to the current deviation component. For example, for each deviation component, select the top N records whose values have the smallest Euclidean distance from the current deviation component. Extract the corresponding adjustment coefficients from these records and perform classification statistics on them. Classification statistics can involve calculating the average or median of the adjustment coefficients corresponding to the diameter deviation component, performing similar processing on the adjustment coefficients corresponding to the density deviation component, or performing more complex statistical analysis to obtain representative adjustment coefficients for each dimension.
[0122] Finally, based on the respective contribution ratios of the diameter deviation component and the density deviation component to the overall deviation, the extracted adjustment coefficients are proportionally fused. For example, if the weight of the diameter deviation in the calculation of the overall deviation index is w... d The weight of density deviation is w rho Therefore, the final initial dosage adjustment factor can be expressed as (w d ×Diameter adjustment coefficient) + (w rho ×Density adjustment factor). This fusion method ensures that even without perfectly matching data, a reasonable and representative initial addition adjustment factor can still be generated based on the relative importance of each deviation component, thus adapting to the current unique deviation situation.
[0123] In actual water treatment processes, the water flow rate is not constant. If the dosage coefficient is adjusted only based on the state of the flocs and the changes in the real-time water flow rate are ignored, the amount of coagulant added may not match the actual amount of water to be treated, thereby affecting the coagulation effect or causing waste of the agent.
[0124] In this regard, refer to Figure 5As shown, this application further proposes a method for calculating and updating the coagulant dosage by combining the initial dosage adjustment coefficient with real-time monitored water flow data. Specifically, this method includes: obtaining the benchmark coagulant dosage rate used for the current system operation and collecting real-time water flow data; calculating the flow proportion component of the coagulant dosage requirement based on the current water flow data; performing a fusion calculation between the initial dosage adjustment coefficient and the flow proportion component to generate a comprehensive dosage adjustment factor; applying the comprehensive dosage adjustment factor to the benchmark dosage rate to calculate the theoretical dosage; and rounding the theoretical dosage based on the minimum adjustment accuracy and maximum adjustment range of the dosing equipment to output an optimized dosage value that can be directly executed.
[0125] The system acquires the baseline coagulant dosing acceleration rate used for current system operation and collects water flow data in real time. The baseline coagulant dosing acceleration rate is typically an initial reference value determined based on the water treatment plant's design parameters, historical operating experience, or prior optimization experiments. It represents the rate of agent dosing acceleration required to maintain good coagulation performance at standard or design flow rates. This rate can be a fixed value or a preset stepped value based on the fluctuation range of the raw water quality. Real-time water flow data is continuously acquired using flow meters (e.g., electromagnetic flow meters, ultrasonic flow meters, or vortex flow meters) installed at the inlet of the water treatment system or flocculation tank. These flow meters convert water velocity or volumetric flow rate into electrical signals and transmit them to the control system to reflect the actual volume of water being treated.
[0126] The flow rate proportion component of the coagulant dosage requirement is calculated based on current water flow data. This component quantifies the degree of change in the current water flow rate relative to a baseline flow rate (e.g., the design flow rate, average flow rate, or the flow rate corresponding to a baseline dosing rate). It is typically calculated as the ratio of the current real-time flow rate to the baseline flow rate, for example: Flow rate proportion component = (Current real-time flow rate / Baseline flow rate). This component directly reflects the linear adjustment of the coagulant demand caused by changes in water volume.
[0127] The initial dosage adjustment coefficient and the flow rate proportional component are fused to generate a comprehensive dosage adjustment factor. The purpose of this fusion calculation is to organically combine the initial dosage adjustment coefficient (reflecting water quality and flocculation effect requirements) based on dynamic changes in floc size with the flow rate proportional component (reflecting treatment volume requirements) based on changes in water flow. Common fusion calculation methods include multiplicative fusion (e.g., comprehensive dosage adjustment factor = initial dosage adjustment coefficient × flow rate proportional component), weighted average fusion, or fuzzy logic-based fusion. This fusion generates a more comprehensive and accurate comprehensive dosage adjustment factor that simultaneously considers the impact of both water quality and volume changes on coagulant dosage.
[0128] The theoretical dosage is calculated by applying the comprehensive dosage adjustment factor to the baseline dosage acceleration rate. "Applied to" typically means multiplying the comprehensive dosage adjustment factor by the baseline coagulant dosage acceleration rate, i.e.: Theoretical dosage = Baseline coagulant dosage acceleration rate × Comprehensive dosage adjustment factor. This theoretical dosage represents the ideal total amount of coagulant that should be added to the system under the current floc state and water flow conditions.
[0129] The theoretical dosage is rounded using an engineering approach, taking into account the minimum adjustment precision and maximum adjustment range of the dosing equipment, to output an optimized dosage value that can be directly executed. This engineering rounding takes into account the physical limitations of the actual dosing pump equipment. Minimum adjustment precision refers to the smallest increment in the dosage change that the dosing pump can achieve; for example, the pump's stroke or frequency can only be adjusted in specific increments. Maximum adjustment range refers to the maximum and minimum dosage that the dosing pump can achieve. The rounding process may include rounding the theoretical dosage to the nearest adjustable value of the equipment, or limiting the theoretical dosage to an executable range if it exceeds the equipment's maximum or minimum range. This ensures that the output optimized dosage value is an instruction that the actual equipment can accurately execute.
[0130] Specifically, in actual operation, when the adjustment direction indicated by the initial addition adjustment coefficient is inconsistent with the adjustment direction indicated by the water flow change trend, for example, when the floc status indicates that the addition amount needs to be reduced but the water flow is increasing, simple fusion calculation may lead to conflict or instability in the addition amount adjustment strategy, affecting the precise control of coagulation effect.
[0131] In response, this application further proposes that, in the fusion calculation step, when the adjustment direction indicated by the initial addition adjustment coefficient is inconsistent with the adjustment direction indicated by the flow change trend, the following priority decision mechanism is adopted: obtain the severity level of the current flocculation state comprehensive deviation; if the severity level exceeds a preset first threshold, then the adjustment direction indicated by the initial addition adjustment coefficient is the main factor, and the flow change trend is used as an auxiliary correction term for fusion; if the severity level does not exceed the preset first threshold but exceeds a preset second threshold, then the initial addition adjustment coefficient and the flow change trend are given the same weight for balanced fusion; if the severity level does not exceed the preset second threshold, then the adjustment direction indicated by the flow change trend is the main factor, and the initial addition adjustment coefficient is used as an auxiliary correction term for fusion.
[0132] Specifically, obtaining the severity level of the current flocculation state's overall deviation refers to the quantitative classification of the overall deviation index calculated by comparing the average particle diameter and density values with preset standard values. This level can be determined based on multiple preset threshold ranges; for example, the overall deviation index can be divided into different levels such as "slight," "moderate," and "severe," each level corresponding to a specific deviation range. This step aims to provide a quantitative basis for subsequent decision-making to assess the stability and risk level of the current flocculation process.
[0133] When the severity level exceeds a preset first threshold, it indicates a very serious deviation in the current flocculation state, and the flocculation effect has significantly deviated from the target. In this case, correcting the floc state becomes the primary task. Therefore, the adjustment direction indicated by the initial addition adjustment coefficient (which directly reflects the floc state deviation) will dominate to ensure that the floc state is quickly and effectively brought back to the normal range. At this time, although the flow rate change trend is still an important factor, its role is downgraded to an auxiliary correction term for fusion, so as to avoid interference with the emergency correction of the floc state due to flow rate fluctuations. For example, this can be achieved by setting a larger weighting factor for the initial addition adjustment coefficient and a smaller weighting factor for the flow rate change trend.
[0134] If the severity level does not exceed the preset first threshold but exceeds the preset second threshold, it indicates that the flocculation state deviation is at a moderate level. In this case, it is necessary to pay attention to both the adjustment of floc state and the impact of water flow changes on the dosage. Therefore, this scheme adopts a balanced integration strategy, that is, assigning equal weight to the initial dosage adjustment coefficient and the flow change trend. This ensures that the dosage adjustment can respond to the deviation of floc state and adapt to the normal fluctuation of water flow, thereby maintaining the overall stability of the system. For example, a simple arithmetic mean or weighted average can be used, where the two factors have equal weight.
[0135] When the severity level does not exceed the preset second threshold, it indicates that the flocculation state deviation is minor and the flocculation process is in a relatively stable state. At this time, the need for fine-tuning the floc state is not so urgent, while the real-time changes in water flow rate may have a more significant impact on the coagulant dosage. Therefore, in this case, the adjustment direction indicated by the flow rate change trend should be prioritized to ensure that the coagulant dosage can match the changes in water flow rate in a timely and accurate manner, maintaining a dynamic balance in the dosage. The initial dosage adjustment coefficient serves as an auxiliary correction term for fine-tuning to further optimize the flocculation effect. For example, a larger weighting factor can be set for the flow rate change trend, while a smaller weighting factor can be set for the initial dosage adjustment coefficient.
[0136] By introducing a priority decision-making mechanism based on the severity of the overall deviation in flocculation state, this application can intelligently resolve the conflict in dosing strategies when the initial dosing adjustment coefficient is inconsistent with the direction indicated by the flow rate change trend. When the flocculation state deviation is severe, priority is given to correcting the floc state to ensure rapid restoration of process stability; when the deviation is moderate, the floc state and flow rate changes are considered in a balanced manner to achieve robust control; when the deviation is slight, flow rate changes are the primary consideration to ensure dynamic matching between the dosage and the water flow rate. This hierarchical decision-making mechanism makes the coagulant dosing control more refined and intelligent, effectively avoiding dosage fluctuations or control errors that may result from simple blending, thereby significantly improving the accuracy of coagulant dosing and the operational stability of the water treatment system, and ensuring the continuous compliance of effluent water quality standards.
[0137] Reference Figure 6 As shown, this application further proposes a coagulant dosing control system based on visual recognition of dynamic changes in flocs to implement the above method. The system includes an image acquisition and processing module, a floc feature analysis module, an intelligent decision-making module, a dosing optimization module, and a control execution and feedback module.
[0138] The image acquisition and processing module is used to acquire image data of the flocculation process in water in real time through an image acquisition device, and to perform image enhancement processing on the acquired raw images to highlight the boundaries of floc particles and output clear particle distribution images.
[0139] The floc feature analysis module is connected to the image acquisition and processing module. It is used to identify the size and quantity characteristics of floc particles based on the particle distribution image and to determine the average diameter and density of particles in the current flocculation stage by means of image analysis technology.
[0140] The intelligent decision-making module, connected to the floc feature analysis module, is used to calculate the deviation between the current average particle diameter and density value and the preset standard value, extract the addition adjustment records under similar water quality conditions from historical data, and obtain a preliminary addition adjustment coefficient that matches the current floc state deviation.
[0141] The dosage optimization module, connected to the intelligent decision-making module, is used to combine the initial dosage adjustment coefficient with the real-time monitored water flow data, and calculate and update the coagulant dosage to obtain the optimized dosage for the current working conditions.
[0142] The control execution and feedback module is connected to the dosage optimization module. It is used to generate control commands based on the optimized dosage and send them to the dosing pump equipment. It adjusts the dosing speed or stroke of the dosing pump equipment to change the actual amount of coagulant added per unit time. It also continuously receives the updated floc image data from the image acquisition and processing module to verify the adjustment effect, thus forming a closed-loop continuous control of the flocculation process status.
[0143] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for controlling coagulant dosing based on visual recognition of dynamic changes in flocs, applied to the flocculation process section of a water treatment system, characterized in that, Includes the following steps: The image acquisition device acquires image data of the flocculation process in water in real time, and performs image enhancement processing on the acquired raw images to highlight the boundaries of floc particles and obtain clear particle distribution images. Based on particle distribution images, image analysis technology is used to identify the size and quantity characteristics of floc particles and determine the average diameter and density of particles in the current flocculation stage. The deviation from the preset standard value is calculated based on the current average particle diameter and density value. The addition adjustment records under similar water quality conditions are extracted from historical data to obtain a preliminary addition adjustment coefficient that matches the current floc state deviation. By combining the initial dosage adjustment coefficient with the real-time monitored water flow data, the optimal dosage for the current working conditions is obtained by calculating and updating the coagulant dosage. Based on the optimized dosage, the control command is sent to the dosing pump equipment to adjust the dosing speed or stroke of the pump equipment to change the actual amount of coagulant added per unit time. The updated floc images are continuously monitored to verify the adjustment effect, thereby achieving continuous control of the flocculation process status.
2. The coagulant dosing control method based on visual recognition of dynamic changes in flocs according to claim 1, characterized in that: Image enhancement processing is performed on the acquired raw images to highlight the boundaries of flocculent particles, resulting in a clear particle distribution image, including: The original image is denoised and brightness compensated to obtain an initial image with a uniform background; The initial image is locally contrast-adaptive enhanced, and the enhancement intensity is dynamically adjusted according to the gray-level distribution of each region of the image to amplify the contour features of the flocculent particles and generate an edge-enhanced image. Gradient detection and edge connection are performed on the edge enhancement image to identify and enhance significant boundaries. At the same time, based on the preset geometric continuity rules, incomplete edge segments that meet the conditions are connected into continuous boundaries to obtain a complete floc boundary image. The floc boundary image is converted into a binary image, and morphological optimization is performed on the binary image to eliminate noise points and fill gaps within the boundary, outputting a clear particle distribution image for subsequent feature recognition.
3. The coagulant dosing control method based on visual recognition of dynamic changes in flocs according to claim 1, characterized in that: Determine the average particle diameter and density values at the current flocculation stage, including: Perform particle labeling on the particle distribution image, assign a unique identifier to each individual flocculent particle region, and extract the geometric contour information of each labeled region; Based on the geometric contour information of each particle, the maximum inscribed circle diameter of each particle is calculated as the equivalent diameter of the particle, and the total number of effective marked areas within the image field of view is counted. Arrange all particles in descending order of equivalent diameter, remove the smallest particle group whose equivalent diameter is less than a preset threshold, calculate the weighted average of the equivalent diameter of the remaining particles, and use it as the average particle diameter of the current flocculation stage. The particle density value at the current flocculation stage is calculated by dividing the total number of valid marked areas by the actual water sampling volume corresponding to the image.
4. The coagulant dosing control method based on visual recognition of dynamic changes in flocs according to claim 3, characterized in that: When determining the average particle diameter, the process of removing the smallest particle group with an equivalent diameter smaller than a preset threshold employs an adaptive threshold method, including: All particle equivalent diameters are divided into several levels according to their size. Calculate the proportion distribution of particle number in each grade to the total particle number, and find the first obvious local minimum point in the proportion distribution; The upper limit of the equivalent diameter range corresponding to the local minimum point is used as the dynamically determined removal threshold. Based on a dynamically determined removal threshold, particles with an equivalent diameter smaller than the removal threshold are automatically filtered out, and the weighted average of the remaining particles is recalculated as the final average particle diameter.
5. The coagulant dosing control method based on visual recognition of dynamic changes in flocs according to claim 1, characterized in that: Obtain an initial dosing adjustment factor that matches the current floc state deviation, including: The calculated average particle diameter and density values are compared with the preset standard diameter range and standard density range, respectively. The absolute deviation values from the midpoint of their respective ranges are calculated, and the two absolute deviation values are combined into a comprehensive deviation index according to the preset weights. Based on the comprehensive deviation index, the historical database is searched for operation records with water quality conditions similar to the current water quality parameters. The operation records contain the historical comprehensive deviation index and its corresponding dosage adjustment coefficient. From the retrieved operation records, select several records with the smallest difference between the comprehensive deviation index and the current comprehensive deviation index, and extract their corresponding addition adjustment coefficients; The extracted multiple addition adjustment coefficients are weighted and averaged, with the weights determined based on the overall similarity between the corresponding historical records and the current operating conditions. The result is the preliminary addition adjustment coefficient.
6. The coagulant dosing control method based on visual recognition of floc dynamic changes according to claim 5, characterized in that: The preset standard diameter range and standard density range are established in the following way; During multiple historical periods when the system was operating stably and the effluent quality met the standards, the corresponding average particle diameter and density data sequences were collected and recorded simultaneously. Statistical analysis was performed on the data sequences of average particle diameter and density values recorded in each historical period to calculate their respective average values and statistical distribution characteristics; Based on the data distribution of each historical period, after removing obviously outlier abnormal data points, the safe and stable operating ranges of the average particle diameter and density values are determined. The determined safe and stable operating range of average particle diameter is taken as the preset standard diameter range, and the determined safe and stable operating range of particle density value is taken as the preset standard density range.
7. The coagulant dosing control method based on visual recognition of dynamic changes in flocs according to claim 5, characterized in that: When no operational records similar to the current water quality parameters can be retrieved from the historical database, methods for obtaining preliminary dosing adjustment factors include: The combined deviation index of the current average particle diameter and density values is decomposed into diameter deviation component and density deviation component; Retrieve records from the historical database that are similar to the current diameter deviation component and records that are similar to the current density deviation component. Select several records with the closest deviation from the two sets of search results, extract the corresponding dosage adjustment coefficients, and classify and statistically analyze the extracted adjustment coefficients. Based on the respective contribution ratios of the diameter deviation component and the density deviation component to the overall deviation, the extracted adjustment coefficients are proportionally fused to generate a preliminary addition adjustment coefficient applicable to the current abnormal deviation situation.
8. The coagulant dosing control method based on visual recognition of dynamic changes in flocs according to claim 1, characterized in that: The initial dosage adjustment factor is combined with real-time monitored water flow data to calculate and update the coagulant dosage, including: Obtain the benchmark dosing rate of coagulant used for the current system operation and collect water flow data in real time; Calculate the flow ratio component of the required amount of coagulant based on the current water flow data; The initial addition adjustment coefficient and the flow ratio component are combined to generate a comprehensive addition adjustment factor. The theoretical dosage is calculated by applying the comprehensive dosage adjustment factor to the baseline dosage rate. The theoretical dosage is rounded down in an engineering manner by combining the minimum adjustment accuracy and maximum adjustment range of the dosing equipment, and the optimized dosage value that can be directly executed is output.
9. The coagulant dosing control method based on visual recognition of dynamic changes in flocs according to claim 8, characterized in that: In the fusion calculation step, when the adjustment direction indicated by the initial adjustment coefficient is inconsistent with the adjustment direction indicated by the flow rate change trend, the following priority decision mechanism is adopted: Obtain the severity level of the overall deviation of the current flocculation state; If the severity level exceeds the preset first threshold, the adjustment direction indicated by the initial adjustment coefficient will be the primary factor, and the flow change trend will be used as an auxiliary correction factor for integration. If the severity level does not exceed the preset first threshold but exceeds the preset second threshold, the initial adjustment coefficient and the flow change trend are given the same weight for balanced integration. If the severity level does not exceed the preset second threshold, the adjustment direction indicated by the flow change trend will be the primary factor, and an initial adjustment coefficient will be added as an auxiliary correction item for fusion.
10. A coagulant dosing control system based on visual recognition of dynamic changes in flocs, used to implement the method described in any one of claims 1 to 9, characterized in that: include: The image acquisition and processing module is used to acquire image data of the flocculation process in water in real time through an image acquisition device, and to perform image enhancement processing on the acquired raw images to highlight the boundaries of floc particles and output clear particle distribution images. The floc feature analysis module is connected to the image acquisition and processing module. It is used to identify the size and quantity characteristics of floc particles based on the particle distribution image and to determine the average diameter and density of particles in the current flocculation stage by means of image analysis technology. The intelligent decision-making module, connected to the floc feature analysis module, is used to calculate the deviation between the current average particle diameter and density value and the preset standard value, extract the addition adjustment records under similar water quality conditions from historical data, and obtain a preliminary addition adjustment coefficient that matches the current floc state deviation. The dosage optimization module, connected to the intelligent decision-making module, is used to combine the initial dosage adjustment coefficient with the real-time monitored water flow data, and calculate and update the coagulant dosage to obtain the optimized dosage for the current working conditions. The control execution and feedback module is connected to the dosage optimization module. It is used to generate control commands based on the optimized dosage and send them to the dosing pump equipment. It adjusts the dosing speed or stroke of the dosing pump equipment to change the actual amount of coagulant added per unit time. It also continuously receives the updated floc image data from the image acquisition and processing module to verify the adjustment effect, thus forming a closed-loop continuous control of the flocculation process status.
Citation Information
Patent Citations
Coagulation clarification tank accurate dosing method and system based on machine learning and image recognition
CN118579911A
Water plant intelligent dosage prediction method based on data preprocessing
CN121189940A