A Comprehensive Diagnostic Method for Aeration Tank Operation Based on Continuous Image Recognition

By using continuous image recognition technology, combined with contour and texture features, the types of microorganisms and the characteristics of bacterial flocs in the aeration tank can be identified, solving the problem of inaccurate judgment of the operating status of the aeration tank and realizing precise management and early anomaly identification.

CN122313474APending Publication Date: 2026-06-30WEIJING SMART WATER TECH (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WEIJING SMART WATER TECH (SHANGHAI) CO LTD
Filing Date
2026-03-31
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies cannot accurately identify the types of microorganisms in aeration tanks, leading to inaccurate judgment of the aeration tank's operating status, making it difficult to achieve precise management. Furthermore, they cannot promptly identify situations such as high wastewater load, low wastewater load, and shock load, resulting in deterioration of effluent water quality.

Method used

By acquiring multiple microscopic images of water samples from the aeration tank, calculating differential images and identifying moving regions, extracting contour and texture features, and combining these with floc characteristics, the system achieves accurate identification of microbial species and comprehensive diagnosis of the aeration tank's operational status.

Benefits of technology

It enables accurate and rapid identification of the ecological behavior of microorganisms in aeration tanks, reduces deployment costs, and can identify abnormal situations early and issue alerts to prevent further deterioration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122313474A_ABST
    Figure CN122313474A_ABST
Patent Text Reader

Abstract

This invention relates to a comprehensive diagnostic method for aeration tank operation based on continuous image recognition, comprising: acquiring water samples from the aeration tank; continuously acquiring multiple microscopic images of the samples within a fixed observation area, and obtaining a sequence of sample images after preprocessing; dividing the sequence into moving and stationary regions based on pixel differences between the sample images, identifying the trajectory of an object and calculating its length; extracting images of the moving object and extracting its contour and texture features; determining the microbial species of the moving object based on its contour, texture, and trajectory length; analyzing the morphological characteristics of flocs in the stationary region, and comprehensively diagnosing the aeration tank's operational status in conjunction with the microbial species. This invention can accurately determine the dominant microbial species in the aeration tank. Based on this, and combined with the characteristics of the flocs, through the coupling of multiple factors and various feature values, it can directly reflect the sludge activity and treatment effect in the aeration tank, improving the accuracy of operational status assessment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of wastewater treatment and image recognition processing technology, and in particular to a comprehensive diagnostic method for the operation of aeration tanks based on continuous image recognition. Background Technology

[0002] The activated sludge process is one of the most widely used wastewater treatment technologies, with the aeration tank playing a crucial role as the core component. The aeration tank primarily decomposes organic matter and other pollutants in wastewater through the growth and metabolism of aerobic microorganisms. Traditional aeration tank control logic is simple, relying on experience to judge changes in the microbial population within the tank. This makes it difficult to detect potential system problems in a timely manner, easily leading to water quality fluctuations or even accidents. Furthermore, the aeration tank is also a major energy consumer in the entire wastewater treatment plant, thus requiring precise operation and management.

[0003] Currently, precision aeration systems primarily control airflow through dissolved oxygen, with some incorporating influent and effluent water quality and quantity data for comprehensive regulation. However, these are all indirect methods and do not directly reflect microbial growth. In practical applications, regulation often lags, making it difficult to guarantee stable process operation and effluent quality compliance. Furthermore, existing precision aeration systems only monitor and control dissolved oxygen; they cannot effectively identify and address other situations in the aeration tank that lead to effluent quality deterioration, such as high or low wastewater loads or shock loads.

[0004] On the other hand, most existing technologies rely on shape matching to roughly determine the number of microorganisms, lacking methods for precise identification of microbial species. For example, CN120279553A discloses a microbial identification and statistical method that only extracts static image features and uses a neural network to achieve general group identification. However, among the core indicator microorganisms in aeration tanks, the static morphologies of some microbial groups highly overlap, making misjudgment easy to occur based solely on static features. Furthermore, this solution only removes static background and lacks a comprehensive diagnostic method that combines microbial species with floc characteristics. This results in an inability to identify complex operating states of aeration tanks, an incomplete diagnosis of aeration tank operating states, and an inability to achieve comprehensive, precise, and proactive management of aeration tank operating states. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a comprehensive diagnostic method for the operation of aeration tank based on continuous image recognition, which can accurately determine the dominant microbial categories in the aeration tank and improve the accuracy of the judgment of the operation status of the aeration tank.

[0006] The technical solution adopted by this invention to solve its technical problem is: to provide a comprehensive diagnostic method for the operation of aeration tank based on continuous image recognition, comprising: Obtain water samples from the aeration tank; Multiple microscopic images of the sample were continuously acquired within a fixed observation area, and after preprocessing, a sequence of sample images arranged in chronological order was obtained. Calculate the difference image between any two adjacent sample images in the sequence, and take the region in the difference image whose absolute value of the pixel value difference is greater than a set threshold as the moving region, and the other regions as the non-moving region; By tracking the changes in motion regions in the differential image in chronological order, the motion trajectory of the object is identified and the trajectory length of each motion trajectory is calculated. Images of the moving objects corresponding to each motion trajectory are captured separately, and contour and texture features are extracted from the captured images; The types of microorganisms on moving objects are determined based on their contour features, texture features, and trajectory length. The intersection of non-moving regions in all difference images is extracted as the static region. The characteristics of bacterial flocs in the static region are analyzed, and then the operating status of the aeration tank is diagnosed by combining the characteristics of bacterial flocs and the types of microorganisms.

[0007] Furthermore, the contour features include rectangularity, roundness, symmetry, object area, and whether there is a tail or thorns; the texture features include multi-scale fusion inverse moments, which are obtained by using the gray-level co-occurrence matrix to obtain the inverse moments, and then using entropy values ​​to dynamically allocate weights to integrate the inverse moments of multiple directions.

[0008] Furthermore, based on contour features, texture features, and trajectory length, the types of microorganisms on the moving object are determined, including: If the rectangle size is greater than the first rectangle size threshold, it is determined to be a nematode; If the rectangularity is less than the second rectangularity threshold, the roundness is less than or equal to the roundness threshold, and the symmetry is less than the symmetry threshold, it is determined to be a rotifer; If the rectangularity is less than the second rectangularity threshold, the roundness is less than or equal to the roundness threshold, and the symmetry is greater than or equal to the symmetry threshold, it is determined to be lateral trichomonas. If the rectangularity is less than the second rectangularity threshold, and the roundness is greater than the roundness threshold, and there is no tail or spiny hairs, it is determined to be a bean-shaped worm; If the rectangularity is less than the second rectangularity threshold, the roundness is greater than the roundness threshold, and it has a tail or spiny hairs, and the trajectory length is less than or equal to the trajectory length threshold, it is identified as a shield fiberworm. If the rectangle degree is less than the second rectangle degree threshold, the roundness is greater than the roundness threshold, and it has a tail or spiny hairs, and the trajectory length is greater than the trajectory length threshold, and the object area is greater than the area threshold, it is determined to be a wriggling insect. If the rectangularity is less than the second rectangularity threshold, the roundness is greater than the roundness threshold, and it has a tail or spiny hairs, and the trajectory length is greater than the trajectory length threshold, and the object area is less than or equal to the area threshold, it is determined to be a sulfur bacterium. If the rectangularity is between the second rectangularity threshold and the first rectangularity threshold, and it has a tail or spiny hairs, it is identified as a Vorticella. If the rectangularity is between the second rectangularity threshold and the first rectangularity threshold, and there is no tail or spiny hairs, and the trajectory length is greater than the trajectory length threshold, it is determined to be a twisted head worm; If the rectangularity is between the second rectangularity threshold and the first rectangularity threshold, and there is no tail or spiny hairs, and the trajectory length is less than or equal to the trajectory length threshold, and the multi-scale fusion inverse moment is greater than the inverse moment threshold, it is determined to be a worm with a long branch. If the rectangularity is between the second rectangularity threshold and the first rectangularity threshold, and there is no tail or spiny hairs, and the trajectory length is less than or equal to the trajectory length threshold, and the multi-scale fusion inverse moment is less than or equal to the inverse moment threshold, it is determined to be a rotifer.

[0009] Furthermore, the changes in motion regions within the difference images are tracked sequentially over time to identify the object's motion trajectory and calculate the trajectory length of each trajectory, including: For each difference image, a connected region analysis is performed on the motion region to extract candidate bounding boxes for each moving object; A multi-target tracking method is adopted, which matches candidate bounding boxes extracted from each difference image based on IoU similarity to form the object's motion trajectory; The trajectory length of each trajectory is calculated based on the center coordinates of the candidate bounding boxes corresponding to the motion trajectory.

[0010] Furthermore, images of moving objects are captured using the following methods: Based on the IoU similarity matching results, determine whether the current motion trajectory intersects or occludes with other motion trajectories; Select the portion of the current motion trajectory that does not intersect or occlude, extract candidate bounding boxes from it, and obtain the image of the corresponding moving object.

[0011] Furthermore, extracting contour and texture features from the cropped image includes: The brightness change of the cropped image is differentiated twice, and the outermost contour of the moving object is extracted based on the obtained zero-crossing points. An improved flooding algorithm is used to fill the contour based on seed points set within the contour. Extract contour and texture features from the filled color blocks.

[0012] Furthermore, an improved flooding algorithm is used for filling, including: Centered on the seed point, select a neighborhood window and calculate the color mean and variance of that neighborhood; The color difference threshold is calculated based on the variance of the current neighborhood and used as a color correction factor. Calculate the spatial correction factor based on the Euclidean distance between the current pixel and the seed point; Adjust the fill priority using color correction factors and spatial correction factors, extract the pixel with the highest current priority from the priority queue, traverse its four-neighbor or eight-neighbor pixels, update the local statistics of each neighborhood pixel and recalculate the color correction factor and spatial correction factor, add pixels that meet the color difference condition to the queue, and repeat this step until the priority queue is empty or the maximum number of iterations is reached.

[0013] Furthermore, during iterative calculation, the method also includes a step of real-time detection of whether the gradient of adjacent pixels exceeds the gradient threshold. If it does, the color threshold is tightened to suppress false filling across the edge.

[0014] Further analysis of the morphological characteristics of the bacterial flocs in the quiescent region included: Clustering algorithms are used to classify pixels in static areas to obtain dark-colored bacterial clumps and light-colored backgrounds; An opening operation is performed on the classified images to calculate the proportion of fungal micelles and the number of blank areas as morphological characteristics of the fungal micelles.

[0015] Furthermore, the operational status of the aeration tank is comprehensively diagnosed based on the characteristics of the flocs and the types of microorganisms, including: When the dominant microbial species are Vorticella and / or Cyclostome, and the proportion of bacterial flocs is less than the bacterial floc threshold and the number of blank areas is less than the number threshold, it is judged as "operating well". When the dominant microbial species are *Bacillus lentigines* and / or *Trichomonas vaginalis*, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "beginning to deteriorate". When the dominant microbial species is *Pteris vittata*, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "low load". When the dominant microbial species is nematode, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "high load". When the dominant microbial species are sulfur bacteria and / or spirochetes, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "low dissolved oxygen operation". When the dominant microbial species is rotifer, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "high dissolved oxygen operation". When a sharp decrease in platycerium is detected, regardless of the characteristics of the bacterial floc, it is determined to be "shock load, toxic flow in".

[0016] Beneficial effects By adopting the above-mentioned technical solution, the present invention has the following advantages and positive effects compared with the prior art: This invention combines static morphological features, including contour and texture features, with dynamic features, including trajectory length, to achieve accurate and rapid identification that conforms to the ecological behavior principles of microorganisms in aeration tanks. Based on this, combined with the characteristics of flocs, the activity and treatment effect of sludge in aeration tanks can be directly reflected. This invention divides moving and non-moving regions based on differential images and identifies microorganisms and bacterial flocs in different regions. It transforms ecological association rules involving multiple factors and feature values ​​into quantifiable threshold logic, enabling accurate judgment without deploying artificial intelligence networks or large amounts of labeled data. The deployment cost is low and the diagnostic results are interpretable. Maintenance personnel can directly deduce the direction of process adjustments based on the characteristics of dominant microorganisms and bacterial flocs, fully adapting to the rapid decision-making needs of industrial scenarios. At the same time, when the operation of the aeration tank begins to deteriorate or abnormal events such as shock loads or toxic intrusion occur, it can quickly issue an early warning, allowing for timely handling under manual intervention to prevent further deterioration or expansion of the abnormal impact range and reduce its negative effects. Attached Figure Description

[0017] Figure 1 This is a flowchart of a method according to an embodiment of the present invention; Figure 2 This is a diagram showing the effect of original image grayscale processing and adaptive histogram equalization according to an embodiment of the present invention. Figure 3 This is an image showing the effect of static shape edge detection and internal filling processing according to an embodiment of the present invention; Figure 4 This is a flowchart of the decision-making process for determining the types of microorganisms according to an embodiment of the present invention; Figure 5 This is a diagram illustrating the effect of the bacterial floc identification and processing according to an embodiment of the present invention. Detailed Implementation

[0018] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.

[0019] The embodiments of this invention relate to an aeration tank operation diagnosis method based on continuous online image recognition. This method aims to solve the problem of low accuracy in existing technologies that rely solely on contour recognition to determine microbial species. By precisely monitoring the real-time growth of microorganisms and the characteristics of bacterial flocs, it dynamically provides process adjustment suggestions to achieve continuous and stable operation of the aeration tank. Figure 1 As shown, it includes: W100: Online image acquisition and processing; W201: Microbial identification; W202: Identify microbial species; W301: Floc identification; W302: Determine the characteristics of the bacterial flocs; W400: Determines the running status; W500: Provides adjustment suggestions.

[0020] Step W100 can be achieved through the following methods: Sampling was completed at a depth of 10 cm below the water surface near the outlet of the aeration tank using an automatic sampling device. After sampling is completed, the sample is automatically transferred to the viewing area, magnified by the microscope, and then continuously photographed and collected by the lens. The obtained color image is converted to grayscale. Preprocess the grayscale image.

[0021] Step W201 can be achieved through dynamic trajectory recognition and static shape recognition: Dynamic trajectory recognition includes performing a difference operation on two consecutive images, determining whether the difference image is greater than a set threshold, selecting feature points, connecting consecutive feature points in chronological order through straight line segments, and calculating the total length L of all line segments. Static shape recognition includes: locally cropping the moving object based on the dynamic trajectory recognition results; taking the second derivative of the brightness change of the image to obtain zero-crossing points for edge localization; finding the outermost contour of the object to be recognized and specifying any point inside it as a seed point, and using a dynamic correction factor flooding algorithm to complete the filling; and performing feature recognition on the filled color block based on features such as rectangularity, roundness, symmetry, multi-scale fusion inverse difference moment, and whether there is a tail or thorns.

[0022] Step W202 can be determined using the following rules: If the rectangularity is greater than 0.7, it is identified as a nematode; If the rectangularity is less than 0.3, the roundness is less than 0.8, and the symmetry is less than 800, it is identified as a rotifer. If the rectangularity is less than 0.3, the roundness is less than 0.8, and the symmetry is greater than or equal to 800, it is identified as lateral trichomonas. If the rectangle's rectangularity is less than 0.3 and the roundness is greater than 0.8, and there is no tail or spiny hairs, it is identified as a bean-shaped worm. If the rectangularity is less than 0.3 and the roundness is greater than 0.8, and it has a tail or spiny hairs and the movement distance is less than 100, it is identified as a shield fiberworm; If the rectangle's rectangularity is less than 0.3 and its roundness is greater than 0.8, and it has a tail or spiny hairs, and its movement distance is greater than 100 and its area is greater than 10000, it is judged to be a wandering insect. If the rectangularity is <0.3 and the roundness is >0.8, and it has a tail or spiny hairs, and the movement distance is >100 and the area is ≤10000, it is judged to be sulfur bacteria; If the rectangle's rectangularity is between 0.3 and 0.7 and it has a tail or spiny hairs, it is identified as a Vorticella. If the rectangularity is between 0.3 and 0.7, and there is no tail or spiny hairs, and the movement distance is >100, it is identified as a twisted head worm; If the rectangularity is between 0.3 and 0.7, and there is no tail or spiny hairs, and the movement distance is ≤100 and the multi-scale fusion inverse moment is >500, it is identified as a twig-borne insect; If the rectangularity is between 0.3 and 0.7, and there is no tail or spiny hairs, and the movement distance is ≤100 and the multi-scale fusion inverse moment is ≤500, it is identified as a rotifer.

[0023] Step W301 can be achieved in the following way: Based on the dynamic trajectory recognition results of step W201, the static area is locally cropped. The FCM clustering algorithm is used to classify pixels in the static area, thereby distinguishing the dark bacterial clumps from the light background. The image is further processed through opening operations; Introducing the characteristic parameter Floc percentage X p And the number of blank areas X k .

[0024] Step W302 includes: When X p <0.4 and X k When the value is less than 10, it indicates that the bacterial flocs are large, have clear edges, and are tightly packed. The interstitial water between the bacterial flocs is relatively clear and the boundaries are obvious. This indicates that the aeration tank is operating well. When X p >0.4 or X k A value >10 indicates that the flocs are fine and loosely structured, and the interstitial water between the flocs is relatively turbid with no clear boundaries. This reflects that the operating status of the aeration tank has begun to deteriorate or has already deteriorated.

[0025] Step W400 determines the current operating status based on the microbial species identified in W201 and the sludge characteristics identified in W301. The dominant microbial species refer to microbial populations that exhibit high degradation activity or tolerance to specific pollutants in a particular contaminated environment. Specifically: When the dominant microbial species are Vorticella and / or Cyclops, and the floc morphology is X p <0.4 and X k If the value is less than 10, it is considered "operating well"; When the dominant microbial species are *Bacillus lentigines* and / or *Trichomonas vaginalis*, and the floc morphology is X p >0.4 or X k If the value is >10, it is judged as "starting to deteriorate"; When the dominant microbial species is *Paratomium spp.*, and the floc morphology is X p >0.4 or X k If the value is greater than 10, it is considered "low load"; When the dominant microbial species is nematode, and the floc morphology is X p >0.4 or X k If the value is greater than 10, it is considered a "high load"; When the dominant microbial species are sulfur bacteria and / or spirochetes, and the floc characteristics are X p >0.4 or X k If the value is >10, it is determined to be "low dissolved oxygen operation"; When the dominant microbial species is rotifers, and the floc morphology is X p >0.4 or X k If the value is >10, it is determined to be "high dissolved oxygen operation"; When a sharp decrease in platycerium is detected, regardless of the characteristics of the bacterial floc, it is determined to be "shock load, toxic flow in".

[0026] Step W500 includes: When the operating status is "operating well", it indicates that the overall sludge settling and coagulation performance is good and the effluent treatment effect is good. At this time, the existing operating parameters should be maintained and operation management should be strengthened. When the operating status is "low load operation", the sludge settling performance deteriorates and the sludge-water separation is affected. At this time, the sludge return flow should be reduced, nutrients should be added, and the sludge age should be shortened. When the operating status is "high load operation", the wastewater is rich in nutrients, which leads to an increase in free organisms. At this time, the influent flow rate and sludge discharge should be reduced to reduce the sludge load. When the operating status is "low dissolved oxygen operation", the oxygen supply flow rate of the aeration tank should be increased, or the aeration interval time should be shortened to increase the dissolved oxygen concentration. When the operating status is "high dissolved oxygen operation", the oxygen supply flow rate of the aeration tank should be reduced, or the aeration interval should be extended to reduce the dissolved oxygen concentration. When the operating status is "beginning to deteriorate" and / or "impact load, toxic flow in", an alarm should be issued in a timely manner, and manual investigation should be organized to find the cause and deal with the abnormality as soon as possible.

[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0028] Please see Figure 1 This invention provides a method for diagnosing the operation of aeration tanks based on continuous online image recognition, comprising the following steps: W100: Online Image Acquisition and Processing. Specifically, the online image acquisition process is as follows: An automatic sampling device is used to collect samples at a depth of 10cm below the water surface near the outlet of the aeration tank. After sampling, the samples are automatically transferred to the viewing area, magnified by a microscope, and then continuously photographed using the lens. The magnification is 100x, the sampling interval is 10 minutes, the photographing interval is 5 seconds, and the photographing duration is 5 minutes. Specifically, the online image processing process is as follows: The obtained color image is converted to grayscale using a weighted average method, H(x,y)=0.3R(x,y)+0.6G(x,y)+0.1B(x,y), where H is the grayscale value, R is the red color value, G is the green color value, B is the blue color value, and (x,y) are the image position coordinates. The grayscale image is stored using an 8-bit non-linear scale for each sampled pixel, resulting in 256 grayscale levels, i.e., 0-255. Because the background of an image often contains many impurities, preprocessing of the grayscale image is necessary to enhance the contrast between the subject and the background in order to ensure the accuracy of subsequent recognition. This invention employs an improved adaptive histogram equalization method, as follows: Where MN is the total number of pixels in the image, p i f(p) represents the proportion of pixels with gray level i in the image. i ) represents the gray level value of pixel i in the equalized image, and h(a) represents the number of pixels with gray level i in the original image. See the processing results. Figure 2 .

[0029] W201: Microbial identification. Mainly divided into dynamic trajectory identification and static shape identification.

[0030] The specific analysis process for dynamic trajectory recognition is as follows: A difference operation is performed on two consecutive images. When a moving target appears, a significant difference will appear between the two images. The absolute value of the pixel value difference at corresponding positions in the images is then calculated. By determining whether this difference exceeds a set threshold, the motion characteristics of the target object in the image sequence can be analyzed. The mathematical formula is described below: D i(x, y) represents the difference image between the (i+1)th and ith images obtained during each 5-minute sampling period. A value of 1 indicates the foreground (moving region), and a value of 0 indicates the background (non-moving region). I(t) and I(t-1) are the images at times t and t-1, respectively. TH is the threshold value set for the difference image. After processing, D is selected. i Given a feature point (x,y)=1, connect 59 consecutive feature points in chronological order using line segments and calculate the total length L of all line segments, in pixels.

[0031] The sum of all moving regions in the difference images is the final moving region, and the intersection of the non-moving regions is the final stationary region. The moving target detection process is as follows: For the moving region in each difference image, Otsu adaptive thresholding is used to remove noise, and then 8-neighbor connected component analysis is used to filter regions with an area of ​​50-50000 pixels. 2 (Excluding excessively small noise and excessively large background interference) connected regions, candidate bounding boxes (x1, y1, x2, y2) are obtained for each moving microorganism. The center coordinates (x1, y1, x2, y2) of the candidate boxes are extracted. c y c The aspect ratio r = w / h and the area S = (x2-x1)(y2-y1) are used as the initial features of the target. For the first frame of the sequence, a unique trajectory ID (such as ID1, ID2, IDn) is assigned to each candidate box, its center coordinates, aspect ratio, and area are recorded, and the trajectory counter (count=1) and the disappearance counter (miss=0) are initialized.

[0032] For frames 2-60, the Hungarian algorithm combined with IoU similarity matching is used. The specific process is as follows: Calculate the IoU value between each candidate box in the current frame and all active trajectories (miss≤3): (A represents the area of ​​the candidate box in the current frame, and B represents the area of ​​the candidate box in the previous frame of the trajectory). Construct an IoU similarity matrix and solve for the optimal match using the Hungarian algorithm. When IoU ≥ 0.3, bind the current candidate box with the corresponding trajectory ID, update the center coordinates, aspect ratio, and area of ​​the trajectory, increment count by 1, and reset miss to 0. For current candidate boxes that do not match a trajectory, determine them as new targets, assign a new trajectory ID (e.g., IDn+1), and initialize count=1 and miss=0. For trajectories that do not match a current candidate box, increment miss by 1. When miss > 3, terminate the trajectory. When trajectory intersection (IoU ≥ 0.5) or partial occlusion is detected, extract the grayscale histogram (16 bins) of the microorganisms within the candidate box, and calculate the histogram cosine similarity between the current frame target and historical trajectories. , with Sim weight A value of ≥0.4 is used as the matching threshold to avoid incorrect trajectory association.

[0033] For each active trajectory, record the center coordinates frame by frame and calculate the Euclidean distance between consecutive frames. The total length of the trajectory is obtained by summing the results. The unit is pixels.

[0034] The specific analysis process for static shape recognition is as follows: Based on the dynamic trajectory recognition results, the moving object is locally cropped. During cropping, the motion region without intersection or occlusion can be selected based on whether the current motion trajectory intersects or occludes with other motion trajectories, and microbial candidate boxes are cropped from it for further processing. The brightness change of the cropped image is differentiated twice, and the zero-crossing points obtained are used to locate the edges. The effect image after edge detection is shown in the figure. The outermost contour of the object to be recognized is found, and any point inside it is specified as a seed point. The dynamic correction factor flooding algorithm is used to complete the filling, as follows: In addition to the traditional flooding algorithm, 1) a color correction factor CF is introduced, which dynamically adjusts the color difference threshold based on the color statistical characteristics (mean μ, variance σ) of the seed point's neighborhood: ,in Based on the basic color difference threshold, α and β are weighting coefficients controlling variance sensitivity. The threshold is relaxed in low-variance regions (small σ) to accommodate smooth gradations, while the threshold is tightened in high-variance regions (large σ) to suppress noise interference. 2) A spatial correction factor SF is introduced, which, combined with the Euclidean distance d between the pixel and the seed point, limits the diffusion rate of long-distance filling. Where d0 is the distance decay start point, and γ and k are the rate and magnitude of decay control, respectively. Full-speed filling is used for close distances, while gradually decreasing weights for distant distances, prioritizing neighboring regions. 3) Optimize the priority queue, i.e., use a weighted BFS queue, defining the pixel filling priority P as... 4) Add an edge protection mechanism, which involves real-time detection of local gradient changes during queue diffusion. If the gradient G of adjacent pixels exceeds a threshold... Then trigger This is to suppress false filling across edges.

[0035] Furthermore, the specific algorithm flow is as follows: 1) Initialization - Input seed point 1) Calculate μ and σ of the initial neighborhood; 2) Calculate the dynamic threshold – based on σ and distance d of the current region, generate... With priority P; 3) Priority queue diffusion, ① Extract the highest priority pixel from the queue and check its four-neighborhood / eight-neighborhood; ② For each neighboring pixel, update the local statistics and recalculate the correction factor; ③ If the condition is met (color difference < 4) Termination condition – the queue is empty or the maximum number of iterations has been reached. The effect is as follows: Figure 3 As shown.

[0036] Feature recognition of the filled color blocks is mainly based on a comprehensive judgment of the following indicators: Rectangularity = S 待识别物体的面积 / S 待识别物体外接矩形的面积 The area of ​​the image region S is the number of pixels in that region. The bean-shaped worm is nearly round, with a relatively small rectangularity; the Vorticella has a slender tail, with a medium rectangularity; the nematode is slender overall, closest to a rectangle, with a rectangularity close to 1.

[0037] Roundness = S 待识别物体的面积 / S 待识别物体外接圆的面积 Similar to the principle of rectangular classification, it is mainly used to identify microorganisms with a body shape close to round, such as bean worms.

[0038] Symmetry: By counting the number of non-zero pixel values ​​row by row, the row with the most non-zero pixel values ​​of the object to be identified is found. Using the midpoint as the reference point, the standard deviation is calculated using the number of non-zero pixel values ​​on both the left and right sides. This yields the horizontal and vertical standard deviations, corresponding to the symmetry in the horizontal and vertical directions, respectively.

[0039] Multi-scale fusion inverse moments: The inverse moments are obtained using the gray-level co-occurrence matrix, and then weights are dynamically allocated using entropy values ​​to integrate the inverse moments from multiple directions, reducing the bias of texture features in a single direction, and obtaining the multi-scale fusion inverse moments for evaluation. Specifically: Multi-scale fusion inverse moments , Inverse difference moment Gray-level co-occurrence matrix ,in The four directions are 0°, 45°, 90°, and 135°. Let g1 be the entropy value in each direction, g2 be the coordinates of adjacent pixels (x1, y1) and g3 be the gray values ​​corresponding to (x1, y1) and g4 be the gray values ​​corresponding to (x2, y2), and S be the set of pixel pairs with specific spatial relationships in the target region. Multi-scale fusion inverse difference moments are mainly used to evaluate the amount of local variation and have a very strong distinguishing effect on characteristic animals such as *Cypripedium*.

[0040] Whether there is a tail or bristles: By counting the number of non-zero pixel values ​​row by row, the number of rows with the most non-zero pixel values ​​is counted as n. i-max The total number is N, and when there are n consecutive non-zero pixel values ​​less than or equal to n... i-max If n > N / 4, then it is determined to have a tail.

[0041] W202: Determine the microbial species. See below for the specific decision-making process. Figure 4 ,as follows: If the rectangularity is greater than 0.7, it is identified as a nematode; If the rectangularity is less than 0.3, the roundness is less than 0.8, and the symmetry is less than 800, it is identified as a rotifer. If the rectangularity is less than 0.3, the roundness is less than 0.8, and the symmetry is greater than or equal to 800, it is identified as lateral trichomonas. If the rectangle's rectangularity is less than 0.3 and the roundness is greater than 0.8, and there is no tail or spiny hairs, it is identified as a bean-shaped worm. If the rectangularity is less than 0.3 and the roundness is greater than 0.8, and it has a tail or spiny hairs and the movement distance is less than 100, it is identified as a shield fiberworm; If the rectangularity is <0.3 and the roundness is >0.8, and it has a tail or spiny hairs, and the movement distance is >100, and the area S 待识别物体的面积 >10000, classified as a wandering servant insect; If the rectangularity is <0.3 and the roundness is >0.8, and it has a tail or spiny hairs, and the movement distance is >100, and the area S 待识别物体的面积 ≤10000, classified as sulfur bacteria; If the rectangle's rectangularity is between 0.3 and 0.7 and it has a tail or spiny hairs, it is identified as a Vorticella. If the rectangularity is between 0.3 and 0.7, and there is no tail or spiny hairs, and the movement distance is >100, it is identified as a twisted head worm; If the rectangularity is between 0.3 and 0.7, and there is no tail or spiny hairs, and the movement distance is ≤100 and the multi-scale fusion inverse moment is >500, it is identified as a twig-borne insect; If the rectangularity is between 0.3 and 0.7, and there is no tail or spiny hairs, and the movement distance is ≤100 and the multi-scale fusion inverse moment is ≤500, it is identified as a rotifer.

[0042] W301: Floc Shape Identification. Based on the dynamic trajectory identification results of W201, the static area is locally cropped. To better extract the floc images, the FCM clustering algorithm is used for identification. Where m is the dataset size, c is the number of cluster centers, and μ is the number of cluster centers. ij Let α be the membership degree of the i-th data point to the j-th centroid, and let α be a hyperparameter. i -c j ‖ represents the distance from the i-th data point to the j-th center. Further image processing, including opening operations, is then applied to eliminate noise. The final processing result is shown below. Figure 5 At this point, the characteristic parameter X, representing the proportion of bacterial micelles, is introduced. p =S 黑色区域 / S 总面积 And the number of blank areas X k .

[0043] W302: Determine the characteristics of the bacterial flocs. When X p <0.4 and X kWhen the value is less than 10, it indicates that the bacterial flocs are large, have clear edges, and a compact structure. Furthermore, the interstitial water between the bacterial flocs is relatively clear, with distinct boundaries. This indicates that the aeration tank is operating well. When X... p >0.4 or X k A value >10 indicates that the flocs are fine and loosely structured, and the interstitial water between the flocs is relatively turbid with no clear boundaries. This indicates that the aeration tank's operating status has begun to deteriorate or has already deteriorated.

[0044] W400: Determine operating status. As shown in Table 1, the current operating status can be determined when both the microbial species identified by W202 and the sludge characteristics identified by W302 are satisfied. Specifically, when the dominant microbial species are Vorticella and / or Cyclocarya, and the floc characteristics are X... p <0.4 and X k If the value is <10, it is considered "operating well"; when the dominant microbial species are *Pseudomonas beanoidea* and / or *Trichomonas vaginalis*, and the floc morphology is X. p >0.4 or X k If the value is >10, it is judged as "beginning to deteriorate"; when the dominant microbial species is *Paratomium spp.* and the floc morphology is X... p >0.4 or X k If the value is >10, it is considered "low load"; when the dominant microbial species is nematode and the floc morphology is X p >0.4 or X k A value >10 is considered "high load"; when the dominant microbial species are sulfur bacteria and / or spirochetes, and the floc characteristics are X p >0.4 or X k If the value is >10, it is determined to be "low dissolved oxygen operation"; when the dominant microbial species is rotifers and the floc morphology is X p >0.4 or X k If the value is >10, it is judged as "high dissolved oxygen operation"; when a sharp decrease in platycerium is detected (for example, a decrease of more than a certain percentage within a set time), regardless of the characteristics of the bacterial floc, it is judged as "shock load, toxic flow in".

[0045] Table 1. Operating Status Judgment Table W500: Provides adjustment suggestions. As shown in Table 2, when the operating status is "Good Operation," it indicates that the overall sludge settling and flocculation performance is good, and the effluent treatment effect is good. At this time, the existing operating parameters should be maintained, and operation management should be strengthened. When the operating status is "Low Load Operation," the sludge settling performance deteriorates, and sludge-water separation is affected. At this time, the sludge return flow should be reduced, nutrients should be added, and the sludge age should be shortened. When the operating status is "High Load Operation," the wastewater is rich in nutrients, leading to an increase in free organisms. At this time, the influent flow and sludge discharge should be reduced to lower the sludge load. When the operating status is "Low Dissolved Oxygen Operation," the oxygen supply flow of the aeration tank should be increased, or the aeration interval should be shortened to increase the dissolved oxygen concentration. When the operating status is "High Dissolved Oxygen Operation," the oxygen supply flow of the aeration tank should be reduced, or the aeration interval should be extended to lower the dissolved oxygen concentration. When the operating status is "Beginning to Deteriorate" and / or "Shock Load, Toxic Flow In," an alarm should be issued in a timely manner, and the cause should be investigated manually and the abnormality should be dealt with as soon as possible.

[0046] Table 2. Handling Recommendation Table

Claims

1. A method for comprehensive diagnosis of operation of an aeration tank based on continuous recognition of images, characterized in that, include: Obtain water samples from the aeration tank; Multiple microscopic images of the sample were continuously acquired within a fixed observation area, and after preprocessing, a sequence of sample images arranged in chronological order was obtained. Calculate the difference image between any two adjacent sample images in the sequence, and take the region in the difference image whose absolute value of the pixel value difference is greater than a set threshold as the moving region, and the other regions as the non-moving region; By tracking the changes in motion regions in the differential image in chronological order, the motion trajectory of the object is identified and the trajectory length of each motion trajectory is calculated. Images of the moving objects corresponding to each motion trajectory are captured separately, and contour and texture features are extracted from the captured images; The types of microorganisms on moving objects are determined based on their contour features, texture features, and trajectory length. The intersection of non-moving regions in all difference images is extracted as the static region. The characteristics of bacterial flocs in the static region are analyzed, and then the operating status of the aeration tank is diagnosed by combining the characteristics of bacterial flocs and the types of microorganisms.

2. The diagnostic method according to claim 1, characterized in that, Contour features include rectangularity, roundness, symmetry, object area, and whether there is a tail or thorns; texture features include multi-scale fusion inverse moments, which are obtained by using the gray-level co-occurrence matrix to obtain the inverse moments, and then using entropy values ​​to dynamically allocate weights to integrate the inverse moments in multiple directions.

3. The diagnostic method according to claim 2, characterized in that, Based on contour features, texture features, and trajectory length, the types of microorganisms on moving objects are determined, including: If the rectangle size is greater than the first rectangle size threshold, it is determined to be a nematode; If the rectangularity is less than the second rectangularity threshold, the roundness is less than or equal to the roundness threshold, and the symmetry is less than the symmetry threshold, it is determined to be a rotifer; If the rectangularity is less than the second rectangularity threshold, the roundness is less than or equal to the roundness threshold, and the symmetry is greater than or equal to the symmetry threshold, it is determined to be lateral trichomonas. If the rectangularity is less than the second rectangularity threshold, and the roundness is greater than the roundness threshold, and there is no tail or spiny hairs, it is determined to be a bean-shaped worm; If the rectangularity is less than the second rectangularity threshold, the roundness is greater than the roundness threshold, and it has a tail or spiny hairs, and the trajectory length is less than or equal to the trajectory length threshold, it is identified as a shield fiberworm. If the rectangle degree is less than the second rectangle degree threshold, the roundness is greater than the roundness threshold, and it has a tail or spiny hairs, the trajectory length is greater than the trajectory length threshold, and the object area is greater than the area threshold, it is determined to be a wriggling insect. If the rectangularity is less than the second rectangularity threshold, the roundness is greater than the roundness threshold, and it has a tail or spiny hairs, and the trajectory length is greater than the trajectory length threshold, and the object area is less than or equal to the area threshold, it is determined to be a sulfur bacterium. If the rectangularity is between the second rectangularity threshold and the first rectangularity threshold, and it has a tail or spiny hairs, it is identified as a Vorticella. If the rectangularity is between the second rectangularity threshold and the first rectangularity threshold, and there is no tail or spiny hairs, and the trajectory length is greater than the trajectory length threshold, it is determined to be a twisted head worm; If the rectangularity is between the second rectangularity threshold and the first rectangularity threshold, and there is no tail or spiny hair, and the trajectory length is less than or equal to the trajectory length threshold, and the multi-scale fusion inverse moment is greater than the inverse moment threshold, it is determined to be a twig-eaten insect. If the rectangularity is between the second rectangularity threshold and the first rectangularity threshold, and there is no tail or spiny hairs, and the trajectory length is less than or equal to the trajectory length threshold, and the multi-scale fusion inverse moment is less than or equal to the inverse moment threshold, it is determined to be a rotifer.

4. The diagnostic method according to claim 1, characterized in that, By tracing changes in motion regions within differential images in chronological order, identifying object trajectories, and calculating the length of each trajectory, the following methods are employed: For each difference image, a connected region analysis is performed on the motion region to extract candidate bounding boxes for each moving object; A multi-target tracking method is adopted, which matches candidate bounding boxes extracted from each difference image based on IoU similarity to form the object's motion trajectory; The trajectory length of each trajectory is calculated based on the center coordinates of the candidate bounding boxes corresponding to the motion trajectory.

5. The diagnostic method according to claim 4, characterized in that, Images of moving objects are captured using the following methods: Based on the IoU similarity matching results, determine whether the current motion trajectory intersects or occludes with other motion trajectories; Select the portion of the current motion trajectory that does not intersect or occlude, extract candidate bounding boxes from it, and obtain the image of the corresponding moving object.

6. The diagnostic method according to claim 5, characterized in that, Extracting contour and texture features from a cropped image includes: The brightness change of the cropped image is differentiated twice, and the outermost contour of the moving object is extracted based on the obtained zero-crossing points. An improved flooding algorithm is used to fill the contour based on seed points set within the contour. Extract contour and texture features from the filled color blocks.

7. The diagnostic method according to claim 6, characterized in that, An improved flooding algorithm is used for filling, including: Centered on the seed point, select a neighborhood window and calculate the color mean and variance of that neighborhood; The color difference threshold is calculated based on the variance of the current neighborhood and used as a color correction factor. Calculate the spatial correction factor based on the Euclidean distance between the current pixel and the seed point; Adjust the fill priority using color correction factors and spatial correction factors, extract the pixel with the highest current priority from the priority queue, traverse its four-neighbor or eight-neighbor pixels, update the local statistics of each neighborhood pixel and recalculate the color correction factor and spatial correction factor, add pixels that meet the color difference condition to the queue, and repeat this step until the priority queue is empty or the maximum number of iterations is reached.

8. The diagnostic method according to claim 7, characterized in that, During iterative calculations, the process also includes a step of real-time detection of whether the gradient of adjacent pixels exceeds the gradient threshold. If it does, the color threshold is tightened to suppress false filling across edges.

9. The diagnostic method according to claim 1, characterized in that, The morphological characteristics of bacterial flocs in the quiescent region were analyzed, including: Clustering algorithms are used to classify pixels in static areas to obtain dark-colored bacterial clumps and light-colored backgrounds; An opening operation is performed on the classified images to calculate the proportion of fungal micelles and the number of blank areas as morphological characteristics of the fungal micelles.

10. The diagnostic method according to claim 9, characterized in that, The operational status of the aeration tank is diagnosed based on the characteristics of the flocs and the types of microorganisms, including: When the dominant microbial species are Vorticella and / or Cyclops, and the proportion of bacterial flocs is less than the bacterial floc threshold and the number of blank areas is less than the number threshold, it is judged as "operating well". When the dominant microbial species are *Bacillus lentigines* and / or *Trichomonas vaginalis*, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "beginning to deteriorate". When the dominant microbial species is *Pteris vittata*, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "low load". When the dominant microbial species is nematode, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "high load"; When the dominant microbial species are sulfur bacteria and / or spirochetes, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "low dissolved oxygen operation". When the dominant microbial species is rotifer, and the proportion of bacterial flocs is greater than the bacterial floc threshold or the number of blank areas is greater than the number threshold, it is judged as "high dissolved oxygen operation". When the rate of decrease in the number of Shield Fibers exceeds the set value, regardless of the characteristics of the bacterial flocs, it is determined to be "impact load, toxic flow in".

Citation Information

Patent Citations

  • Dynamic microbial recognition statistical method and system based on microbial population analyzer

    CN120279553A