Training method and device of water quality prediction model and related equipment
By constructing and iteratively updating the overall model characteristics of the water quality prediction model, select populations are solved by using population evolution strategies and updating models to collaboratively train the problem of low accuracy of water quality prediction in the existing technology, and more efficient and accurate water quality prediction is achieved.
Patent Information
- Application Number
- CN202510460669.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-06-20
AI Technical Summary
The index data method used in the prior art to determine the effect of sewage treatment has the problem of low accuracy, and neural network prediction models are prone to underfitting or overfitting, which is difficult to meet the requirements of prediction accuracy.
By constructing alternative populations about the overall model characteristics of the water quality prediction model, iterative training is performed using population evolution strategies and population update models, and the water quality prediction model is coordinated to improve prediction accuracy and efficiency.
The training efficiency of the water quality prediction model is improved, local optimal solutions are avoided, and prediction accuracy and prediction efficiency are significantly improved.
Smart Images

Figure CN120181674A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent water environment monitoring, and particularly to a method, device and related equipment for training a water quality prediction model. Background Art
[0002] In the process of sewage treatment for polluted waters, it is necessary to calculate index data to evaluate the water quality of the current sewage treatment process. For example, the COD (Chemical Oxygen Demand) calculated by a mathematical model can be used to evaluate the degree of organic pollution of the water area.
[0003] In practical applications, due to the very complex pollution conditions of polluted waters in many application scenarios, when calculating index data, a large number of parameters usually need to be introduced to correct the mathematical model. This operation will cause problems such as parameter mismatch in the real-time application process of the mathematical model, and ultimately result in a low calculation accuracy of the data model. In addition, the index data can also be predicted through a pre-trained neural network structure. However, in practical applications, a simple neural network structure is prone to underfitting, that is, the prediction accuracy is low, while a complex neural network structure will lead to overfitting, that is, poor generalization, and it is difficult to meet the requirements of prediction accuracy.
[0004] In summary, the existing methods for determining index data for sewage treatment effects have the problem of low accuracy. Summary of the Invention
[0005] In view of this, the purpose of the present application is to provide a method, device and related equipment for training a water quality prediction model to solve the problem of low accuracy existing in the existing methods for determining index data for sewage treatment effects.
[0006] In a first aspect, the present application provides a method for training a water quality prediction model, the method comprising:
[0007] Constructing an alternative population regarding the overall model characteristics of the water quality prediction model;
[0008] wherein the population includes a plurality of distinct individuals, and the individuals represent the overall model characteristics;
[0009] Iteratively training the water quality prediction model to iteratively update the plurality of individuals in the alternative population until a training stop condition is reached to obtain a plurality of target individuals;
[0010] Among them, the update of the alternative population is performed through a population evolution strategy and a population update model. The iterative processes of the population evolution strategy and the population update model are carried out in coordination with the training process of the water quality prediction model. The coordination indicates using the prediction index of the water quality prediction model as the screening condition for the alternative population in the population evolution strategy and the population update model;
[0011] Determine the target overall model characteristics of the water quality prediction model according to multiple said target individuals.
[0012] In a second aspect, the present application provides a training device for a water quality prediction model. The device includes: an alternative population module and a training module;
[0013] The alternative population module is used to construct an alternative population regarding the overall model characteristics of the water quality prediction model;
[0014] Among them, the population includes multiple different individuals, and the individuals represent the overall model characteristics;
[0015] The training module is used to iteratively update multiple said individuals in the alternative population by iteratively training the water quality prediction model until a training stop condition is reached to obtain multiple target individuals;
[0016] Among them, the update of the alternative population is performed through a population evolution strategy and a population update model. The iterative processes of the population evolution strategy and the population update model are carried out in coordination with the training process of the water quality prediction model. The coordination indicates using the prediction index of the water quality prediction model as the screening condition for the alternative population in the population evolution strategy and the population update model;
[0017] The training module is further used to determine the target overall model characteristics of the water quality prediction model according to multiple said target individuals.
[0018] In a third aspect, the present application provides an electronic device. The electronic device includes a processor and a memory. The memory is used to store application programs. The processor runs or executes the software programs stored in the memory to enable the electronic device to implement the above-mentioned training method of the water quality prediction model.
[0019] In a fourth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium is used to store program codes executed by a processor. The program codes are used to implement the above-mentioned training method of the water quality prediction model.
[0020] Fifth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions run on an electronic device, the electronic device implements the above-mentioned training method of the water quality prediction model.
[0021] Beneficial effects:
[0022] The present application provides a training method for a water quality prediction model. The method includes: constructing an alternative population regarding the overall model features of the water quality prediction model; wherein, the population includes a plurality of different individuals, and the individuals represent the overall model features; iteratively training the water quality prediction model to iteratively update a plurality of individuals in the alternative population until a training stop condition is reached to obtain a plurality of target individuals; wherein, the update of the alternative population is performed through a population evolution strategy and a population update model, and the iterative processes of the population evolution strategy and the population update model are carried out in coordination with the training process of the water quality prediction model. The coordination indicates using the prediction index of the water quality prediction model as the screening condition for the alternative population in the population evolution strategy and the population update model; determining the target overall model features of the water quality prediction model according to a plurality of target individuals; in summary, it can be seen that since the present application updates multiple individuals simultaneously during the training process, the training efficiency is improved and the problem of falling into local optimal solutions is avoided; in addition, since the designed "algorithm iteration - model training" coordination framework of the present application can complete the training of the water quality prediction model while adjusting the population evolution direction, it can effectively improve the prediction accuracy and prediction efficiency of the trained water quality prediction model. Description of the drawings
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. The following drawings only show some embodiments of the present application, so they should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other relevant drawings can also be obtained based on these drawings.
[0024] Figure 1 It is a schematic flowchart of the training method of the water quality prediction model provided by the embodiment of the present application;
[0025] Figure 2 It is a schematic structural diagram of an individual provided by the embodiment of the present application;
[0026] Figure 3 It is a schematic diagram of the network structure adjustment of the water quality prediction model provided by the embodiment of the present application;
[0027] Figure 4Schematic diagram for comparing the water quality prediction results of the water quality prediction models respectively trained based on the denoising strategy and the conventional strategy provided by the embodiments of the present application;
[0028] Figure 5 Schematic diagram for comparing the prediction errors of the water quality prediction models respectively trained based on the denoising strategy and the conventional strategy provided by the embodiments of the present application;
[0029] Figure 6 Schematic diagram for comparing the correlation coefficients between various water quality characteristic data and the water quality prediction results provided by the embodiments of the present application;
[0030] Figure 7 Schematic diagram for comparing the selection frequencies between various water quality characteristic data and the water quality prediction results provided by the embodiments of the present application;
[0031] Figure 8 Schematic diagram of the structure of the training device for the water quality prediction model provided by the embodiments of the present application. Detailed implementation manners
[0032] According to practical experience, it is known that the water quality of polluted waters is affected by various factors, such as climate change, soil erosion, industrial wastewater discharge, domestic sewage discharge, agricultural pollution, and natural disasters. Therefore, the physical prediction model constructed based on the physical modeling method by establishing mechanism equations such as mass conservation equations and reaction kinetic models has the following application dilemmas:
[0033] First, the prediction accuracy of the physical prediction model is not high.
[0034] Although the physical prediction model has the advantage of physical interpretability, it faces technical bottlenecks of high modeling complexity and strong parameter sensitivity in actual industrial scenarios. Especially when dealing with complex processes with strong multivariable coupling, the applicability and real-time performance of the physical prediction model are significantly limited.
[0035] Second, the prediction efficiency of the physical prediction model is not high.
[0036] When facing complex industrial scenarios such as multiphase flow coupling in sewage treatment plants and population metabolism in bioreactors, the physical prediction model needs to introduce a large number of empirical correction coefficients, resulting in a sharp expansion of the dimension of the physical prediction model. In practical applications, the calibration of the physical prediction model depends on high-precision soft measurement arrays, and problems such as soft measurement drift and installation deviation commonly existing in industrial sites are likely to cause parameter mismatch, making the prediction error of the physical prediction model accumulate nonlinearly. Especially when dealing with transient working conditions, the real-time performance of the numerical solver is difficult to meet the control cycle requirements.
[0037] To solve the problem that the prediction accuracy and prediction efficiency of physical prediction models are both low, the prediction of the water quality of polluted waters can be achieved by training a neural network structure. However, the neural network prediction model obtained through training has the following application dilemmas:
[0038] First, the prediction accuracy of the neural network prediction model is not high.
[0039] In actual operation, a neural network structure with a simple structure is prone to underfitting, that is, low prediction accuracy. However, a neural network structure with a complex structure will lead to overfitting, that is, poor generalization ability. The matching efficiency between the network structure and optimization assistance still needs to be improved, and the problem of insufficient robustness in the scenario of cross-operating condition data distribution offset is still prominent. In addition, the current technical system generally has common defects such as the lack of a mechanism and data fusion mechanism, weak causal association modeling between variables, and excessive consumption of computing resources, making it difficult to meet the comprehensive requirements of complex industrial processes for real-time performance, interpretability, and engineering applicability. The laboratory detection frequency of key water quality parameters in sewage treatment plants is low, making it difficult to support the large-scale labeled data required for deep model training. Transfer learning also faces domain adaptation problems due to process differences in different plants. In addition, the black-box characteristics of the neural network prediction model are incompatible with the strong empirical dependence of sewage treatment process control, leading to doubts about the reliability of the neural network prediction model by process personnel and restricting its implementation and application in safety-sensitive links.
[0040] Second, the prediction efficiency of the neural network prediction model is not high.
[0041] The neural network prediction model has inherent defects in capturing high-order non-linear characteristics of industrial processes, and the problem of computational efficiency in high-dimensional parameter space has not been fundamentally solved. Specifically, key parameters such as influent flow rate and chemical oxygen demand are significantly affected by factors such as seasons and weather, resulting in a large difference between the historical experience data and real-time operating condition data of the above data. The neural network prediction model is prone to failure due to feature drift. At the same time, the online soft measurement of key biochemical parameters is easily interfered by foam and suspended solids, and the problems of data missing and noise are prominent, making it difficult for existing neural network prediction models to extract stable features from low signal-to-noise ratio data and having insufficient generalization ability for sudden operating conditions.
[0042] To solve the above technical problems, this application provides a training scheme for a water quality prediction model. To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the protection scope of this application.
[0043] First, this application provides a training method for a water quality prediction model, such as Figure 1 As shown, Figure 1 A flow chart of a method for training a water quality prediction model provided in an embodiment of the present application, the method comprising: S100 to S300, the details of which are as follows:
[0044] S100: Construct candidate populations for overall model characteristics of water quality prediction models;
[0045] The population includes multiple different individuals, and each individual represents the characteristics of an overall model.
[0046] Specifically, in an embodiment of the present application, the water quality prediction model is a neural network structure used to predict the water quality of polluted waters, and the specific structure of the neural network structure can be determined according to actual needs; in actual operation, a multi-layer perceptron (MLP) can be used as the neural network structure of the water quality prediction model; the MLP framework is very flexible and allows customization of the network structure, including the number of neurons in the input layer and the hidden layer, to meet different needs.
[0047] In the embodiment of the present application, the overall model characteristics refer to the characteristic data used to describe the overall model characteristics of the water quality prediction model, rather than the relevant network parameters of a certain network layer or a certain neuron, but are characteristic data used to describe the relevant network parameters of all network layers of the water quality model.
[0048] In the prior art, neural network training usually only optimizes model parameters (weights and biases), while the network structure (such as the inter-layer connection method and the number of nodes) remains fixed throughout the training process; this static structure training paradigm has significant defects: when the training samples are insufficient, the neural network structure with a simple structure is prone to underfitting, that is, low prediction accuracy, but the neural network structure with a complex structure will lead to overfitting, that is, poor generalization; due to the objective reality of the scarcity of effective monitoring data in the field of water quality prediction, traditional methods are difficult to adaptively adjust the model capacity under limited samples, which ultimately leads to limited prediction performance.
[0049] In order to solve this problem, an embodiment of the present application constructs an alternative population, which is used to update multiple individuals included in the alternative population during each population iteration process, which is equivalent to updating the overall model characteristics of multiple water quality prediction models in batches during each training process, so as to minimize the technical problems caused by insufficient number of training samples; in actual operation, in order to facilitate the understanding of the alternative population, the alternative population can be regarded as a collection of overall model characteristics of multiple completely different water quality prediction models. When mentioning the alternative population, multiple water quality prediction models with different structures can be thought of.
[0050] In one implementation, each individual includes a first matrix and a second matrix. The first matrix is a binary vector matrix used to indicate the network structure of the water quality prediction model, and the second matrix is a real number matrix used to indicate the model parameters of the water quality prediction model; S110 includes steps (1) to (2), details are as follows:
[0051] Step (1): Construct multiple initial first matrices and multiple initial second matrices;
[0052] Among them, the first matrix is a binary vector matrix, and the second matrix is a real number matrix.
[0053] Specifically, in the embodiments of the present application, the "construction process" of the alternative population only needs to be executed once. When entering the collaborative training of the alternative population and the water quality prediction model, the alternative population can be automatically updated according to the population evolution strategy and the population update model, and there is no need to execute the "construction process" again.
[0054] In the prior art, the training of a neural network model usually only focuses on the update of model parameters such as weights and biases. However, in order to obtain a water quality prediction model with high prediction accuracy and prediction efficiency under the condition of insufficient training samples, the embodiments of the present application enable the network structure of the water quality prediction model to be updated during the iterative training process. Specifically, in the embodiments of the present application, information such as the connection method between network layers and the number of neurons included in the network layer of the water quality prediction model can be adaptively optimized according to the training process to fully explore the best overall model characteristics of the water quality prediction model.
[0055] In order to enable the network structure of the water quality prediction model to be updated during the iterative training process, the embodiments of the present application encode the first matrix and the second matrix for the network structure and model parameters of the water quality prediction model in sequence, so as to efficiently and accurately quantify and represent the network structure and model parameters of the water quality prediction model. It should be noted that the first matrix includes the selection of model input variables; the advantage of this encoding method is that all available input variables will be selected by at least one individual, that is, the complete population will optimize all input nodes. If an individual selects a new input during the evolution process, that is, the evolution of the first matrix, it can be ensured that other individuals in the population have optimized the weights corresponding to the node, without randomly initializing the node, thereby accelerating the convergence speed of the algorithm to a certain extent. In actual operation, the above encoding method breaks through the limitations of traditional fixed-structure models, compresses the network parameter quantity while retaining the expression ability of the water quality prediction model.
[0056] As Figure 2 shown, Figure 2Schematic diagram of the structure of an individual provided by an embodiment of the present application. Each individual includes a first matrix and a second matrix.
[0057] The first matrix includes a plurality of first elements, and the first elements are binary vectors. The row length m of the first matrix corresponds to the sum of the number of hidden layers and input layers in the water quality prediction model, and the column length n of the first matrix corresponds to the number of neurons in each network layer (including hidden layers and input layers) of the water quality prediction model. Among them, the number of rows of the input layer is less than the number of rows of the hidden layer, and both m and n are positive integers.
[0058] In actual operation, in order to ensure the generality and robustness of the water quality prediction model, it is stipulated that the number of hidden layers in the water quality prediction model needs to be restricted within a first preset number range. Among them, the specific range of the first preset number range can be adjusted according to the complexity of the task. In actual applications, the first preset number range can be set to (2, 10).
[0059] In actual operation, in order to ensure the learning ability and computational efficiency of the water quality prediction model, it is usually necessary to refer to the number N of neurons in the input layer of the water quality prediction model i , and restrict the number of neurons in each hidden layer of the water quality prediction model within a second preset number range. Among them, the specific range of the second preset number range can be determined according to actual needs. In actual applications, the second preset number range can be set to (N i , 2N i ), which is used to enhance the expression ability of the model by ensuring the flexibility of the network structure of the water quality prediction model, while avoiding overfitting and ensuring computational efficiency. Among them, N i is a positive integer.
[0060] The arrangement positions of the first elements in the first matrix correspond to the arrangement positions of the neurons in the water quality prediction model. In the first matrix, if the value of a first element is 1, it means that the neuron corresponding to the first element is in an active state, that is, the neuron participates in the prediction behavior of the water quality prediction model. If the value of a first element is 0, it means that the neuron corresponding to the first element is in an inactivated state, that is, the neuron does not participate in the prediction behavior of the water quality prediction model.
[0061] The second matrix includes a plurality of second elements, and the second elements are real numbers (usually less than or equal to 1). The row length and column length of the second matrix are (m + 1) and n in sequence. The first m rows of the second matrix are used to represent the weights of the neurons at the corresponding positions in the first matrix, and the last 1 row of the second matrix is used to represent the biases of the neurons in this column of the first matrix. For example, for Figure 2 the first element with a value of 1 in the upper left corner of the hidden layer area in the first matrix, w 1,2 in the second matrix is the weight of this first element, and b2 is the bias of this first element.
[0062] In actual operation, m and n of all individuals in the population are the same; among them, the values of m and n can be set in advance or randomly determined during the iterative training process of the water quality prediction model; specifically, in order to avoid wasting calculations due to redundant network structures, during the process of updating individuals, the m corresponding to the updated individual is randomly determined within the range of (m 1,min , m 1,max ), and the n corresponding to the updated individual is randomly determined within the range of (n 1,min , n 1,max ), that is, the row and column boundaries of the first matrix and the second matrix can be dynamically adjusted according to the task complexity to avoid redundant structures; among them, m 1,min , m 1,max , n 1,min , and n 1,max are all positive integers, and m 1,min , m 1,max , n 1,min , and n 1,max can be determined according to actual needs, and the present application does not make specific limitations on this.
[0063] In the embodiments of the present application, during the process of constructing multiple first matrices and multiple second matrices, the concept of population is used for construction, that is, a population P1 is constructed for the initial first matrix, and the population P1 includes multiple initial first matrices, and a population P2 is constructed for the initial second matrix, and the population P2 includes multiple initial second matrices; the process of constructing multiple initial first matrices and multiple initial second matrices is the process of initializing the populations P1 and P2.
[0064] During the process of initializing the populations P1 and P2, it is necessary to first determine the value ranges of m and n (m 1,min , m 1,max ) and (n 1,min , n 1,max ), as well as the population sizes N of the populations P1 and P2. The population size is the number of individuals included in the population, and N is a positive integer; the population sizes of the populations P1 and P2 are the same.
[0065] After determining the above parameters, the populations P1 and P2 can be initialized according to the following logic, and the initialization process is shown in Table 1.
[0066] Table 1 Initialization process of populations P1 and P2
[0067]
[0068]
[0069] Step (2): Determine an initial alternative population including a plurality of initial alternative individuals according to a plurality of initial first matrices and a plurality of initial second matrices;
[0070] Among them, the plurality of initial alternative individuals included in the initial alternative population are used for updating during the first training process of the water quality prediction model.
[0071] Specifically, in the embodiment of the present application, after determining a plurality of initial first matrices and a plurality of initial second matrices, the plurality of initial first matrices and the plurality of initial second matrices can be matched one by one, so that each initial first matrix is matched with an initial second matrix, and the matched initial first matrix and initial second matrix are the initial alternative individuals in the initial alternative population; among them, the plurality of initial alternative individuals are used to represent the water quality prediction model in the first iterative training process.
[0072] S200: Iteratively train the water quality prediction model to iteratively update a plurality of individuals in the alternative population until a training stop condition is reached to obtain a plurality of target individuals;
[0073] Among them, the update of the alternative population is executed through a population evolution strategy and a population update model. The iterative processes of the population evolution strategy and the population update model are carried out in coordination with the training process of the water quality prediction model. The coordination indicates using the prediction index of the water quality prediction model as the screening condition for the alternative population in the population evolution strategy and the population update model.
[0074] Specifically, in actual operation, the training samples for training the water quality prediction model usually include noise interference. It should be emphasized that the decision to screen the optimal individuals is made based on the pre-candidate population affected by noise interference, which results in a high possibility of selecting sub-optimal solutions in a noisy environment. To solve this problem, that is, to effectively reduce the negative impact of noise in the training samples for training the water quality prediction model, a plurality of population update strategies are specifically set.
[0075] In the embodiment of the present application, the population update model introduces a Denoising Variational Auto-Encoder (DVAE) to reduce the negative impact of noise in the training samples. DVAE is an auto-encoder that combines a denoising strategy and VAE, including an encoder and a decoder. When the input data including noise is input into the encoder, the decoder reconstructs the input data and outputs the reconstructed data without noise; in actual operation, both the encoder and the decoder in DVAE adopt a four-layer BP neural network structure, the hidden layer dimension is 10, and the learning rate is 10 -4And Xavier is used for weight initialization. In one implementation, during the iterative training of the water quality prediction model, if t meets the first preset condition, the t-th training process before reaching the training stop condition includes steps (3.1) to (3.4), details are as follows:
[0076] Step (3.1): Based on the population evolution strategy, update the current alternative population P determined in the (t - 1)-th training process t to obtain the current candidate population including multiple current candidate individuals.
[0077] Specifically, in actual operation, the first preset condition can be determined according to actual needs, and this application does not make specific limitations on this; in practical applications, the first preset condition can be set as the first 50 training processes, that is, in the training processes where t ≤ 50, steps (3.1) to (3.4) are executed.
[0078] In the embodiments of this application, since the initial alternative individuals in the alternative population represent the overall model characteristics of the water quality prediction model, the process of iterative training for the water quality prediction model is essentially a process of iterative update for the alternative population; in the process of iterative update of the alternative population, the "initial alternative population" is transformed into the "current alternative population" determined in each iterative update process. Except for the first training process, each training process for the water quality prediction model has a corresponding current alternative population.
[0079] According to the above content summary, the initial alternative population is used for update in the first training process of the water quality prediction model, and the current alternative population P t is used for update in the t-th training process; among them, the initial alternative population is constructed before the iterative training of the water quality prediction model, and the current alternative population P t is determined in the (t - 1)-th training process; where t is a positive integer greater than 1.
[0080] In the embodiments of this application, the number of mutant genes or the mutation rate can be adaptively adjusted based on the population evolution strategy to enhance the exploration ability of the water quality prediction model; based on the mutation operation in the population evolution strategy, update the current alternative population P determined in the (t - 1)-th training process t ; among them, the mutation operation is based on the DE / rand / 1 strategy in the Differential Evolution (DE) algorithm to evolve the current alternative individuals included in the current alternative population P t The formula is as follows:
[0081] x i (t) = xr1 (t - 1)+F1·[x r2 (t - 1)-x r3 (t - 1)];
[0082] Wherein, x i (t) represents the i-th mutant individual obtained by updating in the t-th training process; F1 represents the scaling factor in the DE / rand / 1 strategy. In actual operation, the value of F1 can be set to 0.3; r1, r2, and r3 are three randomly exclusive integers within the range of [1, n], and n represents the population size of the current alternative population, that is, the number of current alternative individuals included in the current alternative population; wherein, n is a positive integer, and its specific value can be determined according to actual needs, and this application does not make specific limitations on this.
[0083] x r1 (t - 1), x r2 (t - 1), and x r3 (t - 1) represent 3 individuals randomly selected from the current alternative population P(t - 1) in the (t - 1)-th training process.
[0084] Apply the DE / best / 1 strategy in the Differential Evolution (DE) algorithm to evolve the current alternative individuals included in the current alternative population P t The formula is as follows:
[0085] x u (t)=x best (t - 1)+F2·[x r2 (t - 1)-x r3 (t - 1)];
[0086] Wherein, x best (t - 1) represents the best individual in the current alternative population determined in the (t - 1)-th training process; F2 represents the scaling factor in the DE / best / 1 strategy. In actual operation, the value of F2 can be set to 0.3.
[0087] In actual operation, the global convergence speed of the DE / rand / 1 strategy is relatively slow, but it has good local search ability; on the contrary, the DE / best / 1 strategy has strong global search ability, but relatively weak local search ability.
[0088] In actual operation, the process of determining the above-mentioned two formulas for calculating x i (t) includes the following steps:
[0089] ① Calculate the temporary binary vector x according to the binary coding part (the first matrix) in the alternative populationtemp , the formula is as follows:
[0090]
[0091] In the formula, represents the element - level exclusive - or operation; x r2 (t - 1) and x r3 (t - 1) represent two individuals randomly selected from the current alternative population P t-1 .
[0092] ② For the individual i of the binary vector x temp , if x temp [i]=1, generate a random number R, R ∈ [0, 1), if R < F, then x temp [i]←0; Similarly, if x temp [i]=0, generate a random number R, R ∈ [0, 1), if R < F, then x temp [i]←1; i is a positive integer.
[0093] ③ Determine the formula for calculating the i - th mutant individual x i (t), and the formula is as follows:
[0094] x i (t)=x temp ∨x target ;
[0095] In the formula, ∨ represents the or operation; x target represents the target vector, and the target vector is a vector x t (t - 1) randomly selected from the current alternative population P r1 or the best individual x best (t - 1) in the current alternative population determined during the t - th training process.
[0096] In the embodiments of the present application, after performing the mutation operation on the binary - coded part (the first matrix) representing the water quality prediction model structure, the corresponding neuron weights (the second matrix) are initialized in the same manner as in Table 1.
[0097] In actual operation, after performing the mutation operation, a crossover operation can also be performed on the population based on the crossover operation in the population evolution strategy. The crossover operation consists of two parts: one for processing structure optimization and the other for focusing on network parameters. Among them, the process of the crossover operation includes the following steps:
[0098] The mutant individual x i (t)=[x i,1 (t),x i,2 (t),……,x i,D(t)] is mixed with x i (t - 1) to generate a trial individual x' i,j (t) = [x' i,1 (t), x' i,2 (t), ……, x' i,D (t)];
[0099]
[0100] In the formula, x' i,j (t) represents the j-th element obtained by updating the i-th updated individual in the t-th training process, and this element is an element in the matrix represented by the individual; Cr ∈ [0, 1], Cr represents the crossover rate; randi(D) represents an integer randomly generated from the range [0, D] to ensure that x' i (t) obtains at least one component from the mutant individual x i (t); D represents the dimension of the individual. In actual operation, if the individual is a 4 * 4 matrix, then D is 16.
[0101] It should be emphasized that although each individual in the embodiments of the present application includes two matrices (i.e., the first matrix and the second matrix), during the crossover operation, the position of the j-th element in the matrix does not change before and after the crossover operation. Therefore, the j-th element is not distinguished here as being in the first matrix or the second matrix.
[0102] In actual operation, the main problem faced by the first matrix comes from the differences in the network structures corresponding to the first matrix. Directly applying mutation and crossover operations to two individuals with different network structures may lead to unreasonable configurations; to solve this problem, the embodiments of the present application define and execute a metaheuristic network adjustment operation, as Figure 3 shown, Figure 3 is a schematic diagram of the network structure adjustment of the water quality prediction model provided by the embodiments of the present application, Figure 3 the left side of [] represents a schematic diagram of the network structure of the water quality prediction model before adjustment, Figure 3 the right side of [] represents a schematic diagram of the network structure of the water quality prediction model after adjustment, Figure 3 the dashed circles in [] represent the positions of the neurons to be discarded during the iterative training process; the first column in the structure matrix determines the input variables selected for the water quality prediction model, and the boolean values in the remaining columns determine whether the neurons in the hidden layer are in the working state. Correspondingly, the second matrix also changes with the change of the first matrix.
[0103] Step (3.2): Determine multiple candidate overall model features according to multiple current candidate individuals.
[0104] Specifically, in the embodiments of the present application, the individuals in the population ensure the overall model characteristics of the water quality prediction model. Therefore, when the current candidate individual is obtained, the corresponding candidate overall model characteristics can be determined according to the first matrix and the second matrix included in the current candidate individual, which are used to further determine the corresponding current water quality prediction model. Among them, there is a one-to-one correspondence between multiple candidate individuals, multiple candidate overall model characteristics, and multiple current water quality prediction models.
[0105] Step (3.3): Input the first training sample set into multiple current water quality prediction models that are in one-to-one correspondence with multiple candidate overall model characteristics, so as to obtain multiple groups of current prediction indicators that are in one-to-one correspondence with the multiple current water quality prediction models.
[0106] Among them, the samples in the first training sample set include water quality characteristic data; the current prediction indicator indicates the prediction ability of the current water quality prediction model; each group of the current prediction indicators includes at least two of the current prediction indicators.
[0107] Specifically, the water quality characteristic data may include: soluble inert organic matter S I , readily biodegradable substrate S S , particulate inert organic matter X I , slowly biodegradable substrate X S , active heterotrophic biomass X B,H , active autotrophic biomass X B,A , particulate products X generated by biomass decay P , oxygen S O , nitrate and nitrite nitrogen S NO , ammonia nitrogen S NH , biodegradable organic nitrogen S ND , particulate biodegradable organic nitrogen X ND and alkalinity S ALK and other characteristic data.
[0108] In actual operation, it is necessary to integrate each sample in the multiple samples included in the first training sample with the corresponding label into input data, and then input the input data into the water quality prediction model.
[0109] In the embodiments of the present application, the label of the sample can be any one of COD (Chemical Oxygen Demand) and BOD5 (Biochemical Oxygen Demand after 5 Days); in actual operation, the label of the sample can also be determined according to actual needs, and the present application does not make specific limitations on this.
[0110] In actual operation, after obtaining the original water quality characteristic data through on-site collection, the original data is first denoised and normalized to construct a high-quality training set. Sensor noise points are dynamically identified by the sliding window statistical method, and the dimensional differences between water quality characteristic data are eliminated by Z-score normalization. At the same time, multiple water quality characteristic data are aligned based on timestamps to obtain the first training sample set.
[0111] Step (3.4): According to multiple groups of current prediction indicators, for the current alternative population P t perform an update to obtain the current alternative population required for use in the (t + 1)-th training process.
[0112] Specifically, in actual operation, each group of current prediction indicators can be various data such as model complexity that can indicate the comprehensive performance of the water quality prediction model.
[0113] In practical applications, the purpose of iterative training for the water quality prediction model is to obtain a water quality prediction model with relatively high prediction accuracy and prediction efficiency. Therefore, after obtaining multiple groups of current prediction indicators, the multiple current water quality prediction models can be evaluated according to these multiple groups of current prediction indicators, which is equivalent to evaluating the current candidate population; subsequently, the current alternative population P t is updated to obtain the current alternative population required for use in the (t + 1)-th training process.
[0114] In one implementation, the number of individuals included in the alternative population is N, where N is a positive integer; Step (3.4) includes: Step (3.4.1) to Step (3.4.3), details are as follows:
[0115] Step (3.4.1): Determine the multiple groups of prediction indicators corresponding to the current alternative population P t
[0116] Specifically, in the embodiment of the present application, the current alternative population P t is obtained by screening in the (t - 1)-th training process. Since the screening criterion is screening by prediction indicators, the current alternative population P t must have its corresponding multiple groups of prediction indicators.
[0117] Step (3.4.2): Among the multiple groups of prediction indicators corresponding to the current alternative population P t and the multiple groups of current prediction indicators corresponding to the current candidate population, N groups of candidate prediction indicators are screened out by non-dominated sorting.
[0118] Specifically, in the embodiments of the present application, there is a conflicting relationship among multiple groups of prediction indicators; for example, a higher accuracy rate (the accuracy rate is a prediction indicator) usually indicates that the water quality prediction model has better fitting, however, this fitting often comes at the cost of sacrificing diversity. On the contrary, emphasizing diversity encourages exploring the model structure and parameter configuration, which may lead to a lower accuracy rate of the model but improves the generalization ability; in actual operation, the prediction indicators include the accuracy rate of the model and the diversity of the model structure, and the method for screening N groups of candidate prediction indicators is based on the non-dominated sorting technique in the multi-objective optimization algorithm.
[0119] Step (3.4.3): Combine the individuals corresponding to the N groups of candidate prediction indicators to obtain the current alternative population required for use in the (t + 1)-th training process.
[0120] Specifically, when combining the individuals corresponding to the N groups of candidate prediction indicators to obtain the current alternative population P required for use in the (t + 1)-th training process (t+1) .
[0121] In one implementation, the number of individuals included in the alternative population is N, and N is a positive integer; in the process of iteratively training the water quality prediction model, if t meets the second preset condition, the t-th training process before reaching the training stop condition includes: Step (3.5) to Step (3.10), details are as follows:
[0122] Step (3.5): Among the [(t - 1)×N] individuals included in the (t - 1) current alternative populations respectively determined in the previous (t - 1) training processes, screen out a preferred set including N T preferred individuals.
[0123] Specifically, in the embodiments of the present application, in order to balance convergence and diversity and ensure that the population update model can reliably generate a high-quality current candidate population at different evolution stages, the embodiments of the present application set up a screening process for randomly screening out a preferred set T including N T preferred individuals for training the population update model among the [(t - 1)×N] individuals included in the (t - 1) current alternative populations respectively determined in the previous (t - 1) training processes s ; N T is a positive integer, and its specific value can be determined according to actual needs, and the present application does not make specific limitations on this.
[0124] Step (3.6): Use the preferred set as the second training sample set to train the population update model.
[0125] Specifically, in the embodiments of the present application, N Tis a positive integer; in actual operation, the second preset condition can be determined according to actual needs, and the present application does not make specific limitations thereto; in practical applications, the second preset condition can be set to every k training processes, that is, when the remainder of t / (k + 1) is zero, steps (3.5) to (3.10) are executed for the t-th training process.
[0126] For example, if k = 4, then in the 5th training process, the 10th training process,..., the i(k + 1)-th training process, steps (3.5) to (3.10) are executed; where i is a positive integer greater than 2.
[0127] In the iterative training process of the water quality prediction model, considering that the distribution of the alternative population usually remains stable in consecutive multiple update processes, therefore, if the DVAE is trained at intervals, the algorithm performance and computational complexity can be balanced. The trained DVAE can be used to generate the current candidate population with convergence and diversity, guiding the alternative population to develop in the desired optimization direction. By iteratively merging the newly constructed current preferred individuals, the DVAE is gradually improved because the new current preferred individuals help correct the prediction errors of their predecessors.
[0128] In the embodiment of the present application, during the training process of the DVAE, the second training sample set including N T current alternative populations is input into the DVAE; the encoder in the DVAE learns the mean vector μ and covariance matrix ∑ of the second training sample set, and then randomly extracts a low-dimensional point set from the learned distribution. The decoder in the DVAE reconstructs the low-dimensional point set into a reconstructed data set, and the reconstructed data set is the denoised reconstructed data corresponding to the second training sample set.
[0129] In actual operation, the mean square error is used as the loss function to measure the difference between the original data and the reconstructed data. Subsequently, the network weights of the encoder and decoder are updated through the backpropagation algorithm. When the network weights of the DVAE are updated, the training process of the DVAE ends, that is, the trained population update model is obtained.
[0130] In practical applications, the current candidate population reconstructed by the DVAE and the current alternative population P t have the same distribution, but are not exactly the same, that is, the current candidate population and the current alternative population P tFollow the same distribution but the samples do not overlap; during the iterative update of the current alternative population, the quantity and quality of the current candidate individuals included in the current candidate population depend on the complexity of the problem and the randomness of the search process. Specifically, during the iterative update of the current alternative population, the number of individuals included in the current alternative population obtained through steps (3.1) to (3.4) is usually very small, and both convergence and diversity may be insufficient. If the DVAE is trained at intervals, the above problems can be solved.
[0131] Step (3.7): Update the model through the trained population, and update the current alternative population P determined in the (t - 1)-th training process t to obtain the current candidate population including multiple current candidate individuals.
[0132] Specifically, in actual operation, after inputting the current alternative population P t into the trained population update model, the population update model, i.e., the DVAE, learns the distribution of the current alternative population P t and outputs the reconstructed data set corresponding to the current alternative population P t , which is the current candidate population.
[0133] Step (3.8): Determine multiple candidate overall model features based on multiple current candidate individuals.
[0134] Step (3.9): Input the first training sample set into multiple current water quality prediction models corresponding one-to-one with multiple candidate overall model features to obtain multiple groups of current prediction indicators corresponding one-to-one with multiple current water quality prediction models.
[0135] Step (3.10): Update the current alternative population P t according to multiple groups of current prediction indicators to obtain the current alternative population required for use in the (t + 1)-th training process.
[0136] Specifically, the specific execution process of steps (3.8) to (3.10) can refer to the specific execution process of steps (3.2) to (3.4), which will not be elaborated here.
[0137] S300: Determine the target overall model features of the water quality prediction model based on multiple target individuals.
[0138] Specifically, when the training stop condition is reached, the individuals in the current candidate population obtained in the last training process are the target individuals. Subsequently, a best individual can be determined according to the prediction indicators of the current candidate population, and the overall model features corresponding to the best individual are determined as the final overall model features of the water quality prediction model. Subsequently, the water quality prediction model can be put into use.
[0139] In the embodiments of the present application, the prediction results and prediction errors of the water quality prediction models respectively trained based on the denoising strategy and the non-denoising strategy are evaluated, and the evaluation results are as Figure 4 and Figure 5 shown. Figure 4 FIG. is a comparison schematic diagram of the water quality prediction results of the water quality prediction models respectively trained based on the denoising strategy and the conventional strategy provided by the embodiments of the present application. Figure 5 FIG. is a comparison schematic diagram of the prediction errors of the water quality prediction models respectively trained based on the denoising strategy and the conventional strategy provided by the embodiments of the present application.
[0140] In Figure 4 , when the input data input to the water quality prediction model includes noise, the prediction results corresponding to the conventional strategy (i.e., the training strategy without adopting the denoising strategy) will deviate significantly from the true value (i.e., the label). In Figure 5 , the prediction error curve corresponding to the conventional strategy shows violent fluctuations, large peak amplitudes and high error levels, while the prediction error curve corresponding to the denoising strategy achieves better fitting and significantly reduces the error curve fluctuations.
[0141] Based on Figure 4 and Figure 5 The data shown can prove the effectiveness of the denoising strategy, i.e., using DVAE, in reducing the impact of data noise, so that the prediction results can maintain the accuracy and stability of the prediction even when the input data includes noise; in addition, from the prediction result curve, the water quality prediction model trained by the training method of the water quality prediction model proposed in the embodiments of the present application can not only obtain prediction results that are very close to the true situation of the overall trend but also capture detailed changes with high precision when making predictions.
[0142] According to Figure 5 , it can be further clarified that the water quality prediction model trained based on the denoising strategy shows a smaller error range compared to the water quality prediction model trained based on the conventional strategy, and its error curve is concentrated and close to zero in most regions. The water quality prediction model trained based on the denoising strategy can maintain a high level of stability and accuracy even under noisy conditions. Although the noise interferes with the performance of the water quality prediction model to a certain extent, the water quality prediction model achieves accurate predictions for most variables, especially in trend fitting and error control, demonstrating its excellent robustness and adaptability to high-noise data.
[0143] In the embodiments of the present application, the correlation and correlation coefficients between various water quality characteristic data and water quality prediction results are evaluated, and the evaluation results are as Figure 6 and Figure 7 shown. Figure 6A comparison schematic diagram of the correlation coefficients between various water quality characteristic data and water quality prediction results provided by embodiments of the present application. Figure 7 A comparison schematic diagram of the selection frequencies between various water quality characteristic data and water quality prediction results provided by embodiments of the present application. Figure 7 The auxiliary variable in [[ ]] is water quality characteristic data.
[0144] In [[ ]] Figure 6 The results of the correlation analysis to a certain extent reflect the mechanism of the activated sludge process for sewage treatment. Figure 6 The correlation coefficient in [[ ]] reflects the linear relationship between various water quality characteristic data and water quality prediction results. However, in actual operation, there may be complex non-linear relationships between various water quality characteristic data and water quality prediction results.
[0145] In actual operation, deep learning models and meta-heuristic strategies for feature selection tend to preferentially capture these non-linear relationships rather than relying solely on linear correlations. For example, although the correlation between biomass decay and particulate products generated by nitrate and nitrite nitrogen is low, compared with some highly correlated components, it shows a significantly higher selection frequency.
[0146] According to [[ ]] Figure 6 and [[ ]] Figure 7 The results show that although strongly correlated variables usually have a higher selection frequency in evolutionary algorithms, correlation is not a decisive factor. The selection frequency of highly correlated components may be affected by information redundancy, especially when multiple strongly correlated variables coexist, prompting the training method to preferentially consider variables that provide unique information and significantly improve the performance of the water quality prediction model. In addition, the frequent selection of low-correlation components indicates that the training method proposed in the embodiments of the present application tends to comprehensively consider the non-linear relationships and complex interactions between various water quality characteristic data and water quality prediction results, as well as their global contributions to the optimization objective, rather than relying solely on linear correlations. Therefore, it more accurately reflects the comprehensive strategy of the training method to improve the robustness and generalization ability of the model.
[0147] Second, the present application provides a training device for a water quality prediction model, as shown in [[ ]] Figure 8 shown, Figure 8 A structural schematic diagram of the training device for the water quality prediction model provided by embodiments of the present application. The device includes: an alternative population module 400 and a training module 500;
[0148] The alternative population module 400 is used to construct an alternative population regarding the overall model characteristics of the water quality prediction model;
[0149] Among them, the population includes a plurality of different individuals, and the individuals represent the overall model characteristics;
[0150] A training module 500, configured to iteratively update multiple individuals in an alternative population by iteratively training a water quality prediction model until a training stop condition is reached to obtain multiple target individuals;
[0151] Wherein, the update of the alternative population is performed through a population evolution strategy and a population update model, and the iterative processes of the population evolution strategy and the population update model are carried out in coordination with the training process of the water quality prediction model. The coordination indicates using the prediction index of the water quality prediction model as the screening condition for the alternative population in the population evolution strategy and the population update model;
[0152] The training module 500 is further configured to determine the target overall model features of the water quality prediction model according to multiple target individuals.
[0153] In one implementation, each individual includes a first matrix and a second matrix;
[0154] The first matrix is a binary vector matrix for indicating the network structure of the water quality prediction model; the second matrix is a real number matrix for indicating the model parameters of the water quality prediction model.
[0155] In one implementation, the alternative population module 400 is further configured to construct multiple initial first matrices and multiple initial second matrices;
[0156] The alternative population module 400 is further configured to determine an initial alternative population including multiple initial alternative individuals according to the multiple initial first matrices and the multiple initial second matrices;
[0157] Wherein, the multiple initial alternative individuals included in the initial alternative population are used for update in the first training process of the water quality prediction model.
[0158] In one implementation, during the process of iteratively training the water quality prediction model, if t meets the first preset condition, in the t-th training process before the training stop condition is reached, the training module 500 is further configured to, based on the population evolution strategy, for the current alternative population P determined in the (t - 1)-th training process t Update it to obtain a current candidate population including multiple current candidate individuals;
[0159] The training module 500 is further configured to determine multiple candidate overall model features according to the multiple current candidate individuals;
[0160] The training module 500 is further configured to input a first training sample set into multiple current water quality prediction models corresponding one-to-one to the multiple candidate overall model features to obtain multiple groups of current prediction indexes corresponding one-to-one to the multiple current water quality prediction models;
[0161] Among them, the samples in the first training sample set include water quality characteristic data; the current prediction index indicates the prediction ability of the current water quality prediction model;
[0162] The training module 500 is further configured to update the current alternative population P according to multiple groups of current prediction indexes t to obtain the current alternative population required for use in the (t + 1)-th training process.
[0163] In one implementation, the number of individuals included in the alternative population is n, where n is a positive integer; in the process of iteratively training the water quality prediction model, if t meets the second preset condition, in the (t - 1)-th training process before the training stop condition is reached, the training module 500 is further configured to screen out N T preferred individuals from the [(t - 1)×N] individuals included in the (t - 1) current alternative populations respectively determined in the previous (t - 1) training processes to form a preferred set;
[0164] The training module 500 is further configured to use the preferred set as the second training sample set to train the population update model;
[0165] The training module 500 is further configured to update the current alternative population P determined in the (t - 1)-th training process through the trained population update model t to obtain a current candidate population including multiple current candidate individuals;
[0166] The training module 500 is further configured to determine multiple candidate overall model features according to multiple current candidate individuals;
[0167] The training module 500 is further configured to input the first training sample set into multiple current water quality prediction models that are in one-to-one correspondence with multiple candidate overall model features to obtain multiple groups of current prediction indexes that are in one-to-one correspondence with the multiple current water quality prediction models;
[0168] The training module 500 is further configured to update the current alternative population P according to multiple groups of current prediction indexes t to obtain the current alternative population required for use in the (t + 1)-th training process.
[0169] In one implementation, the number of individuals included in the alternative population is N, where N is a positive integer; the training module 500 is further configured to determine multiple groups of prediction indexes corresponding to the current alternative population P t ;
[0170] The training module 500 is further configured to tFrom the multiple groups of prediction indicators corresponding thereto and the multiple groups of current prediction indicators corresponding to the current candidate population, N groups of candidate prediction indicators are selected by non-dominated sorting;
[0171] The training module 500 is further configured to combine the individuals corresponding to the N groups of candidate prediction indicators to obtain the current alternative population required for use in the (t + 1)-th training process.
[0172] Thirdly, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of S100 - S300 provided in the above embodiments are implemented.
[0173] Fourthly, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps of S100 - S300 in the above embodiments are executed.
[0174] Fifthly, the computer program product provided by the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the foregoing method embodiments. For specific implementation, reference can be made to the steps of S100 - S300 in the method embodiments, which will not be elaborated herein.
[0175] In the embodiments provided by the present application, it should be understood that the disclosed 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 mutual coupling or direct coupling or communication connection can be through some communication interfaces. The indirect coupling or communication connection of the devices or units can be in electrical, mechanical or other forms.
[0176] In addition, 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 may be located in one place, or may be 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.
[0177] Furthermore, in each embodiment of the present application, the various functional modules can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0178] It should be noted that if a function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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 for causing a computer device (which may 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 application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0179] In this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0180] The above are only embodiments of the present application and are not used to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A training method for a water quality prediction model, characterized in that: The method comprises: construct candidate populations regarding overall model characteristics of water quality prediction models; Wherein, the population includes a plurality of different individuals, and the individuals represent the overall model characteristics; Iteratively training the water quality prediction model to iteratively update the multiple individuals in the candidate population until a training stop condition is reached to obtain multiple target individuals; Wherein, the updating of the candidate population is performed through a population evolution strategy and a population update model, the iterative process of the population evolution strategy and the population update model is coordinated with the training process of the water quality prediction model, and the coordinated execution indicates that the prediction index of the water quality prediction model is used as a screening condition for the candidate population in the population evolution strategy and the population update model; Based on the multiple target individuals, the target overall model characteristics of the water quality prediction model are determined.
2. The method according to claim 1, characterized in that Each of the individuals includes a first matrix and a second matrix; The first matrix is a binary vector matrix, used to indicate the network structure of the water quality prediction model; the second matrix is a real number matrix, used to indicate the model parameters of the water quality prediction model.
3. The method according to claim 2, characterized in that The candidate population for constructing the overall model characteristics of the water quality prediction model includes: constructing a plurality of initial first matrices and a plurality of initial second matrices; Determining an initial candidate population including a plurality of initial candidate individuals according to the plurality of initial first matrices and the plurality of initial second matrices; The multiple initial candidate individuals included in the initial candidate population are used to be updated in the first training process of the water quality prediction model.
4. The method according to claim 1, characterized in that In the process of iteratively training the water quality prediction model, if t meets the first preset condition, the t-th training process before the training stop condition is not reached includes: Based on the population evolution strategy, for the current candidate population P determined in the (t-1)th training process t Updating to obtain a current candidate population including a plurality of current candidate individuals; Determine a plurality of candidate overall model features according to the plurality of current candidate individuals; Inputting the first training sample set into a plurality of current water quality prediction models corresponding one-to-one to the plurality of candidate overall model features for model training, so as to obtain a plurality of groups of current prediction indicators corresponding one-to-one to the plurality of current water quality prediction models; Wherein, the samples in the first training sample set include water quality characteristic data; the current prediction index indicates the prediction ability of the current water quality prediction model; each group of prediction indicators includes at least two of the current prediction indicators; According to the multiple sets of current prediction indicators, for the current candidate population P t The update is performed to obtain the current candidate population required to be used in the (t+1)th training process.
5. The method according to claim 1, characterized in that The number of individuals included in the candidate population is N, where N is a positive integer; in the process of iteratively training the water quality prediction model, if t meets the second preset condition, the t-th training process before the training stop condition is reached includes: Among the [(t-1)×N] individuals included in the (t-1) current candidate populations determined in the previous (t-1) training process, N T A preferred set of preferred individuals; Using the preferred set as a second training sample set to train a population update model; The model is updated by the trained population, and the current candidate population P determined in the (t-1)th training process is t Updating to obtain a current candidate population including a plurality of current candidate individuals; Determine a plurality of candidate overall model features according to the plurality of current candidate individuals; Inputting the first training sample set into a plurality of current water quality prediction models corresponding one-to-one to the plurality of candidate overall model features for training, so as to obtain a plurality of groups of current prediction indicators corresponding one-to-one to the plurality of current water quality prediction models; Wherein, each group of the current prediction indicators includes at least two of the current prediction indicators; According to the multiple sets of current prediction indicators, for the current candidate population P t The update is performed to obtain the current candidate population required to be used in the (t+1)th training process.
6. The method according to claim 4 or 5, characterized in that: The number of individuals included in the candidate population is N, where N is a positive integer; according to the multiple groups of current prediction indicators, for the current candidate population P t Update to obtain the current candidate population required for use in the (t+1)th training process, including: Determine the current candidate population P t The corresponding multiple groups of prediction indicators; In the current candidate population P t From the corresponding multiple groups of prediction indicators and the multiple groups of current prediction indicators corresponding to the current candidate population, N groups of candidate prediction indicators are screened out by non-dominated sorting; The individuals corresponding to the N groups of candidate prediction indicators are combined to obtain the current candidate population required to be used in the (t+1)th training process.
7. A training device for a water quality prediction model, characterized in that: The device comprises: a candidate population module and a training module; The candidate population module is used to construct candidate populations for overall model characteristics of the water quality prediction model; Wherein, the population includes a plurality of different individuals, and the individuals represent the overall model characteristics; The training module is used to iteratively update the multiple individuals in the candidate population by iteratively training the water quality prediction model until a training stop condition is reached to obtain multiple target individuals; Wherein, the updating of the candidate population is performed through a population evolution strategy and a population update model, the iterative process of the population evolution strategy and the population update model is coordinated with the training process of the water quality prediction model, and the coordinated execution indicates that the prediction index of the water quality prediction model is used as a screening condition for the candidate population in the population evolution strategy and the population update model; The training module is also used to determine the target overall model characteristics of the water quality prediction model based on the multiple target individuals.
8. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory is used to store an application program, and the processor runs or executes a software program stored in the memory so that the electronic device implements the training method of the water quality prediction model as described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes executed by a processor, and the program codes are used to implement the training method of the water quality prediction model according to any one of claims 1 to 5.
10. A computer program product, characterized in that The computer program product includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device implements the training method for the water quality prediction model according to any one of claims 1 to 5.