A coagulant intelligent dosing control method and system based on image recognition and multi-parameter modeling
Through the intelligent dosing control method based on image recognition and multi-parameter modeling, the problems of delayed response and low accuracy of coagulant dosing control were solved, accurate response and automated control of water quality fluctuations in river water sources were achieved, and the operating efficiency and adaptability of the water plant were improved.
Patent Information
- Application Number
- CN202511037194.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-07-28
AI Technical Summary
In the existing coagulation and sedimentation process, the control of coagulant addition relies on manual experience and offline testing, which has a delayed response, inaccurate control, and strong subjectivity. It is difficult to adapt to the fluctuating water quality characteristics of river water sources caused by climate change, pollution and other factors.
An intelligent dosing control method based on image recognition and multi-parameter modeling is adopted. By constructing a time series input structure that integrates floc images and water quality data, and combining data enhancement and gradient boosting decision tree models, accurate prediction and automatic control of coagulant dosage can be achieved.
It achieves accurate prediction of coagulant dosage, improves water plant operation efficiency, reduces drug consumption and labor costs, and is suitable for large water plants under complex dynamic water source conditions, with adaptive performance and high generalization capabilities.
Smart Images

Figure CN120535101B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to image processing and data processing technology, in particular to an intelligent coagulant dosing control method and system based on image recognition and multi-parameter modeling. Background Art
[0002] Coagulation and sedimentation are the most critical physical and chemical treatment steps in the preparation of drinking water. Their effects directly affect the removal rate of suspended solids, colloids, organic pollutants, etc. in water, and are the core control point for ensuring that the effluent quality meets the standards. The regulation of traditional coagulation processes mainly relies on regular manual inspections of the coagulation tank, and the determination of the amount of coagulant to be added based on sampling and testing and operational experience. This method can maintain a certain degree of control accuracy under conditions where water quality fluctuations are small and the water source is relatively stable. However, for water plants that use river water as their water source, they face problems such as drastic daily changes in water quality, frequent climate disturbances, and unpredictable pollution inputs. Manual control methods have slow response and poor accuracy, making it difficult to meet the needs of refined control.
[0003] With the advancement of image recognition, machine learning, and sensor technologies, the industry is gradually exploring the integration of image recognition and intelligent algorithms into automated coagulant control. For example, attempts are underway to capture floc images using underwater image acquisition equipment. Image processing algorithms (such as threshold segmentation and edge detection) are then used to extract basic characteristic parameters such as floc area and number. These parameters are then empirically correlated with manually assessed flocculation effects. Fuzzy control or fixed rule models are then used to adjust the coagulant dosage. While these technologies offer new avenues for water treatment automation, their principles are often based on static image recognition and empirical rule modeling, making them inadequate for fully adapting to the needs of water quality regulation in complex, dynamic environments. Another example is the addition of water quality parameter inputs, such as influent turbidity or pH, to the system solution, creating a multidimensional control logic. These systems are primarily used for reservoir-based water sources with long-term stable water quality. They lack the ability to detect sudden changes in raw water quality, weather changes, and other external disturbances in real time, and their algorithmic models are difficult to transfer to a wider range of applications. Furthermore, some water plants have also introduced image recognition and modeling technologies to assist in determining coagulant dosage, but existing technologies still suffer from the following significant drawbacks:
[0004] 1. Relying on manual sampling or indirect image analysis, the response time is typically 1-3 hours, far from meeting the needs of real-time dosing adjustments and easily leading to over- or under-dosing. There is a significant time difference between coagulant addition and floc formation, and existing methods fail to systematically model this physical time lag, resulting in the inability of predicted outputs to accurately guide actual control.
[0005] 2. Due to the use of static image analysis combined with empirical rule modeling, it lacks a deep data learning mechanism and is unable to capture complex nonlinear relationships. It has large prediction errors when faced with sudden changes in water quality. It mainly relies on image features or a small number of water quality parameters, lacks the ability to integrate multivariate coupling information (such as temperature, pH, and raw water flow), and has a low level of intelligence.
[0006] 3. In the exploration of using image recognition to assist judgment, it is usually only applicable to reservoir water sources with long-term stable water quality. For typical river water sources such as those in the Pearl River Delta region, the influent water quality changes dramatically and is complex and changeable. Simple image recognition or feedback control based on the current floc state is difficult to effectively respond, and there is a problem of disconnection between recognition lag and control response.
[0007] In general, the control of coagulant addition in the existing coagulation and sedimentation process relies on manual experience judgment and offline detection methods, and has prominent problems such as delayed response, inaccurate control, and strong subjectivity. It is difficult to adapt to the fluctuating water quality characteristics of river water sources caused by climate change, pollution and other factors. Summary of the Invention
[0008] In order to solve the technical problems existing in the prior art, the present invention provides a coagulant intelligent dosing control method and system based on image recognition and multi-parameter modeling, which can monitor the floc state in real time around the clock, integrate multiple parameters (including influent water quality, image features, meteorological information, etc.) to predict the coagulant dosage, and accurately quantify the floc state through image recognition and deep learning modeling. Combined with the raw water feedforward information, a dosing prediction model with adaptive capabilities is established to achieve automated, intelligent and precise control of coagulant dosage.
[0009] In one aspect, the present invention provides a method for intelligent coagulant dosing control based on image recognition and multi-parameter modeling, comprising the following steps:
[0010] S1. Collect floc images from the coagulation sedimentation tank, perform image processing and floc feature extraction, and construct a floc image description vector;
[0011] S2. Constructing time series input structure data for fusing floc images and water quality data. In the time series input structure data, floc image sampling at each moment is defined as a time frame, and each frame contains three types of data.
[0012] The first type of data is the texture features and morphological features extracted from the floc image at the current moment, recorded as the floc image joint feature vector; the second type of data is the real-time influent water quality parameters at the floc image sampling moment, which are the current water quality parameters; the third type of data is the water quality parameters at the moment when the raw water corresponding to the floc image is injected into the sedimentation tank, which are the previous water quality parameters;
[0013] S3. Using data enhancement and sample balancing strategies to enhance and reconstruct the training data of the dosage prediction model to obtain continuously distributed synthetic samples;
[0014] S4. Construct a dosing dosage prediction model enhanced by hierarchical feature fusion, fuse the previous water quality parameters, current water quality parameters and floc image joint feature vector, and optimize the dosing dosage prediction accuracy layer by layer.
[0015] On the other hand, the present invention provides a coagulant intelligent dosing control system based on image recognition and multi-parameter modeling, comprising:
[0016] The floc image acquisition and processing module collects floc images from the coagulation sedimentation tank, performs image processing and floc feature extraction, and constructs a floc image description vector;
[0017] The time series frame structure construction module constructs the time series input structure data that integrates the floc image and water quality data. In the time series input structure data, the floc image sampling at each moment is defined as a time frame, and each frame contains three types of data;
[0018] The first type of data is the texture features and morphological features extracted from the floc image at the current moment, recorded as the floc image joint feature vector; the second type of data is the real-time influent water quality parameters at the floc image sampling moment, which are the current water quality parameters; the third type of data is the water quality parameters at the moment when the raw water corresponding to the floc image is injected into the sedimentation tank, which are the previous water quality parameters;
[0019] The data enhancement and reconstruction module uses data enhancement and sample balancing strategies to enhance and reconstruct the training data of the dosage prediction model to obtain continuously distributed synthetic samples;
[0020] The prediction module constructs a dosing prediction model enhanced by hierarchical feature fusion, which integrates the previous water quality parameters, current water quality parameters and the joint feature vector of floc image to optimize the prediction accuracy of dosing layer by layer.
[0021] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0022] 1. This invention builds a complete underwater image acquisition system, combines image enhancement and multi-feature extraction technology, and uses a phased gradient boosting decision tree model (GBDT) to fuse water quality parameters, image features and time series data to achieve accurate prediction of coagulant dosage, thereby solving the problems of low control accuracy, poor response time, weak model generalization ability, and inability to cope with complex environments in existing technologies.
[0023] 2. The present invention innovatively introduces a time series input structure, combines data from different time frames, and explicitly models the time lag characteristics of coagulation reactions; and uses technologies such as SMOTE data enhancement to improve the model's learning ability for extreme high-turbidity samples, significantly enhancing the model's robustness and generalization capabilities under variable water quality conditions, ultimately achieving automated, intelligent, and refined control of coagulant addition, significantly improving water plant operating efficiency, reducing drug consumption and labor costs, and is suitable for promotion and application in large-scale water plants under complex dynamic water source conditions.
[0024] 3. Compared to existing rule-based control methods, this invention utilizes a machine learning approach based on gradient boosting trees to model the nonlinear mapping relationship between water quality, image, and dosage in stages, resulting in stronger generalization and adaptive performance. The system does not rely on manually formulated judgment rules, but instead develops an accurate regression model through large-sample data training. This allows for stable operation despite varying water sources, seasons, and water quality disturbances.
[0025] 4. Existing technologies fail to account for the time lag between coagulation and floc formation, leading to discrepancies between prediction and execution. This invention innovatively constructs a "time frame" structure, incorporating continuous information such as water quality parameters and image features at both feedforward and feedback points into model training. This explicitly models the time lag effect, fundamentally resolving the prediction bias caused by control delays.
[0026] 5. Traditional models often suffer from inaccurate predictions in highly turbid water due to missing samples and are prone to failure in extreme situations. This invention uses data augmentation technology to effectively expand the number of minority class samples in the training set, enabling the model to maintain high judgment and control effectiveness in abnormal situations such as sudden water pollution and heavy rain. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 1 is a flow chart of a method for controlling the intelligent dosing of a coagulant according to an embodiment of the present invention;
[0028] Figure 2 Schematic diagram of the process of floc image processing and feature extraction in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The present invention will be described in further detail below with reference to the embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0030] Example
[0031] like Figure 1 、 Figure 2 As shown, the intelligent coagulant dosing control method based on image recognition and multi-parameter modeling in this embodiment includes the following steps:
[0032] S1. Collect floc images from the coagulation sedimentation tank, perform image processing and floc feature extraction, and construct a floc image description vector.
[0033] An underwater image acquisition device was deployed in a coagulation sedimentation tank to capture images of the floc formation process, known as floc images. These images were then enhanced and pre-processed to improve their recognizability. Flocs, also known as alum flocs, are formed when alum hydrolyzes and adsorbs impurities in the water, thus separating the impurities.
[0034] In this example, because images of the floc formation process were captured underwater in low-light conditions, image enhancement employed the MSRCR algorithm to perform color correction and contrast optimization on these low-light underwater images. Subsequently, geometric correction was performed using an image distortion correction method, and the image center region was cropped to minimize distortion and illumination interference. The enhanced images were then subjected to adaptive threshold segmentation and morphological filtering to identify the floc outlines. Gray-level co-occurrence matrix (GLCM) analysis was then applied to calculate the floc image's texture feature parameters, which were then combined with basic geometric features to construct a floc image description vector.
[0035] After obtaining the floc outline, feature extraction is performed on the floc image. The extracted features include the following: floc boundary area, perimeter, roundness, eccentricity, compactness, number density, and average particle size. These features are quantified into a set of feature vectors for modeling by calculating the overall image mean and standard deviation to fully reflect the physical morphology of the floc formation. After floc image enhancement and outline extraction, the texture and structural features are calculated.
[0036] S11. Extracting texture features of the floc image through the floc gray-level co-occurrence matrix and generating a texture feature vector.
[0037] This embodiment uses the gray level co-occurrence matrix GLCM method to perform statistical analysis on the image gray space to extract the local texture characteristics of the floc image and construct the texture feature vector The specific steps are as follows:
[0038] S111. Calculate the gray-level co-occurrence matrix G for each flocculent image frame. Under preset direction and distance parameters, extract the following five types of texture statistics from the gray-level co-occurrence matrix:
[0039] Energy used to measure the uniformity of image grayscale distribution:
[0040] ;
[0041] Contrast is a measure of the intensity of local changes in pixel gray levels in an image:
[0042] ;
[0043] Entropy used to describe the complexity and randomness of the image grayscale distribution:
[0044] ;
[0045] Correlation used to characterize the linear correlation between pixel grayscale values:
[0046] ;
[0047] in, Represents the gray-level co-occurrence matrix Rank Elements of the column, 、 Respectively expressed in 、 The mean in the direction, 、 Respectively expressed in 、 Standard deviation in direction.
[0048] S112, the five types of texture statistics extracted are combined into a texture feature vector of the floc image at time t:
[0049] ;
[0050] S12. Extract several types of morphological parameters from the floc edge contour, obtain the floc geometric morphological characteristics, and construct the structural feature vector ; The specific geometric morphological characteristics of flocs include:
[0051] The area of the pixel-occupied region used to represent flocs:
[0052] ;
[0053] The perimeter used to represent the total length of the floc edge outline:
[0054] ;
[0055] Minimum circumcircle radius:
[0056] ;
[0057] The equivalent particle size of the flocs can be estimated using the diameter of a circle of equal area:
[0058] ;
[0059] Roundness is used to evaluate the degree to which the flocs' outline is close to a circle:
[0060] ;
[0061] Compactness is used to measure the complexity and compactness of the floc edge:
[0062] ;
[0063] The eccentricity, which reflects the flatness of the shape, is calculated from the ratio of the major and minor axes of the fitted ellipse:
[0064] ;
[0065] The fractal dimension of the contour roughness is estimated by the relationship between the logarithmic area and the perimeter:
[0066] ;
[0067] The structural feature vector is in the form of:
[0068] ;
[0069] S13, concatenate the texture feature vector and the structural feature vector in the channel dimension to form a complete floc image description vector :
[0070] ;
[0071] The floc image description vector is a joint eigenvector, which not only comprehensively reflects the texture evolution of the flocs in the microscopic image, but also accurately depicts its geometric morphology that develops over time during the coagulation process, providing a high-dimensional effective input for the construction of the subsequent coagulant dosage control model.
[0072] S2. Constructing time series input structure data for fusing floc images and water quality data.
[0073] To accurately model the temporal response characteristics of the coagulation and sedimentation process, this example proposes a time-series input structure that integrates floc images and water quality data, fully accounting for the lag properties of floc formation and data correlation. Given that floc image formation typically lags behind the time when raw water enters the coagulation and sedimentation tank, failure to incorporate a time-delay modeling mechanism would directly impact the model's responsiveness to water quality changes and control accuracy.
[0074] In this embodiment, the sampling of the flocculent image at each moment in the time series input structure data is defined as a time frame. Each frame contains three types of key data: the first is the texture features and morphological features extracted from the flocculent image at the current moment, recorded as the flocculent image joint feature vector , which is used to reflect the feedback status of the current system; the second is the real-time influent water quality parameters (such as turbidity, pH, water temperature, etc.) at the time of sampling the floc image, recorded as , is the current water quality parameter; the third is the water quality parameter when the raw water corresponding to the floc image is injected into the sedimentation tank , which is the previous water quality parameter, also known as historical raw water data, is used to provide feedforward control input. Among the three types of key data mentioned above, there is a time delay between the current water quality parameter and the previous water quality parameter, and the two have the same water quality parameter dimension.
[0075] In order to achieve accurate synchronization of feedforward parameters, this embodiment proposes a dynamic time-delay calculation method based on flow integration to construct time series input structure data. Assume that the current floc image sampling time is , the system starts from the sampling moment Flow data traced back to the time when raw water was injected into the sedimentation tank , and perform integral operation. When the accumulated water volume of the integral operation reaches the effective treatment volume of the sedimentation tank The corresponding time point It can be regarded as the moment when the raw water corresponding to the floc image is injected into the sedimentation tank, that is:
[0076] ;
[0077] in, Indicates the sampling time of floc image The dynamic lag time between the time when the raw water is injected into the sedimentation tank, For sedimentation tank at time The instantaneous water inflow rate, is the effective treatment volume of the sedimentation tank; is a time variable to be searched, indicating the sampling time from the current floc image The length of the time window is pushed forward until the cumulative water inflow during this period reaches the effective treatment capacity of the sedimentation tank.
[0078] Through the above calculation method, the lag time can be automatically adjusted according to the flow rate under different operating conditions, effectively solving the problem that static empirical values cannot adapt to dynamic changes, and enhancing the robustness and real-time performance of the model.
[0079] Finally, the temporal input structure of the fused floc image and water quality data can be expressed as a time window input sequence of length N:
[0080] ;
[0081] in, The sampling time Input clips for the timing of the benchmark; is the timeframe relative subscript; Indicates the Flocculation image features of the frame; Indicates the Real-time inlet water quality parameters of the frame; For the The dynamic lag time corresponding to the frame flocculent image; Indicates the The water quality parameters of the raw water corresponding to the frame floc image at the moment when it is injected into the sedimentation tank.
[0082] This time series input structure not only realizes the organic integration of floc images, current water quality and lagged water quality information, but also accurately simulates the floc response process through flow-driven dynamic time lag estimation. Multiple frames of data are connected in series on a time axis to form a continuous time series input, so that the model can not only identify the current and past states, but also perceive time lags, improving the response capability and control accuracy to abnormal water quality changes, and effectively solving the technical blind spot that "the current floc image reflects the raw water state several times ago."
[0083] This step establishes a time series input structure and a coagulation reaction hysteresis modeling mechanism. Unlike existing coagulation control systems, which typically ignore time lag effects and rely solely on "static judgment" based on current images or water quality data, this embodiment innovatively designs a time series input structure based on the physical process characteristics of the coagulation reaction and constructs an explicit hysteresis modeling mechanism, fundamentally addressing the inability of traditional models to respond accurately.
[0084] In this embodiment, during each sampling session, the collected floc image joint feature vector, the real-time influent water quality parameters at the time of floc image sampling, and the historical raw water data corresponding to the floc image (i.e., the feedforward influent parameters) are combined into a complete time frame input structure. Multiple frames of continuous input are then constructed in chronological order to train the dosing prediction model. This time frame input structure has the following advantages:
[0085] The physical time lag of the entire process from raw water inflow, coagulant addition, floc formation, and image recognition feedback is taken into account, so that the model can clearly map the "historical water quality" status reflected by the current image information;
[0086] The introduction of time series gives the model memory capabilities, enabling it to learn changing trends from multiple frames of historical data and respond to sudden changes in water quality in advance;
[0087] Compared with the single-frame input structure, time series modeling can better smooth out local noise and single sampling errors, thereby improving the robustness and consistency of the overall prediction.
[0088] S3. Data enhancement and sample balancing strategies are used to enhance and reconstruct the training data of the dosage prediction model to obtain continuously distributed synthetic samples.
[0089] To improve the stability and predictive power of the dosage prediction model under extreme water quality conditions, this embodiment introduces a data augmentation mechanism to enhance the training data before modeling. To address sample imbalance, particularly during coagulant dosage prediction, where the training data distribution is skewed due to low actual dosage under some operating conditions, this embodiment introduces the Synthetic Minority Over-sampling Technique (SMOTE) to reconstruct the training data and enhance the dosage prediction model's ability to learn from low-frequency dosage conditions.
[0090] Assume that the minority class sample set in the original training set is , for each of the samples , in its Randomly select a neighbor from the nearest neighbor sample , generate new samples by linear interpolation:
[0091] ;
[0092] in From a uniform distribution The interpolation coefficients of the samples are used to construct synthetic samples with continuous distribution.
[0093] Through data enhancement processing and the introduction of enhanced samples, the model's recognition ability under different water quality conditions is improved, especially maintaining high prediction accuracy during abnormal water quality fluctuations (such as heavy rain, flooding, etc.), effectively avoiding the failure of the dosage prediction model due to training sample bias.
[0094] Through data reconstruction, the distribution range of minority class samples is expanded in the feature space, which significantly alleviates the impact of sample category imbalance on the prediction model training process, and helps to improve the generalization ability and robustness of the prediction model for various dosage intervals.
[0095] S4. Construct a dosing dosage prediction model enhanced by hierarchical feature fusion, fuse the previous water quality parameters, current water quality parameters and floc image joint feature vector, and optimize the dosing dosage prediction accuracy layer by layer.
[0096] To address the problems of multivariable coupling and prediction bias in the coagulation process and achieve high-precision prediction and dynamic adaptive control of coagulant dosage, this example proposes a hierarchical feature fusion boosting network (HFFBN) model. This model is based on the gradient boosting decision tree (GBDT) framework and adopts a two-stage prediction mechanism. It fuses the joint feature vectors of previous and current water quality parameters and floc images to optimize the prediction accuracy of dosage layer by layer.
[0097] S41. In the first stage, a regression model is constructed to make a preliminary prediction of the coagulant dosage demand based on the previous water quality parameters and obtain the preliminary prediction value.
[0098] In the first stage, the previous water quality parameters in the time series input structure data of step S2 are used as the input of the model to roughly determine the current coagulant dosage. Specifically, the HFFBN model uses the water quality parameters of the raw water at the time of injection into the sedimentation tank corresponding to the floc image as the input of the model. As input, the initial coagulant dosage requirement under macro-environmental conditions is fitted, and a regression model is constructed based on the primary mapping relationship between water quality and preliminary predicted dosage values:
[0099] ;
[0100] The regression model is trained based on GBDT and consists of multiple CART subtrees to minimize the following square loss function:
[0101] ;
[0102] in, represents the true value, represents the predicted value output by the first-stage regression model, represents the function learned by the regression model in the first stage, The total loss function representing the squared error loss of the first stage.
[0103] Each round of iteration learns the negative gradient direction between the current predicted value and the true value, that is, the residual term of the first-stage regression model is:
[0104] ;
[0105] in, represents the residual between the predicted value and the true value of the first-stage regression model, It represents the predicted value of the m-1th round of iterative learning in the first stage, and represents the partial derivative of the total loss function of the square error loss in the first stage with respect to the predicted value.
[0106] For the regression tree constructed in the mth iteration Perform training to fit the residual term and update the predicted value:
[0107] ;
[0108] in represents the predicted value of the mth round of iterative learning in the first stage; is the learning rate of the first-stage regression model, which is used to control the influence of each CART subtree on the final model; Indicates that in the mth round, by constructing a regression tree, the input water quality parameters The residual fitted value obtained after feature learning.
[0109] By gradually stacking subtrees, a nonlinear prediction function is constructed:
[0110] ;
[0111] in, It represents the total number of regression subtrees constructed in the first-stage regression model, that is, the number of iterations or weak learners used to fit the preliminary dosing prediction function.
[0112] Finally, the coagulant dosage requirement (i.e. dosage) is predicted by the above nonlinear prediction function to obtain the preliminary prediction value. .
[0113] To further improve the prediction accuracy, before building the second-stage fine-tuning model, it is necessary to calculate the prediction residual based on the difference between the preliminary prediction value output in the first stage and the actual dosage:
[0114] ;
[0115] in, Represents the prediction residual of the first-stage regression model. This prediction residual is used as the supervision target of the second-stage model to subsequently introduce image feature information for error correction.
[0116] S42. In the second stage, a fine-tuning model for the coagulant dosage is constructed. According to the current water quality parameters, the joint feature vector of the floc image, and the preliminary prediction value obtained by the regression model, the coagulant dosage is dynamically and adaptively adjusted to obtain the fine-tuning prediction value.
[0117] The initial prediction value often cannot fully reflect the floc state, and it is difficult to reflect the actual situation. Therefore, the real-time influent water quality parameters at the current floc image sampling time are introduced in the second stage. and the joint feature vector of the floc image ,Combined with the preliminary prediction values obtained by the first stage regression model, a more comprehensive input vector is constructed for training and fine-tuning the hierarchical feature fusion enhancement model.
[0118] After the first stage is completed, HFFBN will predict the residual As the learning goal of the second stage, the water quality parameters of the current floc image sampling moment are introduced Combined feature vector with floc image To form the extended input:
[0119] ;
[0120] Further build the second stage fine-tuning model :
[0121] ;
[0122] in, represents the predicted value output by the second stage fine-tuning model, represents the function learned by the second stage fine-tuning model.
[0123] The second stage fine-tuning model is also trained using the GBDT architecture, optimizing the following loss function:
[0124] ;
[0125] in, The total loss function representing the squared error loss of the second-stage fine-tuning model.
[0126] In each round of iteration, the negative gradient of the predicted residual obtained in the first-stage regression model is calculated as the new residual, that is, the residual term of the second-stage fine-tuning model:
[0127] ;
[0128] The update process of the fine-tuning model prediction value is as follows:
[0129] ;
[0130] in, Fine-tune the learning rate of the model for the second stage; Indicates that in the mth round, by building a regression tree, the extended input The residual fitted value obtained after learning.
[0131] S43. Superimpose the preliminary prediction value and the fine-tuned prediction value to obtain the final prediction value.
[0132] That is, the final prediction value is the superposition of the outputs of the two stages:
[0133] ;
[0134] In this step, a hierarchical feature fusion enhanced dosage prediction model (HFFBN) was constructed. For the first time, it was proposed to decompose the coagulant dosage prediction modeling process into a two-stage structure of "initial prediction + fine adjustment". A two-layer regression model was constructed based on the gradient boosting decision tree (GBDT) algorithm to realize the hierarchical processing and information integration of feedforward and feedback data.
[0135] The HFFBN prediction model utilizes a two-stage dosage prediction architecture based on GBDT, demonstrating excellent nonlinear fitting capabilities and engineering adaptability. The first stage uses real-time influent water quality parameters at the time of historical floc image sampling as input to predict baseline dosage levels, reflecting normal operating conditions. The second stage integrates the real-time influent water quality parameters at the current floc image sampling time with the floc image joint feature vector to enable real-time fine-tuning of dosage. This creates a hierarchical modeling strategy of "coarse adjustment first, fine adjustment later," enhancing system intelligence and responsiveness.
[0136] Unlike existing "single-stage models" or "static feature models," this two-stage structure explicitly distinguishes between the logical hierarchies of prediction driven by raw water characteristics and correction of response results. This effectively reduces prediction bias caused by drastic water quality fluctuations or inconsistent sampling. The GBDT algorithm inherently possesses strong feature selection and robustness, avoiding the reliance of deep neural networks on massive samples. It is therefore suitable for engineering scenarios where water plant data is limited and incompletely annotated.
[0137] The above two-stage model structure realizes the organic combination of the feedforward prediction mechanism driven by the water quality parameters and the result fine-tuning mechanism of image feature feedback, which enhances the fault tolerance of the prediction model to emergencies, water quality disturbances and system lags, and is the key support for the present invention to achieve the core goal of intelligent dosing control.
[0138] Based on the same inventive concept, this embodiment also provides a coagulant intelligent dosing control system based on image recognition and multi-parameter modeling, including the following modules:
[0139] The floc image acquisition and processing module collects floc images from the coagulation sedimentation tank, performs image processing and floc feature extraction, and constructs a floc image description vector;
[0140] The time series frame structure construction module constructs the time series input structure data that integrates the floc image and water quality data. In the time series input structure data, the floc image sampling at each moment is defined as a time frame, and each frame contains three types of data;
[0141] The first type of data is the texture features and morphological features extracted from the floc image at the current moment, recorded as the floc image joint feature vector; the second type of data is the real-time influent water quality parameters at the floc image sampling moment, which are the current water quality parameters; the third type of data is the water quality parameters at the moment when the raw water corresponding to the floc image is injected into the sedimentation tank, which are the previous water quality parameters;
[0142] The data enhancement and reconstruction module uses data enhancement and sample balancing strategies to enhance and reconstruct the training data of the dosage prediction model to obtain continuously distributed synthetic samples;
[0143] The prediction module constructs a dosing prediction model enhanced by hierarchical feature fusion, which integrates the previous water quality parameters, current water quality parameters and the joint feature vector of floc image to optimize the prediction accuracy of dosing layer by layer.
[0144] The above modules are implemented using the corresponding steps of the control method in this embodiment.
[0145] Overall, this invention proposes an intelligent control method for intelligent coagulant dosing control that integrates image recognition, multi-parameter modeling, and time series input. This method offers adaptive capabilities and high-precision predictions in all weather and climate environments. Compared to existing empirical control methods that rely on static images or a single water quality indicator, this invention not only comprehensively upgrades the system structure and algorithmic logic but also systematically addresses the core challenges of traditional control models in areas such as hysteresis modeling, data source integration, prediction accuracy, and dynamic adaptability.
[0146] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.
Claims
1. A coagulant intelligent dosing control method based on image recognition and multi-parameter modeling, characterized in that: The following steps are involved: S1. Collect floc images from the coagulation sedimentation tank, perform image processing and floc feature extraction, and construct a floc image description vector; S2. Constructing time series input structure data for fusing floc images and water quality data. In the time series input structure data, floc image sampling at each moment is defined as a time frame, and each frame contains three types of data. The first type of data is the texture features and morphological features extracted from the floc image at the current moment, recorded as the floc image joint feature vector; the second type of data is the real-time influent water quality parameters at the floc image sampling moment, which are the current water quality parameters; the third type of data is the water quality parameters at the moment when the raw water corresponding to the floc image is injected into the sedimentation tank, which are the previous water quality parameters; S3. Using data enhancement and sample balancing strategies to enhance and reconstruct the training data of the dosage prediction model to obtain continuously distributed synthetic samples; S4. Construct a hierarchical feature fusion-enhanced dosage prediction model, fuse the previous water quality parameters, current water quality parameters and floc image joint feature vector, and optimize the dosage prediction accuracy layer by layer; Step S4 includes: S41. Construct a regression model to make a preliminary prediction of the coagulant dosage requirement based on the previous water quality parameters to obtain a preliminary prediction value; S42, constructing a fine-tuning model for the coagulant dosage, dynamically and adaptively adjusting the coagulant dosage based on the current water quality parameters, the floc image joint feature vector, and the preliminary prediction value obtained by the regression model to obtain a fine-tuning prediction value; S43. Superimpose the preliminary prediction value and the fine-tuned prediction value to obtain the final prediction value.
2. The coagulant intelligent dosing control method according to claim 1, characterized in that: Step S1 includes: S11, extracting texture features of the floc image through the floc gray-level co-occurrence matrix and generating a texture feature vector; S12, extracting several types of morphological parameters from the edge contour of the flocs, obtaining the geometric morphological characteristics of the flocs, and constructing a structural feature vector; S13. Concatenate the texture feature vector and the structural feature vector in the channel dimension to form a complete floc image description vector.
3. The intelligent coagulant dosing control method according to claim 1, characterized in that: Step S2 uses a dynamic time-lag calculation method based on flow integration to construct time series input structure data; Assume that the current floc image sampling time is , from the sampling time Flow data traced back to the time when raw water was injected into the sedimentation tank , and perform integral operation; when the accumulated water volume of the integral operation reaches the effective treatment volume of the sedimentation tank The corresponding time point It can be regarded as the moment when the raw water corresponding to the floc image is injected into the sedimentation tank, that is: ; in, Indicates the sampling time of floc image The dynamic lag time between the time when the raw water is injected into the sedimentation tank, For sedimentation tank at time The instantaneous water inflow rate.
4. The intelligent coagulant dosing control method according to claim 3, characterized in that: The time series input structure data constructed in step S2 is a time window input sequence with a length of N: ; in, The sampling time Input clips for the timing of the benchmark; is the timeframe relative subscript; Indicates the Flocculation image features of the frame; Indicates the Real-time inlet water quality parameters of the frame; For the The dynamic lag time corresponding to the frame flocculent image; Indicates the The water quality parameters of the raw water corresponding to the frame floc image at the moment when it is injected into the sedimentation tank.
5. The intelligent coagulant dosing control method according to claim 1, characterized in that: Step S3 reconstructs the training data using synthetic minority class oversampling technology; Assume that the minority class sample set in the original training set is , for each of the samples , in its Randomly select a neighbor from the nearest neighbor sample , generate new samples by linear interpolation: ; in From a uniform distribution The interpolation coefficients of the samples are used to construct synthetic samples with continuous distribution.
6. The intelligent coagulant dosing control method according to claim 1, characterized in that: Step S41 uses the water quality parameters of the raw water corresponding to the floc image at the time of injection into the sedimentation tank as input, fits the initial coagulant dosage requirements under macro-environmental conditions, and constructs a regression model based on the primary mapping relationship between water quality and preliminary predicted dosage values: ; The regression model is trained based on GBDT and consists of multiple CART subtrees to minimize the following square loss function: ; in, represents the true value, represents the predicted value output by the regression model, represents the function learned by the regression model, represents the total loss function of the squared error loss in the first stage, Indicates the water quality parameters of the raw water corresponding to the floc image at the moment when it is injected into the sedimentation tank; Each round of iteration learns the negative gradient direction between the current predicted value and the true value, and the residual term of the regression model is: ; in, represents the residual between the predicted value and the true value of the regression model, represents the predicted value of the m-1th round of iterative learning, The partial derivative of the total loss function with respect to the predicted value, which represents the squared error loss; Train the regression tree constructed in the mth iteration to fit the residual term and update the predicted value: ; in Represents the predicted value of the mth round of iterative learning; is the learning rate of the regression model; Indicates that in the mth round, by constructing a regression tree, the input water quality parameters The residual fitting value obtained after feature learning; By gradually stacking subtrees, a nonlinear prediction function is constructed: ; in, Represents the total number of regression subtrees constructed in the regression model; The coagulant dosage demand is predicted by the nonlinear prediction function to obtain a preliminary prediction value. .
7. The intelligent coagulant dosing control method according to claim 1, characterized in that: Based on the difference between the initial predicted value output by the regression model in step S41 and the actual dosage, the prediction residual is calculated ; Step S42 uses the prediction residual as the learning target and introduces the water quality parameters at the current floc image sampling time and the joint feature vector of the floc image To form the extended input: ; And build a fine-tuned model : ; in, represents the predicted value output by the fine-tuned model, represents the function learned by the fine-tuning model; The fine-tuning model is also trained using the GBDT architecture, optimizing the following loss function: ; in, The total loss function representing the squared error loss of the fine-tuned model; In each round of iteration, the negative gradient of the predicted residual obtained in the regression model is calculated as the new residual, that is, the residual term of the fine-tuning model: ; The update process of the prediction value of the fine-tuned model is as follows: ; in, The learning rate for fine-tuning the model; Indicates that in the mth round, by building a regression tree, the extended input The residual fitted value obtained after learning.
8. The coagulant intelligent dosing control method according to claim 2, characterized in that: Step S11 first calculates the gray level co-occurrence matrix for each frame of the floc image. Under preset direction and distance parameters, several types of texture statistics are extracted from the gray level co-occurrence matrix, including energy for measuring the uniformity of the image grayscale distribution, contrast for measuring the intensity of local changes in pixel grayscale levels in the image, entropy for describing the complexity and randomness of the image grayscale distribution, and correlation for characterizing the linear correlation between pixel grayscale values. The extracted several types of texture statistics are then combined to form a texture feature vector of the floc image at time t. The geometric morphological features of the flocs obtained in step S12 include the area of the pixel-occupied area of the flocs, the circumference used to represent the total length of the floc edge contour, the minimum circumscribed circle radius, the equivalent particle size for estimating the floc size using the diameter of a circle of equal area, the roundness for evaluating the degree to which the floc contour shape is close to a circle, the compactness for measuring the complexity and compactness of the floc edge, the eccentricity, and the fractal dimension for estimating the contour roughness using the changing relationship between the logarithmic area and the circumference.
9. An intelligent coagulant dosing control system based on image recognition and multi-parameter modeling, characterized in that: The control method according to any one of claims 1 to 8 is used for implementation, wherein the control system comprises: The floc image acquisition and processing module collects floc images from the coagulation sedimentation tank, performs image processing and floc feature extraction, and constructs a floc image description vector; The time series frame structure construction module constructs the time series input structure data that integrates the floc image and water quality data. In the time series input structure data, the floc image sampling at each moment is defined as a time frame, and each frame contains three types of data; The first type of data is the texture features and morphological features extracted from the floc image at the current moment, recorded as the floc image joint feature vector; the second type of data is the real-time influent water quality parameters at the floc image sampling moment, which are the current water quality parameters; the third type of data is the water quality parameters at the moment when the raw water corresponding to the floc image is injected into the sedimentation tank, which are the previous water quality parameters; The data enhancement and reconstruction module uses data enhancement and sample balancing strategies to enhance and reconstruct the training data of the dosage prediction model to obtain continuously distributed synthetic samples; The prediction module constructs a dosing prediction model enhanced by hierarchical feature fusion, which integrates the previous water quality parameters, current water quality parameters and the joint feature vector of floc image to optimize the prediction accuracy of dosing layer by layer.
Citation Information
Patent Citations
Novel water treatment method based on machine vision and device thereof
CN103708592A
Water plant real-time dosing amount prediction method and device based on decision tree algorithm, and medium
CN113687040A