Sewage treatment process optimization method and device based on deep learning

Through deep learning methods, including generating adversarial networks, adaptive wolf pack optimization, mask-enhanced self-coding and adaptive pruning random forests, optimize sewage treatment, the problems of data limitation, gradient stability and overfitting in sewage treatment are solved. , improves processing efficiency and effect.

CN119227908APending Publication Date: 2024-12-31YUNNAN AGRICULTURAL UNIVERSITY
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411614816.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2024-12-31

Smart Images

  • Figure CN119227908A_ABST
    Figure CN119227908A_ABST
Patent Text Reader

Abstract

The invention discloses a sewage treatment process optimization method and device based on deep learning, and the method comprises the steps: carrying out the sample generation based on a generative adversarial network algorithm of hybrid differential privacy, and employing a reverse feature refinement strategy to adjust the data features in the sample generation process; performing feature extraction by adopting a full-connection neural network based on an adaptive wolf pack optimization algorithm; adopting a self-encoding neural network based on mask enhancement to selectively hide partial features of input data in an input layer by adopting a random mask to perform data compression and reconstruction so as to realize feature dimension reduction; and adopting a random forest algorithm based on model capacity self-adaptive pruning to perform classification prediction on the data after feature dimension reduction to obtain a classification result of the sewage treatment degree. According to the method, the sewage treatment process is integrally optimized and improved, the sewage treatment process can be monitored and dynamically optimized in real time after improvement, the sewage treatment efficiency is improved, the sewage treatment effect is improved, and it is ensured that the sewage treatment process meets the environmental protection standard.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a sewage treatment process optimization method and device based on deep learning. Background Art

[0002] Wastewater treatment is a complex system involving multiple chemical, physical and biological processes, which aims to remove or reduce pollutants in wastewater to meet environmental standards and recycle water resources. Due to the diverse and rapidly changing composition of wastewater, traditional wastewater treatment methods face many challenges, such as low treatment efficiency, difficulty in regulation and slow response to abnormal conditions. With the development of information technology and automation technology, real-time monitoring and data acquisition technology has been widely used in wastewater treatment, which provides data support for in-depth analysis and optimization of treatment processes.

[0003] The Chinese invention patent with application number CN202380010898.8 proposes a method and system for reconstructing a wastewater biological treatment process based on machine learning. The method includes: collecting the basic water quality, ecological risk and process information data of the influent and effluent of the wastewater biological treatment process and performing data preprocessing; extracting features of the wastewater biological treatment process and performing multi-unit characterization; constructing a basic effluent water quality prediction model and an effluent ecological risk prediction model for different biological treatment multi-unit combination processes and conducting compliance inspections; simulating and reconstructing different wastewater biological treatment short-range unit combination processes, and conducting effluent water quality compliance inspections under different influent water quality scenarios; evaluating the ecological risk of the reconstructed biological treatment short-range unit combination process with effluent water quality compliance, and determining the optimal wastewater biological treatment process. The present invention can determine a new biological treatment process that meets the basic effluent water quality standards and has the lowest biological risk for different influent water quality scenarios, and solve the selection limitations of existing biological treatment process methods.

[0004] The Chinese invention patent with application number CN202211112693.4 proposes a method and system for predicting sewage treatment water quality based on machine learning, which includes: obtaining the daily historical influent data of the sewage treatment plant and constructing an influent water quality database; dividing the influent water quality data in the influent water quality database into a training set and a test set; constructing a water quality prediction model using the training set based on the five-fold cross-validation method; verifying the water quality prediction model using the test set to obtain the optimal water quality prediction model; inputting the target to be measured into the optimal water quality prediction model to obtain the prediction result. The system includes: a database construction module, a data division module, a model construction module, a verification module and a prediction module. By using the present invention, the influent water quality indicators can be predicted quickly and accurately. As a method and system for predicting sewage treatment water quality based on machine learning, the present invention can be widely used in the field of influent water quality indicator prediction technology.

[0005] The Chinese invention patent with application number CN202410417701.9 proposes a carbon emission accounting method, device and platform for a sunken sewage treatment plant, including: S1, calculating the direct carbon emission intensity of the sunken sewage treatment plant: the calculation method includes calculating the carbon emission intensity of CO-2, the carbon emission intensity of CH-4, and the carbon emission intensity of N-2O respectively, and then adding them to obtain the direct carbon emission intensity; wherein the N-2O conversion rate is obtained by simulation and prediction of the machine learning model; S2, calculating the indirect carbon emission intensity of the sunken sewage treatment plant: the calculation method includes calculating the carbon emission intensity of electricity consumption and the carbon emission intensity of material consumption respectively, and then adding them to obtain the indirect carbon emission intensity; S3, adding the direct carbon emission intensity and the indirect carbon emission intensity to obtain the total carbon emission intensity of the sunken sewage treatment plant. The present invention more conveniently and intuitively calculates the carbon emissions of the sewage treatment plant, so as to achieve low-carbon management of the sewage treatment plant and help reduce the carbon emissions of the sewage treatment plant.

[0006] The existing technology has the following deficiencies, resulting in low efficiency and poor treatment effect of sewage treatment:

[0007] 1. Existing technologies often face the problems of limited data volume and lack of diversity in data collection and processing, which limits the generalization ability and accuracy of the model.

[0008] 2. When processing complex sewage treatment data, traditional neural networks are often affected by gradient vanishing or exploding, resulting in unstable training and inability to effectively extract key features.

[0009] 3. Traditional feature dimensionality reduction techniques fail to effectively process high-dimensional data, often resulting in a large amount of information loss during the dimensionality reduction process, affecting data availability and model performance.

[0010] 4. The traditional random forest algorithm lacks flexibility in setting the number and depth of decision trees, which easily causes model overfitting and limits its application effect on complex data sets. Summary of the invention

[0011] In order to solve the problems of low efficiency and poor treatment effect of the above-mentioned sewage treatment, the present invention proposes a sewage treatment process optimization method and device based on deep learning. The method and device can monitor and dynamically optimize the sewage treatment process in real time, improve the treatment efficiency and effect, and ensure that the treatment process meets environmental protection standards.

[0012] In a first aspect, an embodiment of the present invention provides a sewage treatment process optimization method based on deep learning, comprising:

[0013] Step S1, data collection and labeling: collect relevant data in the sewage treatment process as target data, store the target data in a structured JSON format, and manually label the target data into the following three categories: normal treatment, substandard treatment, and efficient treatment;

[0014] Step S2, data expansion: Generate samples based on the hybrid differential privacy generative adversarial network algorithm, and use the reverse feature refinement strategy to adjust data features during the sample generation process;

[0015] Step S3, feature extraction: using a fully connected neural network based on an adaptive wolf pack optimization algorithm to extract features;

[0016] Step S4, feature dimensionality reduction: using a mask-enhanced autoencoder neural network to selectively hide some features of the input data using a random mask at the input layer to perform data compression and reconstruction to achieve feature dimensionality reduction, wherein the autoencoder neural network includes an encoder and a decoder;

[0017] Step S5, classifying and predicting the sewage treatment degree: using a random forest algorithm based on model capacity adaptive pruning to classify and predict the data after feature dimension reduction, and obtain the classification result of the sewage treatment degree, wherein the random forest algorithm uses an adaptive mechanism to automatically adjust the number and depth of decision trees according to the complexity of the training data;

[0018] Step S6, optimizing the sewage treatment strategy: optimizing the sewage treatment strategy according to the predicted classification results of the sewage treatment degree.

[0019] Optionally, in an implementation of the first aspect, the training process of the hybrid differential privacy-based generative adversarial network algorithm in step S2 includes:

[0020] Step S201, parameter initialization operation: during the initialization process, initial parameters are set for the generator and the discriminator respectively, and differential privacy parameters of the loss function are set at the same time;

[0021] Step 202, sample generation and discrimination: In the sample generation process, the generator samples potential variables from the latent space and generates false data through forward propagation; in the discrimination stage, the discriminator receives false data from the generator and samples in the real data set to distinguish true from false;

[0022] Step 203, adjusting data features: after generating sample data, using the loss function to adjust the data features of the sample data to the generator;

[0023] Step 204, updating the initialization parameters: alternately training the generator and the discriminator, and using the gradient descent method to update the initial parameters of the generator and the discriminator respectively;

[0024] Step 205, repeat iteration: Repeat the above steps 201 to 204 until the preset stop iteration condition is met to complete the model training.

[0025] Optionally, in an implementation of the first aspect, the training process of training the fully connected neural network based on the adaptive wolf pack optimization algorithm in step S3 includes:

[0026] Step S301, parameter initialization operation: initializing weight parameters and bias parameters of the fully connected neural network;

[0027] Step S302, adjusting the parameters of the fully connected neural network and finding the optimal solution: adjusting the parameters of the neural network by simulating the social behavior of the wolf pack based on the adaptive wolf pack optimization algorithm, where each wolf represents a set of potential solutions of the neural network, and the social behavior of the wolf pack helps explore the solution space and find the optimal solution for the wolf pack position;

[0028] Step S303, using adaptive adjustment optimization: in each algorithm iteration, adaptively adjust the search strategy according to the optimization results of the previous generation;

[0029] Step S304, updating the initialization parameters: using the loss function gradient corresponding to the parameters of the generator in each algorithm iteration to update the weight parameters and bias parameters of the fully connected neural network;

[0030] Step S305, repeat iteration: Repeat the above steps 301 to 304 until the preset stop iteration condition is met to complete the model training.

[0031] Optionally, in an implementation of the first aspect, the training process of the mask-enhanced autoencoder neural network in step S4 includes:

[0032] Step S401, parameter initialization operation: initializing the weight parameters and bias parameters of the autoencoder network;

[0033] Step 402, local optimal adjustment of the network layer: according to the framework of the greedy algorithm, set the independent training cycle and learning rate of each layer of the autoencoder network to ensure that each layer of the network can reach the local optimal point before being added to the overall network;

[0034] Step S403, masking the input data: at the beginning of each training cycle, randomly generate a mask matrix for each input vector to randomly mask part of the input data;

[0035] Step S404, data compression processing: inputting the masked data into the encoder in the autoencoder network, and compressing the data into a low-dimensional feature representation after being processed by an activation function;

[0036] Step S405, data reconstruction processing: inputting the data after data compression processing into the decoder in the autoencoder network for data reconstruction and output, wherein the parameter update of the decoder in the autoencoder network is realized by calculating the loss function and the back propagation algorithm;

[0037] Step S406, optimizing the parameters in the autoencoder network: based on the greedy algorithm, the Adam optimizer is used to optimize the parameters of each layer of the autoencoder network;

[0038] Step S407, optimizing the global performance of the autoencoder model: after the training of all network layers of the encoder in the autoencoder network is completed, the models of each network layer are integrated to form a complete autoencoder model, and the loss function is used to fine-tune the complete autoencoder model as a whole to optimize the global performance of the model;

[0039] Step 408: Repeat the above steps 401 to 407 until the preset stop iteration condition is met to complete the model training.

[0040] Optionally, in an implementation of the first aspect, the training process of the random forest algorithm based on model capacity adaptive pruning in step S5 includes:

[0041] Step S501, initializing random forest parameters: initializing the maximum depth of the decision tree in the random forest and the minimum number of samples for each node;

[0042] Step S502, training and optimizing the decision trees in the random forest: for each decision tree in the random forest, randomly selecting a feature subset for training, and in the process of building each decision tree, using chaos indicators for optimization in feature selection and data segmentation;

[0043] Step S503, marking leaf nodes in the decision tree: During the construction of the decision tree, the growth of the decision tree is controlled according to the combination of information gain and chaos index. If the performance improvement of a node in the decision tree is no longer significant, or the depth of the decision tree is greater than or equal to the adaptive threshold, the node is stopped from being split and marked as a leaf node;

[0044] Step S504, voting to determine the classification result: After all decision trees in the random forest are constructed, the final classification result is determined by majority voting.

[0045] In a second aspect, an embodiment of the present invention provides a sewage treatment process optimization device based on deep learning, including: a data acquisition and annotation module, a data processing module;

[0046] The data and annotation module is used to collect relevant data in the sewage treatment process as target data, store the target data in a structured JSON format, and manually annotate the target data into the following three categories: normal treatment, substandard treatment, and efficient treatment;

[0047] The data processing module is used to perform the following operations:

[0048] The sample generation is performed based on the hybrid differential privacy generative adversarial network algorithm, and the reverse feature refinement strategy is used to adjust the data features during the sample generation process;

[0049] A fully connected neural network based on an adaptive wolf pack optimization algorithm is used for feature extraction;

[0050] A mask-enhanced autoencoder neural network is used to selectively hide some features of input data using random masks at the input layer to perform data compression and reconstruction to achieve feature dimensionality reduction, wherein the autoencoder neural network includes an encoder and a decoder;

[0051] A random forest algorithm based on model capacity adaptive pruning is used to classify and predict the data after feature dimension reduction to obtain the classification results of sewage treatment degree, wherein the random forest algorithm uses an adaptive mechanism to automatically adjust the number and depth of decision trees according to the complexity of training data;

[0052] The sewage treatment strategy is optimized based on the predicted classification results of the sewage treatment degree.

[0053] In a third aspect, an embodiment of the present invention provides a computer device, including:

[0054] at least one processor; and

[0055] a memory communicatively coupled to the at least one processor;

[0056] Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0057] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.

[0058] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which implements the method described above when executed by a processor.

[0059] The beneficial effects of the present invention are as follows:

[0060] In the technical solution of the present invention, by selecting a generative adversarial network algorithm based on hybrid differential privacy for sample generation, a fully connected neural network based on an adaptive wolf pack optimization algorithm for feature extraction, a mask-enhanced autoencoder for data compression and reconstruction, and a random forest algorithm based on model capacity adaptive pruning, the data after feature dimensionality reduction is classified and predicted, and a model combination of classification results of sewage treatment degree is obtained, which can simultaneously solve the limitations on the quantity and diversity of sewage data in the sewage treatment process, the gradient vanishing and gradient explosion problems that may be encountered by traditional neural networks when processing complex sewage data, the difficulty of feature extraction in high-dimensional data space, and the overfitting problem that may be caused by the fixed number and depth of decision trees, etc., and optimize and improve the sewage treatment process as a whole. After the improvement, the sewage treatment process can be monitored and dynamically optimized in real time, the treatment efficiency of sewage treatment can be improved, the sewage treatment effect can be improved, and it can be ensured that the sewage treatment process meets environmental protection standards.

[0061] Specifically, in the technical solution of the present invention, firstly, the limitations of the quantity and diversity of sewage treatment data are solved by adopting a generative adversarial network based on hybrid differential privacy, and an inverse feature refinement strategy is used in the data generation process to improve the authenticity and relevance of the generated data;

[0062] Secondly, a fully connected neural network based on an adaptive wolf pack optimization algorithm is used to solve the gradient vanishing and gradient exploding problems that traditional neural networks may encounter when processing complex sewage data. The adaptive mechanism adjusts the search strategy according to the optimization history to improve the efficiency of parameter adjustment.

[0063] Thirdly, the mask-enhanced autoencoder is used for data compression and reconstruction, which solves the problem of feature extraction in high-dimensional data space. The random masking technology is used to force the network to learn from part of the visible data, thus enhancing the model's ability to recognize the intrinsic relationship of the data.

[0064] Finally, the random forest algorithm based on model capacity adaptive pruning is used to solve the overfitting problem that may be caused by the fixed number and depth of decision trees. The parameters of the tree are automatically adjusted according to the complexity of the data set to improve the performance of the model on unseen data.

[0065] In summary, the improvements in the above four aspects achieve overall optimization and improvement of the sewage treatment process. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0067] Figure 1 A schematic diagram of a process flow of a sewage treatment process optimization method based on deep learning in an embodiment of the present invention;

[0068] Figure 2 A flowchart of a training process of a generative adversarial network algorithm based on hybrid differential privacy in an embodiment of the present invention;

[0069] Figure 3 A flowchart of a training process for training a fully connected neural network based on an adaptive wolf pack optimization algorithm in an embodiment of the present invention;

[0070] Figure 4 A flowchart of a training process of an autoencoder neural network based on mask enhancement in an embodiment of the present invention;

[0071] Figure 5 A flowchart of a training process of a random forest algorithm based on model capacity adaptive pruning in an embodiment of the present invention;

[0072] Figure 6 A schematic diagram of the structure of a sewage treatment process optimization device based on deep learning in an embodiment of the present invention;

[0073] Figure 7 A schematic diagram of the hardware structure of a computer device suitable for implementing a sewage treatment process optimization method based on deep learning according to Embodiment 1 of the present invention;

[0074] Figure 8 Another flowchart of a training process for training a fully connected neural network based on an adaptive wolf pack optimization algorithm in an embodiment of the present invention;

[0075] Fig. 9 Another flowchart of the training process of the mask-enhanced autoencoder neural network in an embodiment of the present invention. DETAILED DESCRIPTION

[0076] In order to make the purpose, technical scheme 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. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0077] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0078] In the description of the present invention, it should be understood that the numerical labels before the steps do not identify the order of executing the steps, but are only used to facilitate the description of the present invention and distinguish each step, and therefore cannot be understood as a limitation of the present invention.

[0079] In order to facilitate understanding of the technical solutions in the embodiments of the present invention, the technical terms in this field are briefly introduced below, which are as follows:

[0080] Generative Adversarial Networks (GANs): is a powerful deep learning model that is mainly used to generate new styles of data. GANs consists of two sub-networks: the generator and the discriminator. The generator tries to generate data similar to real data, while the discriminator tries to distinguish between real data and data generated by the generator. The discriminator can also be called a discriminator.

[0081] Hybrid differential privacy: is a technique to protect user privacy. It can perform machine learning without leaking sensitive information. Using hybrid differential privacy in generative adversarial networks (GANs) can improve the security and robustness of the model.

[0082] Adaptive Wolf Pack Optimization Algorithm: It is an evolutionary computation algorithm applied to global optimization problems. This algorithm is inspired by wolf pack behavior because it simulates wolf pack behaviors such as predation, migration, and social interaction, so that it can achieve better performance in global search problems. The main idea of ​​the adaptive wolf pack optimization algorithm is to regard the search process for the global optimal solution as a complex biological evolution process, and to ensure the global convergence of the algorithm by controlling parameters such as group size, individual speed, and inertia weight.

[0083] Random Forest algorithm: It is an integrated learning method, mainly used for predicting and classifying data. It adopts an integrated model composed of multiple decision trees, each of which contains a large number of sampling points. The advantage of this method is that it can automatically solve the problems of overfitting and underfitting, and has good generalization ability.

[0084] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments thereof, as follows:

[0085] Embodiment 1

[0086] Figure 1 A schematic diagram of a process flow of a sewage treatment process optimization method based on deep learning in an embodiment of the present invention;

[0087] like Figure 1 As shown, the sewage treatment process optimization method in the embodiment of the present invention includes the following steps S1 to S6:

[0088] Step S1, data collection and labeling: collect relevant data in the sewage treatment process as target data, store the target data in a structured JSON format, and use manual labeling to label the target data into the following three categories: normal treatment, substandard treatment, and efficient treatment.

[0089] The target data is collected from the real-time monitoring system and historical processing records of the sewage treatment process. Automatic data collection is achieved through various sensors and data acquisition modules. The data is stored in a structured JSON format.

[0090] In one embodiment, the attributes of the data include R a1 is chemical oxygen demand, in mg / L; R a2 is the biological oxygen demand, in mg / L; R a3 is suspended solids, in mg / L; R a4 is ammonia nitrogen, the unit is mg / L; R a5 is total phosphorus, in mg / L; R a6 is total nitrogen, in mg / L; R a7 is pH value; R a8 is the temperature in °C; R a9 is the flow rate, in m 3 / h; R a10 is the electrical conductivity, and its unit is μS / cm.

[0091] It should be noted that this embodiment is only used to illustrate one data format and type of the present invention. In actual applications, the attributes of data are usually more than 10 attributes, and the number of attributes of data may reach dozens or even hundreds.

[0092] Furthermore, the collected data is labeled. The labeling method of the present invention is manual labeling. In one embodiment, the labeling categories include: "normal processing", "processing substandard", and "efficient processing", a total of 3 categories.

[0093] Step S2, data expansion: Generate samples based on the generative adversarial network algorithm with hybrid differential privacy, and use the reverse feature refinement strategy to adjust data features during the sample generation process.

[0094] It is understandable that in the task of the present invention, the collection, acquisition, labeling and preprocessing of training data are time-consuming and labor-intensive, and insufficient training samples can easily lead to poor generalization ability of the model, while affecting the accuracy of the model. The present invention uses a generative adversarial network algorithm based on hybrid differential privacy to generate samples, thereby achieving data expansion. Specifically, the generator attempts to create seemingly real data samples to deceive the discriminator, and the discriminator determines whether the input sample is real data or generated by the generator. The present invention adopts an inverse feature refinement strategy to enable the generator to more accurately adjust data features during the generation process to meet the specific needs of sewage treatment data.

[0095] Specifically, the training process of the generative adversarial network algorithm based on hybrid differential privacy is as follows Figure 2 The corresponding embodiments are described in the embodiment section and will not be repeated here.

[0096] Step S3, feature extraction: feature extraction is performed using a fully connected neural network based on an adaptive wolf pack optimization algorithm.

[0097] The expanded data is input into the feature extraction model to train the feature extraction model. The present invention uses a 3-layer fully connected neural network for feature extraction. In the prior art, some solutions use neural networks for feature extraction. In some neural network structures, gradient vanishing, gradient explosion or falling into local optimal solutions may be encountered, affecting the stability of training and the performance of the model. The present invention uses a neural network based on an adaptive wolf pack optimization algorithm. On the basis of the traditional wolf pack optimization algorithm, an adaptive mechanism is used to adjust the search strategy according to the previous optimization results to improve the algorithm's search efficiency and accuracy in high-dimensional data space.

[0098] Specifically, the training process of the neural network algorithm based on the adaptive wolf pack optimization algorithm is as follows: Figure 3 The corresponding embodiments are described in the embodiment section and will not be repeated here.

[0099] Step S4, feature dimensionality reduction: using a mask-enhanced autoencoder neural network to selectively hide some features of the input data using a random mask at the input layer for data compression and reconstruction to achieve feature dimensionality reduction, wherein the autoencoder neural network includes an encoder and a decoder.

[0100] The data after feature extraction is input into the feature dimensionality reduction model to train the feature dimensionality reduction model. The present invention adopts an autoencoder neural network based on mask enhancement as a feature dimensionality reduction algorithm. The autoencoder neural network based on mask enhancement includes an encoder and a decoder, and realizes data compression and reconstruction by learning the effective expression of input data. On the basis of the traditional autoencoder, the present invention adopts a random mask in the input layer to selectively hide part of the features of the input data, forcing the network to reconstruct the complete output from the partially visible input data, thereby enhancing the model's ability to learn the implicit relationship in the data, so as to ensure that the data after dimensionality reduction can still maintain the original data structure characteristics.

[0101] Specifically, the training of the mask-enhanced autoencoder neural network is as follows: Figure 4 The corresponding embodiments are shown in the embodiment section, which will not be described in detail here.

[0102] Step S5, classify and predict the degree of sewage treatment: use the random forest algorithm based on model capacity adaptive pruning to classify and predict the data after feature dimensionality reduction to obtain the classification results of the degree of sewage treatment, wherein the random forest algorithm uses an adaptive mechanism to automatically adjust the number and depth of decision trees according to the complexity of the training data.

[0103] The reduced-dimensional data is input into the classifier to train the classifier model. The present invention adopts a random forest algorithm based on model capacity adaptive pruning as the classifier model. The random forest is composed of multiple decision trees, each of which is independently constructed during the training process, and the output classification is finally determined by a voting mechanism. In the traditional random forest algorithm, the number and depth of decision trees are often fixed or need to be set manually, which may not be suitable for data sets related to sewage treatment processes. The present invention uses an adaptive mechanism to automatically adjust the number and depth of decision trees according to the complexity of the training data to reduce the risk of overfitting and improve the generalization ability of the model on unseen data.

[0104] Specifically, the training of the random forest algorithm based on model capacity adaptive pruning is as follows Figure 5 The corresponding embodiments are described in detail and will not be described again here.

[0105] Step S6, optimizing the sewage treatment strategy: optimizing the sewage treatment strategy according to the predicted classification results of the sewage treatment degree.

[0106] The trained model is used to process new samples to optimize the sewage treatment process. In one embodiment, the collected raw data is input into the trained feature extraction and feature dimension reduction model for feature processing. Further, the processed features are input into the classifier model for classifier training to obtain classification results. In this embodiment, the classification categories include: "normal treatment", "substandard treatment", and "efficient treatment", a total of 3 categories.

[0107] Furthermore, according to the classification results, corresponding treatment strategies are formulated. For example, if the model predicts that "treatment does not meet the standards", the operator may need to adjust the chemical dosage or treatment time of the treatment facility. By precisely controlling the sewage treatment process, it is ensured that the treatment effect always meets environmental protection standards and improves the effluent quality.

[0108] In the first embodiment of the present invention, by selecting a generative adversarial network algorithm based on hybrid differential privacy for sample generation, a fully connected neural network based on an adaptive wolf pack optimization algorithm for feature extraction, a mask-enhanced autoencoder for data compression and reconstruction, and a random forest algorithm based on model capacity adaptive pruning, the data after feature dimensionality reduction is classified and predicted, and a model combination of classification results of the sewage treatment degree is obtained. This can simultaneously solve the limitations on the quantity and diversity of sewage data in the sewage treatment process, the gradient vanishing and gradient explosion problems that may be encountered by traditional neural networks when processing complex sewage data, the difficulty of feature extraction in high-dimensional data space, and the overfitting problem that may be caused by the fixed number and depth of decision trees, etc., and optimize and improve the sewage treatment process as a whole. After the improvement, the sewage treatment process can be monitored and dynamically optimized in real time, the treatment efficiency of sewage treatment can be improved, the sewage treatment effect can be improved, and it can be ensured that the sewage treatment process meets environmental protection standards.

[0109] Embodiment 2

[0110] Figure 2 The figure is a flowchart of the training process of the generative adversarial network algorithm based on hybrid differential privacy in an embodiment of the present invention.

[0111] In the technical solution of the present invention, the training process of the generative adversarial network algorithm based on hybrid differential privacy in step S2 of the sewage treatment process optimization method based on deep learning can adopt the training operations in the following steps S201-205, such as Figure 2 As shown, the details are as follows:

[0112] Step S201, parameter initialization operation: During the initialization process, the initial parameters are set for the generator and the discriminator respectively, and the differential privacy parameters of the loss function are set at the same time.

[0113] During the initialization process, the generator G c and the discriminator Dc Set the initial parameters. In one embodiment, set θ c and φ c Represent the parameters of the generator and the discriminator respectively, and the initialization process is expressed as:

[0114]

[0115] In the formula, and are the initial parameters of the generator and discriminator respectively; represents a normal distribution with mean 0 and covariance of the identity matrix I.

[0116] At the same time, set the differential privacy parameter σ c , initialized to:

[0117]

[0118] In the formula, δ c and ∈ c are the sensitivity and privacy of the differential privacy algorithm respectively. Preferably, δ c Let the value be 1,∈ c Set the value to 4.

[0119] Step S202, sample generation and discrimination: In the sample generation process, the generator samples potential variables from the latent space and generates false data through forward propagation; in the discrimination stage, the discriminator receives false data from the generator and samples in the real data set to distinguish true from false.

[0120] In the sample generation stage, the generator samples potential variables from the latent space and generates fake data through forward propagation, which can be expressed as:

[0121]

[0122] In the formula, Indicates the generated false data; z c is the latent variable sampled from the prior distribution p(z); G c is the generator; G c () is the generator function; θ c The parameters for the generator.

[0123] Moreover, in the discrimination stage, the discriminator receives the fake data from the generator and the samples in the real data set to distinguish true from false. c The goal is to distinguish real data and fake data Its output is expressed as:

[0124]

[0125] In the formula, is real data; and are the discrimination results of real data and false data respectively; D c is the discriminator; D c () is the discriminator function; φ c are the parameters of the discriminator.

[0126] Step S203, adjusting data features: After generating sample data, use the loss function to adjust the data features of the sample data to the generator.

[0127] After generating sample data, the loss function is used to adjust the generator G c Make adjustments, and the adjustment method is expressed as:

[0128]

[0129] Where, L c is the total loss function; α c and β c are the weight factors of privacy protection and data quality respectively; L privacy () is the loss function for privacy protection; L quality () is a loss function based on data quality. Specifically, the differential privacy parameters include the weight factors of the above privacy protection.

[0130] In one embodiment, the privacy protection loss function considers the privacy degree in differential privacy and the information leakage degree of generated data, and the calculation method is expressed as:

[0131]

[0132] Where, d JS () represents the actual data distribution and generate data distribution The Jensen-Shannon divergence between c represents the strength of differential privacy protection. Preferably, ∈ c Set the value to 3.

[0133] Moreover, the data quality loss function is used to evaluate the authenticity of the generated data, and the calculation method is expressed as:

[0134]

[0135] In the formula, ∥∥2 represents the Euclidean distance, that is, the L2 norm, and Ns is the total number of generated samples.

[0136] Step S204, updating the initialization parameters: alternately train the generator and the discriminator, and use the gradient descent method to update the initial parameters of the generator and the discriminator respectively.

[0137] The generator and the discriminator are trained alternately, and the gradient descent method is used to train θ c and φ c Update, the update method is expressed as:

[0138]

[0139] Where η c is the learning rate; and They are the loss functions L c For θ c and φ c Preferably, η c Set the value to 0.01.

[0140] Furthermore, the generator θ c Gradient The calculation method is expressed as:

[0141]

[0142] In the formula, and They are the loss functions L privacy and L quality About parameter θ c gradient.

[0143] And, the discriminator φ c Gradient The calculation method is expressed as:

[0144]

[0145] In the formula, and They are the loss functions L privacy and L quality About parameter φ c gradient.

[0146] Step S205, repeat iteration: Repeat the above steps S201 to S204 until the preset stop iteration condition is met to complete the model training.

[0147] Repeat the above steps until the preset stop iteration condition is met, which means that the model training is completed. In one embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000 times.

[0148] In the second embodiment of the present invention, a generative adversarial network based on hybrid differential privacy is adopted to solve the problems of limited data volume and lack of diversity in data collection and processing of sewage treatment data. An inverse feature refinement strategy is used in the process of generating data to improve the authenticity and relevance of the generated data, thereby improving the sewage treatment process. Combined with the improvements in the other three aspects, the overall optimization and improvement of the sewage treatment process is achieved.

[0149] Embodiment 3

[0150] Figure 3 The figure is a flowchart of a training process for training a fully connected neural network based on an adaptive wolf pack optimization algorithm in an embodiment of the present invention.

[0151] In the technical solution of the present invention, the training process of training a fully connected neural network based on an adaptive wolf pack optimization algorithm in step S3 of the sewage treatment process optimization method based on deep learning can adopt the following training operations in steps S301 to S305, such as Figure 3 As shown, the details are as follows:

[0152] Step S301, parameter initialization operation: initializing the weight parameters and bias parameters of the fully connected neural network.

[0153] Initialize the parameters of the neural network, the parameters of the neural network include weight parameters and bias parameters. In one embodiment, the initialization method is expressed as:

[0154]

[0155] In the formula, represents the initial value of the neural network parameters; σ cs is the initialization standard deviation; G t (0,I) represents a Gaussian distribution with mean 0 and covariance equal to the identity matrix. Preferably, σ cs Set to 0.01.

[0156] Step S302, adjust the parameters of the fully connected neural network and find the optimal solution: adjust the parameters of the neural network by simulating the social behavior of the wolf pack based on the adaptive wolf pack optimization algorithm, where each wolf represents a set of potential solutions of the neural network, and the social behavior of the wolf pack helps explore the solution space and find the optimal solution for the wolf pack's position.

[0157] The adaptive wolf pack optimization algorithm adjusts the parameters of the neural network by simulating the social behavior of the wolf pack. Each wolf represents a set of potential solutions of the neural network, and the social behavior of the wolf pack helps explore the solution space and find the optimal solution. The wolf pack position update method is expressed as:

[0158]

[0159] In the formula, and are the positions of the wolf at iterations t and t+1 respectively; x cp is the optimal position of an individual in a wolf pack; x cg is the global optimal position; α c and β c is a parameter that balances exploration and exploitation. Preferably, α c and β c Set them to 0.3 and 0.5 respectively.

[0160] Step S303, use adaptive adjustment optimization: in each algorithm iteration, the search strategy is adaptively adjusted according to the optimization results of the previous generation.

[0161] In each algorithm iteration, the search strategy is adjusted according to the optimization results of the previous generation. The adaptive adjustment method is expressed as:

[0162]

[0163] In the formula, is the updated α c ; c is the adjustment factor used to adjust α c ; ∥∥ represents the Euclidean distance.

[0164] In one embodiment, the adjustment factor λ c Adjustments are made based on feedback from historical optimization performance, and the calculation method is expressed as:

[0165]

[0166] Where, T ve is the number of historical iterations considered, indicating how many generations of past performance affect the current adjustment; is the attenuation factor, γ c is the decay rate; is the loss function value at the tth iteration; is the neural network parameter of the t-th iteration, that is, the optimal position x of the individual in the wolf pack of the t-th iteration cp The corresponding neural network parameters. Preferably, γ c Set to 3.

[0167] Step S304, update the initialization parameters: use the loss function gradient corresponding to the parameters of the generator in each algorithm iteration to update the weight parameters and bias parameters of the fully connected neural network.

[0168] Update the weight parameters and bias parameters of the neural network. The update method is expressed as:

[0169]

[0170] In the formula, and are the neural network parameters of the t-th iteration and the t+1-th iteration respectively; η c is the learning rate; It is in the parameter The gradient of the loss function at . Preferably, η c Set to 0.01.

[0171] Furthermore, the gradient The calculation method is expressed as:

[0172]

[0173] Where M is the number of samples in each batch of training data; x cm is the input data of the mth sample; y cm is the true label of the mth sample; is the cross entropy loss function; f(x cm θ c ) is the predicted output of the neural network model.

[0174] Step S305, repeat iteration: Repeat the above steps S301 to S304 until the preset stop iteration condition is met to complete the model training.

[0175] Repeat the above steps until the preset stop iteration condition is met, which means that the model training is completed. In one embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations, preferably, the preset maximum number of iterations is set to 1000 times.

[0176] It should be noted that another flowchart of the training process of training a fully connected neural network based on the adaptive wolf pack optimization algorithm is as follows Figure 8 As shown, the description of the accompanying drawings is the same as the solution described in the third embodiment above, which will not be repeated here.

[0177] In the third embodiment of the present invention, a fully connected neural network based on an adaptive wolf pack optimization algorithm is used to solve the gradient vanishing and gradient exploding problems that traditional neural networks may encounter when processing complex sewage data. The adaptive mechanism adjusts the search strategy according to the optimization history to improve the efficiency of parameter adjustment, thereby improving the sewage treatment process. Combined with the improvements in the other three aspects, the overall optimization and improvement of the sewage treatment process is achieved.

[0178] Embodiment 4

[0179] Figure 4 The figure is a flowchart of the training process of the mask-enhanced autoencoder neural network in an embodiment of the present invention.

[0180] In the technical solution of the present invention, the training process of the mask-enhanced autoencoder neural network in step S4 of the sewage treatment process optimization method based on deep learning can adopt the following training operations in steps S401 to S408, such as Figure 4 As shown, the details are as follows:

[0181] Step S401, parameter initialization operation: initializing the weight parameters and bias parameters of the autoencoder network.

[0182] Initialize the parameters of the autoencoder network, including the weights and bias parameters of the autoencoder network, and set Θ (l ) is the parameter set of the lth layer, including weights and biases, that is, Θ (l) = {W tu (l) ,b tu (l)}, and W tu (l) is the weight matrix of the lth layer, b tu (l) is the bias vector of the lth layer. In one embodiment, the initialization method is random initialization.

[0183] Step S402, local optimal adjustment of the network layer: according to the framework of the greedy algorithm, set the independent training cycle and learning rate of each layer of the autoencoder network to ensure that each layer of the network can reach the local optimum before being added to the overall network.

[0184] According to the framework of the greedy algorithm, set the independent training cycle and learning rate of each layer to ensure that each layer can reach the local optimum before joining the overall network. The number of independent training cycle iterations T for the lth layer l Set to:

[0185]

[0186] In the formula, Ep is the total number of iterations, Ler is the total number of layers, δ l,Ler is the Kronecker function, ensuring that the last layer can have more training cycles.

[0187] Step S403, masking the input data: at the beginning of each training cycle, a mask matrix is ​​randomly generated for each input vector to randomly mask part of the input data.

[0188] At the beginning of each training cycle, for each input vector X th, randomly generate a mask matrix m, which is used to randomly mask part of the input data. The way to generate the mask is expressed as:

[0189] m j ~Ber(p)

[0190] In the formula, m j is the jth element of the mask vector m, p is the mask ratio; Ber( ) is the Bernoulli distribution discrete function, which is used to generate the mask matrix, each element m j Independently drawn from the Ber(p) distribution, the probability that the element has p is set to 1 (i.e., selected or activated), and the probability of 1-p is set to O (i.e., covered or inactivated).

[0191] Furthermore, the calculation method of the mask ratio p is expressed as:

[0192]

[0193] In the formula, Var(X TH 0 means input data X TH The variance of tu is the preset variance threshold, and min() represents the minimum value function.

[0194] Step S404, data compression processing: input the masked data into the encoder in the autoencoder network, and compress the data into a low-dimensional feature representation after processing by an activation function.

[0195] After the input data is masked, it is sent to the encoder. The encoder compresses the data into a low-dimensional feature representation after processing through the activation function. The forward propagation method of the encoder is expressed as:

[0196] z tu =Sig(W tu (enc) ⊙X th +b tu (enc) )

[0197] In the formula, z tu is the encoded feature vector, Sig() is the Sigmoid activation function, W tu (enc) and b tu (enc) are the weights and biases of the encoder, and ⊙ represents the Hadamard product.

[0198] Step S405, data reconstruction processing: input the data after data compression processing into the decoder in the autoencoder network for data reconstruction and output, wherein the parameter update of the decoder in the autoencoder network is achieved by calculating the loss function and the back propagation algorithm.

[0199] The low-dimensional features are fed into the decoder in the autoencoder network. The decoder attempts to reconstruct the original input data. By calculating the loss function, the back propagation algorithm updates the parameters in the network. The output of the decoder is expressed as:

[0200] X th ^=Sig(W tu (dec) ·z tu +b tu (dec) )

[0201] In the formula, X th ^ is the output of the decoder, that is, the reconstructed input data.

[0202] Furthermore, the calculation method of the loss function is expressed as:

[0203]

[0204] Where, L au is the total loss, is the reconstruction error, λ ru is the weight to control the isolation loss; ∥z tu ∥0 is the isolated loss, indicating that z tu The number of non-zero elements of is used to measure the sparsity of the code. Preferably, λ ru Set to 0.3.

[0205] Furthermore, the isolation loss ∥z tu The calculation method of ∥0 is expressed as:

[0206]

[0207] Where n z is the vector z tu Dimensions; is the encoded feature vector of the i-th dimension; 1() is the indicator function, when The value is 1 when , otherwise it is 0.

[0208] Step S406, optimizing the parameters in the autoencoder network: Based on the greedy algorithm, the Adam optimizer is used to optimize the parameters of each layer of the autoencoder network.

[0209] The greedy algorithm is used to optimize the parameters of each layer. In one embodiment, the parameter update method uses the Adam optimizer, and the update method is expressed as:

[0210]

[0211] In the formula, and denote the parameters of the tth iteration and t+1th iteration of the lth layer, Adam() is the Adam optimizer function, η vu is the learning rate, L au is the calculated loss, is the gradient of the parameters of the t-th iteration of the l-th layer with respect to the loss function. Preferably, η vu Set the dynamic adjustment strategy, and its initial value is set to 0.01.

[0212] In one embodiment, let the learning rate of the tth iteration be The dynamic adjustment method is expressed as:

[0213]

[0214] In the formula, is the initial learning rate, is the initial reconstruction weight, is the reconstruction weight of the tth iteration, δ vu is the adjustment influence coefficient. Preferably, δ vu Set to 3, Set to 5.

[0215] Furthermore, the reconstruction weight of the tth iteration The adjustment of is based on the current effect of the reconstruction error and the sparsity weight, and is calculated as:

[0216]

[0217] In the formula, γ yc is the adjustment rate parameter, is the current reconstruction error, β yc is the sparsity weight, X th For input data, is the reconstructed output of the tth iteration. Preferably, γ yc Set to 0.3, β yc Set to 5.

[0218] Furthermore, the gradient adjustment method in the Adam optimizer is expressed as:

[0219]

[0220] In the formula, m^ t and v^ tare the bias-corrected first-order and second-order moment estimates of the tth iteration, respectively, and ∈ is a small constant. Preferably, ∈ is set to 0.0001.

[0221] Furthermore, the bias-corrected first-order and second-order moment estimates m^ t and v^ t The calculation method is:

[0222]

[0223] In the formula, m t and v t is the exponential moving average of the gradient and the exponential moving average of the square of the gradient at the tth iteration, and is the decay rate of the tth iteration. Preferably, and Set to 0.9 and 0.999 respectively.

[0224] Step S407, optimizing the global performance of the autoencoder model: After the training of all network layers of the encoder in the autoencoder network is completed, the models of each network layer are integrated to form a complete autoencoder model, and the loss function is used to fine-tune the complete autoencoder model as a whole to optimize the global performance of the model.

[0225] After all layers are trained, the models of each layer are integrated to form a complete autoencoder model, and the overall fine-tuning is performed to optimize the global performance of the model. The fine-tuning method is expressed as:

[0226]

[0227] In the formula, Θ fine-tune is the fine-tuned parameter, N tu is the number of training samples, is the i-th training sample, Indicates that the parameter is and the loss function of Θ.

[0228] Step S408, repeat the above steps S401 to S407 until the preset stop iteration condition is met to complete the model training.

[0229] Repeat the above steps until the preset stop iteration condition is met, which means that the model training is completed. In one embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000 times.

[0230] It should be noted that another flowchart of the training process of the mask-enhanced autoencoder neural network is as follows: Fig. 9As shown, the description of the accompanying drawings is the same as the solution described in the fourth embodiment above, which will not be repeated here.

[0231] In the fourth embodiment of the present invention, a mask-enhanced autoencoder is used to compress and reconstruct data, which solves the problem of feature extraction in high-dimensional data space. The random masking technology is used to force the network to learn from some visible data, thereby enhancing the model's ability to recognize the intrinsic relationship of the data, thereby improving the sewage treatment process. Combined with the improvements in the other three aspects, the overall optimization and improvement of the sewage treatment process is achieved.

[0232] Embodiment 5

[0233] Figure 5 The present invention is a flowchart of a training process of a random forest algorithm based on model capacity adaptive pruning in an embodiment of the present invention.

[0234] In the technical solution of the present invention, the training process of the random forest algorithm based on model capacity adaptive pruning in step S5 of the sewage treatment process optimization method based on deep learning can adopt the following training operations in steps S501 to S504, such as Figure 5 As shown, the details are as follows:

[0235] Step S501, initializing random forest parameters: initializing the maximum depth of the decision tree in the random forest and the minimum number of samples for each node.

[0236] Initialize the random forest parameters. In one embodiment, let the i-th decision tree T in the random forest u,i The parameter initialization includes the maximum depth d of the decision tree u,i and the minimum number of samples per node n u,i , the initialization method is expressed as:

[0237]

[0238]

[0239] Where N u Represents the total number of samples of training data; Indicates a round-up operation.

[0240] Step S502, training and optimizing the decision trees in the random forest: for each decision tree in the random forest, randomly selecting a feature subset for training, and in the process of building each decision tree, using chaos indicators for optimization during feature selection and data segmentation.

[0241] For each decision tree in the random forest, a feature subset is randomly selected for training. Specifically, in the process of building each decision tree, feature selection and data segmentation use the chaos index C u,i Optimize, expressed as:

[0242]

[0243] In the formula, f represents the selected feature; H u (f) represents the entropy of a given feature f, which is used to evaluate the uncertainty of the feature; E u (f) and σ u (f) represents the expectation and standard deviation of the category distribution under f; p(c|f) is the conditional probability of category c given feature f.

[0244] Furthermore, in this embodiment, the calculation method of p(c|f) is expressed as:

[0245]

[0246] In the formula, Count(c,f) represents the number of samples with feature f and belonging to category c, and Count(f) is the number of all samples with feature f.

[0247] And, in this embodiment, it is expected that E u The calculation method of (f) is expressed as:

[0248]

[0249] In the formula, c represents the encoded value of the category label.

[0250] And, in this embodiment, the standard deviation σ u The calculation method of (f) is expressed as:

[0251]

[0252] In the formula, Classes represents the set of all categories.

[0253] Step S503, marking leaf nodes in the decision tree: During the construction of the decision tree, the growth of the decision tree is controlled according to the combination of information gain and chaos index. If the performance improvement of a node in the decision tree is no longer significant, or the depth of the decision tree is greater than or equal to the adaptive threshold, the node is stopped from being split and marked as a leaf node.

[0254] In the process of building a decision tree, the growth of the decision tree will be based on the information gain IG u,i and chaos index C u,iIf the segmentation of a node no longer leads to significant performance improvement, or the depth of the tree has reached the adaptive threshold, the node will stop segmenting and be marked as a leaf node. The adaptive pruning process is calculated as follows:

[0255]

[0256] In the formula, I u () indicates the impurity of a node; parent indicates two adjacent nodes; N u,left and N u,right are the number of samples of the left and right child nodes after segmentation; u is the pruning threshold; depth(T u,i ) indicates the depth of the current tree; d u,max is the maximum value of the depth. Preferably, d u,max Set to 30, λ u Set to 0.01.

[0257] In one embodiment, the calculation method of Gini impurity is expressed as:

[0258]

[0259] Moreover, in this embodiment, the calculation method of entropy is expressed as:

[0260]

[0261] Step S504, voting to determine the classification result: After all decision trees in the random forest are constructed, the final classification result is determined by majority voting.

[0262] After all decision trees are constructed, the final classification result is determined by majority voting, that is, the classification results of each tree for the test sample are aggregated to produce the final decision, which is expressed as:

[0263] Y u =mode({T u,i (x u )|i=1,2,…,M u})

[0264] Where, T u,i (x u ) represents the i-th decision tree for sample x u The classification result of M u is the total number of decision trees in the random forest; mode() represents the majority voting function, returning the class label with the largest proportion; x u is the sample feature to be classified; Y u is the category output by the model; T u,iis the i-th decision tree. Preferably, M u Set to 100.

[0265] In the fifth embodiment of the present invention, a random forest algorithm based on adaptive pruning of model capacity is adopted to solve the overfitting problem that may be caused by the fixed number and depth of decision trees. The parameters of the tree are automatically adjusted according to the complexity of the data set to improve the performance of the model on unseen data, thereby improving the sewage treatment process. Combined with the improvements in the other three aspects, the overall optimization and improvement of the sewage treatment process is achieved.

[0266] Embodiment 6

[0267] Figure 6 It is a structural schematic diagram of a sewage treatment process optimization device based on deep learning in an embodiment of the present invention.

[0268] like Figure 6 As shown, the sewage treatment process optimization device 60 based on deep learning in the embodiment of the present invention includes: a data collection and annotation module 601 and a data processing module 602;

[0269] The data and annotation module 601 is used to collect relevant data in the sewage treatment process as target data, store the target data in a structured JSON format, and manually annotate the target data into the following three categories: normal treatment, substandard treatment, and efficient treatment;

[0270] The data processing module 602 is used to perform the following operations:

[0271] The sample generation is performed based on the hybrid differential privacy generative adversarial network algorithm, and the reverse feature refinement strategy is used to adjust the data features during the sample generation process;

[0272] A fully connected neural network based on an adaptive wolf pack optimization algorithm is used for feature extraction;

[0273] A mask-enhanced autoencoder neural network is used to selectively hide some features of input data using random masks at the input layer to perform data compression and reconstruction to achieve feature dimensionality reduction, wherein the autoencoder neural network includes an encoder and a decoder;

[0274] A random forest algorithm based on model capacity adaptive pruning is used to classify and predict the data after feature dimension reduction to obtain the classification results of sewage treatment degree, wherein the random forest algorithm uses an adaptive mechanism to automatically adjust the number and depth of decision trees according to the complexity of training data;

[0275] The sewage treatment strategy is optimized based on the predicted classification results of the sewage treatment degree.

[0276] Optionally, the data processing module 602 can be specifically used to perform the training operations in steps S201 to 205 in the above-mentioned embodiment 2, so as to realize the training of the generative adversarial network algorithm based on hybrid differential privacy in step S2 of the sewage treatment process optimization method based on deep learning in the technical solution of the present invention.

[0277] Optionally, the data processing module 602 can also be specifically used to perform the training operations in steps S301 to S305 in the above-mentioned embodiment three, so as to realize the training of the fully connected neural network based on the adaptive wolf pack optimization algorithm in step S3 of the sewage treatment process optimization method based on deep learning in the technical solution of the present invention.

[0278] Optionally, the data processing module 602 can also be specifically used to perform the training operations in steps S401 to S408 in the above-mentioned embodiment 4, so as to realize the training of the mask-enhanced autoencoder neural network in step S4 of the sewage treatment process optimization method based on deep learning in the technical solution of the present invention.

[0279] Optionally, the data processing module 602 can also be specifically used to perform the training operations in steps S501 to S504 in the above-mentioned embodiment 5, so as to realize the training of the random forest algorithm based on model capacity adaptive pruning in step S5 of the sewage treatment process optimization method based on deep learning in the technical solution of the present invention.

[0280] Embodiment 7

[0281] Figure 7 The present invention is a schematic diagram of the hardware structure of a computer device suitable for implementing a sewage treatment process optimization method based on deep learning according to Embodiment 1 of the present invention.

[0282] like Figure 7 The hardware architecture of the computer device 70 is shown. In some embodiments, the computer device 70 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle-mounted terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 70 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Figure 7 As shown, the computer device 70 includes but is not limited to: a memory 710, a processor 720, and a network interface 730 which can be interconnected and communicated via a system bus.

[0283] Wherein: the memory 710 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 710 can be an internal storage module of the computer device 70, such as a hard disk or memory of the computer device 70. In other embodiments, the memory 710 can also be an external storage device of the computer device 70, such as a plug-in hard disk equipped on the computer device 70, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 710 can also include both the internal storage module of the computer device 70 and its external storage device. In this embodiment, the memory 710 is generally used to store the operating system and various application software installed on the computer device 70, such as the program code of the bullet screen display method, etc. In addition, the memory 710 can also be used to temporarily store various types of data that have been output or are to be output.

[0284] The processor 720 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips in some embodiments. The processor 720 is generally used to control the overall operation of the computer device 70, such as performing control and processing related to data interaction or communication with the computer device 70. In this embodiment, the processor 720 is used to run the program code stored in the memory 710 or process data.

[0285] The network interface 730 may include a wireless network interface or a wired network interface, and the network interface 730 is generally used to establish a communication link between the computer device 70 and other computer devices. For example, the network interface 730 is used to connect the computer device 70 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 70 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0286] It should be pointed out that Figure 7 Only a computer device having components 710 - 730 is shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0287] In this embodiment, the bullet screen display method stored in the memory 710 can also be divided into one or more program modules and executed by one or more processors (such as processor 720) to complete the embodiment of the present invention.

[0288] Embodiment 8

[0289] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the barrage display method in the embodiment are implemented.

[0290] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store the operating system and various application software installed on the computer device, such as the program code of the bullet screen display method in the embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.

[0291] Embodiment 9

[0292] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.

[0293] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present invention can be implemented by general-purpose computer devices, they can be concentrated on a single computer device, or distributed on a network composed of multiple computer devices, and optionally, they can be implemented by executable program codes of computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.

[0294] It should be noted that the above are only preferred embodiments of the present invention, and the patent protection scope of the present invention is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A sewage treatment process optimization method based on deep learning, characterized in that: include: Step S1, data collection and labeling: collect relevant data in the sewage treatment process as target data, store the target data in a structured JSON format, and manually label the target data into the following three categories: normal treatment, substandard treatment, and efficient treatment; Step S2, data expansion: Generate samples based on the hybrid differential privacy generative adversarial network algorithm, and use the reverse feature refinement strategy to adjust data features during the sample generation process; Step S3, feature extraction: using a fully connected neural network based on an adaptive wolf pack optimization algorithm to extract features; Step S4, feature dimensionality reduction: using a mask-enhanced autoencoder neural network to selectively hide some features of the input data using a random mask at the input layer to perform data compression and reconstruction to achieve feature dimensionality reduction, wherein the autoencoder neural network includes an encoder and a decoder; Step S5, classifying and predicting the sewage treatment degree: using a random forest algorithm based on model capacity adaptive pruning to classify and predict the data after feature dimension reduction, and obtain the classification result of the sewage treatment degree, wherein the random forest algorithm uses an adaptive mechanism to automatically adjust the number and depth of decision trees according to the complexity of the training data; Step S6, optimizing the sewage treatment strategy: optimizing the sewage treatment strategy according to the predicted classification results of the sewage treatment degree.

2. The method for optimizing sewage treatment process according to claim 1, characterized in that: The training process of the hybrid differential privacy-based generative adversarial network algorithm in step S2 includes: Step S201, parameter initialization operation: during the initialization process, initial parameters are set for the generator and the discriminator respectively, and differential privacy parameters of the loss function are set at the same time; Step 202, sample generation and discrimination: In the sample generation process, the generator samples potential variables from the latent space and generates false data through forward propagation; in the discrimination stage, the discriminator receives false data from the generator and samples in the real data set to distinguish true from false; Step 203, adjusting data features: after generating sample data, using the loss function to adjust the data features of the sample data to the generator; Step 204, updating initialization parameters: alternately training the generator and the discriminator, and using the gradient descent method to update the initial parameters of the generator and the discriminator respectively; Step 205, repeat iteration: Repeat the above steps 201 to 204 until the preset stop iteration condition is met to complete the model training.

3. The method for optimizing sewage treatment process according to claim 1, characterized in that: The training process of training the fully connected neural network based on the adaptive wolf pack optimization algorithm in step S3 includes: Step S301, parameter initialization operation: initializing weight parameters and bias parameters of the fully connected neural network; Step S302, adjusting the parameters of the fully connected neural network and finding the optimal solution: adjusting the parameters of the neural network by simulating the social behavior of the wolf pack based on the adaptive wolf pack optimization algorithm, where each wolf represents a set of potential solutions of the neural network, and the social behavior of the wolf pack helps explore the solution space and find the optimal solution for the wolf pack position; Step S303, using adaptive adjustment optimization: in each algorithm iteration, adaptively adjust the search strategy according to the optimization results of the previous generation; Step S304, updating the initialization parameters: using the loss function gradient corresponding to the parameters of the generator in each algorithm iteration to update the weight parameters and bias parameters of the fully connected neural network; Step 305, repeat iteration: Repeat the above steps 301 to 304 until the preset stop iteration condition is met to complete the model training.

4. The method for optimizing sewage treatment process according to claim 1, characterized in that: The training process of the mask-enhanced autoencoder neural network in step S4 includes: Step S401, parameter initialization operation: initializing the weight parameters and bias parameters of the autoencoder network; Step 402, local optimal adjustment of the network layer: according to the framework of the greedy algorithm, set the independent training cycle and learning rate of each layer of the autoencoder network to ensure that each layer of the network can reach the local optimal point before being added to the overall network; Step S403, masking the input data: at the beginning of each training cycle, randomly generate a mask matrix for each input vector to randomly mask part of the input data; Step S404, data compression processing: inputting the masked data into the encoder in the autoencoder network, and compressing the data into a low-dimensional feature representation after being processed by an activation function; Step S405, data reconstruction processing: inputting the data after data compression processing into the decoder in the autoencoder network for data reconstruction and output, wherein the parameter update of the decoder in the autoencoder network is realized by calculating the loss function and the back propagation algorithm; Step S406, optimizing the parameters in the autoencoder network: based on the greedy algorithm, the Adam optimizer is used to optimize the parameters of each layer of the autoencoder network; Step S407, optimizing the global performance of the autoencoder model: after the training of all network layers of the encoder in the autoencoder network is completed, the models of each network layer are integrated to form a complete autoencoder model, and the loss function is used to fine-tune the complete autoencoder model as a whole to optimize the global performance of the model; Step 408: Repeat the above steps 401 to 407 until the preset stop iteration condition is met to complete the model training.

5. The method for optimizing sewage treatment process according to claim 1, characterized in that: The training process of the random forest algorithm based on model capacity adaptive pruning in step S5 includes: Step S501, initializing random forest parameters: initializing the maximum depth of the decision tree in the random forest and the minimum number of samples for each node; Step S502, training and optimizing the decision trees in the random forest: for each decision tree in the random forest, randomly selecting a feature subset for training, and in the process of building each decision tree, using chaos indicators for optimization in feature selection and data segmentation; Step S503, marking leaf nodes in the decision tree: During the construction of the decision tree, the growth of the decision tree is controlled according to the combination of information gain and chaos index. If the performance improvement of a node in the decision tree is no longer significant, or the depth of the decision tree is greater than or equal to the adaptive threshold, the node is stopped from being split and marked as a leaf node; Step S504, voting to determine the classification result: After all decision trees in the random forest are constructed, the final classification result is determined by majority voting.

6. A sewage treatment process optimization device based on deep learning, characterized in that: include: Data collection and annotation module, and,data processing module; The data and annotation module is used to collect relevant data in the sewage treatment process as target data, store the target data in a structured JSON format, and manually annotate the target data into the following three categories: normal treatment, substandard treatment, and efficient treatment; The data processing module is used to perform the following operations: The sample generation is performed based on the hybrid differential privacy generative adversarial network algorithm, and the reverse feature refinement strategy is used to adjust the data features during the sample generation process; A fully connected neural network based on an adaptive wolf pack optimization algorithm is used for feature extraction; A mask-enhanced autoencoder neural network is used to selectively hide some features of input data using random masks at the input layer to perform data compression and reconstruction to achieve feature dimensionality reduction, wherein the autoencoder neural network includes an encoder and a decoder; A random forest algorithm based on model capacity adaptive pruning is used to classify and predict the data after feature dimension reduction to obtain the classification results of sewage treatment degree, wherein the random forest algorithm uses an adaptive mechanism to automatically adjust the number and depth of decision trees according to the complexity of training data; The sewage treatment strategy is optimized based on the predicted classification results of the sewage treatment degree.

7. A computer device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Cited By

  • Intelligent monitoring and early warning method for tunnel construction environment data

    CN120296579A

  • A Smart Monitoring and Early Warning Method for Tunnel Construction Environment Data

    CN120296579B

  • Oxidation flocculation treatment system for sulfur-containing wastewater in mancozeb production

    CN122010265A