Construction method of COD quantitative prediction model
By selecting characteristic spectral lines from the ultraviolet-visible absorption spectrum of COD standard solution and an improved vulture optimization algorithm to train the BP neural network, the problem of insufficient detection accuracy and stability in water quality analysis in the prior art is solved, and a high-precision and rapid convergence COD quantitative prediction model is achieved.
Patent Information
- Application Number
- CN202510106090.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-23
AI Technical Summary
The ultraviolet-visible absorption spectrometry used in water quality analysis in the prior art has problems with insufficient detection accuracy and stability, especially when faced with interference from complex water components and turbidity, single-wavelength or multi-wavelength models are difficult to meet the prediction needs. At the same time, BP neural network has problems such as slow convergence speed and easy to fall into local optimality in the prediction of water quality parameters.
By selecting characteristic spectral lines in the wavelength range of correlation with COD concentration from the UV-visible absorption spectrum of COD standard solution, the training data set is constructed, and the BP neural network is trained using the improved vulture optimization algorithm to improve its convergence speed and prediction accuracy.
The high accuracy and rapid convergence of the COD quantitative prediction model are achieved, which improves detection accuracy and stability, avoids local optimal solutions, and improves the generalization ability of the model.
Smart Images

Figure CN120028273A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of COD detection, and in particular to a method for constructing a COD quantitative prediction model. Background Art
[0002] Chemical oxygen demand (COD) is an important indicator for measuring the organic matter content in water, reflecting the degree of water pollution by reducing substances. Traditional COD detection methods, such as the permanganate method and the dichromate method, have a wide detection range and high accuracy, but they have problems such as long measurement cycle, high cost, and secondary pollution caused by chemical reagents.
[0003] Ultraviolet-visible spectroscopy (UV-Vis) has been widely used in water quality analysis as a rapid, pollution-free, and easy-to-analyze online detection method. At present, COD detection using ultraviolet absorption spectroscopy mostly adopts single-wavelength and multi-wavelength methods to achieve quantitative analysis based on the absorbance of COD at a specific wavelength. However, the actual water body components are complex and there is interference from turbidity. Simple single-wavelength or multi-wavelength models are difficult to meet the prediction needs. How to improve its detection accuracy and stability remains an urgent problem to be solved.
[0004] At the same time, BP (Back Propagation, BP) neural network is widely used in water quality parameter prediction due to its powerful nonlinear modeling ability. However, BP neural network has shortcomings such as slow convergence speed and easy to fall into local optimum, which limits its application effect. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide a method for constructing a COD quantitative prediction model, by selecting characteristic spectral lines in a wavelength range that is correlated with the COD concentration from the ultraviolet-visible absorption spectrum of the COD standard solution to construct a training data set, and using the Sky Eagle optimization algorithm, dynamic opponent learning strategy and fitness-distance balance strategy to improve the Vulture optimization algorithm, and then train the BP neural network to obtain a COD quantitative prediction model with fast convergence speed and high prediction accuracy.
[0006] The present application provides a method for constructing a COD quantitative prediction model, the method comprising:
[0007] S1. Collect UV-visible absorption spectra of COD standard solution and turbidity standard solution respectively;
[0008] S2, selecting characteristic spectral lines within a wavelength range that are correlated with COD concentration from the UV-visible absorption spectrum of the COD standard solution, and performing turbidity compensation using the UV-visible absorption spectrum of the turbidity standard solution to obtain a training data set;
[0009] S3. Using the training data set and an improved vulture optimization algorithm, the BP neural network is trained to obtain a COD quantitative prediction model.
[0010] Further, the COD standard solution and the turbidity standard solution are prepared by the following method:
[0011] Using deionized water, according to the standard solution dilution method, a potassium hydrogen phthalate standard solution with a COD concentration of 100 mg / L and a formazine standard solution with a turbidity of 400 NTU are respectively diluted in a gradient manner to obtain a COD standard solution with a COD concentration gradient distribution and a turbidity standard solution with a turbidity gradient distribution;
[0012] Wherein, the concentration of the potassium hydrogen phthalate standard solution is 0.08502 mg / mL.
[0013] Further, the COD concentration gradient distribution of the COD standard solution is as follows: within the concentration range of 1-40 mg / L, at intervals of 1 mg / L, a total of 40 groups of COD standard solutions are prepared;
[0014] The turbidity gradient distribution of the turbidity standard solution is: within the range of 1-100 NTU, at an interval of 5 NTU, and a total of 21 groups of turbidity standard solutions are prepared.
[0015] Furthermore, the training data set is obtained by:
[0016] The absorption spectrum data of 265nm and 275nm wavelength points are selected from the UV-visible absorption spectrum of the COD standard solution as characteristic spectrum lines within the wavelength range that are correlated with the COD concentration;
[0017] The absorption spectrum data of the turbidity standard solution at a wavelength of 550 nm was used to perform turbidity compensation to obtain a training data set.
[0018] Furthermore, the improved vulture optimization algorithm is used to train the BP neural network, including:
[0019] S3a, initialize the structure and parameters of the BP neural network;
[0020] S3b, initializing the population size and maximum number of iterations of the vulture optimization algorithm, and mapping the initial parameters of the BP neural network to the initial solution of the vulture optimization algorithm;
[0021] S3c, using the dynamic adversarial learning strategy, by comparing the fitness values of the current solution and the opposite solution of the current solution, retaining the solution with a higher fitness value as a candidate solution to update the position of each individual;
[0022] S3d, for each updated individual, using the training data set, calculating the fitness value of each individual in the current population, and selecting the current optimal individual as the current solution;
[0023] Repeat steps S3c-S3d until the maximum number of iterations is reached to output a global optimal solution, and map the global optimal solution back to the parameters of the BP neural network.
[0024] Furthermore, the position of each individual is updated by the following method:
[0025] Calculate the satiety rate of each individual in the current population;
[0026] When the individual's satiety rate is greater than or equal to 1, the candidate solution is used as a reference to update the individual's position using the exploration strategy of the Sky Eagle optimization algorithm;
[0027] When the satiety rate of an individual is less than 1, the current optimal individual is used as a reference and the development strategy of the vulture optimization algorithm is used to update the individual position.
[0028] Furthermore, the exploration strategy of the Sky Eagle optimization algorithm is used to update the individual position, including:
[0029] When the random number rand is between (0, 0.5], the candidate solution is used as a reference to update the individual position using the extended exploration strategy of the Sky Eagle optimization algorithm;
[0030] When the random number rand is between (0.5, 1), all candidate solutions are obtained, and each candidate solution is scored using the fitness-distance balance strategy to select the candidate solution with the highest score. The selected candidate solution is then used as a reference to update the individual position using the shrinking exploration strategy of the Sky Eagle optimization algorithm.
[0031] Furthermore, the fitness-distance balance strategy is used to score each candidate solution, including:
[0032] For each candidate solution, calculate the Euclidean distance between the candidate solution and the current optimal solution to obtain the distance value of the candidate solution;
[0033] The fitness value of the candidate solution is obtained, and based on the distance value and the fitness value of the candidate solution, a fitness-distance balance score of the candidate solution is obtained.
[0034] Further, the development strategy of the vulture optimization algorithm is used to update the individual position, including:
[0035] When the satiety rate of the individual is between [0.5, 1), the first development parameter is obtained, and a rotation flight strategy or a siege strategy targeting the optimal individual and the suboptimal individual is determined to update the individual position;
[0036] When the satiety rate of the individual is less than 0.5, a second development parameter is obtained, and a competition strategy based on the optimal individual and the suboptimal individual is determined, or a Levy flight strategy with the optimal individual and the suboptimal individual as targets is determined to update the individual position;
[0037] The values of the first development parameter and the second development parameter are both between [0, 1].
[0038] The method for constructing a COD quantitative prediction model provided in the present application is, first, by selecting characteristic spectral lines within a wavelength range that are correlated with COD concentration from the UV-visible absorption spectrum of the COD standard solution, and using a turbidity standard solution for turbidity compensation, to construct a training data set; secondly, the vulture optimization algorithm is improved using the Sky Eagle optimization algorithm, the dynamic adversarial learning strategy, and the fitness-distance balance strategy, which significantly improve the convergence speed and robustness of the algorithm and the quality of the solution; finally, the BP neural network is trained to obtain a COD quantitative prediction model with fast convergence speed and high prediction accuracy. Using the improved vulture optimization algorithm to optimize the BP neural network can improve the prediction accuracy and training efficiency of the network, avoid local optimal solutions, and improve generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flowchart of a method for constructing a COD quantitative prediction model provided in an embodiment of the present application is shown;
[0040] Figure 2 The absorption spectrum of the COD standard solution provided in the embodiment of the present application in the 210-310nm band is shown;
[0041] Figure 3 The normalized curve diagram of the absorption spectrum of the COD standard solution provided in the embodiment of the present application in the 210-310nm band is shown;
[0042] Figure 4 The absorption spectrum of the turbidity standard solution provided in the embodiment of the present application in the 200-800nm band is shown;
[0043] Figure 5 The normalized curve diagram of the absorption spectrum of the turbidity standard solution provided in the embodiment of the present application in the 200-800nm band is shown. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the technical solution more clear, the technical solution is further described in detail below in conjunction with specific implementation methods. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the technical solution.
[0045] Please refer to Figure 1 The flowchart of the method for constructing the COD quantitative prediction model proposed in the embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0046] S101, collecting UV-visible absorption spectra of COD standard solution and turbidity standard solution respectively.
[0047] S102, selecting characteristic spectral lines within a wavelength range that are correlated with COD concentration from the UV-visible absorption spectrum of the COD standard solution, and performing turbidity compensation using the UV-visible absorption spectrum of the turbidity standard solution to obtain a training data set.
[0048] S103, using the training data set and an improved vulture optimization algorithm to train the BP neural network to obtain a COD quantitative prediction model.
[0049] Next, the above technical solution is described in detail through specific embodiments.
[0050] Example 1: Collecting UV-Visible Absorption Spectra of COD Standard Solution and Turbidity Standard Solution
[0051] First, the COD standard solution and the turbidity standard solution were prepared by the following method:
[0052] Deionized water is used to dilute a potassium hydrogen phthalate standard solution with a COD concentration of 100 mg / L and a formazine standard solution with a turbidity of 400 NTU in a gradient manner according to a standard solution dilution method to obtain a COD standard solution with a COD concentration gradient distribution and a turbidity standard solution with a turbidity gradient distribution; wherein the concentration of the potassium hydrogen phthalate standard solution is 0.08502 mg / mL; the COD concentration gradient distribution of the COD standard solution is: within a concentration range of 1-40 mg / L, at an interval of 1 mg / L, a total of 40 groups of COD standard solutions are prepared; the turbidity gradient distribution of the turbidity standard solution is: within a range of 1-100 NTU, at an interval of 5 NTU, a total of 21 groups of turbidity standard solutions are prepared.
[0053] Secondly, set up the experimental instruments and parameters:
[0054] The embodiment of the present application uses a UV-3600Plus shimadzu spectrometer, a UV-visible near-infrared spectrophotometer, to collect UV-visible absorption spectra. The built-in light sources of the spectrometer are a deuterium lamp and a tungsten lamp, wherein the deuterium lamp is used as an ultraviolet light source to provide a continuous spectral band in the wavelength range of 190-400nm, and the tungsten lamp is used as a visible light source to provide a continuous spectral band in the wavelength range of 400-780nm. Furthermore, the detection wavelength range is set to 200-700nm, the scanning step is set to 1nm, and deionized water is used as a background control solution. In addition, the embodiment of the present application uses a quartz glass cuvette with a UV transmittance greater than or equal to 85% and a thickness of 10mm as a sample pool for the solution.
[0055] Again, set up the experimental environment: a dark room with a temperature of 20 ± 0.5 °C and a humidity of 35 ± 5%.
[0056] Finally, the UV-visible absorption spectra of the COD standard solution and the turbidity standard solution were collected respectively.
[0057] Here, in order to avoid the randomness of the collection results, the embodiment of the present application collects each solution 5 times, and the average spectrum of the UV-visible absorption spectra collected 5 times is used as the UV-visible absorption spectrum of the COD standard solution and the turbidity standard solution.
[0058] Example 2: Analysis of spectral characteristics of COD standard solution
[0059] By analyzing the UV-visible spectrum of the COD standard solution, it can be seen that in the 310-700nm visible light band, the absorbance of the COD standard solution is close to 0, and in the 210-310nm ultraviolet band, the COD standard solution has absorption. Therefore, the embodiment of the present application intercepts this band and obtains the following Figure 2 The absorption spectrum of COD standard solution in the 210-310nm band is shown in FIG. Figure 2 As shown, the COD standard solution mainly absorbs in two bands: 220-240nm band. The absorption peak in this band is mainly due to the absorption of benzene rings or other conjugated double bonds in organic matter; 260-290nm band. The absorption peak in this band is mainly caused by aromatic compounds and other substances containing conjugated structures in organic compounds.
[0060] Further, for Figure 2 The absorption spectrum of the COD standard solution in the 210-310nm band is normalized to obtain Figure 3 The normalized curve of the absorption spectrum of the COD standard solution in the 210-310nm band is shown. Figure 3As shown, the COD standard solution has obvious absorption characteristics in the 245-275nm band. The spectral lines in this band are smooth and free of burrs and miscellaneous peaks, and no oversaturation phenomenon is observed. Therefore, the following conclusion can be drawn: in the 245-275nm band, the concentration of the COD standard solution is correlated with the absorbance of the COD standard solution.
[0061] Based on the above analysis, the embodiment of the present application selects the ultraviolet absorption spectrum data of 7 key wavelength points (245nm, 250nm, 255nm, 260nm, 265nm, 270nm, 275nm) in the 245-275nm band, and uses the least squares method and the single wavelength modeling method to construct the model of the ultraviolet absorbance of each wavelength and the concentration of the COD standard solution, and introduces the correlation coefficient r and the determination coefficient R 2 As the core evaluation index, the fitting effect of a single wavelength is evaluated. Here, please refer to the fitting effect of a single wavelength of each wavelength model as shown in Table 1.
[0062] Table 1. Single wavelength fitting effect of each wavelength model
[0063]
[0064]
[0065] It can be seen from Table 1 that the fitting effect of the model with wavelength points of 245nm, 250nm and 275nm is better.
[0066] In order to further improve the accuracy of the model, the multi-wavelength modeling method was adopted to construct a multi-wavelength model using three wavelength points (245nm, 250nm, and 275nm) with better fitting effects, and the linear relationship between the ultraviolet absorbance and the concentration of the COD standard solution was obtained as shown in the following formula (1):
[0067] Y=0.62173+16.8235X 1 +26.8817X 2 +52.0833X 3 ; (1)
[0068] Where Y is the predicted COD concentration, X is 1 , X 2 , X 3 They are the absorbance of COD standard solution at wavelengths of 245nm, 250nm, and 275nm respectively.
[0069] In order to further optimize the model, all the UV absorption spectrum data were processed using partial least squares method, and outliers that did not conform to statistical laws were removed. Finally, it was found that combining the data of the two wavelengths of 265nm and 275nm could obtain the best fitting effect, and the new fitting formula was obtained as follows:
[0070] Y=1.151-177.86X 4 +302.1647X 3 ; (2)
[0071] In the formula, X 4 It is the absorbance of COD standard solution at a wavelength of 265nm.
[0072] In addition, in order to verify the performance of the model, the correlation coefficient r and determination coefficient R of the multi-wavelength model constructed with three wavelength points (245nm, 250nm, and 275nm) and the multi-wavelength model constructed with two wavelength points (265nm and 275nm) were calculated respectively. 2 As the core evaluation index, the fitting effect of multi-wavelength is evaluated. Here, please refer to the fitting effect of the multi-wavelength model shown in Table 2.
[0073] Table 2. Fitting effect of multi-wavelength model
[0074]
[0075]
[0076] It can be seen from Table 2 that the multi-wavelength model constructed with two wavelength points (265nm and 275nm) has a better fitting effect and higher model accuracy.
[0077] Therefore, the embodiment of the present application determines the absorption spectrum data at wavelengths of 265 nm and 275 nm as characteristic spectral lines within a wavelength range that is correlated with COD concentration.
[0078] Example 3: Analysis of spectral characteristics of turbidity standard solution
[0079] Please refer to Figure 4 The absorption spectrum of the turbidity standard solution in the 200-800nm band is shown in FIG. Figure 4 As shown in Figure 2, the turbidity standard solution absorbs not only the ultraviolet light, but also the visible light. Figure 4 The absorption spectrum of the turbidity standard solution in the 200-800nm band is normalized to obtain the following Figure 5 The normalized curve of the absorption spectrum of the turbidity standard solution in the 200-800nm band is shown. Figure 5As shown in the figure, in the 400-800nm band, the turbidity standard solution exhibits a high degree of overlap. In general, it is recommended to use white light in the 400-680nm band for turbidity measurement, because this band, especially the green light region between 495-570nm, has excellent light scattering properties, which can achieve high-sensitivity detection in the turbidity measurement system.
[0080] Therefore, the embodiment of the present application selects the absorption spectrum data of the 550nm wavelength point located in the center of the green light region as the turbidity compensation data.
[0081] Based on the analysis of the above embodiments 2 and 3, the specific implementation of step S102 is as follows:
[0082] The absorption spectrum data at 265nm and 275nm wavelength points were selected from the UV-visible absorption spectrum of the COD standard solution as characteristic spectral lines within the wavelength range that are correlated with the COD concentration, and the absorption spectrum data at 550nm wavelength point of the turbidity standard solution was used for turbidity compensation to obtain a training data set.
[0083] Example 4: Constructing a COD quantitative prediction model
[0084] The African Vultures Optimization Algorithm (AVOA) is a metaheuristic algorithm proposed in 2021 that simulates the complex foraging mechanism of African vultures in nature. In the natural environment, vultures frequently migrate long distances to explore more abundant food resources. The vulture optimization algorithm has good development capabilities, but the exploration mechanism is not perfect enough. Considering that the exploration mechanism of the Eagle Optimization Algorithm has powerful global search capabilities and search characteristics, therefore, the embodiment of the present application takes the vulture optimization algorithm as the core framework, and uses the exploration strategy of the Eagle Optimization Algorithm to replace the original vulture optimization algorithm's exploration strategy to improve the first part of the vulture optimization algorithm.
[0085] The second improvement to the vulture optimization algorithm is to introduce a dynamic adversarial learning strategy during the iteration process, simultaneously evaluate the fitness values of the current solution and its opposing solutions, and then retain the suitable solutions as candidate solutions to participate in subsequent iterative calculations.
[0086] The third improvement to the vulture optimization algorithm is to introduce a fitness-distance balance strategy in the search strategy. Based on the fitness value of the candidate solution and the distance value between the candidate solution and the current optimal solution, the candidate solution is scored and the appropriate candidate solution is selected to guide the subsequent search direction.
[0087] By improving the original vulture optimization algorithm in the above three parts, and then using the improved vulture optimization algorithm to train the BP neural network, a COD quantitative prediction model is obtained.
[0088] In the specific implementation, the BP neural network is trained using the improved vulture optimization algorithm in the following way:
[0089] Step 201: Initialize the structure and parameters of the BP neural network.
[0090] Step 202: Initialize the population size and maximum number of iterations of the vulture optimization algorithm, and map the initial parameters of the BP neural network to the initial solution of the vulture optimization algorithm.
[0091] Step 203: using a dynamic adversarial learning strategy, by comparing the fitness values of the current solution and the opposite solution of the current solution, retaining the solution with a higher fitness value as a candidate solution, so as to update the position of each individual;
[0092] Before comparing the fitness values of the current solution and the opposite solution of the current solution, the opposite solution of the current solution is generated by the following formula (1):
[0093]
[0094] Where, X i is the i-th current solution in the population, is the X generated by DOL i The opposite solution, r 8 and q represent random numbers generated in the interval [0,1], ub and lb are the upper and lower bounds of the search space, t represents the current number of iterations, and T represents the maximum number of iterations of the algorithm.
[0095] Here, the embodiment of the present application introduces a time factor tf to add dynamic changes to the calculation of the opposite point, making the generation process of the opposite solution more flexible and adaptable, and effectively improving the ability of the algorithm to avoid falling into the local optimum.
[0096] In the specific implementation, the location of each individual is updated through the following steps:
[0097] Step 2031, calculate the satiety rate of each individual in the current population.
[0098] In this step, the satiety rate F of each individual is calculated by the following formula (2):
[0099]
[0100] In the formula, I i represents the current iteration number, M represents the maximum iteration number, h is a random number between [-2,2], r1 is a random number between [0,1], and z is a random number between [-1,1].
[0101] When z < 0, it means that the individual is in a hungry state, and when z > 0, it means that the individual is full; further, when |F| ≥ 1, the population is in the exploration stage, and when |F| < 1, the population is in the development stage.
[0102] Step 2032: When the satiety rate of the individual is greater than or equal to 1, the candidate solution is used as a reference to update the individual position using the exploration strategy of the Sky Eagle optimization algorithm.
[0103] In the specific implementation, the exploration strategy of the Eagle optimization algorithm is used to update the individual position through the following steps:
[0104] Step 301: When the random number rand is between (0, 0.5], the candidate solution is used as a reference to update the individual position using the extended exploration strategy of the Sky Eagle optimization algorithm.
[0105] In this step, the individual position is updated by the following formula (3):
[0106]
[0107] Where, X 1 (t+1) is the solution of the t+1th iteration generated by the extended exploration strategy; X best (t) is the current solution obtained before the tth iteration; t and T are the current iteration number and the maximum iteration number; X M (t) the average value of the current solution at the tth iteration; r 6 is a random number between [0,1];
[0108] Among them, X is obtained by the following formula (4): M (t):
[0109]
[0110] In the formula, N is the number of groups.
[0111] The above formulas (3) and (4) describe the behavior of the eagle identifying prey areas and selecting the best hunting area by flying high with a vertical bend.
[0112] Step 302: When the random number rand is between (0.5, 1), all candidate solutions are obtained, and each candidate solution is scored using the fitness-distance balance strategy to select the candidate solution with the highest score. The selected candidate solution is then used as a reference to update the individual position using the shrinking exploration strategy of the Sky Eagle optimization algorithm.
[0113] In this step, the individual position is updated by the following formula (5):
[0114] X 2 (t+1)=X best (t)×Levy(D)+X R (t)+(yx)×r 7 ; (5)
[0115] Where, X 2 (t+1) is the solution of the t+1th iteration generated by the shrinking exploration strategy; Levy (D) represents the Levy flight operation; X R (t) is the candidate solution obtained in the range [1, N] at the tth iteration; x and y represent the spiral shape of the contour during the search process; r 7 is a random number between [0,1];
[0116] Where x and y are obtained by the following formula (6):
[0117]
[0118] Where r is a value between 1 and 20, which is used to fix the number of search cycles; U is a value fixed at 0.00565; D 1 is an integer from 1 to the dimension of the search space; ω is fixed to 0.005.
[0119] The above formulas (5) and (6) describe the behavior of the eagle when it discovers the prey area from high altitude, hovers above the target prey, and prepares to attack after landing.
[0120] In addition, in metaheuristic algorithms, the selection mechanism is crucial. It aims to select guiding individuals from the current population to guide the subsequent search direction and build a balance between exploring the unknown solution space and developing known optimal solutions.
[0121] Therefore, before updating the individual position, it also includes: using the fitness-distance balance strategy to score each candidate solution to select the candidate solution with the highest score. Specifically, the fitness-distance balance strategy is used to score each candidate solution through the following steps:
[0122] Step 3021: For each candidate solution, calculate the Euclidean distance between the candidate solution and the current optimal solution to obtain the distance value of the candidate solution.
[0123] In this step, the Euclidean distance between the candidate solution and the current optimal solution is calculated by the following formula (7):
[0124]
[0125] Where D is the dimension, N is the total number of candidate solutions in the population, and the i-th candidate solution is defined as
[0126] Furthermore, the distance value of the candidate solution is obtained by the following formula (8):
[0127]
[0128] Step 3022: Obtain the fitness value of the candidate solution, and obtain the fitness-distance balance score of the candidate solution based on the distance value and the fitness value of the candidate solution.
[0129] In this step, the distance value and fitness value of the candidate solution are first normalized, and then the fitness-distance balance score is calculated based on the normalized distance value and fitness value of the candidate solution by the following formula (9):
[0130]
[0131] Where γ is a constant equal to 0.5, normF Xi Represents the normalized fitness value of the candidate solution, normD Xi Represents the normalized distance value of the candidate solution.
[0132] Step 2033: When the satiety rate of the individual is less than 1, the current optimal individual is used as a reference and the development strategy of the vulture optimization algorithm is used to update the individual position.
[0133] In specific implementation, the individual positions are updated using the development strategy of the vulture optimization algorithm through the following steps:
[0134] Step 401: When the satiety rate of an individual is between [0.5, 1), a first development parameter is obtained, and a rotation flight strategy or a siege strategy targeting the optimal individual and the suboptimal individual is determined to update the individual position.
[0135] Among them, the value of the first development parameter is between [0, 1].
[0136] In this step, when 0.5≤|F|<1, the individual is relatively full and energetic, and has two strategies: rotation flight and siege. The first development parameter P is used. 2 Make a selection. When the random number r P2 ≤P 2 When the random number r is generated, the siege strategy is implemented, that is, the weaker individuals obtain food by besieging the stronger individuals; P2 >P 2 When , the rotation flight strategy is executed, that is, the individual rotates in the air, similar to spiral motion. Specifically, the individual position is updated by the following formula (10):
[0137]
[0138] Wherein, P(i + 1) is the individual position vector in the next iteration, and r P2 , r 4 , r 5 are all random numbers between [0, 1], F is the satiation rate of the vultures in the current iteration, d(t) represents the distance between the i-th individual and the current optimal individual, and R(i) represents the position vector of one of the optimal individual and the sub-optimal individual in the current iteration.
[0139] Step 402: When the satiation rate of the individual is less than 0.5, obtain the second exploitation parameter, and determine the competition strategy based on the optimal individual and the sub-optimal individual, or the Levy flight strategy targeting the optimal individual and the sub-optimal individual, so as to update the individual position.
[0140] Among them, the value of the second exploitation parameter is between [0, 1].
[0141] In this step, when |F| < 0.5, the individuals gather at the food source and there is a fierce scramble. At this time, almost all individuals in the population are already full, but after a long time of consumption, the optimal individual and the sub-optimal individual will feel hungry again. When the generated random number r P3 ≤ P 3 , the competition strategy is executed, that is, due to the consumption of a large amount of food, there is a phenomenon where multiple individuals gather at a single food resource and compete with each other; when the generated random number r P3 > P 3 , the Levy flight strategy is executed, that is, when looking for the remaining small amount of food, other individuals will become vicious and move in all directions of the optimal individual and the sub-optimal individual. Specifically, the individual position is updated through the following formula (11):
[0142]
[0143] Wherein, Levy(D) represents the Levy flight operation, Best 1 (i) represents the optimal individual, and Best 2 (i) represents the sub-optimal individual.
[0144] In addition, the optimal individual and the sub-optimal individual are obtained in the following way:
[0145] After the current population is formed, calculate the fitness values of all individuals, and select the optimal individual and the sub-optimal individual according to the fitness values.
[0146] Step 204: For each updated individual, use the training data set to calculate the fitness value of each individual in the current population, and select the current optimal individual as the current solution.
[0147] Repeat steps 203-204 until the maximum number of iterations is reached, and then execute step 205 to output a global optimal solution, and map the global optimal solution back to the parameters of the BP neural network.
[0148] The above contents are only preferred embodiments of the present invention. For ordinary technicians in this field, many changes can be made in the specific implementation methods and application scopes based on the ideas of the present technical content. As long as these changes do not deviate from the concept of the present invention, they all fall within the scope of protection of this patent.
Claims
1. A method for constructing a COD quantitative prediction model, characterized in that: The method comprises: S1. Collect UV-visible absorption spectra of COD standard solution and turbidity standard solution respectively; S2, selecting characteristic spectral lines within a wavelength range that are correlated with COD concentration from the UV-visible absorption spectrum of the COD standard solution, and performing turbidity compensation using the UV-visible absorption spectrum of the turbidity standard solution to obtain a training data set; S3. Using the training data set and an improved vulture optimization algorithm, the BP neural network is trained to obtain a COD quantitative prediction model.
2. The method according to claim 1, characterized in that The COD standard solution and turbidity standard solution were prepared by the following method: Using deionized water, according to the standard solution dilution method, a potassium hydrogen phthalate standard solution with a COD concentration of 100 mg / L and a formazine standard solution with a turbidity of 400 NTU are respectively diluted in a gradient manner to obtain a COD standard solution with a COD concentration gradient distribution and a turbidity standard solution with a turbidity gradient distribution; Wherein, the concentration of the potassium hydrogen phthalate standard solution is 0.08502 mg / mL.
3. The method according to claim 2, characterized in that The COD concentration gradient distribution of the COD standard solution is as follows: within the concentration range of 1-40 mg / L, at intervals of 1 mg / L, a total of 40 groups of COD standard solutions are prepared; The turbidity gradient distribution of the turbidity standard solution is: within the range of 1-100 NTU, at an interval of 5 NTU, and a total of 21 groups of turbidity standard solutions are prepared.
4. The method according to claim 1, characterized in that The training data set is obtained by: The absorption spectrum data of 265nm and 275nm wavelength points are selected from the UV-visible absorption spectrum of the COD standard solution as characteristic spectrum lines within the wavelength range that are correlated with the COD concentration; The absorption spectrum data of the turbidity standard solution at a wavelength of 550 nm was used to perform turbidity compensation to obtain a training data set.
5. The method according to claim 1, characterized in that The improved vulture optimization algorithm is used to train the BP neural network, including: S3a, initialize the structure and parameters of the BP neural network; S3b, initializing the population size and maximum number of iterations of the vulture optimization algorithm, and mapping the initial parameters of the BP neural network to the initial solution of the vulture optimization algorithm; S3c, using the dynamic adversarial learning strategy, by comparing the fitness values of the current solution and the opposite solution of the current solution, retaining the solution with a higher fitness value as a candidate solution to update the position of each individual; S3d, for each updated individual, using the training data set, calculating the fitness value of each individual in the current population, and selecting the current optimal individual as the current solution; Repeat steps S3c-S3d until the maximum number of iterations is reached to output a global optimal solution, and map the global optimal solution back to the parameters of the BP neural network.
6. The method according to claim 5, characterized in that Update the position of each individual by: Calculate the satiety rate of each individual in the current population; When the individual's satiety rate is greater than or equal to 1, the candidate solution is used as a reference to update the individual's position using the exploration strategy of the Sky Eagle optimization algorithm; When the satiety rate of an individual is less than 1, the current optimal individual is used as a reference and the development strategy of the vulture optimization algorithm is used to update the individual position.
7. The method according to claim 6, characterized in that The exploration strategy using the Skyhawk optimization algorithm to update individual positions includes: When the random number rand is between (0, 0.5], the candidate solution is used as a reference to update the individual position using the extended exploration strategy of the Sky Eagle optimization algorithm; When the random number rand is between (0.5, 1), all candidate solutions are obtained, and each candidate solution is scored using the fitness-distance balance strategy to select the candidate solution with the highest score. The selected candidate solution is then used as a reference to update the individual position using the shrinking exploration strategy of the Sky Eagle optimization algorithm.
8. The method according to claim 7, characterized in that The method of scoring each candidate solution using the fitness-distance balance strategy includes: For each candidate solution, calculate the Euclidean distance between the candidate solution and the current optimal solution to obtain the distance value of the candidate solution; The fitness value of the candidate solution is obtained, and based on the distance value and the fitness value of the candidate solution, a fitness-distance balance score of the candidate solution is obtained.
9. The method according to claim 6, characterized in that The development strategy of the vulture optimization algorithm is used to update individual positions, including: When the satiety rate of the individual is between [0.5, 1), the first development parameter is obtained, and a rotation flight strategy or a siege strategy targeting the optimal individual and the suboptimal individual is determined to update the individual position; When the satiety rate of the individual is less than 0.5, a second development parameter is obtained, and a competition strategy based on the optimal individual and the suboptimal individual is determined, or a Levy flight strategy with the optimal individual and the suboptimal individual as the target is determined to update the individual position; The values of the first development parameter and the second development parameter are both between [0, 1].