Method and system for identifying macro mode of alumen ustum cluster
By using dynamic polarization image acquisition and multi-scale convolutional neural network to identify the macro-modality of floc clusters, and combining fuzzy PID and reinforcement learning to achieve adaptive dosing control, the problems of inaccurate floc cluster identification and slow system response were solved, thus improving the stability and efficiency of the flocculation process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-03-13
AI Technical Summary
In existing technologies, the macroscopic characteristics of floc clusters in flocculation and sedimentation processes are not accurately identified, leading to unstable dosing control. Furthermore, existing systems are difficult to adapt to complex working conditions and require rapid response, resulting in long overall response times and low system integration.
Employing dynamic polarization image acquisition, multi-scale convolutional neural networks, and fusion control algorithms, the system corrects images by optically marking target points, identifies macro-modalities of *Hemiberlesia lataniae* clusters, and combines fuzzy PID and reinforcement learning modules to achieve adaptive dosing control. Image processing is completed locally, enabling rapid response.
It improves the accuracy of alum floc feature recognition and the system's adaptability, shortens the response time, enhances the stability and efficiency of the flocculation process, and reduces drug consumption and maintenance frequency.
Smart Images

Figure CN121661388A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wastewater treatment technology, and in particular relates to a method and system for macromodal identification of alum floc clusters. Background Technology
[0002] In the flocculation and sedimentation processes of waterworks and wastewater treatment plants, the internal space of the tank is typically divided into a flocculation tank and a sedimentation tank by a weir. Flocculants are added to the flocculation tank to induce flocculation in the raw water (usually characterized by the formation of "flocs"). The flocculated water then flows through the weir into the sedimentation tank, where the flocs are projected in a parabolic shape before settling. The quality of the flocculation directly determines the effluent quality and operating costs. Currently, the monitoring and control of flocculation primarily relies on automated technologies based on machine vision or human experience, but several technical bottlenecks remain to be addressed.
[0003] 1. Existing technologies typically acquire images of flocs using submerged underwater cameras and employ traditional image processing algorithms (such as thresholding and contour extraction) to identify and statistically analyze the physical characteristics (such as size, quantity, and density) of individual flocs, using these microscopic statistical values as indicators for evaluating flocculation effectiveness. However, the settling performance of flocs is actually determined by the overall macroscopic characteristics of a cluster composed of billions of flocs. The existing technologies lack a direct and accurate mapping relationship between the microscopic indicators (such as average size or quantity) and the overall settling properties of the floc cluster, leading to a disconnect between dosing control based on these indicators and actual sedimentation results, and an inability to accurately reflect and predict effluent turbidity.
[0004] 2. Existing machine vision-based recognition methods suffer from severe deficiencies in accuracy and stability under complex real-world conditions. Factors such as numerous air bubbles in the water, surface reflections, and turbidity changes due to sudden shifts in water quality can severely interfere with image acquisition, making it difficult for traditional algorithms to accurately segment and identify alum floc targets. This results in a large number of false positives and false negatives, distorting measurement data and significantly reducing reliability.
[0005] 3. Existing automatic dosing control systems mostly employ control methods based on fixed mathematical models (such as simple PID control) or establish simple linear relationships between water quality parameters (such as raw water flow rate and turbidity) and dosing dosage. The flocculation process is a complex, multivariate, nonlinear, and time-delayed process, its effectiveness influenced by a dozen factors including the type of chemical, water temperature, pH value, influent flow rate, and water quality fluctuations. Existing control strategies struggle to characterize and adapt to this complex nonlinear relationship, lacking self-learning and adaptive capabilities. When faced with seasonal changes, sudden changes in water quality, and other operational conditions, the control effect is poor, still requiring manual intervention and parameter adjustments based on experience, making it difficult to achieve continuous and stable optimal control.
[0006] 4. Some existing technical solutions employ a model of uploading image data to a cloud server for centralized processing and analysis. This architecture introduces significant network transmission latency, resulting in an excessively long overall response time from image acquisition to control execution, which cannot meet the stringent real-time control requirements of the rapidly changing flocculation process. Furthermore, the system suffers from low integration with existing distributed control systems (DCS) or programmable logic controllers (PLCs) in water plants, leading to complex deployment and hindering efficient "plug-and-play" operation and stable, reliable collaborative work.
[0007] Therefore, it is of great significance to study a macro-modal recognition method and system for *Hemiberlesia lataniae* clusters to address the above-mentioned shortcomings. Summary of the Invention
[0008] In view of this, the present invention aims to overcome the shortcomings of the above-mentioned problems in the prior art and proposes a method and system for macromodal recognition of alum flower clusters.
[0009] To achieve the above objectives, the technical solution of the present invention is implemented as follows:
[0010] The first aspect of this invention also provides a method for macromodal identification of *Hemiberlesia lataniae* clusters, comprising the following steps:
[0011] S1. Dynamic polarization images of the flocculation tank outlet area, including optically marked target points, are acquired and used as the raw images;
[0012] S2. Correct the color and geometric features of the original image based on the optically marked target points to obtain the corrected image;
[0013] S3. Input the corrected image into a pre-trained multi-scale convolutional neural network model, collect the contour edges of the corrected image, and output a binarized mask image of the macro-modality of the alum cluster in the corrected image.
[0014] S4. Calculate the total pixel area of the alum flower region in the binarized mask image, use it as the area of the alum flower cluster projection in the current frame, and perform filtering processing;
[0015] S5. Read the current water quality parameters and the projected area of the filtered flocculent cluster in real time, and output dynamic dosing instructions.
[0016] Furthermore, it also includes the following steps:
[0017] S6. Control the actuator response via dosing commands;
[0018] S7. Determine whether the operating status is stable based on the fluctuation of effluent turbidity, the rate of change of the projected area of the filtered flocculent cluster, and the adjustment range of the dosing command. If yes, proceed to step S8; otherwise, proceed to step S10.
[0019] S8. Enter self-learning optimization mode, store the current control process as a positive sample in the experience replay buffer, update the policy network parameters, and dynamically adjust the weights of the fuzzy rule base.
[0020] S9. Maintain the current parameters, return to step S1, and continue the next round of dynamic polarization image acquisition;
[0021] S10. Trigger the retrospective diagnostic mechanism to check image quality issues, including signal-to-noise ratio, integrity of optical marker target recognition, and presence of abnormal interference;
[0022] S11. If the signal-to-noise ratio is less than the preset value, the optical marker target loss is greater than or equal to the preset value, or the binarization false detection rate is greater than the preset value, then proceed to step S12; otherwise, proceed to step S13.
[0023] S12. Feedback to step S1, dynamically adjust the polarization angle of the light entering the camera lens during the imaging process of the alum flower cluster, and re-acquire the dynamic polarization image;
[0024] S13. Feedback to step S5, adjust the fuzzy PID parameters, enhance the exploration rate, and make a new decision.
[0025] Furthermore, the water quality parameters in step S5 include the total phosphorus concentration, flow rate, and pH value of the raw water.
[0026] Furthermore, in step S7, if the turbidity fluctuation of the effluent is less than or equal to ±5%, the change rate of the projected area of the filtered flocculent cluster is less than 2% / min, and the adjustment range of the dosing command is less than or equal to 5%, then the operating status is considered stable.
[0027] Furthermore, in step S11, the preset value of signal-to-noise ratio is 20dB, the preset value of optical target point loss is 2, and the preset value of binarization false detection rate is 10%.
[0028] A second aspect of the present invention also provides a macromodal recognition system for *Hemiberlesia lataniae* clusters, comprising:
[0029] The image acquisition module is used to dynamically acquire polarized images of the flocculation tank outlet area, including optical marker targets. It includes an industrial camera, a dynamic polarizing lens, and optical marker targets. The dynamic polarizing lens is mounted below the industrial camera lens, and the industrial camera is mounted above the flocculation tank outlet area with its optical axis perpendicular to the water surface. The optical marker targets are placed at the edge of the tank or underwater. The dynamic polarizing lens includes a polarizing filter, an STM ring stepper motor, and a controller. The polarizing filter is fixed to the output end of the STM ring stepper motor via a ring bracket. The STM ring stepper motor is electrically connected to the controller, which is also connected to a GPS module and a real-time clock module. The GPS module obtains latitude and longitude information, and combined with the time information provided by the real-time clock module, the current azimuth and altitude angles of the sun are obtained. Based on the real-time acquired azimuth and altitude angles of the sun, a matching process is performed in a preset database to determine the polarization direction of the reflected light from the water surface in the current scene. The polarization angle of the polarizing filter is obtained based on the perpendicular relationship between the polarization direction of the polarizing filter and the polarization direction of the reflected light.
[0030] The correction module is used to correct the color and geometric features of the original image based on the optically marked target points to obtain a corrected image;
[0031] The macro-modal region extraction module is used to input the corrected image into a pre-trained multi-scale convolutional neural network model, collect the contour edges of the corrected image, and output a binarized mask image of the macro-modal of the alum cluster in the corrected image.
[0032] The processing module is used to calculate the total pixel area of the alum flower region in the binarized mask image, which is used as the area of the alum flower cluster projection in the current frame, and to perform filtering processing.
[0033] The intelligent decision-making module is used to read the current water quality parameters and the projected area of the filtered flocculent cluster in real time, and output dynamic dosing instructions.
[0034] Furthermore, it also includes:
[0035] The control module is used to control the response of the actuator through dosing commands;
[0036] The first judgment module is used to determine whether the system is operating stably based on the fluctuation of effluent turbidity, the rate of change of the projected area of the filtered flocculent cluster, and the adjustment range of the dosing command.
[0037] The reinforcement learning module is used to enter the self-learning optimization mode, store the current control process as a positive sample in the experience replay buffer, update the policy network parameters, and dynamically adjust the weights of the fuzzy rule base.
[0038] The process control module is used to maintain the current parameters and feed them back to the image acquisition module to continue the next round of dynamic polarization image acquisition;
[0039] The inspection module is used to trigger the retrospective diagnostic mechanism to check image quality issues, including signal-to-noise ratio, integrity of optical marker target recognition, and presence of abnormal interference.
[0040] The second judgment module determines that if the signal-to-noise ratio is less than the preset value, the optical marker target point loss is greater than or equal to the preset value, or the binarization false detection rate is greater than the preset value, then it switches to the first dynamic adjustment module; otherwise, it switches to the second dynamic adjustment module.
[0041] The first dynamic adjustment module is used to feed back to the image acquisition module to dynamically adjust the polarization angle of the light entering the camera lens during the imaging process of the alum flower cluster, and to re-acquire the dynamic polarization image.
[0042] The second dynamic adjustment module is used to feed back to the intelligent decision-making module, adjust the fuzzy PID parameters, enhance the exploration rate, and make a new decision.
[0043] Compared with the prior art, the present invention has the following advantages:
[0044] The macro-modal recognition method and system for alum floc clusters described in this invention have achieved significant improvements in image acquisition stability and anti-interference ability, alum floc feature recognition accuracy, dosing control adaptability, and system integration response performance. It also avoids the problems of underwater equipment pollution and frequent maintenance, has a simple structure, high reliability, and effectively improves water treatment efficiency. Attached Figure Description
[0045] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0046] Figure 1 This is a flowchart of the macro-modal recognition method for *Hemiberlesia lataniae* clusters according to an embodiment of the present invention;
[0047] Figure 2 This is a schematic diagram of the application of the alum cluster macromodal recognition system described in this embodiment of the invention in a pool.
[0048] Figure 3 This is a schematic diagram of the industrial camera structure according to an embodiment of the present invention;
[0049] Figure 4 This is a data display chart showing the application of the present invention in an example of continuous operation for 50 days.
[0050] Explanation of reference numerals in the attached figures:
[0051] 1. Pool body; 2. Baffle weir; 3. Flocculation tank; 4. Sedimentation tank; 5. Industrial camera; 6. Optical marker target; 7. Floc cluster projection; 8. Polarizing filter; 9. STM ring stepper motor; 10. Support; 11. Dynamic polarizing lens. Detailed Implementation
[0052] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0053] In the description of this invention, it should be understood that these descriptions are merely exemplary and not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0054] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0055] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0056] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0057] Example 1
[0058] like Figure 1 As shown, a method for macromodal recognition of *Hemiberlesia lataniae* clusters includes the following steps:
[0059] S1. Dynamic polarization images are acquired in the outlet area of flocculation tank 3, which includes optically marked target points, and used as the original images. Dynamic polarization images are image sequences that record the changes in the polarization state of light (the polarization state of light after it shines on an object and is reflected, scattered, or transmitted by the object, and finally enters the camera lens) over time.
[0060] S2. Correct the original image for color and geometric features based on the optical marker target points to obtain a corrected image; eliminate image deviations caused by camera angle, water wave refraction, etc., and ensure that images acquired at different time points have a uniform scale and color standard;
[0061] S3. Macro-modal region extraction: The corrected image is input into a pre-trained multi-scale convolutional neural network model to collect the contour edges of the corrected image and output as a binarized mask image of the macro-modal of the alum cluster in the corrected image; In this embodiment, the multi-scale convolutional neural network model is a conventional technical means that can be mastered by those skilled in the art, and its structure has not been improved in this solution;
[0062] S4. Calculate the total pixel area of the alum flower region in the binarized mask image, use it as the area of the alum flower cluster projection in the current frame, and perform filtering processing; where the alum flower cluster projection is the orthographic projection of the alum flower parabola on the horizontal plane.
[0063] S5. Real-time reading of current water quality parameters and the projected area of the filtered flocculent cluster, and output of dynamic dosing instructions; Here, the intelligent decision module reads the current water quality parameters and the projected area of the filtered flocculent cluster in real time and outputs dynamic dosing instructions, with a response delay of less than or equal to 200ms.
[0064] S6. The actuator responds to the dosing command to complete a closed-loop control action, and the control cycle is less than or equal to 1 second, which meets the rapid response requirements of the flocculation process.
[0065] S7. Determine whether the system is stable based on the fluctuation of effluent turbidity, the rate of change of the projected area of the filtered flocculent cluster, and the adjustment range of the dosing command. If yes, proceed to step S8; otherwise, proceed to step S10.
[0066] S8. Enter self-learning optimization mode, store the current control process as a positive sample in the experience replay buffer, update the policy network parameters, and dynamically adjust the weights of the fuzzy rule base to achieve the system's continuous self-evolution capability.
[0067] S9. Maintain the current parameters, return to step S1, and continue the next round of dynamic polarization image acquisition;
[0068] S10. Trigger the retrospective diagnostic mechanism to check image quality issues, including signal-to-noise ratio, integrity of optical marker target recognition, and presence of abnormal interference;
[0069] S11. If the signal-to-noise ratio is less than the preset value, the optical target point loss is greater than or equal to the preset value of optical target point loss, or the binarization false detection rate (referring to the proportion of pixels that should be background after binarization but are incorrectly identified as foreground when producing a binarized mask) is greater than the preset value of binarization false detection rate, then proceed to step S12; otherwise proceed to step S13.
[0070] S12. Feedback to step S1, dynamically adjust the polarization angle of the light entering the camera lens during the imaging process of the alum flower cluster, and re-acquire the dynamic polarization image;
[0071] S13. Feedback is sent to step S5 to adjust the fuzzy PID parameters, enhance the exploration rate, and make a new decision to form an adaptive closed loop of the control strategy.
[0072] The water quality parameters in step S5 include the total phosphorus concentration, flow rate, and pH value of the raw water.
[0073] In step S7, if the turbidity fluctuation of the effluent is less than or equal to ±5%, the change rate of the projected area of the filtered flocculent cluster is less than 2% / min, and the adjustment range of the dosing command is less than or equal to 5%, then the operating status is considered stable.
[0074] In step S11, the preset value for signal-to-noise ratio is 20dB, the preset value for optical target point loss is 2, and the preset value for binarization false detection rate is 10%.
[0075] In this embodiment, step S3 includes the multi-scale convolutional neural network model:
[0076] Convolutional layer 1 has a kernel size of 3x3, a stride of 1, and padding of 1; the number of kernels is 32; the activation function is ReLU; for multi-scale features, 3x3, 5x5, and 7x7 kernels are used in parallel to perform convolution operations to capture features at different scales. The outputs of the 5x5 and 7x7 kernels are reduced to the same number of channels as the 3x3 kernel by a 1x1 kernel, and then the feature maps of the three scales are concatenated along the channel dimension.
[0077] Pooling layer 1, pooling type is max pooling; pooling kernel size is 2x2, stride is 2; output size is H / 2x W / 2x 96;
[0078] The second convolutional layer has a kernel size of 3x3, a stride of 1, and padding of 1; the number of kernels is 64; the activation function is ReLU; the multi-scale features are performed by using 3x3, 5x5, and 7x7 convolutional kernels in parallel. The outputs of the 5x5 and 7x7 convolutional kernels are reduced to the same number of channels as the 3x3 convolutional kernel by a 1x1 convolutional kernel, and then the feature maps of the three scales are concatenated along the channel dimension.
[0079] Pooling layer 2, pooling type is max pooling; pooling kernel size is 2x2, stride is 2; output size is H / 4x W / 4x 192;
[0080] The third convolutional layer has a kernel size of 3x3, a stride of 1, and padding of 1; the number of kernels is 128; the activation function is ReLU; the multi-scale features are performed using 3x3, 5x5, and 7x7 convolutional kernels. The outputs of the 5x5 and 7x7 convolutional kernels are reduced to the same number of channels as the 3x3 convolutional kernel by a 1x1 convolutional kernel, and then the feature maps of the three scales are concatenated along the channel dimension.
[0081] Fully connected layer, upsampling method is bilinear interpolation; upsampling factor is 2; output size is H x W x 64;
[0082] Binarized mask, convolution kernel size 1x1, stride 1, padding 0; number of convolution kernels 1 (output is a binary mask image); activation function is Sigmoid; output is a binary mask image of the macromodality of the alum cluster in the original image.
[0083] In this embodiment, in step S4, to avoid drastic changes in the area value due to instantaneous fluctuations in water flow, the calculated area value is input into a low-pass digital filter function, the formula of which is:
[0084] Sfiltered=α·Sprevious+(1-α)·Scurrent,
[0085] Where α is the filtering coefficient, and in this embodiment, the value of α ranges from 0.3 to 0.8, which determines the degree of smoothing. When it is close to 1, the filter depends more on the previous value, the smoothing effect is stronger, but the response speed is slower; when it is close to 0, the filter depends more on the current value, the smoothing effect is weaker, but the response speed is faster; Sfiltered is the smoothed area value after filtering; Sprevious is the area value after filtering in the previous frame. This is the smoothed value that was calculated and stored before, and is used to perform a weighted average with the current value; Scurrent is the original area value of the current frame, which is the sum of white pixels directly calculated from the binarized mask image.
[0086] Example 2
[0087] like Figure 2 and Figure 3 As shown, a macromodal recognition system for *Hemiberlesia lataniae* clusters includes:
[0088] The image acquisition module is used to dynamically acquire polarized images of the flocculation tank outlet area, including optical marker targets. It includes an industrial camera 5, a dynamic polarizing lens 11, and optical marker targets 6. The dynamic polarizing lens is mounted below the industrial camera lens (or in front of the industrial camera lens if the direction of light entering the industrial camera is taken as a reference). The industrial camera is mounted above the flocculation tank outlet area via a bracket 10, with its optical axis perpendicular to the water surface. The optical marker targets are located at the edge of the tank 1 or underwater. The dynamic polarizing lens includes a polarizing filter 8, an STM ring stepper motor 9, and a controller. The polarizing filter is fixed to the STM ring stepper motor via a ring bracket. At the output of the stepper motor, the STM ring stepper motor is electrically connected to the controller, which controls it. The controller is also connected to a GPS module and a real-time clock module. The GPS module acquires latitude and longitude information, and combined with the time information (specifically year, month, day, hour, and minute) provided by the real-time clock (RTC) module, it obtains the current azimuth angle (the horizontal angle of the sun relative to the device) and altitude angle (the vertical angle between the sun and the horizon). Based on the real-time acquired azimuth and altitude angles, it matches them against a preset database to quickly determine the polarization direction of the reflected light from the water surface in the current scene. Based on the perpendicular relationship between the polarization direction of the polarization filter and the polarization direction of the reflected light, it obtains the polarization... The polarization angle of the filter; In this embodiment, obtaining the current azimuth and altitude angles of the sun based on latitude, longitude, and time information is a conventional technique mastered by those skilled in the art, and no improvement has been made to the specific process here, so the specific process will not be described in detail here; In this embodiment, the industrial camera resolution is not less than 2448×2048 pixels (5 million pixels), ensuring that the smallest identifiable alum floc cluster feature occupies no less than 3 to 5 pixel units; The vertical distance between the center of the industrial camera lens and the water surface is 0.5 to 2 meters, ensuring that the lens field of view covers the flocculation tank outlet area within a width of 1.5 to 2.5 meters, while avoiding the direct impact of water surface fluctuations on imaging; Frame rate ≥ 3 0fps, meeting the real-time capture requirements of dynamic changes in floc clusters during flocculation, ensuring no motion blur under water flow velocities of 0.1-0.3m / s; spectral response range of 400-700nm (visible light band), which, when combined with a dynamic polarizing lens, can reduce water surface reflection interference by more than 85%; dynamic range ≥120dB, ensuring clear imaging within a light intensity range of 50-10000lux, adapting to different weather conditions and outdoor installation environments; polarization angle adjustment range of the polarizing filter is continuously adjustable from 0° to 180°, with adjustment step accuracy ≤±0.5°, ensuring precise elimination of water surface reflection light at different incident angles; response time ≤50ms.The lens is equipped with an STM ring stepper motor with a rotation cycle of 360° / 24h, which can automatically correct according to the angle of sunlight. The polarizing filter has a transmittance of ≥85% (in the working wavelength range of 400-700nm), ensuring sufficient light enters the industrial camera. In this embodiment, the optical marker targets are circular targets with a diameter of 50±0.1mm, and the center-to-center distance between each target is 500±1mm, forming a precise calibration grid. The color standard adopts standard white with CIE 1931 chromaticity coordinates (x,y) of (0.310,0.316) and standard black with (0.140,0.080), and a contrast ratio of ≥9:1, ensuring accurate identification even under underwater imaging conditions. The installation accuracy is such that the parallelism error between the target plane and the water surface is ≤±0.5°, and the distance error between adjacent target points is ≤±0.2mm, ensuring the accuracy of image geometric correction. The waterproof rating is IP68, allowing for long-term immersion in water and withstanding water temperatures ranging from 0-45℃.
[0089] The correction module is used to correct the color and geometric features of the original image based on the optically marked target points to obtain a corrected image;
[0090] In this embodiment, the color correction step includes: A1. Analyzing the acquired original image, extracting the color information of each color block in the optical marker target, accurately separating the red, green, and blue color block regions in the optical marker target using an image segmentation algorithm, and obtaining the RGB values of these regions; A2. Comparing the extracted RGB values with known standard RGB values, calculating the deviation value of each color block in the R, G, and B channels (i.e., red, green, and blue channels). If the RGB value of the standard red block is (255, 0, 0), while the RGB value of the red block extracted from the original image is (240, 10, 5), then the deviation of the R channel is 255-240=15, the deviation of the G channel is 0-10=-10, and the deviation of the B channel is 0-5=-5; A3. Correcting the color deviation of each of the R, G, and B channels according to the linear relationship between the color deviation and the actual color value. For example, for the R channel, the corrected R value can be obtained by formula R 校正 =R 原始 +ΔR calculation, where ΔR is the deviation value of the R channel, and the other two channels are calculated in the same way; A4. For each pixel in the original image, the values of the R, G, and B channels are corrected respectively, thereby eliminating color deviation caused by factors such as camera angle and lighting conditions, so that images acquired at different times have a uniform standard in color;
[0091] The geometric feature correction steps include: B1. Identifying the four corner positions and the outline shape of the optical marker target point through edge detection; B2. Comparing with known actual geometric features to calculate geometric distortion parameters, i.e., calculating the proportional difference between the actual size and standard size of the optical marker target point in the original image, and the offset between the corner positions and standard positions of the optical marker target point. These parameters reflect the degree of image geometric distortion caused by factors such as camera angle and water wave refraction; B3. Calculating the perspective transformation matrix from the distorted image to the standard image, based on the coordinates of the four corner points of the optical marker target point in the distorted and standard images, to achieve geometric feature correction of the original image; B4. Performing coordinate transformation on each pixel in the original image to eliminate geometric distortion caused by factors such as camera angle and water wave refraction, ensuring that images acquired at different time points have a uniform standard in scale and shape, thus ensuring the accuracy of subsequent image processing and analysis. In this embodiment, color and geometric feature correction based on optical marker targets is common knowledge that can be grasped by those skilled in the art.
[0092] The macro-modal region extraction module is used to input the corrected image into a pre-trained multi-scale convolutional neural network model, collect the contour edges of the corrected image, and output a binarized mask image of the macro-modal of the alum cluster in the corrected image.
[0093] The processing module is used to calculate the total pixel area of the alum flower region in the binarized mask image, which is used as the projected area of the alum flower cluster in the current frame, and to perform filtering processing.
[0094] The intelligent decision-making module is used to read the current water quality parameters and the projected area of the filtered flocculent cluster in real time, and output dynamic dosing instructions. In this embodiment, the intelligent decision-making module exchanges data and issues instructions with the water plant's existing DCS or PLC system through a standardized industrial protocol (such as Modbus TCP / IP). The intelligent decision-making module includes a fuzzy PID module and a reinforcement learning module. The core is a fusion control algorithm: the fuzzy PID module is responsible for handling the nonlinear characteristics of the system. It takes the deviation between the projected area and the set value and its rate of change as fuzzy input, and dynamically adjusts the proportional, integral, and derivative parameters (Kp, Ki, Kd) of the PID controller to generate a preliminary dosing adjustment suggestion; the reinforcement learning algorithm is responsible for realizing the continuous self-optimization of the system. Its agent takes the system state (water quality parameters, area deviation) as the state, the adjustment of the dosing amount as the action, and the stabilization of the effluent turbidity within the target range as the reward. Through continuous interaction with the environment (flocculation process), it continuously improves the system's performance. The algorithm continuously optimizes the decision-making strategy to fine-tune or compensate the output of the fuzzy PID module, adapting to long-term and slow-moving operating conditions such as changes in reagent type and seasonal water temperature. Finally, the fusion algorithm outputs a precise control command for the dosing pump frequency or valve opening, which is sent to the PLC of the dosing unit for execution via the Modbus protocol. The entire response time from image acquisition to command issuance is controlled within 10 seconds, meeting the requirements for real-time control of the flocculation process. In this embodiment, since the intelligent decision-making module, reinforcement learning module, and fuzzy PID module are all existing technologies, and the fusion control algorithm combining the three is also a conventional technical means in industrial control and other fields, this solution does not improve its structure and principle. Therefore, its specific content will not be described here.
[0095] The control module is used to control the response of the actuator via dosing commands; the actuator can be a dosing pump or a regulating valve.
[0096] The first judgment module is used to determine whether the system is operating stably based on the fluctuation of effluent turbidity, the rate of change of the projected area of the filtered flocculent cluster, and the adjustment range of the dosing command.
[0097] The reinforcement learning module is used to enter the self-learning optimization mode, store the current control process as a positive sample in the experience replay buffer, update the policy network parameters, and dynamically adjust the weights of the fuzzy rule base.
[0098] The process control module is used to maintain the current parameters and feed them back to the image acquisition module to continue the next round of dynamic polarization image acquisition;
[0099] The inspection module is used to trigger the retrospective diagnostic mechanism to check image quality issues, including signal-to-noise ratio, integrity of optical marker target recognition, and presence of abnormal interference.
[0100] If the second judgment module determines that the signal-to-noise ratio is less than the preset value, the optical marker target point loss is greater than or equal to the preset value of optical target point loss, or the binarization false detection rate (referring to the proportion of pixels that should be the background after binarization but are incorrectly identified as the foreground when producing a binarized mask) is greater than the preset value of the binarization false detection rate, then it switches to the first dynamic adjustment module; otherwise, it switches to the second dynamic adjustment module.
[0101] The first dynamic adjustment module is used to feed back to the image acquisition module to dynamically adjust the polarization angle of the light entering the camera lens during the imaging process of the alum flower cluster, and to re-acquire the dynamic polarization image.
[0102] The second dynamic adjustment module is used to feed back to the intelligent decision-making module, adjust the fuzzy PID parameters, enhance the exploration rate, and make a new decision.
[0103] Compared with existing technologies, this invention achieves significant improvements in image acquisition anti-interference capability, accuracy of alum flower feature recognition, adaptiveness of dosing control, and system integration response performance, demonstrating outstanding technological advancement and practical value. Specific effects are as follows:
[0104] 1. Improve image acquisition stability and anti-interference capability
[0105] Compared with traditional methods that use underwater cameras or fixed polarization imaging, this invention effectively solves the long-standing technical problems of visual monitoring, such as water surface reflection, bubble interference, and color distortion, by introducing a collaborative structure of industrial camera, dynamic polarization lens, and optical marker target.
[0106] Under complex conditions of fluctuating light intensity (50–10000 lux) and surface bubble coverage ≤30%, the image signal-to-noise ratio of this system remains stable at over 20 dB, which is more than 40% higher than that of traditional non-polarized imaging methods.
[0107] The dynamic polarization adjustment mechanism can eliminate specular reflection in real time, reducing water surface reflection interference by more than 85% and increasing image availability from less than 70% in existing technologies to more than 98%.
[0108] Combined with high-precision optical markers (positioning error ≤ ±0.2mm), dual correction of image color and geometric deformation is achieved, ensuring image consistency under different times and water quality conditions, and avoiding misjudgment caused by environmental changes;
[0109] It has excellent structural advantages, does not require submersion installation, avoids the problems of easy contamination and frequent maintenance of underwater equipment, and has a simpler structure and higher reliability.
[0110] 2. Achieve a paradigm upgrade in identification from micro-statistics to macro-modal analysis.
[0111] Existing technologies rely on the contour extraction and quantity / size statistics of individual alum flocs, and the results have a weak correlation with actual settling performance (correlation coefficient R). 2 <0.6). This invention proposes using the projected area of alum floc clusters as a macro-modal characterization index to directly reflect the overall aggregation state and settling potential of the flocs. Verification through field measurements at multiple water plants shows that the correlation coefficient between the filtered alum floc projected area and the final effluent turbidity reaches R0.6. 2 ≥0.92, significantly better than traditional indicators;
[0112] A multi-scale convolutional neural network model was used for region segmentation, achieving an accuracy of ≥95%, with both false negative and false positive rates controlled within 5%, which is far superior to the traditional threshold segmentation combined with morphology processing method (average accuracy of about 70%).
[0113] Macro-level indicators are not affected by the accumulation of individual identification errors, making them more robust and practical for engineering applications.
[0114] This invention establishes for the first time a direct mapping relationship between macromodal visual features, sedimentation performance, and dosing response, solving the fundamental problems of inaccurate observation and unstable control in traditional methods.
[0115] 3. Construct a fusion control algorithm to achieve truly adaptive dosing.
[0116] To address the problems of rigidity and difficulty in adapting to sudden changes in water quality in existing PID control strategies, this invention proposes a control architecture that integrates fuzzy PID and reinforcement learning, which combines rapid response and continuous optimization capabilities. The fuzzy PID module enables immediate correction of the current deviation with a response delay of ≤200ms. The reinforcement learning module continuously learns the optimal control strategy through an experience replay buffer. In scenarios such as seasonal changes and sudden changes in raw water turbidity, the system can complete parameter self-adjustment within 24 hours, while traditional systems require manual intervention or parameter tuning that can take several hours.
[0117] On-site operation data shows that after adopting this system, the fluctuation of chemical dosage was reduced by 35%, the compliance rate of effluent turbidity increased from 82% to 98.5%, and the average chemical consumption was reduced by 12-18%.
[0118] This solution possesses a closed-loop capability of "perception-decision-execution-learning," eliminating reliance on human experience and truly achieving unattended intelligent drug dispensing.
[0119] 4. Optimize system architecture to improve response speed and engineering integration.
[0120] Unlike the centralized processing model that uploads images to the cloud, this invention adopts an edge computing + local closed-loop control architecture. All image processing and decision-making are completed on the local industrial control computer, and it is seamlessly connected to the DCS / PLC system through standard industrial buses (such as Modbus TCP, Profinet). The overall system control cycle is ≤1 second, which is more than 70% shorter than the cloud processing model (typical delay >3 seconds), meeting the real-time control requirements of the rapidly changing flocculation process.
[0121] It supports "plug and play" deployment, and can be quickly integrated without modifying the existing water plant control system, reducing the deployment time from several days in the traditional solution to within 4 hours;
[0122] The end-to-end localization process also reduces network dependence and data security risks.
[0123] Integrated advantages: compact structure, convenient deployment, and rapid response, suitable for both new plants and intelligent transformation of old water plants.
[0124] 5. Overall benefits: Energy saving and consumption reduction, pollution reduction, and improved operational efficiency.
[0125] Production efficiency is improved, the system's automatic operation rate reaches over 95%, the frequency of manual inspections is reduced, and maintenance labor costs are lowered;
[0126] The product yield increased, the stability of the effluent from sedimentation tank 4 was greatly improved, the load on subsequent treatment was reduced, and the overall water treatment qualification rate was improved.
[0127] Environmental pollution is reduced, precise dosing avoids excessive dosage of chemicals, reduces secondary pollution of water bodies by aluminum / iron salt residues, and reduces sludge production by about 10-15%.
[0128] The following is a specific example of applying the present invention.
[0129] This example is applied to a surface water treatment plant with a daily processing capacity of 50,000 tons, for real-time monitoring and closed-loop control of floc clusters in the outlet area of a horizontal flow flocculation tank.
[0130] I. System Composition and Equipment Configuration
[0131] Industrial camera: Basler acA2440-35gc CMOS color camera with a resolution of 2448×2048 pixels, a frame rate of 35fps, a spectral response range of 400–700nm, and a dynamic range of 120dB; installation method: fixed above the outlet weir of the flocculation tank with a stainless steel bracket, the lens center is 1.8m above the water surface, the optical axis is strictly perpendicular to the water surface (tilt deviation ≤0.5°), and the field of view covers the width of the outlet weir of 2.2m;
[0132] Dynamic polarization lens: It adopts an STM ring stepper motor, which is integrated in front of the industrial camera lens. The polarization angle can be continuously adjusted within the range of 0° to 360°, with an adjustment step accuracy of ±0.5° and a response time of ≤50ms.
[0133] Optical marker target points: A total of 4 optical marker target points are arranged on both sides of the flocculation tank, with a diameter of 50.0±0.1mm, a center-to-center distance of 500.0±0.2mm between two adjacent optical marker target points, a parallelism error between the target surface and the water surface of ≤0.5°, a protection level of IP68, and a water temperature resistance of 0–45℃.
[0134] It uses the Advantech ARK-3520L embedded industrial PC, equipped with an Intel Core i7-1165G7 processor, 16GB of memory, a 256GB solid-state drive, and comes pre-installed with the Ubuntu 20.04LTS operating system;
[0135] The multi-scale U-Net network based on transfer learning has a ResNet-34 backbone network (pre-trained on ImageNet), an input image size of 1024×1024 pixels, and an output binarized mask image. The model was trained on 5000 labeled images and the Dice coefficient is ≥0.93.
[0136] The algorithm combines fuzzy PID and deep Q-network (DQN) fusion, with a sampling period of 1 second, a fuzzy rule base containing 16 rules, a DQN experience replay buffer capacity of 10,000 rules, and a learning rate of 1×10⁻⁶. -4 ;
[0137] The communication interface is equipped with dual network ports (RJ45), which interface with the water plant DCS system (Siemens S7-1500 series PLC) via Modbus TCP protocol, with a control command transmission delay of ≤50ms.
[0138] The actuator uses a dosing pump, specifically a Milton Roy series precision metering pump, with a flow rate adjustment range of 0–20 L / h, a control signal of 4–20 mA, and a response time of ≤100 ms.
[0139] II. System Operation Flow
[0140] Image acquisition. Image acquisition is triggered once per second. The system automatically adjusts the polarization angle based on the signal-to-noise ratio (SNR) of the previous image, scans within ±15° of the original angle, and selects the angle with the highest SNR as the acquisition parameter for this time.
[0141] Image correction. Target detection and perspective transformation are performed using OpenCV to complete geometric correction; white balance and chromaticity calibration are performed using a color lookup table (LUT) to ensure image consistency under different lighting conditions.
[0142] Macromodal recognition. After cropping the image to 1024×1024, it is input into a multi-scale convolutional neural network model to generate a binarized mask image; the total area of connected regions in the mask (unit: pixel 2) is calculated and converted into physical area (cm²). 2 / m 2 (Water surface), and the output is smoothed through a first-order low-pass filter (cutoff frequency 1Hz).
[0143] Intelligent control. Reads current raw water turbidity (NTU) and flow rate (m³). 3 The optimal dosage is calculated by a fusion algorithm based on parameters such as pH value and the projected area of the flocculent after filtering, and the metering pump speed is adjusted by a 4–20mA signal.
[0144] Backtracking optimization. The system stability is assessed every 5 minutes. If the effluent turbidity fluctuation is >±5%, the backtracking mechanism is activated: image quality is checked first, and the polarization angle is readjusted or the DQN strategy network is fine-tuned online if necessary.
[0145] II. Operational Results
[0146] like Figure 4 The data shown is the data from 50 consecutive days of operation of this system. The corresponding data analysis table is shown in Table 1 below.
[0147] Table 1 Data Analysis Table
[0148] index Initial mean (days 1–15) Late-term mean (days 41–50) Improvement range Projected area of alum flowers <![CDATA[7.8cm 2 / m 2 ]]> <![CDATA[11.9cm 2 / m 2 ]]> ↑52.6% Dosage 16.3 mg / L 20.9 mg / L ↑28.2% effluent turbidity 1.83 NTU 0.89NTU ↓51.4% Backtracking trigger frequency 8 times / 15 days ≈ 53.3% 1 time / 10 days = 10% ↓81%
[0149] Trend of change in the projected area of alum flowers:
[0150] From day 1 to day 15, the value fluctuated frequently between 6.7 and 8.9, and was below 7.5 multiple times, reflecting that the system was in the parameter exploration stage.
[0151] The lowest value of 6.7 was observed on the 7th day, corresponding to a turbidity peak of 2.30, triggering a backtracking process;
[0152] It enters an upward channel from the 16th day, although there are slight pullbacks (such as on the 26th day), but overall it shows a steady increase.
[0153] It reached 12.1 on day 50, an increase of 55% compared to the initial stage.
[0154] Characteristics of effluent turbidity trends:
[0155] The initial values were high (1.92–2.30), with significant fluctuations.
[0156] It reached a peak of 2.30 on day 7, and then gradually decreased through controlled adjustments;
[0157] It enters a stable range below 1.3 after the 30th day;
[0158] It dropped to 0.87 on day 50, which is better than the Class A standard (1.0 NTU).
[0159] After a debugging period, the system achieved stable operation and demonstrated its adaptability to engineering projects.
[0160] The effective image acquisition rate was 98.7%.
[0161] The turbidity compliance rate of effluent increased from 83.2% to 98.1%;
[0162] The average dosage of polyaluminum chloride (PAC) was reduced by 16.3%.
[0163] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for macro-modal recognition of *Hemiberlesia lataniae* clusters, characterized in that, Includes the following steps: S1. Dynamic polarization images of the flocculation tank outlet area, including optically marked target points, are acquired and used as the raw images; S2. Correct the color and geometric features of the original image based on the optically marked target points to obtain the corrected image; S3. Input the corrected image into a pre-trained multi-scale convolutional neural network model, collect the contour edges of the corrected image, and output a binarized mask image of the macro-modality of the alum cluster in the corrected image. S4. Calculate the total pixel area of the alum flower region in the binarized mask image, use it as the area of the alum flower cluster projection in the current frame, and perform filtering processing; S5. Read the current water quality parameters and the projected area of the filtered flocculent cluster in real time, and output dynamic dosing instructions.
2. The method for macro-modal recognition of *Hemiberlesia lataniae* clusters according to claim 1, characterized in that, It also includes the following steps: S6. Control the actuator response via dosing commands; S7. Determine whether the operating status is stable based on the fluctuation of effluent turbidity, the rate of change of the projected area of the filtered flocculent cluster, and the adjustment range of the dosing command. If yes, proceed to step S8; otherwise, proceed to step S10. S8. Enter self-learning optimization mode, store the current control process as a positive sample in the experience replay buffer, update the policy network parameters, and dynamically adjust the weights of the fuzzy rule base. S9. Maintain the current parameters, return to step S1, and continue the next round of dynamic polarization image acquisition; S10. Trigger the retrospective diagnostic mechanism to check image quality issues, including signal-to-noise ratio, integrity of optical marker target recognition, and presence of abnormal interference; S11. If the signal-to-noise ratio is less than the preset value, the optical marker target loss is greater than or equal to the preset value, or the binarization false detection rate is greater than the preset value, then proceed to step S12; otherwise, proceed to step S13. S12. Feedback to step S1, dynamically adjust the polarization angle of the light entering the camera lens during the imaging process of the alum flower cluster, and re-acquire the dynamic polarization image; S13. Feedback to step S5, adjust the fuzzy PID parameters, enhance the exploration rate, and make a new decision.
3. The method for macro-modal recognition of *Hemiberlesia lataniae* clusters according to claim 1, characterized in that: The water quality parameters in step S5 include the total phosphorus concentration, flow rate, and pH value of the raw water.
4. The method for macro-modal recognition of *Hemiberlesia lataniae* clusters according to claim 2, characterized in that: In step S7, if the turbidity fluctuation of the effluent is less than or equal to ±5%, the change rate of the projected area of the filtered flocculent cluster is less than 2% / min, and the adjustment range of the dosing command is less than or equal to 5%, then the operating status is considered stable.
5. The method for macro-modal recognition of *Hemiberlesia lataniae* clusters according to claim 2, characterized in that: In step S11, the preset value for signal-to-noise ratio is 20dB, the preset value for optical target point loss is 2, and the preset value for binarization false detection rate is 10%.
6. A macro-modal recognition system for *Hemiberlesia lataniae* clusters, characterized in that, include: The image acquisition module is used to perform dynamic polarization image acquisition on the flocculation tank outlet area, including optical marker targets. The correction module is used to correct the color and geometric features of the original image based on the optically marked target points to obtain a corrected image; The macro-modal region extraction module is used to input the corrected image into a pre-trained multi-scale convolutional neural network model, collect the contour edges of the corrected image, and output a binarized mask image of the macro-modal of the alum cluster in the corrected image. The processing module is used to calculate the total pixel area of the alum flower region in the binarized mask image, which is used as the area of the alum flower cluster projection in the current frame, and to perform filtering processing. The intelligent decision-making module is used to read the current water quality parameters and the projected area of the filtered flocculent cluster in real time, and output dynamic dosing instructions.
7. The macro-modal recognition system for *Hemiberlesia lataniae* clusters according to claim 6, characterized in that, Also includes: The control module is used to control the response of the actuator through dosing commands; The first judgment module is used to determine whether the operating status is stable based on the fluctuation of effluent turbidity, the rate of change of the projected area of the filtered floc cluster, and the adjustment range of the dosing command. The reinforcement learning module is used to enter the self-learning optimization mode, store the current control process as a positive sample in the experience replay buffer, update the policy network parameters, and dynamically adjust the weights of the fuzzy rule base. The process control module is used to maintain the current parameters and feed them back to the image acquisition module to continue the next round of dynamic polarization image acquisition; The inspection module is used to trigger the retrospective diagnostic mechanism to check image quality issues, including signal-to-noise ratio, integrity of optical marker target recognition, and presence of abnormal interference. The second judgment module determines that if the signal-to-noise ratio is less than the preset value, the optical marker target point loss is greater than or equal to the preset value, or the binarization false detection rate is greater than the preset value, then it switches to the first dynamic adjustment module; otherwise, it switches to the second dynamic adjustment module. The first dynamic adjustment module is used to feed back to the image acquisition module to dynamically adjust the polarization angle of the light entering the camera lens during the imaging process of the alum flower cluster, and to re-acquire the dynamic polarization image. The second dynamic adjustment module is used to feed back to the intelligent decision-making module, adjust the fuzzy PID parameters, enhance the exploration rate, and make a new decision.