Sewage treatment soft measurement virtual sample generation method, device, equipment and medium
Through adversarial training of multi-objective optimization functions and generative adversarial networks, initialized populations are generated, and the stability and adaptability problems of virtual sample generation in sewage treatment are solved, high consistency between virtual samples and actual data sets is achieved, and the prediction accuracy of sewage treatment soft measurement model is improved.
Patent Information
- Application Number
- CN202510788607.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-06-13
AI Technical Summary
The existence of virtual sample generation methods in sewage treatment in the prior art is limited by the prior distribution assumption of statistical interpolation methods, resulting in over-tightening and distribution offset, lack of nonlinear feature characterization capabilities, and poor training stability of generative adversarial networks, making it difficult to adapt to complex dynamic systems, resulting in inadequate prediction deviations of key parameters and low knowledge distillation efficiency.
Generate initial populations through multi-objective optimization functions, combine the generative adversarial network and discriminator for adversarial training, optimize the generator input data set, ensure the intrinsic structural consistency between the virtual samples and the sewage treatment parameter data set, and use simulated binary cross operators and parameter pruning technology to improve the stability and adaptability of the generative model.
It improves the accuracy and adaptability of virtual samples, solves the problems of generative adversarial network gradient disappearance and pattern crash, ensures the consistency between virtual samples and actual data sets, and improves the prediction capabilities of soft measurement models.
Smart Images

Figure CN120296431A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of soft sensing, and in particular, to a method, device, equipment and medium for generating virtual samples for soft sensing of sewage treatment. Background Art
[0002] In the process of industrial production, especially in complex scenarios such as sewage treatment, we need to accurately predict some key parameters (such as chemical oxygen demand COD, biochemical oxygen demand BOD5, etc.). However, in actual operation, the data of these parameters are often very limited and difficult to obtain, which leads to the problem of insufficient samples during model training.
[0003] Existing virtual sample generation technologies have systematic technical bottlenecks in industrial intelligent applications: at the methodological level, they are limited by the prior distribution assumptions of statistical interpolation methods, resulting in a vicious cycle of overfitting and distribution shift in low-entropy industrial data scenarios, and lacking effective characterization ability for the nonlinear characteristics of complex dynamic systems; in terms of industrial adaptability dimension, there are defects such as insufficient decoupling of multi-physical field coupling and lack of embedding of process mechanism knowledge, leading to an increase in prediction deviation of key parameters and low efficiency of knowledge distillation; in terms of algorithm architecture, the generative adversarial network technology has further developed into the mainstream direction of the data-driven paradigm. Its basic architecture captures the potential distribution characteristics of data through deep nonlinear mapping, but has defects such as poor adversarial training stability and insufficient characterization of industrial data uncertainty, which often hinders its applicability in industrial scenarios; at the engineering application level, due to the vacuum of causal association modeling and the fault of digital twin consistency, the risk of failure in control strategy optimization is exacerbated and the dynamic simulation fidelity is insufficient. These defects form the underlying technical barriers restricting industrial intelligence, and there is an urgent need to construct a new generation of generation paradigm that integrates mechanism modeling, nonlinear dynamic analysis and multi-modal knowledge embedding to achieve breakthrough improvements. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method for generating virtual samples for soft sensing of sewage treatment, which optimizes the sewage treatment parameter data set through a multi-objective optimization function to obtain an initial population, and solves the technical bottlenecks of gradient disappearance and mode collapse of the generative adversarial network through a guidance information sharing architecture, ensuring the intrinsic structure consistency between the virtual samples and the sewage treatment parameter data set, and improving the accuracy of the virtual samples.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating virtual samples for soft sensing of sewage treatment, including: Obtaining a sewage treatment parameter data set; wherein, the sewage treatment parameter data set includes sewage treatment process parameters and at least one sewage treatment result parameter; Optimize the initial input data set of the generator of the generative adversarial network based on a multi-objective optimization function to generate an initial population; wherein, the multi-objective optimization function includes a coverage metric function and a discretization metric function; Input the initial population into the generator of the generative adversarial network, and input the initial virtual samples and the sewage treatment parameter data set output by the generator of the generative adversarial network into the discriminator of the generative adversarial network for adversarial training to obtain the virtual samples output after the generator reaches a stable state as the virtual samples corresponding to the sewage treatment parameter data set; wherein, the adversarial training refers to multi-task joint training implemented for each of the sewage treatment result parameters.
[0006] In a preferred embodiment of the present invention, the above multi-objective optimization function includes a coverage metric function and a discretization metric function; optimizing the initial input data of the generator of the generative adversarial network based on the multi-objective optimization function to generate an initial population includes: Create a group of initial input data sets that follow a normal distribution; According to the coverage metric function and the discretization metric function, calculate the coverage metric and the discretization metric corresponding to each parent individual in the initial input data set; Screen the parent individuals according to the coverage metric and the discretization metric corresponding to each parent individual to obtain a parent population; Generate an offspring population corresponding to the parent population based on the simulated binary crossover operator; According to the coverage metric function and the discretization metric function, calculate the coverage metric and the discretization metric corresponding to each offspring individual in the offspring population; When the coverage metric corresponding to each offspring individual meets the coverage threshold and the discretization metric meets the discretization threshold, based on the Pareto dominance relationship, select a preset number of individuals from the parent population and the offspring population as the initial population.
[0007] In a preferred embodiment of the present invention, the above generating an offspring population corresponding to the parent population based on the simulated binary crossover operator includes: Obtain two parent individuals from the parent population in a preset order in turn; Input the parent individuals into the simulated binary crossover operator to obtain two offspring individuals until all parent individuals are traversed; Form the obtained offspring individuals into an offspring population.
[0008] In a preferred embodiment of the present invention, the above obtaining the sewage treatment parameter data set includes sewage treatment process parameters and sewage treatment result parameters, and the number of sewage treatment result parameters is at least one.
[0009] In a preferred embodiment of the present invention, inputting the initialized population into the generator of the generative adversarial network, and inputting the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter dataset into the discriminator of the generative adversarial network for adversarial training includes: For each sewage treatment result parameter, establish a training subtask as the subtask corresponding to the sewage treatment result parameter; For each subtask, generate a parameter mask for the generator in the subtask; For each subtask, perform an element-wise multiplication operation according to the preset initialized basic network and the parameter mask to construct a sub-network corresponding to the generator of the generative adversarial network in the subtask; For each subtask, prune the parameter mask of the generator of the generative adversarial network in the subtask according to the preset pruning rate to obtain the pruned parameter mask of the generator in the subtask; For each subtask, when the sharing rate of the pruned parameter mask of the generator of the generative adversarial network in the subtask is less than or equal to the sharing rate threshold, input the pruned parameter mask of the generator in the subtask into the generator of the generative adversarial network in the subtask to update the generator of the generative adversarial network in the subtask to obtain the updated generator of the generative adversarial network in the subtask; For each subtask, input the initialized population into the updated generator of the generative adversarial network corresponding to the sewage treatment result parameter, and input the initial virtual samples, sewage treatment process parameters, and sewage treatment result parameters output by the updated generator of the generative adversarial network into the discriminator of the generative adversarial network corresponding to the sewage treatment result parameter for adversarial training.
[0010] In a preferred embodiment of the present invention, the above generator reaches a stable state, including: Obtain the first virtual sample and the second virtual sample output by the generator of the generative adversarial network; wherein the first virtual sample and the second virtual sample are the virtual samples output by the generator of the generative adversarial network in the last two times during the adversarial training process; Calculate the maximum mean difference between the first virtual sample and the second virtual sample; When the maximum mean difference is less than the difference threshold, it is determined that the generator reaches a stable state.
[0011] In a preferred embodiment of the present invention, after inputting the initialized population into the generator of the generative adversarial network, inputting the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter dataset into the discriminator of the generative adversarial network for adversarial training, and obtaining the virtual samples output after the generator reaches a stable state as the virtual samples corresponding to the sewage treatment parameter dataset, it includes: Input the virtual samples into the soft sensor model for sewage treatment to train the soft sensor model for sewage treatment, and obtain the trained soft sensor model for sewage treatment. The soft sensor model for sewage treatment is used to predict the sewage treatment result parameters based on the sewage treatment process parameters. Among them, the soft sensor model for sewage treatment is a neural network model constructed based on a multi-layer perceptron.
[0012] In a second aspect, an embodiment of the present invention further provides a device for generating virtual samples of a soft sensor for sewage treatment, including: A data acquisition module, configured to acquire a sewage treatment parameter data set. Among them, the sewage treatment parameter data set includes sewage treatment process parameters and at least one sewage treatment result parameter; An initial population acquisition module, configured to optimize the initial input data set of the generator of the generative adversarial network based on a multi-objective optimization function to generate an initial population. Among them, the multi-objective optimization function includes a coverage metric function and a discretization metric function; A virtual sample acquisition module, configured to input the initial population into the generator of the generative adversarial network, and input the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter data set into the discriminator of the generative adversarial network for adversarial training, and obtain the virtual samples output after the generator reaches a stable state as the virtual samples corresponding to the sewage treatment parameter data set. Among them, the adversarial training refers to multi-task joint training implemented for each of the sewage treatment result parameters.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method for generating virtual samples of a soft sensor for sewage treatment in the first aspect above.
[0014] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by the processor, the computer-executable instructions cause the processor to implement the method for generating virtual samples of a soft sensor for sewage treatment in the first aspect above.
[0015] The embodiments of the present invention bring the following beneficial effects: The embodiments of the present invention provide a method for generating an initial population through a multi-objective optimization function. By optimizing these objectives, the generated initial population can be closer to the real sample set and have higher diversity. Furthermore, the generated virtual samples can better reflect the complex characteristics of the sewage treatment process, enabling the soft sensor model to better adapt to the actual sewage treatment process, solving the technical bottlenecks of gradient disappearance and mode collapse in the generative adversarial network, ensuring the intrinsic structural consistency between the virtual samples and the sewage treatment parameter data set, and improving the accuracy of the virtual samples. By integrating and acquiring the original sensor data set collected during the sewage treatment process, focusing on constructing a high-quality input data set that conforms to the characteristics of the industrial scenario, aiming to solve the problem of uneven distribution of the original data, and providing a basis for enhancing the representation ability and integrity of the virtual samples.
[0016] Other features and advantages of the present invention will be described in the subsequent description, or, some features and advantages can be inferred from the description or determined without doubt, or can be known by implementing the above technologies of the present invention.
[0017] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, details are described as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 It is a flowchart of a method for generating virtual samples for soft sensor of sewage treatment provided by the embodiments of the present invention; Figure 2 It is a flowchart of another method for generating virtual samples for soft sensor of sewage treatment provided by the embodiments of the present invention; Figure 3a It is a flowchart of another method for generating virtual samples for soft sensor of sewage treatment provided by the embodiments of the present invention; Figure 3b It is a schematic diagram of criterion sharing between multi-task subnets provided by the embodiments of the present invention; Figure 4 It is a structural schematic diagram of another method for generating virtual samples for soft sensor of sewage treatment provided by the embodiments of the present invention; Figure 5 It is a structural schematic diagram of a device for generating virtual samples for soft sensor of sewage treatment provided by the embodiments of the present invention; Figure 6A schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0021] In the field of virtual sample generation technology, the existing technical solutions mainly include the following technical routes: 1) The interpolation method based on statistical distribution realizes sample expansion through a multi-dimensional space interpolation strategy. Among them, the large trend diffusion method (MTD) adopts a linear interpolation mechanism to improve the uniformity of sample distribution, but its linear assumption leads to insufficient decoupling ability for the characteristics of non-linear dynamic systems; 2) The improved method improves the sampling robustness through joint probability distribution reconstruction, but it is prone to the phenomenon of over-tight models due to the constraint of the prior distribution.
[0022] 3) The generative adversarial network technology captures the potential distribution characteristics of data through deep non-linear mapping. Its improvement schemes include an adversarial generation framework integrating an encoder structure, which uses the collaborative modeling of local patterns and global features to improve the physical consistency of generated samples, and a generative adversarial network introducing a fuzzy membership function to achieve robust generation under unstructured noise interference. However, there are generally problems such as unstable adversarial training and incomplete decoupling of multi-variable coupling features.
[0023] 4) The neural evolution fusion method optimizes the network architecture and parameters through an evolutionary algorithm, and constructs a hierarchical evolution mechanism to alleviate the defect of mode collapse. However, it faces the bottleneck of the structured integration of evolutionary operators and process knowledge. When dealing with the multi-scale dynamic characteristics of industrial processes, the above methods still have technical bottlenecks such as the lack of a domain knowledge embedding mechanism and insufficient causal association modeling between variables.
[0024] Based on this, a virtual sample generation method for soft measurement of sewage treatment provided by an embodiment of the present invention generates an initial population through a multi-objective optimization function, considering various factors, making the generated virtual samples better reflect the complex characteristics of the sewage treatment process, so that the soft measurement model can better adapt to the actual sewage treatment process, solves the technical bottlenecks of gradient disappearance and mode collapse of the generative adversarial network, ensures the intrinsic structural consistency between the virtual samples and the sewage treatment parameter data set, and improves the accuracy of the virtual samples.
[0025] To facilitate the understanding of this embodiment, a virtual sample generation method for soft measurement of sewage treatment disclosed in an embodiment of the present invention will be introduced in detail first.
[0026] Example 1 The embodiment of the present invention provides a method for generating virtual samples for soft measurement of sewage treatment. Figure 1 It is a flowchart of a method for generating virtual samples for soft measurement of sewage treatment provided by the embodiment of the present invention. As Figure 1 shown, the method for generating virtual samples for soft measurement of sewage treatment may include the following steps: Step S101, obtain a sewage treatment parameter data set.
[0027] The sewage treatment parameter data set includes sewage treatment process parameters and sewage treatment result parameters, and the number of sewage treatment result parameters is at least one. Among them, the sewage treatment process parameters are key indicators collected in real time during the operation of the sewage treatment process; the sewage treatment result parameters are core parameters characterizing the final treatment effect after the end of the sewage treatment process, and the number of such parameters is at least one. From the perspective of causal logic, the sewage treatment process parameters are key variables affecting the sewage treatment result parameters. By precisely regulating the former, the latter can be effectively controlled, thereby ensuring the quality and efficiency of sewage treatment.
[0028] Among them, the sewage treatment parameter data set is collected by sensors set during the sewage treatment process. Further, for the original data set collected by the sensors set during the sewage treatment process, preprocessing operations such as data interpolation, variable transformation, and adding perturbations are performed on the original data in the sensor original data set to obtain the sewage treatment parameter data set.
[0029] Exemplarily, Task 1 and Task 2 in the sewage treatment task are the biochemical oxygen demand (BOD5) and chemical oxygen demand (COD) for 5 days respectively, and the detailed information of the variables included in the sewage treatment parameter data set is shown in Table 1.
[0030] Table 1. Thirteen variables in the sewage treatment process
[0031] There can be a total of 100 input-output data records in the sewage treatment parameter data set. Among them, each input-output data includes the input data shown as x1 to x as shown in Table 1, that is, the sewage treatment process parameters, and the output data shown as y1 to y2 as shown in Table 1, that is, the sewage treatment result parameters. Among these data, 70% is used as the training data set and 30% is used as the test data set. The training data samples and the test data samples are mutually exclusive. 13 shown, and the output data shown as y1 to y2 as shown in Table 1, that is, the sewage treatment result parameters. Among these data, 70% is used as the training data set and 30% is used as the test data set. The training data samples and the test data samples are mutually exclusive.
[0032] Step S102, optimize the initial input data set of the generator of the generative adversarial network based on a multi-objective optimization function to generate an initial population.
[0033] The multi-objective optimization function includes a coverage metric function and a discretization metric function. The coverage metric is used to measure the consistency between the distribution of the evolutionary population and the real data. The discretization metric is used to evaluate the individual diversity within the population. By optimizing these objectives, the generated initial population can be made closer to the real sample set and have a high diversity.
[0034] The initial input data set can be a randomly generated data set. Exemplarily, the initial input data set can consist of multiple random numbers.
[0035] Specifically, assume that the population D representing the input of the generator consists of n individuals, P D and P R represent the distributions of the population D and the sewage treatment parameter data set. The coverage metric function can be expressed as:
[0036] where Cover(D) is the coverage metric; is the probability distribution of each individual in the population D; is the probability distribution of each data in the sewage treatment parameter data set; x is an individual in the population D; y is a data in the sewage treatment parameter data set.
[0037] The discretization metric function Dis(D) can be expressed as:
[0038] where Dis(D) is the discretization metric; c(i,j) represents the cosine similarity between individual i and individual j.
[0039] Preset the initial input data set, which includes n random numbers. Based on the multi-objective optimization function, calculate the coverage metric and the discretization metric between the initial input data set and the sewage treatment parameter data set, and optimize the initial input data set according to the coverage metric and the discretization metric to reduce the coverage metric and the discretization metric, and obtain the initial population.
[0040] Step S103, input the initial population into the generator of the generative adversarial network, input the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter data set into the discriminator of the generative adversarial network, perform adversarial training, and obtain the virtual samples output after the generator reaches a stable state as the virtual samples corresponding to the sewage treatment parameter data set.
[0041] In a generative adversarial network, the generator is used to generate virtual sample data, and the discriminator is used to judge the probability that a sample comes from virtual sample data or real samples. The generator learns the distribution of real samples based on the results of the discriminator to reduce errors, so that the generator and the discriminator are trained together in a min-max game confrontation.
[0042] In an embodiment of the present invention, the generator uses a multi-layer perceptron with 4 hidden layers. The hidden layer uses the ReLU activation function, and the output layer uses a linear activation function:
[0043]
[0044] Among them, and are the weights and biases between the input layer and the hidden layer of the generator respectively; is the output of the hidden layer in the generator; and are the weights and biases between the hidden layer and the output layer of the generator respectively; is the output of the generator during the training process. is the sewage treatment process parameter composed of noise data, is the sewage treatment result parameter in the sewage treatment parameter dataset. constitutes the initial population.
[0045] The discriminator includes multiple hidden layers. Among them, the hidden layer uses the Relu activation function, and the output layer uses the Sigmoid activation function:
[0046]
[0047]
[0048] Among them, is the mixed sample composed of the initial virtual sample and the sewage treatment parameter dataset ; and are the weights and biases between the input layer and the hidden layer of the discriminator respectively; is the output of the hidden layer in the discriminator; and are the weights and biases between the hidden layer and the output layer respectively; sigmoid is the S-shaped activation function; Output is the output of the discriminator during the training process.
[0049] The objective function of the generative adversarial network is:
[0050] Among them, represents the distribution of the sewage treatment process parameters in the sewage treatment parameter dataset; is the output of the discriminator ; is the output of the discriminator represents the distribution of the sewage treatment process parameters in the initial virtual sample; Output is the output of the discriminator ; is the output.
[0051] After n times of training, the quality of the initial virtual sample output by the generator is compared with the quality of the initial virtual sample detected last time. When the difference between the two is less than the preset threshold, it is considered that the generator has reached stability. Specifically, the following formula can be used to determine whether the generator has reached stability:
[0052] Among them, Q n represents the quality of the initial virtual sample generated by the generator in the nth training, represents the preset threshold, which can be set according to the actual situation. If the value is 1, it means that the generator has reached stability. On the contrary, if it has not reached stability, it needs to continue training.
[0053] When the generator is stable, the initial virtual sample generated by the generator in the last training is used as the virtual sample corresponding to the sewage treatment parameter dataset.
[0054] Among them, the adversarial training refers to the multi-task joint training implemented for the sewage treatment result parameters. Specifically, for each sewage treatment result parameter, a sub-task is established. For each sub-task, the initialized population is input into the corresponding generator. The generator generates initial virtual samples based on the initialized population, and then inputs these initial virtual samples, the sewage treatment process parameters, and the sewage treatment result parameters corresponding to the sub-task into the discriminator together. The task of the discriminator is to determine whether the input samples are real sewage treatment data (including sewage treatment process parameters and sewage treatment result parameters) or virtual samples generated by the generator. In this process, the generator and the discriminator perform adversarial training. The generator continuously adjusts its own parameters, trying to generate more realistic virtual samples to deceive the discriminator; the discriminator also continuously optimizes to improve its ability to distinguish between real samples and virtual samples. Through this adversarial training, the generator can gradually learn the distribution characteristics of real sewage treatment data, thereby generating high-quality virtual samples. Among them, after the training is completed, different sub-tasks can correspond to different generators trained, and the similarity of the parameters between the generators meets a preset threshold. The similarity of the parameters refers to the ratio of the number of identical parameters to the total number of parameters of each generator for any two generators' parameters. Exemplarily, Generator 1 and Generator 2 each have 10 parameters, and 8 of them are the same. For Generator 1, the parameter similarity is 80%, and for Generator 2, the parameter similarity is 80%.
[0055] A method for generating virtual samples for soft sensing of sewage treatment provided by an embodiment of the present invention generates an initialized population through a multi-objective optimization function, with data coverage and dispersion as the optimization objectives, considering various factors, making the generated virtual samples better reflect the complex characteristics of the sewage treatment process, so that the soft sensing model can better adapt to the actual sewage treatment process, solves the technical bottlenecks of gradient disappearance and mode collapse in the generative adversarial network, ensures the intrinsic structural consistency between the virtual samples and the sewage treatment parameter data set, and improves the accuracy of the virtual samples. By integrating and obtaining the original sensor data set collected during the sewage treatment process, focusing on constructing a high-quality input data set that conforms to the characteristics of the industrial scenario, preprocessing operations such as data imputation, variable transformation, and adding perturbations are performed on the original data in the original sensor data set, aiming to solve the problems of a large amount of noise and uneven distribution in the original data, and improve the representational ability and integrity of the data.
[0056] Embodiment 2 Another method for generating virtual samples for soft sensing of sewage treatment is also provided by an embodiment of the present invention; this method is implemented on the basis of the method in the above embodiment; this method focuses on describing that the multi-objective optimization function includes a coverage index function and a discretization index function; based on the multi-objective optimization function, the specific implementation method of optimizing the initial input data of the generative adversarial network generator to generate an initialized population.
[0057] Figure 2 This is a flowchart of another virtual sample generation method for sewage treatment soft measurement provided by an embodiment of the present invention. As Figure 2 shown, the virtual sample generation method for sewage treatment soft measurement may include the following steps: Step S201: Obtain a sewage treatment parameter data set.
[0058] Step S202: Create an initial input data set that follows a normal distribution.
[0059] Specifically, create a set of random data sets that follow a normal distribution in the target space O as the initial input data set. The data included in the initial input data set can be called individuals, and the individuals in the initial input data set can be used as parent individuals.
[0060] Step S203: Calculate the coverage index and discretization index corresponding to each parent individual in the initial input data set according to the coverage index function and the discretization index function.
[0061] For each parent individual in the initial input data set, input the sewage treatment parameter data set and the initial input data set into the coverage index function to obtain the coverage index of the parent individual, and input the sewage treatment parameter data set and the initial input data set into the discretization index function to obtain the discretization index of the parent individual.
[0062] Step S204: Screen the parent individuals according to the coverage index and discretization index corresponding to each parent individual to obtain a parent population.
[0063] According to the coverage index and discretization index corresponding to each parent individual, perform binary tournament selection, retain the parent individuals with better indexes, and obtain a parent population. It can be understood that, in a certain order, the coverage index and discretization index of adjacent two parent individuals can be compared respectively, retain the parent individual with a smaller coverage index, retain the parent individual with a smaller discretization index, and the retained parent individuals are used as the parent population.
[0064] Step S205: Generate an offspring population corresponding to the parent population based on the simulated binary crossover operator.
[0065] Use the simulated binary crossover operator (SBX) reproduction operator to generate an offspring population. Assume that two parent individuals are and , and use the SBX operator to generate two offspring individuals and :
[0066] Among them, d refers to the number of data included in an individual; is dynamically and randomly determined by the distribution factor according to the equation :
[0067] Among them, is a custom parameter, the larger the value, the greater the probability that the generated offspring individuals approximate the parent individuals. .
[0068] Specifically, the offspring population can be determined through Steps A1 - A3.
[0069] Step A1: Sequentially obtain two parent individuals from the parent population in a preset order.
[0070] Step A2: Input the parent individuals into the simulated binary crossover operator to obtain two offspring individuals until all parent individuals are traversed.
[0071] Step A3: Compose the obtained offspring individuals into an offspring population.
[0072] The preset order can be set in advance according to the actual situation.
[0073] Step S206: Calculate the coverage index and discretization index corresponding to each offspring individual in the offspring population according to the coverage index function and the discretization index function.
[0074] For each offspring individual in the offspring population, input the sewage treatment parameter dataset and the offspring population into the coverage index function to obtain the coverage index of the offspring individual, and input the sewage treatment parameter dataset and the offspring population into the discretization index function to obtain the discretization index of the offspring individual.
[0075] Step S207: When the coverage index corresponding to each offspring individual meets the coverage threshold and the discretization index meets the discretization threshold, based on the Pareto dominance relationship, select a preset number of individuals from the parent population and the offspring population as the initial population.
[0076] The coverage threshold and the discretization threshold refer to the thresholds of the pre-set coverage index and the discretization index. Through the coverage threshold and the discretization threshold, the consistency between the distribution of the offspring population and the sewage treatment parameter dataset can be determined. When the coverage index corresponding to each offspring individual is less than the coverage threshold and the discretization index is less than the discretization threshold, it is determined that the coverage index corresponding to each offspring individual meets the coverage threshold and the discretization index meets the discretization threshold. At this time, it indicates that the distribution of the offspring population has good consistency with the sewage treatment parameter dataset. Otherwise, it indicates that the consistency between the distribution of the offspring population and the sewage treatment parameter dataset is poor, and the offspring population needs to be updated to the parent population and return to execute step S204. Or when the number of times of returning to execute step S204 reaches the preset number of times, even if there are offspring individuals whose corresponding coverage index does not meet the coverage threshold or the discretization index does not meet the discretization threshold, step S208 can also be executed.
[0077] Specifically, when the coverage index corresponding to each offspring individual meets the coverage threshold and the discretization index meets the discretization threshold, according to the Pareto dominance relationship, a preset number of individuals are selected from the parent population and the offspring population as the initial population. The preset number can be the same as the number of data in the initial input dataset.
[0078] Furthermore, in the embodiments of the present invention, the initial population can be obtained by the evolutionary optimization algorithm MBEA-GI. Specifically, the evolutionary optimization algorithm MBEA-GI is shown in Table 2: Table 2. Evolutionary Optimization Algorithm MBEA-GI
[0079] Step S208, input the initial population into the generator of the generative adversarial network, input the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter dataset into the discriminator of the generative adversarial network, perform adversarial training, and obtain the virtual samples output after the generator reaches a stable state as the virtual samples corresponding to the sewage treatment parameter dataset.
[0080] The method for generating virtual samples of sewage treatment soft sensors provided by the embodiments of the present invention uses the coverage index and the discretization index to dynamically correct the offspring population, ensuring the intrinsic structural consistency between the offspring population and the original sewage treatment parameter dataset, and uses the coverage index and the discretization index to monitor the generation process of the offspring population. When the coverage index and the discretization index of the offspring population are lower than the set threshold in continuous iterations, the training is automatically terminated, ensuring that the generator finally generates virtual samples that not only conform to the distribution of the sewage treatment parameter dataset but also cover the blind area of the feature space, breaking through the limitations of traditional generation models in industrial small-sample scenarios.
[0081] Embodiment 3 The embodiment of the present invention also provides another method for generating virtual samples for soft measurement of sewage treatment; this method is implemented on the basis of the method in the above embodiment; this method focuses on describing the specific implementation manner of inputting the initialized population into the generator of the generative adversarial network, and inputting the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter dataset into the discriminator of the generative adversarial network for adversarial training.
[0082] Figure 3a It is a flowchart of another method for generating virtual samples for soft measurement of sewage treatment provided by the embodiment of the present invention, as Figure 3a shown, this method for generating virtual samples for soft measurement of sewage treatment may include the following steps: Step S301, obtain the sewage treatment parameter dataset.
[0083] Step S302, optimize the initial input dataset of the generator of the generative adversarial network based on the multi-objective optimization function to generate an initialized population.
[0084] Step S303, for each sewage treatment result parameter, establish a training subtask as the subtask corresponding to the sewage treatment result parameter.
[0085] During the sewage treatment process, there are multiple sewage treatment result parameters, such as chemical oxygen demand (COD), biochemical oxygen demand (BOD5), ammonia nitrogen content, etc. For each sewage treatment result parameter, an independent training subtask is established. The purpose of doing this is to perform refined generative adversarial network training for each specific result parameter, because different sewage treatment result parameters are affected by various factors in the sewage treatment process in different ways and degrees. Each subtask focuses on learning how to generate virtual samples related to this specific result parameter to better reflect its change rules and influencing factors. Each subtask corresponds to a generative adversarial network.
[0086] Step S304, for each subtask, generate a parameter mask for the generator in the subtask.
[0087] The parameter mask is a matrix with the same structure as the generator parameters, and its element values are usually 0 or 1. In each subtask, a parameter mask for the generator is generated through a specific algorithm or strategy. The role of the parameter mask is to control which parameters in the generator participate in the calculation and which parameters are temporarily masked. For example, the generator parameters corresponding to the elements with a value of 1 will be used in the calculation process, while the parameters corresponding to the elements with a value of 0 do not participate in the current calculation. In this way, the structure and function of the generator can be flexibly adjusted to meet the needs of different subtasks.
[0088] Specifically, for each subtask, the parameter mask for resuming the subtask can be default generated as all 1s.
[0089] Step S305, for each subtask, perform an element-wise multiplication operation according to the preset initialized base network and the parameter mask to construct a sub-network corresponding to the generator of the generative adversarial network in the subtask.
[0090] The preset initialized base network is a predefined network structure that contains a certain number of neurons and connections. In each subtask, an element-wise multiplication operation is performed on the initialized base network and the generated parameter mask. Specifically, each parameter in the base network is multiplied by the element at the corresponding position in the parameter mask to obtain a new network structure, that is, the sub-network. This operation can selectively retain or remove some parameters and connections in the base network according to the setting of the parameter mask, enabling the sub-network to focus on learning features and patterns related to the subtask, and improving the pertinence and efficiency of the sub-network.
[0091] Step S306, for each subtask, prune the parameter mask of the generator of the generative adversarial network in the subtask according to the preset pruning rate to obtain the pruned parameter mask of the generator in the subtask.
[0092] The preset pruning rate is a preset proportional value used to control the proportion of parameters in the parameter mask that need to be pruned (i.e., set to 0). For each subtask, the pruning operation is performed on the parameter mask of the generator according to this pruning rate. During the pruning process, the contribution degree of each parameter in the parameter mask to the model performance is evaluated, and then the mask elements corresponding to the parameters with smaller contributions are set to 0 according to certain rules. This can further simplify the structure of the sub-network, remove redundant parameters, reduce the computational amount and complexity of the model, and avoid overfitting problems, improving the generalization ability of the model.
[0093] Step S307, for each subtask, when the sharing rate of the pruned parameter mask of the generator of the generative adversarial network in the subtask is less than or equal to the sharing rate threshold, input the pruned parameter mask of the generator in the subtask into the generator of the generative adversarial network in the subtask to update the generator of the generative adversarial network in the subtask to obtain the updated generator of the generative adversarial network in the subtask.
[0094] The sharing rate threshold is a preset threshold used to determine whether the sharing degree of the parameter mask is appropriate. For each subtask, when the sharing rate of the pruned parameter mask of the generator is less than or equal to the sharing rate threshold, it indicates that the parameter mask achieves good parameter sharing and structural simplification on the premise of ensuring the performance of the generative adversarial network. At this time, the pruned parameter mask is input into the generator of the generative adversarial network for the subtask to update the parameters of the generator. The updated generator can better adapt to the requirements of the subtask and generate virtual samples that more conform to the parameter characteristics of specific sewage treatment results.
[0095] Step S308, for each subtask, input the initialized population into the updated generator of the generative adversarial network corresponding to the sewage treatment result parameters, and input the initial virtual samples, sewage treatment process parameters, and sewage treatment result parameters output by the updated generator of the generative adversarial network into the discriminator of the generative adversarial network corresponding to the sewage treatment result parameters for adversarial training.
[0096] For each subtask, input the initialized population into the corresponding updated generator. The generator generates initial virtual samples based on the initialized population, and then inputs these initial virtual samples, sewage treatment process parameters, and the sewage treatment result parameters corresponding to the subtask into the discriminator together. The task of the discriminator is to determine whether the input samples are real sewage treatment data (including sewage treatment process parameters and sewage treatment result parameters) or virtual samples generated by the generator. In this process, the generator and the discriminator perform adversarial training. The generator continuously adjusts its own parameters, trying to generate more realistic virtual samples to deceive the discriminator; the discriminator also continuously optimizes to improve its ability to distinguish between real samples and virtual samples. Through this adversarial training, the generator can gradually learn the distribution characteristics of real sewage treatment data, thereby generating high-quality virtual samples.
[0097] Furthermore, in the embodiments of the present invention, the training of the generative adversarial network between subtasks can be achieved through the guidance information sharing architecture. Specifically, the guidance information sharing architecture is shown in Table 3: Table 3. Guidance Information Sharing Architecture
[0098] Among them, the network parameters in the pre-parameterized basic network Ԑ are , and perform random sampling on to obtain . For each task, initialize the parameter mask as a mask of all 1s, that is, . For each task, use the dataset D t of this task to perform k-step training on the pre-parameterized basic network to obtain Prune according to the pruning rate α the remaining parameters in. Among them, are the network parameters of the network obtained after k steps of training. If the j-th parameter in the network parameters is pruned, then the j-th data in the parameter mask is set to 0. Calculate the sharing rate according to the proportion of non-zero data in the parameter mask, where refers to the number of non-zero elements in the parameter mask, refers to the number of parameters in the pre-parameterized basic network Ԑ. If the calculated sharing rate is less than or equal to S, it means that the degree of parameter sharing meets the requirements, and the current parameter mask is retained. If the calculated sharing rate is greater than S, it means that the task reuses too many dedicated parameters and the sharing needs to be enhanced. At this time, is reset, which can be reset to the initial value or the network parameters obtained during a certain training, and retrained and pruned until the calculated sharing rate is less than or equal to S.
[0099] Among them, steps 4-6 in Algorithm 2 can be understood through the schematic diagram of criterion sharing between multitask subnets as shown in Figure 3b . Given a source task and a target task, criteria can be derived from their respective Task 1 and Task 2 through the sparse mask sharing mechanism. Specifically, the network of the source task generator is the initialized basic network Ԑ, and the mask can all be set to 1. Task 1 is the BOD5 sample generation task, Task 2 is the COD sample generation task, and the parameters of the generators of Task 1 and Task 2 are adjusted by the pruning mask M and the initialized basic network Ԑ. Using the mask M t of task t and the initialized basic network Ԑ, the generator of task t can be expressed as , where ⊙ represents element-wise multiplication. Thus, a subnetwork is derived from the initialized basic network Ԑ for each task, that is, the mask of the generator of Task 1 is and the mask of the generator of Task 2 is , and the subnetwork has a structure associated with a hypothesis subspace suitable for the given task. In essence, the inductive bias customized for a task is embedded in the subnetwork structure. Ideally, tasks with similar inductive biases should be assigned to similar parameter parts.
[0100] Since the guidance information sharing architecture is iterative, multiple candidate subnets may be generated as pruning progresses. In practical applications, only one subnet is selected for each task to form the guidance information sharing architecture. To solve this problem, we adopt the greedy principle to select the subnet that performs best among the candidate subnets. If there are multiple subnets with the best performance, the subnet with the lowest sparsity is selected. The specific steps are shown in Table 4: Table 4. Training Steps of the Network Based on Guidance Information Sharing
[0101] During the multi-task training process, each task needs to be processed sequentially. This step is to select the task to be trained currently, picking one from T tasks, so as to perform data processing and network parameter update for that task subsequently. For example, when T = 3, task 1 may be selected in the first loop, task 2 in the second loop, task 3 in the third loop, and then the loop continues. Mini-batch is a small part of data randomly selected from the sewage treatment parameter dataset of task t. When training on a large-scale dataset, the entire dataset is usually not used all at once, but the dataset is divided into multiple mini-batches. Randomly selecting mini-batches can increase the randomness and generalization of training, and avoid overfitting of the model to specific data. For example, if the dataset of task t has 1000 samples and the mini-batch size is set to 32, then 32 samples are randomly selected from the 1000 samples to form a mini-batch. Each task has its corresponding sub-network, and these sub-networks are obtained through operations such as parameter sharing and pruning based on the initialized basic network. The selected mini-batch data is input into the sub-network corresponding to task t so that the sub-network can perform forward propagation calculation according to the input data to obtain the output result. After the sub-network performs forward propagation to obtain the output result, the output result is compared with the true label in the mini-batch data, and the loss function (such as mean square error, cross entropy, etc.) is calculated. Then, the gradient of the loss function with respect to the sub-network parameters is calculated through the backpropagation algorithm, and the parameters of the sub-network are updated according to the gradient to make the output result of the sub-network closer to the true label. This is a key step in the training process. By continuously adjusting the parameters, the sub-network can learn task-related features and patterns.
[0102] Step S309: Use the virtual samples output after the generator reaches the stable state as the virtual samples corresponding to the sewage treatment parameter dataset.
[0103] The virtual sample generation method for sewage treatment soft sensor provided by the embodiments of the present invention realizes directional knowledge transfer between multiple tasks through a parameter pruning and sharing mechanism. Based on the dynamic masking technology, an adaptable sparse sub-network is constructed, which can retain the task-specific features while reusing the underlying network parameters according to a preset ratio, and explore the implicit associations between different prediction tasks. By parallelly processing multiple industrial index prediction tasks (COD and BOD5), a cross-task knowledge transfer channel is established using the shared parameter layer while ensuring the independence of each task, significantly improving the generalization ability of the model in small sample scenarios and the multi-task collaboration efficiency.
[0104] Embodiment 4 The embodiments of the present invention also provide another virtual sample generation method for sewage treatment soft sensor; this method is implemented based on the method of the above embodiment; this method focuses on describing the specific implementation manner for the generator to reach a stable state.
[0105] Figure 4 is a flowchart of another virtual sample generation method for sewage treatment soft sensor provided by the embodiments of the present invention, as Figure 4 shown, this virtual sample generation method for sewage treatment soft sensor may include the following steps: Step S401, obtain a sewage treatment parameter data set.
[0106] Step S402, based on a multi-objective optimization function, optimize the initial input data set of the generator of the generative adversarial network to generate an initial population.
[0107] Step S403, input the initial population into the generator of the generative adversarial network, and input the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter data set into the discriminator of the generative adversarial network for adversarial training.
[0108] Step S404, obtain the first virtual sample and the second virtual sample output by the generator of the generative adversarial network.
[0109] Among them, the first virtual sample and the second virtual sample are the virtual samples output by the generator of the generative adversarial network in the last two times during the adversarial training process. Specifically, during the adversarial training process, the generator continuously generates virtual samples. The virtual samples output during the last two trainings are collected and are respectively called the first virtual sample and the second virtual sample.
[0110] Step S405, calculate the maximum mean difference between the first virtual sample and the second virtual sample.
[0111] The Maximum Mean Discrepancy (MMD) is a metric used to measure the difference between two distributions. By calculating the MMD between the first virtual sample and the second virtual sample, the stability of the generator when outputting virtual samples consecutively can be evaluated. The smaller the MMD value, the more similar the distributions of the two virtual samples, and the more stable the output of the generator; the larger the MMD value, the greater the difference in the distributions of the two virtual samples, indicating that there are significant fluctuations in the output of the generator.
[0112] Exemplarily, the Maximum Mean Discrepancy can be calculated by the following formula:
[0113] where \(x\) represents the first virtual sample, \(y\) represents the second virtual sample, \(E\) represents the expected value, represents the Euclidean norm.
[0114] Step S406, when the Maximum Mean Discrepancy is less than the difference threshold, it is determined that the generator has reached a stable state.
[0115] A difference threshold is preset in advance. When the calculated Maximum Mean Discrepancy between the first virtual sample and the second virtual sample is less than this threshold, it is considered that the output of the generator has stabilized, that is, when the generator outputs virtual samples consecutively, the difference in the sample distributions generated is small, and the performance of the generator has reached a certain stability. If the calculated Maximum Mean Discrepancy between the first virtual sample and the second virtual sample is greater than or equal to this threshold, it is considered that the output of the generator has not stabilized, that is, when the generator outputs virtual samples consecutively, the difference in the sample distributions generated is large, and the performance of the generator has not reached stability, and it is necessary to continue training and return to execute step S403.
[0116] Furthermore, the laundry virtual sample and the second virtual sample can be obtained multiple times. When the Maximum Mean Discrepancy between the first virtual sample and the second virtual sample obtained consecutively is less than the preset threshold, it is determined that the generator has reached a stable state.
[0117] Step S407, the virtual sample output after the generator reaches a stable state is used as the virtual sample corresponding to the sewage treatment parameter dataset.
[0118] Step S408, the virtual sample is input into the sewage treatment soft sensor model to train the sewage treatment soft sensor model, and the trained sewage treatment soft sensor model is obtained.
[0119] The sewage treatment soft sensor model is used to predict the sewage treatment result parameters based on the sewage treatment process parameters. Specifically, the sewage treatment process parameters in the virtual samples are used as the input of the sewage treatment soft sensor model to predict the sewage treatment result parameters, and compared with the sewage treatment result parameters in the virtual samples to determine the error between the two. According to the error, it is determined whether the sewage treatment soft sensor model is trained. If the error between the two is less than the preset error, it is determined whether the sewage treatment soft sensor model is trained, otherwise, training continues. Further, the virtual samples can also be divided into a training set and a validation set to train the sewage treatment soft sensor model. Usually, the ratio of the training set to the validation set is 8:2 or 7:3.
[0120] Further, the sewage treatment soft sensor model is a neural network model constructed based on a multi-layer perceptron, and its modeling process is described as follows: Step 1: Determine the original training samples of the multi-layer perceptron, that is, the sewage treatment parameter data set, and merge the virtual sample set with the original training samples to form an extended training sample set. Step 2: Use the mean squared error (MSE) as the loss function to minimize the difference between the predicted value and the true value, thereby establishing a regression model. Specifically, based on the extended training sample set and the MSE loss function, the multi-layer perceptron is trained using the backpropagation algorithm. The backpropagation algorithm calculates the gradients of the loss function with respect to the parameters in the network and propagates the gradients backward along the network to update the network parameters (weights and biases), continuously adjusting the model to reduce the loss function value, thereby establishing a regression model that can accurately predict the key water quality indicators of sewage treatment. Step 3: Determine the hyperparameters of the multi-layer perceptron, including the number of neurons, learning rate, etc.
[0121] In the embodiment of the present invention, the multi-layer perceptron architecture consists of three hidden layers, each hidden layer contains 64, 32, and 16 neurons respectively, and an output layer containing each neuron. All hidden layers use the ReLU activation function, while the output layer uses a linear activation function to adapt to the regression model. To ensure the stable convergence of the sewage treatment soft sensor model, the weights are initialized using the Xavier initialization method. The Xavier initialization method randomly initializes the weights according to the number of inputs and outputs of the neurons, so that the variances of the activation values and gradients of each layer remain stable during the network training process, avoiding gradient explosion or disappearance caused by improper weight initialization, thereby improving the stability and convergence speed of model training. During the training process, the Adam optimizer is used, and the learning rate is set to 0.001. By setting a batch size of 16 and 200 training epochs, the computational efficiency and generalization performance of the training process are balanced.
[0122] The virtual sample generation method for sewage treatment soft measurement provided by the embodiments of the present invention can effectively measure whether the output of the generator has converged to a stable state by calculating the maximum mean difference (MMD) between the virtual samples continuously output by the generator and comparing it with the difference threshold, avoiding over-training or under-training of the generator, and ensuring that the generated virtual samples have good stability and consistency. After the generator reaches a stable state, the virtual samples output by it are obtained as the virtual samples corresponding to the sewage treatment parameter dataset, and these virtual samples can better reflect the characteristics and distribution of the original dataset. It can provide more accurate data support for the simulation, prediction, optimization, etc. of the sewage treatment process, help improve the performance of related models and algorithms, and thus improve the efficiency and quality of sewage treatment.
[0123] Embodiment 5 Corresponding to the above method embodiments, the embodiments of the present invention provide a device for generating virtual samples for sewage treatment soft measurement. Figure 5 As shown in the structural schematic diagram of a device for generating virtual samples for sewage treatment soft measurement provided by the embodiments of the present invention. Figure 5 As shown in the figure, the device for generating virtual samples for sewage treatment soft measurement may include: A data acquisition module 501, configured to acquire a sewage treatment parameter dataset; wherein, the sewage treatment parameter dataset includes sewage treatment process parameters and at least one sewage treatment result parameter. An initial population acquisition module 502, configured to optimize the initial input dataset of the generator of the generative adversarial network based on a multi-objective optimization function to generate an initial population; wherein, the multi-objective optimization function includes a coverage metric function and a discretization metric function. A virtual sample acquisition module 503, configured to input the initial population into the generator of the generative adversarial network, input the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter dataset into the discriminator of the generative adversarial network, perform adversarial training, and obtain the virtual samples output after the generator reaches a stable state as the virtual samples corresponding to the sewage treatment parameter dataset; wherein, the adversarial training refers to multi-task joint training implemented for each of the sewage treatment result parameters.
[0124] A virtual sample generation device for sewage treatment soft sensing provided by an embodiment of the present invention generates an initial population through a multi-objective optimization function. Taking data coverage and dispersion as optimization objectives and considering various factors, the generated virtual samples can better reflect the complex characteristics of the sewage treatment process, enabling the soft sensing model to better adapt to the actual sewage treatment process. It solves the technical bottlenecks of gradient disappearance and mode collapse in the generative adversarial network, ensures the intrinsic structural consistency between the virtual samples and the sewage treatment parameter dataset, and improves the accuracy of the virtual samples. By integrating and obtaining the original sensor dataset collected during the sewage treatment process, focusing on constructing a high-quality input dataset that conforms to the characteristics of the industrial scenario, preprocessing operations such as data imputation, variable transformation, and adding perturbations are performed on the original data in the original sensor dataset, aiming to solve the problems of excessive noise and uneven distribution in the original data and improve the representational ability and integrity of the data.
[0125] In some embodiments, the initial population acquisition module 502 is further configured to: Create a group of initial input datasets that follow a normal distribution; According to the coverage index function and the discretization index function, calculate the coverage index and the discretization index corresponding to each parent individual in the initial input dataset; Screen the parent individuals according to the coverage index and the discretization index corresponding to each parent individual to obtain the parent population; Generate an offspring population corresponding to the parent population based on the simulated binary crossover operator; According to the coverage index function and the discretization index function, calculate the coverage index and the discretization index corresponding to each offspring individual in the offspring population; When the coverage index corresponding to each offspring individual meets the coverage threshold and the discretization index meets the discretization threshold, based on the Pareto dominance relationship, select a preset number of individuals from the parent population and the offspring population as the initial population.
[0126] In some embodiments, generating an offspring population corresponding to the parent population based on the simulated binary crossover operator includes: Successively obtain two parent individuals from the parent population in a preset order; Input the parent individuals into the simulated binary crossover operator to obtain two offspring individuals until all parent individuals are traversed; Form the obtained offspring individuals into an offspring population.
[0127] In some embodiments, the sewage treatment parameter dataset includes sewage treatment process parameters and sewage treatment result parameters, and the number of sewage treatment result parameters is at least one.
[0128] In some embodiments, the virtual sample acquisition module 503 is further configured to: For each sewage treatment result parameter, a training subtask is established as the subtask corresponding to the sewage treatment result parameter; For each subtask, a parameter mask of the generator in the subtask is generated; For each subtask, according to the preset initialized basic network and the parameter mask, an element-wise multiplication operation is performed to construct a sub-network corresponding to the generator of the generative adversarial network in the subtask; For each subtask, the parameter mask of the generator of the generative adversarial network in the subtask is pruned according to the preset pruning rate to obtain the pruned parameter mask of the generator in the subtask; For each subtask, when the sharing rate of the pruned parameter mask of the generator of the generative adversarial network in the subtask is less than or equal to the sharing rate threshold, the pruned parameter mask of the generator in the subtask is input into the generator of the generative adversarial network in the subtask to update the generator of the generative adversarial network in the subtask, and an updated generator of the generative adversarial network in the subtask is obtained; For each subtask, the initialized population is input into the updated generator of the generative adversarial network corresponding to the sewage treatment result parameter, and the initial virtual samples, sewage treatment process parameters, and sewage treatment result parameters output by the updated generator of the generative adversarial network are input into the discriminator of the generative adversarial network corresponding to the sewage treatment result parameter for adversarial training.
[0129] In some embodiments, the virtual sample acquisition module 503 is further configured to: Obtain a first virtual sample and a second virtual sample output by the generator of the generative adversarial network; wherein the first virtual sample and the second virtual sample are the virtual samples output by the generator of the generative adversarial network in the last two times during the adversarial training process; Calculate the maximum mean difference between the first virtual sample and the second virtual sample; When the maximum mean difference is less than the difference threshold, it is determined that the generator reaches a stable state.
[0130] In some embodiments, the device further includes: A model training module, configured to input the virtual samples into the sewage treatment soft sensor model to train the sewage treatment soft sensor model, and obtain a trained sewage treatment soft sensor model, where the sewage treatment soft sensor model is used to predict the sewage treatment result parameters according to the sewage treatment process parameters; wherein, the sewage treatment soft sensor model is a neural network model based on a multi-layer perceptron.
[0131] The device provided by the embodiments of the present invention has the same implementation principle and the same technical effects as those of the foregoing method embodiments. For a brief description, for the parts not mentioned in the device embodiments, reference may be made to the corresponding contents in the foregoing method embodiments.
[0132] Example 6 An embodiment of the present invention further provides an electronic device for running the above sewage treatment soft measurement virtual sample generation method; see Figure 6 the structural schematic diagram of an electronic device shown in the figure. The electronic device includes a memory 600 and a processor 601. Among them, the memory 600 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 601 to implement the above sewage treatment soft measurement virtual sample generation method.
[0133] Furthermore, Figure 6 the electronic device shown in the figure further includes a bus 602 and a communication interface 603. The processor 601, the communication interface 603 and the memory 600 are connected through the bus 602.
[0134] Among them, the memory 500 may include a high-speed random access memory (RAM, Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 603 (which can be wired or wireless), a communication connection is realized between this system network element and at least one other network element, and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 602 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 6 only a bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0135] The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 601 or the instructions in the form of software. The above-mentioned processor 601 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 600, and the processor 601 reads the information in the memory 500 and combines its hardware to complete the steps of the method in the foregoing embodiments.
[0136] The embodiments of the present invention also provide a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above sewage treatment soft measurement virtual sample generation method. For the specific implementation, reference can be made to the method embodiments, and details are not described herein again.
[0137] The computer program product for the sewage treatment soft measurement virtual sample generation method provided by the embodiments of the present invention includes a computer-readable storage medium storing non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the method described in the foregoing method embodiments. For the specific implementation, reference can be made to the method embodiments, and details are not described herein again.
[0138] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and details are not described herein again.
[0139] In several embodiments provided by the present invention, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be in electrical, mechanical, or other forms.
[0140] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0141] In addition, each functional unit in various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0142] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical disks and other various media that can store program codes.
[0143] Finally, it should be noted that the above-described embodiments are only specific embodiments of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions recorded in the foregoing embodiments or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A virtual sample generation method for soft measurement of sewage treatment, characterized in that including: Obtain a sewage treatment parameter dataset; wherein, the sewage treatment parameter dataset includes sewage treatment process parameters and at least one sewage treatment result parameter; Based on a multi-objective optimization function, optimize the initial input dataset of the generator in the generative adversarial network to generate an initial population; wherein, the multi-objective optimization function includes a coverage metric function and a discretization metric function; Use the initial population as the input of the generator, and input the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter dataset into the discriminator of the generative adversarial network for adversarial training to obtain the virtual samples output after the generator reaches a stable state as the virtual samples corresponding to the sewage treatment parameter dataset; wherein, the adversarial training refers to multi-task joint training implemented for each of the sewage treatment result parameters.
2. The method according to claim 1, wherein The optimizing the initial input data of the generator of the generative adversarial network based on the multi-objective optimization function to generate an initial population includes: Create a set of initial input datasets that follow a normal distribution; According to the coverage metric function and the discretization metric function, calculate the coverage metric and the discretization metric corresponding to each parent individual in the initial input dataset; Screen the parent individuals according to the coverage metric and the discretization metric corresponding to each parent individual to obtain a parent population; Generate an offspring population corresponding to the parent population based on a simulated binary crossover operator; According to the coverage metric function and the discretization metric function, calculate the coverage metric and the discretization metric corresponding to each offspring individual in the offspring population; When the coverage metric corresponding to each offspring individual meets the coverage threshold and the discretization metric meets the discretization threshold, based on the Pareto dominance relationship, select a preset number of individuals from the parent population and the offspring population as the initial population.
3. The method according to claim 2, characterized in that, Generating an offspring population corresponding to the parent population based on a simulated binary crossover operator includes: Sequentially obtain two parent individuals from the parent population in a preset order; Input the parent individuals into the simulated binary crossover operator to obtain two offspring individuals until all parent individuals are traversed; Form the obtained offspring individuals into the offspring population.
4. The method according to claim 1, characterized in that, The sewage treatment parameter dataset includes sewage treatment process parameters and sewage treatment result parameters, and the number of the sewage treatment result parameters is at least one.
5. The method according to claim 4, wherein The inputting the initial population into the generator of the generative adversarial network, and inputting the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter dataset into the discriminator of the generative adversarial network for adversarial training includes: For each sewage treatment result parameter, establish a training subtask as the subtask corresponding to the sewage treatment result parameter; For each subtask, generate a parameter mask for the generator in the subtask; For each subtask, perform an element-wise multiplication operation according to a preset initial basic network and the parameter mask to construct a sub-network corresponding to the generator of the generative adversarial network in the subtask; For each subtask, prune the parameter mask of the generator in the generative adversarial network in the subtask according to a preset pruning rate to obtain the pruned parameter mask of the generator in the subtask; For each subtask, when the sharing rate of the pruned parameter mask of the generator in the generative adversarial network in the subtask is less than or equal to the sharing rate threshold, input the pruned parameter mask of the generator in the subtask into the generator in the generative adversarial network in the subtask to update the generator in the generative adversarial network in the subtask, and obtain the updated generator of the generative adversarial network in the subtask; For each subtask, input the initialized population into the updated generator of the generative adversarial network corresponding to the sewage treatment result parameters, and input the initial virtual samples output by the updated generator of the generative adversarial network, the sewage treatment process parameters, and the sewage treatment result parameters into the discriminator of the generative adversarial network corresponding to the sewage treatment result parameters for adversarial training.
6. The method according to claim 1, characterized in that, The generator reaching a stable state includes: Obtain a first virtual sample and a second virtual sample output by the generator of the generative adversarial network; wherein the first virtual sample and the second virtual sample are the virtual samples output by the generator of the generative adversarial network in the last two times during the adversarial training process; Calculate the maximum mean difference between the first virtual sample and the second virtual sample; When the maximum mean difference is less than the difference threshold, determine that the generator has reached a stable state.
7. The method according to claim 4, characterized in that After inputting the initialized population into the generator of the generative adversarial network, inputting the initial virtual samples output by the generator of the generative adversarial network and the sewage treatment parameter dataset into the discriminator of the generative adversarial network for adversarial training, and obtaining the virtual samples output after the generator reaches a stable state as the virtual samples corresponding to the sewage treatment parameter dataset, it further includes: Input the virtual samples into a sewage treatment soft sensor model to train the sewage treatment soft sensor model, and obtain a trained sewage treatment soft sensor model, where the sewage treatment soft sensor model is used to predict the sewage treatment result parameters according to the sewage treatment process parameters; wherein, the sewage treatment soft sensor model is a neural network model constructed based on a multi-layer perceptron.
8. A virtual sample generation device for soft measurement of sewage treatment, characterized in that It includes: A data acquisition module, configured to acquire a sewage treatment parameter dataset; wherein, the sewage treatment parameter dataset includes sewage treatment process parameters and at least one sewage treatment result parameter; An initialized population acquisition module, configured to optimize the initial input dataset of the generative adversarial network generator based on a multi-objective optimization function to generate an initialized population; wherein, the multi-objective optimization function includes a coverage metric function and a discretization metric function; A virtual sample acquisition module, configured to input the initialized population into a generator of the generative adversarial network, input an initial virtual sample output by the generator of the generative adversarial network and the sewage treatment parameter data set into a discriminator of the generative adversarial network, perform adversarial training, and obtain a virtual sample output after the generator reaches a stable state as the virtual sample corresponding to the sewage treatment parameter data set; wherein the adversarial training refers to multi-task joint training implemented for each of the sewage treatment result parameters.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the sewage treatment soft measurement virtual sample generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer executable instructions, and when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to implement the sewage treatment soft measurement virtual sample generation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
A multi-grade chemical process soft sensor modeling method automatically generating samples
CN109002686A
Sewage quality multi-index prediction method
CN117236510A
Adversarial network training method, adversarial network training device, medium and equipment
CN118569351A
Intelligent risk control system for financial fraud detection based on generative adversarial network
CN119941390A
Subtask Adaptable Neural Network
US20230214656A1