A water inflow risk type identification method based on convolutional neural network
Through the water inlet risk type identification method based on convolutional neural network, the microscopic image data of activated sludge can be used to monitor the sludge health status and water inlet risks in real time, and the delay in monitoring the sludge health status in sewage treatment plants is solved. and the difficulty of risk identification have improved the sewage treatment effect and operational safety.
Patent Information
- Application Number
- CN202210628921.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-06
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2042-06-06
AI Technical Summary
The prior art is difficult to monitor the health status of sludge and the risk of water inlet in sewage plants in real time and keenly, resulting in reduced sewage treatment effects and economic losses.
The water inlet risk type identification method based on convolutional neural network is used to cultivate activated sludge in the SBR reactor, collect microscopic image data, train the water inlet risk type identification model, judge the abnormal water inlet type, and provide early warning support.
Real-time monitoring of activated sludge instability conditions and accurate identification of abnormal water inlet types are achieved, which improves the water inlet risk control capabilities of sewage treatment plants and reduces economic losses.
Smart Images

Figure CN115050023B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sewage treatment detection, and in particular to a method for identifying water inflow risk types based on a convolutional neural network. Background Art
[0002] In traditional scientific research, the evaluation of activated sludge status is often analyzed from traditional water quality parameters (removal of pollutants, etc.) and sludge property indicators; under the background of the rapid development of molecular biology technology based on nucleic acid sequencing, the use of metagenomics technology, metatranscriptomics and single-cell genomics can conduct deeper and more multi-dimensional information mining and analysis of activated sludge. Although the above indicators can conduct a comprehensive and in-depth evaluation of the status of sludge, their detection is often time-consuming and labor-intensive, and has a huge delay (short for hours, long for months), and it is very difficult to apply them to daily monitoring of actual projects.
[0003] In comparison, the monitoring operation of sludge under a microscope is very simple and efficient. You only need to take a sample and place it under a microscope to make an initial judgment on the health status of the activated sludge. However, in the daily operation of sewage treatment plants, microscopic inspection projects have problems such as low operation frequency, small sample size, and high requirements for technical personnel. It is often impossible to capture changes in sludge morphology in a timely and sensitive manner, and the intuitive advantages of microscopic inspection are also lost. In addition, there is currently a lack of a scientific, systematic, objective and standard sludge evaluation system for the overall health status of activated sludge in aeration tanks during the actual operation of sewage treatment plants, and it is naturally difficult to monitor the sludge status in real time.
[0004] The study of sludge morphology found that the microscopic morphological characteristics of activated sludge have a certain correlation with its physical and chemical properties and even water quality. Based on the research, it is believed that the image of activated sludge has a certain correlation with the health status of activated sludge.
[0005] Various types of abnormal sewage have multifaceted toxic effects on activated sludge. They can not only directly or indirectly affect the metabolic activity of the sludge, but also cause deep and irreversible damage to the sludge by affecting its physiological structure. Extremely abnormal influent can often cause harm to the activated sludge system. At the very least, it will reduce the sewage treatment effect. At worst, it will seriously affect the normal operation of the sewage treatment plant and cause huge economic losses. Therefore, it is very important to monitor the influent conditions in the bioreactor system. However, in the actual operation of the water plant, it is often impossible to perceive the various parameter contents of various types of influent in time and respond. It is often not until the effluent abnormalities appear that the sludge system has collapsed, especially when the activated sludge has a long destabilization process. Therefore, how to judge the type of abnormal sewage based on the destabilization state of the activated sludge has become a direction for further monitoring the sewage treatment effect. Summary of the invention
[0006] The present invention provides a method for identifying water inlet risk types based on a convolutional neural network, aiming to determine the type of abnormal sewage according to the unstable state of activated sludge.
[0007] The present invention provides a method for identifying water inflow risk types based on a convolutional neural network, comprising the following steps:
[0008] S1. Normal influent is introduced into the inlet of the SBR reactor, and the activated sludge is cultured and tested in a sequential batch operation mode; various types of abnormal influent are selected as experimental variation conditions, and the inlet of the SBR reactor is replaced with various types of abnormal influent, and the activated sludge is cultured continuously for multiple cycles;
[0009] S2. Track and analyze the monitoring indicators of activated sludge and water quality monitoring indicators of pollutant removal effect before and after the experimental conditions change, and synchronously inject mud samples into the real-time online microscopic image capture device during the aeration stage of each cycle, and capture and collect microscopic images of the activated sludge through the real-time online microscopic image capture device;
[0010] S3. A water inlet risk type recognition model is built with a convolutional neural network as the main network, and the collected sludge images are input into the water inlet risk type recognition model for training. The water inlet risk type recognition model performs deep feature extraction and analysis on the sludge images;
[0011] S4. The trained influent risk type identification model determines the type of abnormal influent based on the sludge instability state in the periodically input activated sludge microscopic images.
[0012] As a further improvement of the present invention, in the steps S1 and S4, the types of abnormal influent water include heavy metal Cu 2+ Influent, containing heavy metal Cr 2+ Influent, influent with too low pH, influent with too high pH, influent containing aniline, influent with high salinity.
[0013] As a further improvement of the present invention, in step S2, the monitoring indicators of activated sludge include SV5, SV 30 , SVI and MLSS, MLVSS indicators; water quality monitoring indicators include COD, NH4 + -N, PO4 3- -P.
[0014] As a further improvement of the present invention, the input layer of the water inflow risk type identification model randomly crops the input microscopic image data to 224×224, randomly selects pictures in the training set to flip horizontally, calls the built-in Normalize function to normalize the picture data, and converts the data into a standard Gaussian distribution;
[0015] The output layer of the water inflow risk type identification model outputs a one-dimensional vector of the target quantity category, which respectively represents the prediction results of each input image, and finally outputs the prediction results and corresponding probability values of each input mud sample, and takes the label corresponding to the maximum probability as the classification result.
[0016] As a further improvement of the present invention, in step S2, the specific image collection process of the real-time online microscopic image capture device includes:
[0017] The stage of sufficient mixing of mud and water, i.e., the aeration stage in a single reaction cycle, is set as the sludge sampling stage, during which the sludge image is recorded in the form of a video, and the sampling speed of the real-time online microscopic image capture device is adjusted so that the sludge passes through the field of view clearly and steadily at an appropriate speed;
[0018] Frames of the sludge videos collected from the sub-experiments of each abnormal water inflow type were extracted at equal intervals to obtain the original sludge images, and the histogram distribution characteristics, image entropy values and other characteristics of each image were analyzed and calculated to screen the image data;
[0019] At the same time, multiple label folders are created as containers for sludge images impacted by multiple abnormal water inflow types; the screened image data are stored in each label folder as training data for input into the water inflow risk type recognition model.
[0020] As a further improvement of the present invention, the image data includes training set data, validation set data, and test set data, wherein the validation set data is randomly extracted in proportion from the training set data by calling a Pytorch built-in function.
[0021] As a further improvement of the present invention, the real-time online microscopic image capturing device performs operations including ROI movement and blurring on the image during the process of image feature analysis and extraction.
[0022] As a further improvement of the present invention, in step S1, three groups of SBR reactors are operated synchronously during the experiment: an experimental group is used for various types of water inlet shock experiments; a control group is used to eliminate the influence of operating cycle variables; and one is used for sludge reserve acclimation to replenish the sludge loss in the abnormal water inlet shock experiment.
[0023] As a further improvement of the present invention, during the training process of step S3, the water inflow risk type identification model is trained by a transfer learning method, and the parameters of the pre-trained model are selected to load the weight information obtained by training on the dataset ImageNet.
[0024] As a further improvement of the present invention, the convolutional neural network for building the water inflow risk type identification model is the EfficientNet B0 network model.
[0025] The beneficial effects of the present invention are as follows: the abnormal influent type is identified through activated sludge images as the goal, SBR reactor sludge experiments are carried out on different types of abnormal impact influent, and on the basis of obtaining sludge images, the influent risk type recognition model based on the convolutional neural network is used to analyze and extract features of the sludge image to judge the abnormal influent type that the sludge is impacted by, which can provide early warning technical support for the influent risk control of the sewage treatment plant to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flow chart of a method for identifying water inflow risk types based on a convolutional neural network of the present invention;
[0027] Figure 2 It is a schematic diagram of the MB conv structure in the EfficientNet B0 network model of the present invention;
[0028] Figure 3 It is a schematic diagram of the SE Net structure in the EfficientNet B0 network model of the present invention;
[0029] Figure 4 This is a rendering of the training process of the EfficientNet B0 model of the present invention;
[0030] Figure 5 It is a graph of image feature extraction by the convolutional neural network EfficientNet B0 model of the present invention;
[0031] Figure 6 is a graph showing the change in pollutant removal rate of the reactor under abnormal water inlet conditions of the present invention;
[0032] Figure 7 It is a performance change diagram of activated sludge in the present invention;
[0033] Figure 8 It is the unstable sludge image caused by various types of abnormal water inflow in the present invention;
[0034] Fig. 9 It is a diagram of the prediction effect of the EfficientNet B0 model of the present invention in the confusion matrix. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0036] Embodiment 1:
[0037] like Figure 1 As shown, a method for identifying water inflow risk types based on a convolutional neural network of the present invention comprises the following steps:
[0038] S1. Normal influent was introduced into the water inlet of the SBR reactor (sequencing batch reactor), and the activated sludge was cultured and tested in sequencing batch operation mode; 6 types of abnormal influent were selected as experimental variation conditions, and the water inlet of the SBR reactor was replaced with 6 types of abnormal influent, and the activated sludge was cultured continuously for several cycles.
[0039] The 6 types of abnormal water inflow risk studied are: heavy metal Cu 2+ Influent, containing heavy metal Cr 2+ Influent, influent with too low pH, influent with too high pH, influent containing aniline, influent with high salinity.
[0040] In order to make the image analysis and comparison results of the sludge before and after the abnormal water inflow shock more credible, the before and after control is mainly used in the image analysis. During the experiment, three SBR reactors will be operated simultaneously: an experimental group for various types of water inflow shock experiments; a control group for eliminating the influence of operating cycle variables; and a sludge reserve acclimatization to replenish the sludge loss in the abnormal water inflow shock experiment.
[0041] The experiment uses artificial water distribution to simulate the corresponding wastewater as the influent of the SBR reactor, which is convenient for controlling the impact factor and realizing the impact of abnormal influent on the SBR reactor, thereby inducing the instability of the activated sludge. In order to strictly control the variables and make the research on sludge more reliable, before the formal abnormal influent impact experiment, the activated sludge will be domesticated and cultivated with normal influent in advance. The domestication time is about one week, and the stability of the monitored influent and effluent water quality indicators and sludge indicators is used as a sign of successful domestication.
[0042] S2. The monitoring indicators of the properties of activated sludge and the water quality monitoring indicators of the pollutant removal effect are tracked and analyzed before and after the experimental conditions change, and the sludge samples are synchronously injected into the real-time online microscopic image capture device through a peristaltic pump during the aeration stage of each cycle, and the microscopic images of the activated sludge are captured and collected by the real-time online microscopic image capture device.
[0043] The specific image collection process of the real-time online microscopic image capture device is as follows:
[0044] The stage of sufficient mixing of mud and water, i.e. the aeration stage (3h) in a single reaction cycle (6h), was set as the sludge sampling stage. During this process, the sludge image was recorded in the form of video. The effective video recording time for each cycle was about 2.5h, the video frame rate was 60 frames / second, and the number of pictures collected in a single cycle reached 540,000. The sampling speed of the real-time online microscopic image capture device was adjusted so that the sludge could pass through the field of view at a steady and clear speed at a suitable speed. Finally, the moving speed of the sludge with a maximum residence time of about 9s in the microscope field of view was selected. Since the microscope field of view is circular, the average residence time of the sludge was calculated to be 8.2s. Therefore, it is believed that 1097 pictures of sludge in different fields of view can be collected in a single cycle, which can relatively systematically represent the morphology of the activated sludge in this cycle.
[0045] In the process of image feature analysis and extraction, it is also necessary to perform operations such as moving and blurring the ROI of the image to improve the robustness of the model. Therefore, images other than the 1097 images with different field of view contents can still be used as training set images to improve the model effect.
[0046] The sludge videos collected from all sub-experiments were extracted at equal intervals to obtain the original sludge images, and the histogram distribution characteristics, image entropy values and other characteristics of each image were analyzed and calculated to eliminate invalid frames without target sludge in the picture. At the same time, label folders BN, CR, CU, H, OH, and SALT were created as the labels for aniline, Cr, and NH, respectively. 2+ , Cu 2+ , acidity, alkalinity and salinity shock sludge images. According to the pre-experimental training, the ratio of the training set to the test set was selected to be 8:2, the total number of single-label image data was 1,250, and the total number of images called in the experiment was 7,500.
[0047] Finally, the filtered image data are stored in each label folder: 1000 training sets (20% of which are validation sets) and 250 test sets. The validation set data is randomly extracted in proportion from the training set by calling the Pytorch built-in function.
[0048] S3. A water inlet risk type recognition model is built with a convolutional neural network as the main network, and the collected sludge images are input into the water inlet risk type recognition model for training. The water inlet risk type recognition model performs deep feature extraction and analysis on the sludge images;
[0049] S4. The trained influent risk type identification model determines the type of abnormal influent based on the sludge instability state in the periodically input activated sludge microscopic images.
[0050] The water inflow risk type identification model is built with the convolutional neural network as the main network, maintaining the original network main structure, and adjusting the image input layer and the final fully connected layer to facilitate the output of the results. The specific adjustments are as follows:
[0051] Input layer: randomly crop the input image data to 224×224; randomly select images in the training set and flip them horizontally to fully avoid the subjective factors that may be caused by manual adjustment from interfering with the model effect; call the built-in Normalize function to standardize the image data and convert the data into a standard Gaussian distribution in order to speed up the convergence of the model.
[0052] Output layer: After modifying the nodes of the fully connected layer to the number of categories of the model constructed in this paper, the output layer is passed through the Softmax function to output one-dimensional vectors of the target number categories, representing the prediction results of each input image; finally, the prediction results and corresponding probability values of each input sample are output, and the label corresponding to the maximum probability is taken as the classification result.
[0053] The present invention preferably uses the EfficientNet B0 network model as the main network model of the water inflow risk type identification model, and its specific network structure is shown in Table 1.
[0054]
[0055] Table 1 Model structure of EfficientNet B0
[0056] The core structure of this model is the Mobile Inverted Bottleneck Conv (MB Conv), which uses 3×3 and 5×5 convolution kernels alternately for feature extraction. Compared with the aforementioned residual structure, the inverted residual incorporates an attention mechanism, which enhances the network's attention to important parts of the target and feature extraction. The specific structural design is as follows: Figure 2 shown.
[0057] Among them, "SE" is the Squeeze and Excitation Network (SE Net), which is an attention mechanism module commonly used in the field of vision. This module can help the network focus on channel features with more information and suppress unimportant channel features, thereby improving the performance of the model. The specific structure of SE Net is as follows Figure 3 shown.
[0058] In order to speed up the convergence of the model, the transfer learning method is used to train the water inflow risk type identification model. The parameters of the pre-trained model are selected to load the weight information obtained by training on the ImageNet dataset.
[0059] The weight update in the model adopts the momentum-based stochastic gradient descent (SGD+Momentum) optimization algorithm. The network parameters oscillate greatly when the SGD method is used alone. The combined momentum technology can reduce the oscillation during training and make the network converge faster and more stable. The momentum is set to 0.9.
[0060] The learning rate is the rate at which the cost function decreases toward its minimum value. The initial learning rate is set to 0.001. The number of iterations (Epoch) is set to 20. In one Epoch, the computer will use all the training and data in the database to complete a training session. The batch size refers to the number of images selected in a full-time update. It is generally preliminarily set based on the size of the graphics card and the size of the network. After specific experiments, this experiment sets the batch size to 64.
[0061] The changes in the accuracy, loss function, and learning rate of the EfficientNet B0 model during the specific training process are as follows: Figure 4 In the training of EfficientNet B0, the accuracy rate reached over 90% in the first iteration.
[0062] Taking the network model built by EfficientNet B0 as an example, the intermediate feature map data is called to output, and the feature maps of some layers are displayed as follows Figure 5 As shown, they are the output results of the 1st, 40th and 60th convolutional layers respectively.
[0063] Shallow neural networks mainly learn shallow features of activated sludge in images, such as the color of sludge, contour information of sludge cluster edges, and texture features; higher-level neural networks can learn more complex and complete features with regional distinguishing functions, and even features with partial regions as research units, such as the morphology of a single sludge cluster and the distance between sludge clusters in a single field of view; higher-level neural networks can learn high-order features that are more relevant to the target semantics and have richer semantic information, providing huge information support for the realization of target tasks, such as the differences between sludge in a single field of view and the distribution characteristics of sludge in the field of view.
[0064] During the training process, the network will also automatically block out some repetitive, useless, and interfering information that has no guiding role in the target classification task. For example, horizontal stripes in the field of view caused by the image acquisition device will be ignored in the gradual deepening of the network's learning process and will not be paid attention to and calculated as necessary features required for the task.
[0065] Embodiment 2:
[0066] During the experiment, the water quality of the SBR reactor was monitored. The specific monitoring indicators included COD (chemical oxygen demand), NH4 + -N, PO4 3- -P, the goal is to monitor the sewage treatment effect of activated sludge; at the same time, synchronously monitor the sludge SV5, SV 30 , SVI and MLSS, MLVSS and other sludge indicators are used to assist in evaluating the actual health status of activated sludge during the cycle. Figure 6 shown. Figure 6 (a) The removal efficiency of activated sludge after being exposed to high concentration of aniline; (b) The removal efficiency of activated sludge after being exposed to 3% salinity; (c) 2+ Changes in the removal efficiency of pollutants by activated sludge after water inflow; (d) 2+ (e) Changes in the removal efficiency of activated sludge for pollutants after influent; (f) Changes in the removal efficiency of activated sludge for pollutants after influent with high pH.
[0067] On the whole, after being impacted by various abnormal water inflows, the metabolism of activated sludge is generally inhibited to varying degrees, which is mainly reflected in the reduction of pollutant removal effect of sludge, COD, NH4 + -N, PO4 3- -P effluent concentration increased significantly. The overall trend of the whole impact process is roughly as follows: in the early stage of impact, the removal rate of pollutants decreases, and as the culture and acclimatization time increases, the microorganisms gradually adapt to the changes in the environment, the system's ability to withstand various impact conditions continues to increase, and the ability to remove organic matter, denitrify and remove phosphorus also gradually increases. In particular, some types of toxic substances in the impact influent have a certain selection effect on the microorganisms in the activated sludge. As some microorganisms in the sludge die, the related dominant bacteria proliferate in large numbers. Overall, the activity of the activated sludge has recovered slightly, and the effluent COD and NH4 + -N, PO4 3- -P concentration is slightly reduced, such as influent containing aniline, low pH influent and high salinity influent shock.
[0068] The response mode and speed of activated sludge to different types of influent shocks are also different. This is because different shocks have different toxicity mechanisms on sludge, resulting in very different effects. For example, in highly alkaline influent and non-trace heavy metals (Cu 2+ and Cr 2+ ) Under the impact of influent, the activated sludge showed serious phosphorus release phenomenon, among which PO4 3--P concentration increased by 7 times compared with the influent, and the phosphorus release effect under the influence of heavy metals only made the effluent PO4 3- -P concentration increased by 1 times; however, the impact of acidic influent and high-salinity influent on phosphorus release was small, making the effluent PO4 3- -P concentration increased by only 2% and 4%; the impact of aniline-containing water on PO4 3- In order to further compare the effects of various types of water inlet shock on pollutant removal rate, the effects of COD, NH4 + -N, PO4 3- -P were ranked according to their response levels, as shown in Table 2.
[0069]
[0070] Table 2 Relative impact of various types of influent on the removal rate of each pollutant
[0071] It can be seen that different types of abnormal water inflow have slightly different effects on the removal of various types of pollutants. In comparison, some abnormal water inflows have a slightly different effect on PO4 3- -P has the greatest impact, while other abnormal influents have the greatest impact on COD, which can also be used as one of the references for distinguishing the risk types of abnormal influents. For example, influent containing aniline has the greatest impact on the removal of organic matter in sewage, followed by NH4 + -N removal, while PO4 3- -P removal has the least effect; on the contrary, 2+ The influent has the smallest effect on the removal of organic matter in sewage, followed by NH4 + -N removal, while PO4 3- -P removal has the greatest impact.
[0072] By comparing the speed of pollutant removal in various types of water impact experiments, it can be seen that the non-trace heavy metals (Cu 2+ and Cr 2+ ) influent, aniline-containing influent and high pH influent shock experiments all showed a decrease in pollutant removal rate in the first cycle of influent change, while the effects of acidity and salinity shocks only began to appear in the second cycle of influent change. In comparison, the latter response has a certain lag.
[0073] Furthermore, taking activated sludge as the direct research object, the changing rules of various activated sludge indicators in various types of water impact experiments were analyzed. The changes in the settling performance of the sludge in each experiment were as follows: Figure 7 shown. Figure 7(a) The performance changes of activated sludge after being impacted by influent containing high concentration of aniline; (b) The performance changes of activated sludge after being impacted by influent containing 3% salinity; (c) The performance changes of activated sludge after being impacted by influent containing heavy metal Cu 2+ Changes in activated sludge performance after water shock; (d) exposure to heavy metal Cr 2+ (e) Changes in activated sludge performance after influent shock; (f) Changes in activated sludge performance after influent shock.
[0074] By comparing the differences in sludge performance changes between different impact types, it was found that except for the high alkalinity water inlet impact, other types of impacts have a tendency to improve sedimentation performance. Abnormal water inflow can not only directly affect the above-mentioned properties of activated sludge, but also indirectly affect sludge performance by affecting other related indicators such as sludge concentration. For example, in the high-salinity water inflow experiment, the effluent was turbid during the operation cycle, accompanied by the leakage of some sludge, and the sludge concentration also decreased to a certain extent, further causing potential changes in SVI.
[0075] In the analysis of sludge images collected by the real-time online microscopic image capture device, since all unstable sludges were included under a single label during the data screening of the data set, the characteristic strength of the sludge images within the label is not consistent, that is, some sludge images are highly distinguishable, while some sludge images are difficult to distinguish with the naked eye from the type of water impact that caused the unstable state. In order to intuitively display the morphology of these six types of sludge, unstable sludge images with representative characteristics under each label were selected for comparison, such as Figure 8 shown.
[0076] from Figure 8 The unstable sludge under various types of water shock is compared with healthy sludge, and their specific characteristics are analyzed as follows:
[0077] (1) Healthy sludge:
[0078] The sludge flocs in the field of view are uniform in size, with a dense floc structure. The sludge is relatively full and round, with clear edges and a clearly closed shape. The overall color is light brown.
[0079] (2) Activated sludge under the impact of aniline-containing influent:
[0080] The flocs of the activated sludge in the field of vision showed serious disintegration. The sludge became sticky and appeared in different areas. Inside the areas were a large amount of finely divided and clumped sludge. The sludge was uneven in size, light brown and yellowish in color, and the depth of the sludge splashes varied greatly. The sludge was obviously stacked, and the stacked parts appeared denser. The edges were unclear and finely divided matter and angular were obviously present.
[0081] (3) Containing Cr2+ Activated sludge under influent shock:
[0082] The activated sludge flocs in the field of view showed serious disintegration, the porosity increased and the void distribution was uneven; the size differences between the sludges were greater, the color distribution of the sludge flocs was uneven, and the transmittance was also different; the edges of the sludge were not clear, and some of them had angular edges.
[0083] (4) Containing Cu 2+ Activated sludge under influent shock:
[0084] The activated sludge flocs in the field of view showed serious disintegration, with increased porosity and uneven distribution of voids; the size differences between the sludges were greater, and the colors of the sludge flocs ranged from light brown to yellowish, to dark brown to black; the three-dimensionality of the sludge flocs in the field of view decreased, becoming more two-dimensional, with clear edges and darker color than the inside of the flocs.
[0085] (5) Activated sludge under low pH influent shock:
[0086] The activated sludge flocs in the field of view showed very serious disintegration, and the sludge was extremely scattered in the entire field of view; the size differences between the sludges were greater, the overall color of the sludge flocs was dark gray, and there were differences in light transmittance; the edge of the sludge was lighter and less clear than the main part of the flocs, and had angular edges.
[0087] (6) Activated sludge under high pH influent shock:
[0088] The flocs of the activated sludge in the field of view showed a certain degree of disintegration, the porosity increased and the void distribution was uneven; the size of the sludge was uneven, and the overall color of the sludge flocs was light brown and yellowish; the three-dimensionality of the sludge flocs in the field of view decreased, becoming more two-dimensional, with clear edges and darker color than the inside of the flocs.
[0089] (7) Activated sludge under high salinity influent shock:
[0090] The flocs of the activated sludge in the field of vision showed serious disintegration. The sludge became sticky and appeared in different areas. Inside the areas were a large amount of finely divided and clumped sludge. The sludge was uneven in size, light brown and yellowish in color, and the depth of the sludge splashes varied greatly. The sludge was obviously stacked, and the stacked parts appeared denser. The edges were unclear and finely divided matter and angular were obviously present.
[0091] The model parameters of the EfficientNet B0 network model obtained by training on the training set are exported, and the model structure is called to predict the 1500 pictures (6 categories, 250 pictures in each category) in the prepared test set. The model is comprehensively evaluated from the confusion matrix, accuracy, precision and other dimensions combined with the real categories of the pictures.
[0092] Based on the prediction results of the target image by the EfficientNet B0 model, the confusion matrix is drawn in combination with the actual situation of each image. Fig. 9 As shown in Table 3, it can be seen that this model has a superior effect on the identification process of sludge impact types. According to the prediction effect in the confusion matrix, the accuracy of sludge identification for each category is calculated as shown in Table 3.
[0093]
[0094] Table 3 Identification accuracy of each impact type sludge
[0095] As can be seen from the table, the recognition accuracy of this model for each shock type has reached a high level. Except for alkalinity shock, the recognition rates of the remaining types are all above 90%, especially for sludge subjected to aniline and acidity shocks, the recognition accuracy is as high as 100%. In particular, the recognition accuracy of sludge images subjected to alkalinity shock is only 76%, of which 22.8% of the images are considered to be Cu 2+ The results of the above multi-models show that the position has a greater degree of misidentification, which further proves that the change of sludge morphology under alkalinity shock is related to Cu in the image field. 2+ The shocks are quite similar.
[0096]
[0097] Table 4 EfficientNet B0 multi-index evaluation
[0098] The other performance indicators of the model are shown in Table 4. From the table, we can see that the overall accuracy of the model is as high as 94.4% and the precision is 94.9%.
[0099] The present invention aims to identify the abnormal type of influent by using activated sludge images, and 2+ Cr 2+ The SBR reactor sludge experiment was carried out with six different types of impact influents, including sludge images, abnormal pH (pH too high, pH too low), influent containing organic matter (aniline), and high salinity influent. On the basis of obtaining sludge images, the features of the sludge images were analyzed and extracted based on the convolutional neural network, and the following conclusions were obtained:
[0100] (1) The main research object in this experiment is the microscopic image of sludge, and various conventional indicators of activated sludge are monitored simultaneously, including inlet and outlet water quality indicators: COD, NH4 + -N, PO4 3- -P, sludge index: SV5, SV 30, SVI and MLSS, MLVSS, etc. This series of traditional indicators assists in verifying the unstable state change process of sludge. The results show that the microscopic image of sludge has a certain correlation with the indications of various indicators, that is, the sludge image can reflect the health status of activated sludge to a certain extent.
[0101] (2) By comparing the properties of sludge after being impacted by different water sources, it was found that due to the different impact mechanisms of various types of toxic substances on sludge, the impact effects and impact methods are also very different. These differences also cause the characteristic differences of sludge images to a certain extent, making it possible to identify sludge from different toxic sources through image feature analysis and calculation.
[0102] (3) The constructed EfficientNet B0 network model has the fastest iterative convergence and the most stable training effect. It can achieve a classification accuracy of 94.4% and a precision of 94.9%, which is obviously superior.
[0103] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A method for identifying water ingress risk types based on convolutional neural networks, characterized in that: The following steps are involved: S1. Normal water is introduced into the inlet of the SBR reactor, and the activated sludge is cultured and tested in a sequential batch operation mode; Various types of abnormal influent were selected as experimental variation conditions, the inlet end of the SBR reactor was replaced with various types of abnormal influent, and the activated sludge was continuously cultured for multiple cycles; S2. Track and analyze the monitoring indicators of activated sludge and water quality monitoring indicators of pollutant removal effect before and after the experimental conditions change, and synchronously inject mud samples into the real-time online microscopic image capture device during the aeration stage of each cycle, and capture and collect microscopic images of the activated sludge through the real-time online microscopic image capture device; S3. A water inlet risk type recognition model is built with a convolutional neural network as the main network, and the collected sludge images are input into the water inlet risk type recognition model for training. The water inlet risk type recognition model performs deep feature extraction and analysis on the sludge images; S4. The trained influent risk type identification model determines the type of abnormal influent based on the sludge instability state in the periodically input activated sludge microscopic images.
2. The water inflow risk type identification method based on convolutional neural network according to claim 1 is characterized in that: In the steps S1 and S4, the types of abnormal influent water include heavy metal Cu 2+ Influent, containing heavy metal Cr 2+ Influent, influent with too low pH, influent with too high pH, influent containing aniline, influent with high salinity.
3. The water inflow risk type identification method based on convolutional neural network according to claim 1 is characterized in that: In step S2, the monitoring indicators of activated sludge include SV5, SV 30 , SVI and MLSS, MLVSS indicators; water quality monitoring indicators include COD, NH4 + -N, PO4 3- -P.
4. The water inflow risk type identification method based on convolutional neural network according to claim 1 is characterized in that: The input layer of the water inflow risk type identification model randomly crops the input microscopic image data to 224×224, randomly selects images in the training set to flip horizontally, calls the built-in Normalize function to normalize the image data, and converts the data into a standard Gaussian distribution; The output layer of the water inflow risk type identification model outputs a one-dimensional vector of the target quantity category, which respectively represents the prediction results of each input image, and finally outputs the prediction results and corresponding probability values of each input mud sample, and takes the label corresponding to the maximum probability as the classification result.
5. The water inflow risk type identification method based on convolutional neural network according to claim 1 is characterized in that: In step S2, the specific image collection process of the real-time online microscopic image capture device includes: The stage of sufficient mixing of mud and water, i.e., the aeration stage in a single reaction cycle, is set as the sludge sampling stage, during which the sludge image is recorded in the form of a video, and the sampling speed of the real-time online microscopic image capture device is adjusted so that the sludge passes through the field of view clearly and steadily at an appropriate speed; Frames of the sludge videos collected from the sub-experiments of each abnormal water inflow type were extracted at equal intervals to obtain the original sludge images, and the histogram distribution characteristics, image entropy values and other characteristics of each image were analyzed and calculated to screen the image data; At the same time, multiple label folders are created as containers for sludge images impacted by multiple abnormal water inflow types; the screened image data are stored in each label folder as training data for input into the water inflow risk type recognition model.
6. The water inflow risk type identification method based on convolutional neural network according to claim 5 is characterized in that: The image data includes training set data, validation set data, and test set data, wherein the validation set data is randomly extracted in proportion from the training set data by calling the Pytorch built-in function.
7. The water inflow risk type identification method based on convolutional neural network according to claim 5 is characterized in that: The real-time online microscopic image capturing device performs operations including ROI movement and blurring on the image during the process of image feature analysis and extraction.
8. The water inflow risk type identification method based on convolutional neural network according to claim 1 is characterized in that: In the step S1, during the experiment, three groups of SBR reactors are operated synchronously: an experimental group is used for various types of water inlet shock experiments; a control group is used to eliminate the influence of operating cycle variables; and one is used for sludge reserve acclimation to replenish the sludge loss in the abnormal water inlet shock experiment.
9. The water inflow risk type identification method based on convolutional neural network according to claim 1 is characterized in that: During the training process of step S3, the water inflow risk type identification model is trained by a transfer learning method, and the parameters of the pre-trained model are selected to load the weight information obtained by training on the dataset ImageNet.
10. The water inflow risk type identification method based on convolutional neural network according to claim 1 is characterized in that: The convolutional neural network used to build the water inflow risk type identification model is the EfficientNet B0 network model.
