A method and system for identifying activated sludge stages based on metazoan target recognition and a storage medium

By combining image recognition and feature matrix analysis with the XGBoost model, the problem of determining the biochemical reaction stage of activated sludge was solved, enabling rapid and accurate sludge status identification and process adjustment.

CN120877282BActive Publication Date: 2025-11-25AOTU TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511383449.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2025-11-25
Estimated Expiration
2045-09-26

AI Technical Summary

Technical Problem

Existing technologies make it difficult to accurately determine the biochemical reaction stage of activated sludge, and a single indicator cannot fully reflect changes in the microbial population and quantity, leading to inaccurate operation of the biochemical tank.

Method used

Image recognition technology is used to identify flocs and metazoans in activated sludge, extract feature data and construct a feature matrix, use the XGBoost model to predict the activated sludge stage, and combine sensors to monitor water quality indicators in real time for process control.

Benefits of technology

It enables rapid and efficient identification of activated sludge stages, provides timely dosing guidance, adapts to process changes in different water plants, and improves the interpretability and flexibility of production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120877282B_ABST
    Figure CN120877282B_ABST
Patent Text Reader

Abstract

The application discloses a kind of active sludge stage identification method, system and storage medium based on metazoan target identification, belong to the technical field of information security, continuously scan and photograph the bacteria-jelly region in active sludge, and record the position coordinates of each picture, obtain picture matrix;Image recognition processing is carried out based on target detection model, and boundary box coordinates, boundary box pixel area, image area in detection frame and class probability are output;Based on the result of image recognition, the feature data used for prediction is extracted, and the feature matrix is constructed;Based on feature matrix, XGBoost model is used for prediction, and the stage value y of active sludge is output to carry out process control decision.The application can quickly and conveniently obtain the stage condition of the currently cultured active sludge, and can guide production and process adjustment without many related professional knowledge, and has good practicability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of sewage treatment, and particularly relates to an activated sludge stage identification method and system based on metazoan target identification and a storage medium. BACKGROUND

[0002] The activated sludge is flocculation formed by mixing and interweaving of various aerobic microorganisms, facultative anaerobic microorganisms (and possibly a small amount of anaerobic microorganisms in some cases) and organic and inorganic solids in wastewater. The activated sludge method and its derivative improved process is the most widely used method for treating municipal wastewater, which can remove soluble and colloidal state biodegradable organic matter and suspended solids and other substances that can be adsorbed by activated sludge, and also remove part of phosphorus and nitrogen, and is a general term for various methods of biological treatment of wastewater micro-organisms suspended in water.

[0003] The proliferation process of microorganisms in the activated sludge is divided into four stages: adaptation period, logarithmic growth period, deceleration proliferation period and endogenous respiration period. Generally speaking, the area for biochemical reaction is best controlled in the deceleration proliferation period, which requires accurate judgment of the growth stage of the activated sludge and prediction of the future growth trend of the sludge. However, at present, the guiding production in the biochemical tank is mainly based on the experience of old employees, which depends on a single indicator, such as the nitrate nitrogen value of the biochemical tank. However, the reaction in the biochemical tank is relatively complex, and a single indicator cannot fully reflect the state of the sludge. The changes in the population and quantity of microorganisms are more reliable than some indicators in reflecting the state of the sludge. Specifically, under the conditions of suitable temperature, sufficient dissolved oxygen content and absence of inhibitory substances, the determining factor for controlling the growth of activated sludge is the ratio between the food amount F (the amount of organic matter in wastewater, also known as the amount of substrate) and the microbial amount M (the amount of activated sludge), which is also affected by the degradation rate of organic substrate, the oxygen utilization rate and the aggregation and adsorption performance of activated sludge. SUMMARY

[0004] The application aims to provide an activated sludge stage identification method and system based on metazoan target identification and a storage medium, which aims to solve the above problems.

[0005] The application is mainly implemented through the following technical solutions:

[0006] An activated sludge stage identification method based on metazoan target identification, comprising the following steps:

[0007] Step S1: continuously scanning and photographing the zoogleal mass area in the activated sludge, and recording the position coordinates of each picture to obtain a picture matrix;

[0008] Step S2: performing image recognition processing based on the target detection model, and outputting the bounding box coordinates, the bounding box pixel area, the image region in the detection box and the class probability;

[0009] Step S3: extracting feature data for prediction;

[0010] Step S31: based on the result of step S2 recognition, the zooglea characteristics are extracted, and [zooglea number, zooglea size, zooglea color, zooglea shape, zooglea coordinates] are obtained;

[0011] Step S32: based on the result of step S2 recognition, the metazoan characteristics are extracted, and [metazoan number, metazoan size, metazoan color, metazoan type, metazoan coordinates] are obtained;

[0012] Step S33: based on the features extracted in steps S31 and S32, the binding relationship is analyzed, and the Pearson correlation coefficient r of the number of metazoans corresponding to the zooglea is calculated;

[0013] Step S34: based on the result of step S2 recognition, the part of the original picture without the bounding box is obtained, and is used as the interstitial water region; after the interstitial water region is processed as a black and white binary graph, the proportion of black and white pixels is calculated, which is used as the turbidity feature of the interstitial water;

[0014] Step S35: based on the results of steps S31-S33, the feature indicators are extracted; based on the extracted feature indicators and the real-time monitored water quality indicators of the sensor, a feature matrix X is constructed mn , wherein m and n are the number of rows and columns of the feature matrix, respectively, and m is the same as the number of feature categories in the feature matrix;

[0015] Step S4: based on the feature matrix, an XGBoost model is used for prediction, and the stage value y of the activated sludge is outputted to make process control decision.

[0016] In order to better realize the present application, further, in step S31, the zooglea number is obtained based on the position coordinates of the picture, the zooglea coordinates are obtained based on the bounding box coordinates of the zooglea, and the zooglea size is obtained based on the bounding box pixel area of the zooglea; the proportion of high frequency energy is calculated by performing Fourier transform on the image region in the detection box of the zooglea, and the zooglea shape is obtained, which is used to represent the compactness of the zooglea.

[0017] In order to better realize the present application, further, the step S33 includes the following steps:

[0018] (1) based on the zooglea coordinates x f , y f) and metazoan coordinates x m , y m ), calculate the Euclidean distance of each metazoan to the nodule;

[0019] ;

[0020] (2) Based on the minimum Euclidean distance, get the unique active nodule of the metazoan at the current moment, and bind the corresponding metazoan number and nodule number;

[0021] (3) Finally, the Pearson correlation coefficient r of the number of metazoans corresponding to the nodule:

[0022] ;

[0023] Wherein: n is the total number of nodules;

[0024] S i is the area of the i-th nodule;

[0025] C i is the number of metazoans bound to the i-th nodule;

[0026] is the average area of the nodule;

[0027] is the average number of metazoans bound to the nodule.

[0028] In order to better realize the present application, further, in the step S35, the feature matrix X mn includes:

[0029] Taking the turbidity of interstitial water as the water quality index x 11 ; Based on the water quality index detected by the sensor x 12 , x 13 … x 1j ; Wherein j = the total number of sensor types + 1;

[0030] Based on the number of nodule numbers, the nodule number index is obtained x 21 ;

[0031] Calculate the mean, median, mode and standard deviation of the size of all nodules to obtain the index x 22 ,x 23 、 x 24 、 x 25 ;

[0032] According to the RGB sequence in the color of the zoogloea, the white-brown degree is calculated, and according to the white-brown degree, the mean, median, mode and standard deviation are calculated to obtain the index x 26 、 x 27 、 x 28 、 x 29 ;

[0033] The mean, median, mode and standard deviation of all zoogloea morphologies are calculated to obtain the index x 210 、 x 211 、 x 212 、 x 213 ;

[0034] Based on the number of metazoan numbers, the metazoan number index is obtained x 31 ;

[0035] Based on the type of metazoan, the number of each type of metazoan is counted to obtain the index x 32 、 x 33 、 x 34 、 x 35 … x 3i ; wherein: i = the number of types of metazoans - 1;

[0036] According to the RGB sequence in the color of the metazoan, the white-brown degree is calculated, and according to the white-brown degree, the mean, median, mode and standard deviation of each type of metazoan are calculated to obtain the index x 32-1 、 x 32-2 、 x 32-3 、 x 32-4 、 x 33-1 、 x 33-2 、 x 33-3 、 x 33-4 , …x 3i-4 ;

[0037] Calculate the mean, median, mode, and standard deviation of all metazoan sizes to obtain the index x 32-5 , x 32-6 , x 32-7 , x 32-8 , x 33-5 , x 33-6 , x 33-7 , x 33-8 , x 3i-8 ;

[0038] Take the Pearson correlation coefficient r as the index x 36 .

[0039] To better realize the present application, further, the white-brown degree = t x 100%, wherein t is a projection parameter:

[0040] ;

[0041] Wherein: WC is the vector of the target color point C (R, G, B) relative to the white point W (255, 255, 255);

[0042] WB is the vector of the brown point B (139, 69, 19) relative to the white point W (255, 255, 255);

[0043] is the module length;

[0044] Dot product WC x WB = (R-255)(-116) + (G-255)(-186) + (B-255)(-236).

[0045] Dot product WC x WB = (R-255)(-116) + (G-255)(-186) + (B-255)(-236).

[0046] To better realize the present invention, further, in step S4, the feature influence of the feature matrix is ​​dynamically adjusted. A feature influence matrix [a,b,c] is constructed based on water quality features, floc features, and metazoan features. During the normalization process of each feature, the standardized interval (0,1) is modified to (0,a), (0,b), and (0,c) respectively; thereby controlling the magnitude of the mutual influence between water quality features, floc features, and metazoan features.

[0047] To better implement this invention, the stage value y is initially a series of probability values, outputting the probability for consecutive unit time. Then, the probability distribution is analyzed, and the number K of unit time with probabilities greater than a set threshold is counted. If K is greater than the threshold, the model is reliable.

[0048] Analyze the distribution range where the probability is greater than a set threshold to obtain the minimum index M1 and the maximum index M2, and calculate the range R = M2 − M1 + 1; then, calculate the continuous proportion r. c =K / R, if r c If the value exceeds a set threshold, the model is considered reliable, and the final output stage value y represents the number of days with the highest probability. Otherwise, the model is considered unreliable, and the feature influence matrix [a,b,c], the threshold for the quantity K, and the continuous ratio r are adjusted. c .

[0049] To better realize the present invention, step S5 is further included:

[0050] Step S51: Under the same type of activated sludge environment, the first predicted value y 1p Compared with the actual value y 1r The difference is e1;

[0051] Step S52: After time t, obtain the second predicted value y. 2p And the second predicted value y 2p Compared with the actual value y 1r+t The difference is e2;

[0052] Step S53: Add e2 to the difference sequence, calculate the mean of the sequence, and obtain the updated error value e;

[0053] Step S54: Calculate y 2p +e yields y 2pc , then y 2pc This serves as the stage value predicted for the activated sludge stage.

[0054] This invention is mainly achieved through the following technical solutions:

[0055] The application discloses an activated sludge stage identification system based on metazoan target identification, which is realized based on the method and comprises a data acquisition module, a target identification module, a feature extraction module, a feature matrix module and a prediction module.

[0056] A computer readable storage medium, which stores a computer program, the program being executed by a processor to realize the method.

[0057] The application has the following advantages:

[0058] (1) Simple. The application derives a feature matrix for a classification algorithm based on image recognition results, and can quickly and efficiently analyze the stage of activated sludge by specific feature extraction and combination of a classification model, so that a conclusion that needs long-term experiments can be easily obtained.

[0059] (2) Efficient. The application can achieve unmanned report output, and can complete the whole identification and classification process in a few minutes at the fastest speed according to the configuration and performance, so that timely dosing guidance and remediation can be provided.

[0060] (3) Strong interpretability. The feature influence matrix constructed by the application enhances adaptive identification function; the feature influence matrix after verification of the classification model can reflect the part that has a greater impact on the overall environment, and thus provides an optimization direction.

[0061] (4) Strong flexibility. For different water plants, the model can be well adapted due to the difference in water quality and process. Because the method for judging the activated sludge state is mainly used for water quality in actual production, the water quality is different in different water plants. BRIEF DESCRIPTION OF DRAWINGS

[0062] Figure 1A flow chart of the active sludge stage identification method based on metazoan target identification of the present application. DETAILED DESCRIPTION

[0063] Embodiment 1

[0064] An active sludge stage identification method based on metazoan target identification, as shown in the figure, comprises the following steps: Figure 1

[0065] Step S1: Microscopic image acquisition and water quality index acquisition based on sensors are simultaneously performed at the same time point t. Specifically, an active sludge image is taken using a microscope, a microscopic image is acquired, and a picture matrix is obtained.

[0066] Step S11: 0.05 mL of sludge is taken to make a slide, comprising the following steps:

[0067] 1) First, clean the slide and wipe it dry with lens paper;

[0068] 2) Shake the fresh active sludge mixture collected from the biochemical tank, use a rubber bulb pipette to suck the fresh active sludge mixture, and remove the first few times of sucking the fresh active sludge mixture to make the inner wall of the rubber bulb pipette close to the original sludge mixture environment;

[0069] 3) Drop one drop of the mixture (0.05 mL) to the center of the glass slide;

[0070] 4) Place the cover glass flat on the slide and press it gently to make the sludge flat.

[0071] Step S12: Find the zooglea in the active sludge using 100 times magnification, and then take a picture of the zooglea. Specifically, it comprises the following steps:

[0072] 1) Place the prepared slide behind the stage;

[0073] 2) Adjust the eyepiece and objective lens to 10x10 magnification;

[0074] 3) Adjust the light source to make the field of view bright;

[0075] 4) Adjust the coarse focus screw and fine focus screw to make the picture clear;

[0076] 5) Adjust the field of view to the upper left corner of the slide edge;

[0077] 6) Take a complete picture of all parts of 0.05 mL of sludge by continuous shooting. The shooting method is to use the motor to drive the stage to move, and to scan the entire slide row by row, starting from the left upper corner edge of the cover glass.

[0078] ​7) Mark all pictures with the upper left corner coordinate as the origin to record their position relationship, such as the fifth picture in the first row is (1, 5) and the second picture in the third row is (3, 2), and all pictures can form a picture matrix.

[0079] Step S13: Process the image in the zoogloea and manually label metazoans. Specifically, in the image processing and manual labeling, the following need to be labeled:

[0080] The bounding box of the metazoan;

[0081] The bounding box of the zoogloea.

[0082] Step S2: Train the target detection model based on the YOLO algorithm to perform image recognition.

[0083] The YOLO algorithm is prior art, for example, the YOLOv11 model can be used for recognition, and the recognition rate of the YOLO algorithm basically meets the index requirements. Since the order of magnitude of metazoans changes significantly at different sludge stages, this task does not extremely depend on the level of recognition accuracy. Based on the YOLO architecture, a deep learning target detection model is constructed, and the specific training process includes the following steps:

[0084] 1) Data labeling:

[0085] Input: spliced sludge microscopic image matrix (coordinates such as (3, 2));

[0086] Output: double-labeled targets (metazoan class + zoogloea region);

[0087] Label format: [class, x_center, y_center, width, height] (YOLO standard format).

[0088] 2) Training configuration:

[0089] Backbone network: CSPDarknet53;

[0090] Input resolution: 640x640 pixels;

[0091] Loss function: CIoU Loss;

[0092] Data augmentation: random HSV color disturbance + Mosaic enhancement.

[0093] 3) Model output:

[0094] Bounding box coordinates: corresponding to the coordinates of the zoogloea / metazoan in key indicators 1 and 2. (x_img+x_box, y_img+y_box);

[0095] Bounding box pixel area: corresponding to the zoogloea / metazoan size indicator in Key Indicator 1 and Indicator 2, (width x height x scale factor);

[0096] Detection box image region: a selected image region for participating in the next step of image processing, corresponding to the RGB color and Fourier transform input in Key Indicator 1 and Indicator 2;

[0097] Class probability: in the form of metazoan type one-hot encoding, corresponding to the metazoan type in Key Indicator 2: argmax(probabilities).

[0098] In summary, the target detection model is used to recognize the complete image. Note that a quantitative amount of sludge needs to be taken for each sampling.

[0099] Step S3: Extract feature data for prediction;

[0100] Step S31: Perform zoogloea feature extraction, i.e., extract Key Indicator 1:

[0101] The zoogloea contains the following refined features:

[0102] 1. Zoogloea number: for each zoogloea, there is a unique number, for example, (3, 2, 2) represents the second recognized zoogloea in the third row of the second picture.

[0103] 2. Zoogloea size: a numerical value representing the area of the zoogloea on the picture. Since the magnification is fixed, for images with similar imaging clarity, the lens distance is also basically fixed, so the scale is fixed. Here, the specific value of the scale can not be considered because the size of the value is not different after normalization in the later stage.

[0104] 3. Zoogloea color: a three-element array, after extracting the RGB channels from the picture, the average value of each zoogloea in each channel within the recognition range is taken as the RGB value.

[0105] 4. Zoogloea morphology: a numerical value, after Fourier transform of the detection box image, the proportion of high-frequency energy is calculated. The high-frequency region refers to the region outside the center radius R of the spectrum, R = image width / 8. The high-frequency energy proportion refers to the high-frequency energy / total energy. This value can represent the compactness of the zoogloea.

[0106] 5. Zoogloea coordinates: the coordinates of the center point of the recognized zoogloea.

[0107] Step S32: Perform metazoan recognition, extract Key Indicator 2:

[0108] The metazoan contains the following refined features:

[0109] 1. metazoan number: for each recognized metazoan, there will be a unique number;

[0110] 2. metazoan size: a numerical value, same as the size of the zoogloea;

[0111] 3. metazoan color: a three-dimensional array, same as the color of the zoogloea;

[0112] 4. metazoan type: for the recognized metazoan, a type will be returned, such as rotifer, nematode, oligochaete, etc.;

[0113] 5. metazoan coordinates: the coordinates of the center point of the recognized metazoan.

[0114] Step S33: binding relationship analysis; extract the key indicators 3 derived from key indicators 1 and key indicators 2:

[0115] After obtaining the zoogloea coordinates and metazoan coordinates, calculate the Euclidean distance from each metazoan coordinate to the zoogloea coordinate. For each metazoan, the zoogloea with the smallest Euclidean distance is considered to be its active zoogloea at the current time. Bind the metazoan number with the zoogloea number, and combine the contents of other key indicators, we can get:

[0116] 1. metazoan selection tendency: calculate the Pearson correlation coefficient of the number of metazoans corresponding to the zoogloea, representing the average selection tendency of microorganisms for zoogloea size at a certain stage;

[0117] 2. Interstitial water turbidity: after obtaining the bounding box of the recognition result, the part of the original image excluding the bounding box can be obtained, which can be approximately considered as the interstitial water area. After black and white binary image processing is performed on the interstitial water area, the proportion of black and white pixels is calculated to serve as the turbidity feature of the interstitial water. Specifically, the interstitial water turbidity is one of the water quality indicators, belonging to the first type of water quality input as follows, at the same level as BOD, COD, etc.

[0118] Wherein, the Euclidean distance from the metazoan coordinates to the zoogloea coordinates is:

[0119] ;

[0120] Wherein: x m , y m are the metazoan coordinates;

[0121] x f , y f are the zoogloea coordinates; ​

[0122] Set the maximum binding distance threshold (e.g. 200 pixels); if the distance from the metazoan coordinate to all the zoogloea is greater than the threshold, it is marked as "unbound", and the unbound is counted as the number of free metazoans; each metazoan is only bound to one zoogloea.

[0123] Among them, for the Pearson correlation coefficient r of the number of metazoans corresponding to the zoogloea, r can be directly processed as a feature:

[0124] ;

[0125] Among them: n : Total number of zoogloea in the current slide;

[0126] S i : Area (number of pixels) of the i-th zoogloea;

[0127] C i : Number of metazoans bound to the i-th zoogloea;

[0128] : Average area of zoogloea;

[0129] : Average number of bound metazoans of zoogloea.

[0130] Among them, if the positive correlation r>0, the metazoan prefers large zoogloea;

[0131] If the negative correlation r<0, the metazoan prefers small zoogloea;

[0132] If the positive correlation r is close to 0, there is no significant selection tendency.

[0133] Among them, the calculation formula of interstitial water turbidity (Turbidity) is:

[0134] ;

[0135] Among them: N white The number of white pixels in the interstitial water area;

[0136] N black The number of black pixels in the interstitial water area.

[0137] Step S4: According to the detection result, a correlation model of metazoan and activated sludge stage is established.

[0138] 1. Feature index extraction is performed, and a feature matrix is constructed in combination with water quality indexes.

[0139] Since the stage of activated sludge is a linear cycle, there is no case of late sludge turning into medium, so the target value (y) can be established according to the sludge sampling time. Specifically, assuming that the sludge experiences 20 days in four cycles, the cycle is divided into 120 values, and sampling is performed every 6 hours, 4 times a day, 80 times of sampling in 20 days, and the numbers from 0-1 are equally divided into 80, denoted as the stage value of the sludge.

[0140] The above is how to obtain the y value, that is, the prediction value. For model input X, the basic version of the feature obtained in step three needs to be processed. The specific input features are as follows:

[0141] The first type is the input of water quality. Water quality indicators are macro indicators, all of which are numerical data, which can be input after normalization. For example, according to the installation of various sensors, a number of input values can be obtained x 12 , x 13 … x 1j , Among them j = the total number of sensor types + 1, respectively representing measured values such as BOD, COD, ammonia nitrogen, total phosphorus, total nitrogen, ORP, pH, dissolved oxygen, nitrate nitrogen, and phosphate. Among them, the turbidity of interstitial water is taken as the water quality index x 11 .

[0142] The second type is the input related to the zooglea. In key indicator 1, all zooglea in the current picture can be obtained

zooglea number, zooglea size, zooglea color, zooglea shape, zooglea coordinates

[0143] (1) According to the number of zooglea numbers, the number of zooglea is obtained x 21 ;

[0144] (2) Calculate the mean, median, mode, and standard deviation of all zooglea sizes to obtain x 22 、 x 23 、 x 24 、 x 25 ;

[0145] (3) According to the RGB sequence in the zooglea color, calculate the white-brown degree, and according to the white-brown degree, calculate the mean, median, mode, and standard deviation to obtain x 26 、 x 27 、 x28 、 x 29 ;

[0146] Where the calculation method of white-brown degree is:

[0147] Step a1: Calculate the vector:

[0148] Vector WC = C - W = (R-255, G-255, B-255);

[0149] Vector WB = B - W = (139-255, 69-255, 19-255) = (-116, -186, -236);

[0150] Step a2: Calculate the projection parameter t:

[0151] ;

[0152] Where: dot product WC×WB= (R-255)(-116) + (G-255)(-186) + (B-255)(-236);

[0153] Modulus square = (-116) 2 + (-186) 2 + (-236) 2 = 103748.

[0154] Step a3: Normalize the projection parameter t to [0, 1];

[0155] If t < 0, take t = 0, which is brighter than white, and force it to be white;

[0156] If t > 1, take t = 1, which is darker than brown, and force it to be brown;

[0157] Final value: white-brown degree = t × 100%.

[0158] (4) The mycelium pellet morphology is a ratio sequence, and the mean, median, mode, and standard deviation are calculated to obtain x 210 、 x 211 、 x 212 、 x 213 .

[0159] The third type is the metazoan-related features, which can be obtained from the key indicator 2

metazoan number, metazoan type, metazoan color, metazoan size, metazoan coordinates

[0160] (1) According to the metazoan number, the number of metazoans identified in the image can be obtained x 31 ;

[0161] (2) The metazoan type is a one-hot encoding. According to the number of identified categories in the algorithm, the number of each type of metazoan can be counted. Here, rotifer, nematode, clock worm, and dendrobranch worm are taken as examples. The features x 32 , x 33 , x 34 , x 35 ;

[0162] (3) According to the four types of metazoans, their metazoan colors are counted respectively, and the calculation method is the same as that in the second type of features. The white-brown degree is calculated, and the mean, median, mode, and standard deviation are calculated according to the white-brown degree, to obtain x 32-1 , x 32-2 , x 32-3 , x 32-4 , x 33-1 , x 33-2 ··· x 35-4 .

[0163] (4) According to the identified area size of each metazoan, the classification features are counted to obtain the mean, median, mode, and standard deviation of the metazoan size, x 32-5 , x 32-6 , x 32-7 , x 32-8 , x 33-5 , x 33-6 ··· x 35-8 .

[0164] The fourth type is the biological preference feature, that is, the key indicator 3, the feature of r value x 36 .

[0165] And the value (X) for prediction is the number of metazoan and the water quality indicators at that time, such as BOD, COD, ammonia nitrogen, dissolved oxygen, pH, ORP, etc., which are easy to obtain after installing corresponding sensors. Then, a data set is established according to the above data, and a "metazoan survival state-sludge stage" prediction model is established by a regression algorithm.

[0166] The basic idea is unchanged, and in addition to the original sensor monitoring indicators COD, BOD, ammonia nitrogen, dissolved oxygen, pH, ORP, etc., the above-mentioned features also need to be brought in. The goal of the model is to use this data set to fit a stage value, and XGBoost and other decision tree-based ensemble models can be used to quickly achieve a better result.

[0167] 2. Based on the XGBoost model prediction, output the stage value.

[0168] After obtaining the model, only need to sample again according to the previous sludge sampling method. The obtained metazoan number, water quality indicators, etc. are substituted into the model of step S3 to obtain a value in the active sludge stage value (0-1), that is, the active sludge stage value. This method can quantify the development stage of the activated sludge to guide production and make the overall sludge state more intuitive.

[0169] Preferably, the influence of the features when inputting XGBoost is changed, and the feature influence is adjusted based on the feature category according to the situation of the water plant, with X mn in the matrix number, m. Specifically, in the feature normalization process, the influence of the three types of features is adjusted according to a feature influence matrix [a, b, c]. In the normalization process, the 1 corresponding to the standardization process ~N(0, 1) is changed to a, b and c, so as to control the influence size between them. According to the experience of the water plant, the size of a, b and c can be adjusted to make the classification result more inclined to be affected by the changes of the water quality features (traditional method), the zooglea (microbial related) features and the metazoan (indicator species) features.

[0170] Preferably, the stage value y is changed to a series of probability values to verify the effectiveness of the output result. Specifically, the original stage value y is a single value, representing the number of days of the activated sludge stage. Change to, for each X mn matrix input, a series of y probabilities are output, for example, if there are 20 days, the model judges the probability of each day. According to the logic, the activated sludge always develops continuously from one stage to the next, so according to the distribution of the 20 output probabilities, the distribution is calculated, which is:

[0171] 1) Set a probability threshold: Choose a probability threshold to define "high probability". The threshold can be adjusted according to actual conditions. For example, the average probability is 1 / 20=0.05.

[0172] 2) Calculate the number of days with high probability: Count the number of days with probability greater than the probability threshold, denoted as K.

[0173] 3) Check the minimum number of days with high probability: If K is less than the set threshold, the model is not reliable, otherwise, the model is reliable.

[0174] 4) Calculate the range of high probability days: Find the minimum index M1 and maximum index M2 in all high probability days, calculate the range R=M2−M1+1.

[0175] Calculate the continuous proportion: Calculate the proportion r c =K / R.

[0176] If r c is close to 1, for example, r c is greater than or equal to the set threshold, indicating that the high probability days are concentrated, the model is reliable.

[0177] If r c is less than the set threshold, indicating that the number of high probability days is scattered, the model is not reliable.

[0178] Correspondingly, if the model is reliable, the final output stage value y is the highest probability day, if the model is not reliable, adjust the values of a, b and c until a reliable value is output. This part can be adjusted manually and does not depend on the algorithm. Usually it is finished at this stage.

[0179] If it is impossible to achieve the effect no matter how to adjust a, b and c, adjust the threshold of the number K and the continuous proportion r c , usually the threshold of the number K needs to be reduced and the continuous proportion r c needs to be reduced, but at the same time an indication of abnormal working condition is output, indicating that the activated sludge state does not conform to normal observation results.

[0180] Preferably, it further comprises step S5: after obtaining the activated sludge stage value, the result is corrected. Since the development of each stage is continuous, the result of stage 1 will inevitably reach stage 5 after developing for 4 stages. Then, after continuous sampling of the sludge at regular intervals, multiple stage judgment values y1, y2, y3 can be obtained. An average prediction bias value e needs to be stored in the system. The calculation method of the value is:

[0181] (1) In the same type of activated sludge environment. The difference between the first prediction value y 1p and the actual value y 1r is e1;

[0182] (2) after t time, get the predicted value y 2p , the difference between the actual value y 1r+t is e2;

[0183] (3) add e2 to the difference sequence, calculate the sequence mean to get the updated value e;

[0184] (4) calculate y 2p +e to get y 2pc , then y 2pc is the final result of the activated sludge stage prediction;

[0185] (5) repeat steps 2 to 4, can get y 3pc , y 4pc , and e is also constantly updated.

[0186] By correcting the y pc value, it can be used to more accurately determine the current activated sludge stage value, which can be used as a reference basis for guiding the work of dosing, aeration, etc. in the process.

[0187] The above is only the preferred embodiment of the present application, and does not limit the present application in any form. Any simple modification or equivalent change made on the basis of the technical essence of the present application to the above embodiment falls within the protection scope of the present application.

Claims

1. A method for identifying activated sludge stages based on metazoan target recognition, characterized in that, Includes the following steps: Step S1: Continuously scan and photograph the floc area in the activated sludge, and record the position coordinates of each image to obtain an image matrix; Step S2: Perform image recognition processing based on the object detection model, and output the bounding box coordinates, bounding box pixel area, image region within the detection box, and class probability; Step S3: Extract feature data for prediction; Step S31: Based on the results of the identification in step S2, perform feature extraction of the fungal floc to obtain [floc number, floc size, floc color, floc shape, floc coordinates]; Step S32: Based on the results of the identification in step S2, perform metazoan feature extraction to obtain [metazoan ID, metazoan size, metazoan color, metazoan type, metazoan coordinates]; Step S33: Based on the features extracted in steps S31 and S32, perform binding relationship analysis and calculate the Pearson correlation coefficient r of the number of metazoans corresponding to the bacterial flocs; Step S34: Based on the results identified in step S2, obtain the portion of the original image with the bounding box removed, and use it as the interstitial water region; After processing the interstitial water region into a black-and-white binary image, the proportion of black and white pixels is calculated and used as the turbidity characteristic of the interstitial water. Step S35: based on the results of steps S31-S33, feature index extraction is performed; based on the extracted feature index and the water quality index monitored by the sensor in real time, a feature matrix X is constructed mn where m and n are the number of rows and columns of the feature matrix, respectively; Step S4: Based on the feature matrix, the XGBoost model is used for prediction, and the stage value y of the activated sludge is output for process control decisions.

2. The activated sludge stage identification method based on metazoan target recognition according to claim 1, characterized in that, In step S31, the floc number is obtained based on the position coordinates of the image, the floc coordinates are obtained based on the bounding box coordinates of the floc, and the floc size is obtained based on the pixel area of ​​the bounding box of the floc. Fourier transform is performed on the image region within the detection box of the floc, and the proportion of high-frequency energy is calculated to obtain the floc morphology, which is used to characterize the density of the floc.

3. The activated sludge stage identification method based on metazoan target recognition according to claim 1, characterized in that, Step S33 includes the following steps: (1) Based on the coordinates of the bacterial flocs ( x f , y f ) and metazoan coordinates ( x m , y m ), calculate the Euclidean distance from each metazoan to the fungal floc; ; (2) Based on the minimum Euclidean distance, the unique active bacterial floc of the metazoan at the current moment is obtained, and the corresponding metazoan number is bound to the bacterial floc number; (3) Finally, the Pearson correlation coefficient r for the number of metazoans corresponding to the bacterial flocs: ; in: n This represents the total number of bacterial flocs. S i Let be the area of ​​the i-th bacterial floc; C i The number of metazoans bound to the i-th bacterial floc; This represents the average area of ​​the bacterial micelles; The average number of offspring bound to the bacterial floc.

4. A method for identifying activated sludge stages based on metazoan target recognition according to any one of claims 1-3, characterized in that, In step S35, the feature matrix X mn include: Using the turbidity characteristics of interstitial water as a water quality indicator x 11 Water quality indicators are obtained based on sensor detection. x 12 , x 13 … x 1j ;in j =Total number of sensor types + 1; The number of flocs was determined based on their number. x 21 ; Calculate the mean, median, mode, and standard deviation of all fungal floc sizes to obtain the index. x 22 , x 23 , x 24 , x 25 ; Based on the RGB sequence of the color of the fungal flocs, the degree of white-brown color is calculated. Then, based on this degree of white-brown color, the mean, median, mode, and standard deviation are calculated to obtain the index. x 26 , x 27 , x 28 , x 29 ; Calculate the mean, median, mode, and standard deviation of all fungal floc morphologies to obtain the index. x 210 , x 211 , x 212 , x 213 ; The number of metazoans was used to obtain a metazoan population index. x 31 ; Based on the statistics of the number of each type of metazoan, indicators were obtained. x 32 , x 33 , x 34 , x 35 … x 3i Where: i = number of metazoan species - 1; Based on the RGB sequence of metazoan colors, the white-brown degree is calculated. Then, based on the white-brown degree, the mean, median, mode, and standard deviation of each metazoan type are calculated to obtain the index x. 32-1 , x 32-2 , x 32-3 , x 32-4 , x 33-1 , x 33-2 , x 33-3 , x 33-4 ... x 3i-4 ; Calculate the mean, median, mode, and standard deviation of the size of all metazoans to obtain the index. x 32-5 , x 32-6 , x 32-7 , x 32-8 , x 33-5 , x 33-6 , x 33-7 , x 33-8 ... x 3i-8 ; Using the Pearson correlation coefficient r as an indicator x 36 .

5. The activated sludge stage identification method based on metazoan target recognition according to claim 4, characterized in that, The degree of white-brown color is calculated as t × 100%, where t is the projection parameter. ; Where: WC is the vector of the target color point C(R,G,B) relative to the white point W(255,255,255); WB is the vector of the brown point B(139,69,19) relative to the white point W(255,255,255); For the module length; The dot product WC×WB=(R-255)(-116)+(G-255)(-186)+(B-255)(-236).

6. The activated sludge stage identification method based on metazoan target recognition according to claim 1, characterized in that, In step S4, the feature influence of the feature matrix is ​​dynamically adjusted. A feature influence matrix [a,b,c] is constructed based on water quality features, floc features, and metazoan features. During the normalization of each feature, the standardized interval (0,1) is modified to (0,a), (0,b), and (0,c) respectively. This controls the magnitude of the mutual influence between water quality features, floc features, and metazoan features.

7. The activated sludge stage identification method based on metazoan target recognition according to claim 6, characterized in that, The initial stage value y is a series of probability values, outputting the probability of consecutive units of time; then, the probability distribution is analyzed, and the number K of units of time with a probability greater than a set threshold is counted. If K is greater than the threshold, the model is reliable. Analyze the distribution range where the probability is greater than a set threshold to obtain the minimum index M1 and the maximum index M2, and calculate the range R = M2 − M1 + 1; then, calculate the continuous proportion r. c =K / R, if r c If the value exceeds the set threshold, the model is considered reliable, and the final output stage value y represents the number of days with the highest probability. Otherwise, the model is unreliable; adjust the feature influence matrix [a,b,c] and adjust the threshold of the quantity K and the continuous proportion r. c .

8. The activated sludge stage identification method based on metazoan target recognition according to claim 1, characterized in that, It also includes step S5: Step S51: Under the same type of activated sludge environment, the first predicted value y 1p Compared with the actual value y 1r The difference is e1; Step S52: After time t, obtain the second predicted value y. 2p And the second predicted value y 2p Compared with the actual value y 1r+t The difference is e2; Step S53: Add e2 to the difference sequence, calculate the mean of the sequence, and obtain the updated error value e; Step S54: Calculate y 2p +e yields y 2pc , then y 2pc This serves as the stage value predicted for the activated sludge stage.

9. An activated sludge stage identification system based on metazoan target recognition, implemented based on the activated sludge stage identification method based on metazoan target recognition according to any one of claims 1-8, characterized in that, It includes a data acquisition module, a target recognition module, a feature extraction module, a feature matrix module, and a prediction module; the data acquisition module is used to scan and capture images to obtain an image matrix; the target recognition module is used to obtain bounding box coordinates, bounding box pixel area, image region within the detection box, and category probability based on the target detection module; the feature extraction module is used to obtain feature data for prediction based on the features of target recognition; the prediction module is used to obtain the stage value y of activated sludge based on the feature data.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the activated sludge stage identification method based on metazoan target recognition as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Activated sludge morphology and sludge volume index SVI soft measurement method

    CN112634347A

  • Microflora prediction-based two-stage activated sludge system optimization method and system

    CN119722415A