Enhanced genetic algorithm spectrum matching method, device, equipment and storage medium

By introducing the fitness function of Euclidean distance and angle into spectral matching, and improving the selection and mutation strategy of the genetic algorithm, the problems of large calculation amount and low accuracy in the traditional spectral matching method are solved, and a more efficient Spectral matching effect.

CN114416768BActive Publication Date: 2024-09-24CENT SOUTH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210065522.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2024-09-24
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

In the traditional spectral matching method, the iterative optimization algorithm has a large amount of calculation and low accuracy, and the traditional genetic algorithm has poor local search ability and is easy to fall into local optimality, resulting in poor matching results.

Method used

An enhanced genetic algorithm is proposed. By constructing a matching mathematical model and spectral database, Euclidean distance and angle are used to establish a fitness function, and through improved selection, crossover and mutation strategies, the algorithm's local search capability and search capabilities are improved. Excellent ability.

Benefits of technology

The accuracy of the spectral matching results and the operating efficiency of the algorithm are improved, the calculation time is reduced, and the ability to evaluate the quality of the matching results is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416768B
    Figure CN114416768B
Patent Text Reader

Abstract

The present invention provides a spectrum matching method, device, equipment and storage medium of an enhanced genetic algorithm, the method comprising: constructing a matching mathematical model and a matching spectrum database; wherein the spectrum database consists of n m-dimensional discretized spectrum vectors l n (λ) is composed of, and the matching mathematical model is expressed as #imgabs0#k n is the matching coefficient, L(λ) is the matching spectrum vector; obtain the target spectrum vector; establish a fitness function based on the Euclidean distance and angle between the target spectrum vector and the matching spectrum vector; input the matching spectrum database, the target spectrum vector and the fitness function into the genetic algorithm according to the matching mathematical model, optimize and solve the matching coefficient through the genetic algorithm to output the optimal matching coefficient matrix and matching result. Compared with the prior art, this embodiment has better local search capability, can improve the optimization capability, improve the accuracy of matching results, and reduce the running time of the algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a spectrum matching method, device, equipment and storage medium of an enhanced genetic algorithm. Background Art

[0002] Electromagnetic spectrum matching algorithms and related circuits and systems are widely used in radio communications. Electromagnetic spectrum matching refers to the generation of electromagnetic spectrum signals similar to the target electromagnetic spectrum through detection-feedback-calibration and other links based on the electromagnetic spectrum characteristics of electromagnetic devices and their circuits. For electromagnetic waves of different wavelengths, due to the great differences in physical mechanisms, the application occasions of related electromagnetic waves are also very different. For example, the 1064nm band is the missile guidance band, and the 1550nm band is the communication wavelength. For these different electromagnetic wave application scenarios, achieving full-band spectrum matching also has different meanings: for the visible light band, the electromagnetic spectrum matching method can be used to match the solar spectrum for healthy lighting and plant growth; in the field of military applications, the key to achieving stealth in different bands is to try to eliminate the spectral difference between the target and the background; at the same time, spectrum matching technology is an important prerequisite for achieving spectral adaptive regulation.

[0003] For spectral matching methods, it is crucial to improve the accuracy of matching results. Traditionally, the spectral matching problem is reduced to a nonlinear least squares problem. The most commonly used iterative optimization algorithms to solve such problems are Newton method, Gauss-Newton method and LM (Levenberg-Marquardt) method. Such iterative methods are complicated, computationally intensive and inaccurate. Therefore, we use a more intelligent, flexible and accurate genetic optimization algorithm.

[0004] Genetic algorithm is one of the more classic and widely used optimization algorithms, mainly because it has global optimization capabilities and is suitable for the field of spectral matching technology. However, traditional genetic algorithms have poor local search capabilities. For multi-dimensional optimization problems, their selection, mutation, and crossover strategies are simple, with fixed probabilities, and their crossover and mutation capabilities are limited, resulting in poor local search capabilities, poor population diversity, and easy to fall into local optimality, resulting in poor matching results. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the present invention provides a spectrum matching method, device, equipment and storage medium of an enhanced genetic algorithm to improve the above problems.

[0006] The present invention is achieved in that:

[0007] A spectrum matching method of an enhanced genetic algorithm, comprising:

[0008] Construct a matching mathematical model and a matching spectral database, and obtain a target spectral vector; wherein the spectral database consists of n m-dimensional discretized spectral vectors l n (λ) is composed, and the matching mathematical model is expressed as k n is the matching coefficient, L(λ) is the matching spectrum vector;

[0009] The fitness function is established based on the Euclidean distance and angle between the target spectrum vector and the matching spectrum vector;

[0010] According to the matching mathematical model, the matching spectrum database, the target spectrum vector and the fitness function are input into the genetic algorithm, and the matching coefficient is optimized and solved by the genetic algorithm;

[0011] Output the optimal matching coefficient matrix and matching results.

[0012] Preferably, the relationship between the Euclidean distance D between the target spectrum vector Y and the matching spectrum vector L is:

[0013]

[0014] The relationship between the cosine value of the angle between the target spectrum vector and the matching spectrum vector is:

[0015]

[0016] The formula of fitness function Fitness is:

[0017]

[0018] Preferably, the algorithm parameters of the genetic algorithm include encoding length, population size, number of iterations, selection roulette, crossover probability, and mutation probability; then the matching coefficient is optimized and solved by the genetic algorithm, specifically including:

[0019] Set genetic algorithm parameters;

[0020] Initialize the population and calculate the population fitness value according to the fitness function;

[0021] Determine whether the number of iterations is greater than the preset value;

[0022] If so, output the optimal matching coefficient matrix and matching results;

[0023] If not, population selection is performed according to the selection roulette method;

[0024] Crossover is performed according to the set crossover probability;

[0025] Calculate the fitness values ​​of the offspring and the parent generation, and form a new offspring by removing duplicates and sorting;

[0026] mutating the new offspring according to the mutation probability;

[0027] Calculate the fitness values ​​of the offspring and the parent generation, and form a new population by removing duplicates and sorting to participate in the next iteration.

[0028] Preferably, when performing population selection in a roulette wheel manner, a cosine function is used to transform the individual fitness values ​​of the selection operation, as follows:

[0029]

[0030] After the transformation, the probability of an individual being selected changes, as shown below:

[0031]

[0032] Where T is the total number of iterations, t is the current number of iterations, Fit' represents the individual fitness value after transformation, Fit is the original fitness value, Fitavg is the average fitness value of the population, and Ps represents the probability of an individual with a fitness value of Fit' being selected.

[0033] Preferably, the crossover probability Pc during the crossover operation and the mutation probability Pm during the mutation operation are expressed as follows:

[0034]

[0035]

[0036] Where a, b, c are adaptive control parameters.

[0037] Preferably, the coding segments to which each coefficient belongs are distinguished during crossover and mutation operations, and the probability of crossover and mutation of the coefficients corresponding to each coding segment are operated independently to achieve multi-dimensional individual mutation, enhance the local search capability of each coefficient, and improve the optimization capability.

[0038] Preferably, it also includes:

[0039] The matching results are uniformly evaluated to judge the quality of the matching results; the evaluation parameters used in the evaluation refer to the correlation index between the matching spectrum vector and the target spectrum vector, and the formula is as follows:

[0040]

[0041] Where y is the target spectrum vector, L is the matching spectrum vector, is the expected value of y; the correlation index R 2≤1. The closer it is to 1, the better the matching effect.

[0042] The embodiment of the present invention further provides a spectrum matching device of an enhanced genetic algorithm, which comprises:

[0043] A model building unit is used to build a matching mathematical model and a matching spectral database and obtain a target spectral vector; wherein the spectral database consists of n m-dimensional discretized spectral vectors l n (λ) is composed, and the matching mathematical model is expressed as k n is the matching coefficient, L(λ) is the matching spectrum vector;

[0044] A fitness function establishing unit, used for establishing a fitness function based on the Euclidean distance and angle between the target spectrum vector and the matching spectrum vector;

[0045] An optimization solving unit, used for inputting the matching spectrum database, the target spectrum vector and the fitness function into the genetic algorithm according to the matching mathematical model, and optimizing and solving the matching coefficient through the genetic algorithm;

[0046] The output unit is used to output the optimal matching coefficient matrix and matching results.

[0047] An embodiment of the present invention further provides a spectrum matching device of an enhanced genetic algorithm, which includes a memory and a processor. The memory stores a computer program, and the computer program can be executed by the processor to implement the spectrum matching method of the enhanced genetic algorithm as described above.

[0048] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement the spectrum matching method of the enhanced genetic algorithm as described above.

[0049] In summary, the embodiment of the present invention proposes a new fitness function; makes adaptive transformation and improvement on the selection probability of the genetic algorithm; improves the local search ability of the algorithm through improved crossover and mutation methods, and at the same time, the improved crossover and mutation probabilities can be adaptively changed with the number of population iterations, and finally the matched spectra are uniformly evaluated using correlation coefficients. Compared with the transmitted genetic algorithm, this embodiment has better local search ability, can improve the optimization ability, improve the accuracy of matching results, and reduce the running time of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0051] Figure 1 A schematic flow chart of a spectrum matching method using an enhanced genetic algorithm provided in the first embodiment of the present invention.

[0052] Figure 2 It is a schematic diagram of the relationship between the distance and angle between the target spectral vector and the matching spectral vector.

[0053] Figure 3 It is a flow chart of the improved genetic algorithm of the present invention.

[0054] FIG4( a ) is a schematic diagram showing the principle of a conventional crossover operation.

[0055] FIG4( b ) is a schematic diagram showing the principle of the crossover operation of this embodiment.

[0056] FIG. 5 is a schematic diagram showing spectrum matching of any random spectrum using an ideal infrared LED spectrum curve.

[0057] Figure 6 This is a schematic diagram comparing the matching results of the improved genetic algorithm of this embodiment and the traditional genetic algorithm.

[0058] FIG. 7 is a schematic diagram of the matching results of spectra such as reflectivity and emissivity.

[0059] Figure 8 A schematic structural diagram of a spectrum matching device of an enhanced genetic algorithm provided in the second embodiment of the present invention. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0061] See also Figure 1 The first embodiment of the present invention provides a spectrum matching method of an enhanced genetic algorithm, which can be performed by a spectrum matching device of an enhanced genetic algorithm (hereinafter referred to as a matching device), and in particular, by one or more processors in the matching device to implement the following steps:

[0062] S101, constructing a matching mathematical model and a matching spectral database, and obtaining a target spectral vector; wherein the spectral database consists of n m-dimensional discretized spectral vectors l n (λ) is composed, and the matching mathematical model is expressed as k n is the matching coefficient, L(λ) is the matching spectrum vector;

[0063] In this embodiment, the spectrum database consists of n spectrum vectors l for matching. n (λ), each spectral vector is an m-dimensional column vector. According to the spectral superposition principle, the matching mathematical model is expressed as follows:

[0064]

[0065] L(λ) is the matching spectrum vector, k n is the matching coefficient, l n (λ) is a discretized single spectral vector involved in matching. It is expressed in matrix form as:

[0066]

[0067] Let single spectral vector li = [li(λ1), li(λ2), ..., li(λm)] T , the spectral database is I = [l1, l2, ..., ln]. The matching coefficient matrix to be optimized is K = [k1, k2, ... kn] T , then the matching spectrum vector is expressed as L = I * K = [L (λ1), L (λ2), ..., L (λ m )] T , the target spectrum vector is Y = [y(λ1), y(λ2), ..., y(λ m )] T Each λ1...λ in the formula m The wavelength intervals are the same.

[0068] S102, establishing a fitness function based on the Euclidean distance and angle between the target spectrum vector and the matching spectrum vector.

[0069] like Figure 2 As shown, in this embodiment, the relationship between the Euclidean distance between the target spectrum vector and the matching spectrum vector is as follows:

[0070]

[0071] The relationship between the cosine value of the angle between the target spectrum vector and the matching spectrum vector is as follows:

[0072]

[0073] The fitness function established by Euclidean distance and angle is as follows:

[0074]

[0075] In the formula, Fitness represents the fitness function. The closer cosθ is to 1, the closer the angle θ is to 0, and the closer the matching spectrum vector is to the target spectrum vector. The smaller D is, the closer the matching spectrum vector is to the target spectrum vector. In general, the larger the fitness function Fitness is, the better the matching effect is, and the ideal value is 1.

[0076] In this embodiment, a fitness function is established based on the Euclidean distance between the target spectral vector and the matching spectral vector and the vector angle. The Euclidean distance represents the numerical difference between the two spectra, and the angle represents the difference in the shapes of the two spectral curves. The improved fitness function has a more comprehensive optimization standard. It not only optimizes the distance between the target spectral vector and the matching vector, but also fully considers the optimization of the angle between the two vectors. Therefore, compared with the traditional fitness function algorithm that only considers the distance, the fitness function of this embodiment has a stronger optimization ability.

[0077] S103, inputting the matching spectrum database, the target spectrum vector and the fitness function into the genetic algorithm according to the matching mathematical model, and optimizing and solving the matching coefficient by the genetic algorithm;

[0078] S104, outputting the optimal matching coefficient matrix and matching results.

[0079] Specifically, the algorithm parameters of the genetic algorithm include encoding length, population size, number of iterations, selection roulette, crossover probability, and mutation probability.

[0080] If Figure 3 As shown, the matching coefficient is optimized and solved by the genetic algorithm, specifically including:

[0081] Set the genetic algorithm parameters.

[0082] The population size can be set to 500-1000. If the population is too small, the global optimization ability is poor, and if the population is too large, the time cost is too high. Select parameters such as roulette, crossover probability, and mutation probability to set them separately.

[0083] Initialize the population and calculate the population fitness value according to the fitness function.

[0084] Among them, the population is initialized, two random populations are generated, and then the fitness values ​​of the two populations are calculated according to the fitness function. To calculate the fitness value, the binary code must be decoded first and converted into a decimal value. The fitness of the corresponding individuals of the two populations is compared, and the individual with the larger fitness is selected as the initial population individual. The number of rows of the initial population random matrix is ​​the population size, and the number of columns is the individual code length * the number of coefficients to be optimized n.

[0085] Determine whether the number of iterations is greater than the preset value;

[0086] Preferably, the number of iterations is 10,000. If the number of iterations is too small, the result will not converge, and if the number of iterations is too large, the time cost will be too high.

[0087] If so, output the optimal matching coefficient matrix and matching results;

[0088] If not, population selection is performed according to the selection roulette method.

[0089] Among them, the traditional roulette selection method is: the probability of an individual being selected as a crossover or mutation individual is equal to the individual fitness value / the sum of all individual fitness values ​​in the current population. This method is easy to produce super individuals, affect population diversity, and cause local optimality. For example, for a population with a population size of 100, there is a super individual with a selection probability of 0.3. After selection, the number of this individual in the population may exceed 30, which reduces the probability of other individuals being selected. This embodiment preferably proposes a method for nonlinear transformation of individual fitness, using a cosine function to transform the individual fitness value of the selection operation, as follows:

[0090]

[0091] After the transformation, the probability of an individual being selected changes, as shown below:

[0092]

[0093] In the formula, Fit' represents the individual fitness value after transformation, Fit represents the original fitness value, Fitavg represents the average fitness value of the population, and Ps represents the probability of the individual with the fitness value of Fit' being selected. The purpose of using the cosine function for transformation is that the cosine function is a monotonically decreasing function in [0,π / 2], and the cosine function changes relatively slowly in the early stage of the algorithm (the derivative value is small), and the cosine value is approximately 1, so that within a large number of iterations, Fit'≈Fit+favg, which reduces the difference in the probability of selection between the original individuals and increases the probability of selection of other individuals, which is conducive to maintaining population diversity; and in the later stage of the algorithm, the cosine function changes more sharply, making the cosine value approach 0 faster and faster, Fit'≈Fit, the probability difference of individual selection becomes larger, increasing the probability of selection of excellent individuals and accelerating convergence.

[0094] Example: Accumulate the calculated probabilities (Ps) of each individual row by row. If the individual probability is [0.1, 0.2, 0.3], the accumulated probability is [0.1, 0.1+0.2, 0.1+0.2+0.3]). At the same time, randomly generate probability column vectors and sort them (assuming they are [0.05, 0.08, 0.35]). In this example, if 0.05<0.1, the first individual is selected. If 0.08<0.1, the first individual is selected again. If 0.35>0.1, the second individual is eliminated when 0.35>0.3. If 0.35<0.6, the third individual is selected.

[0095] The above example is to illustrate the selection operation in detail. In actual runtime, the probability value may be different.

[0096] Crossover is performed according to the set crossover probability.

[0097] The purpose of the crossover operation is to make the population produce different solutions and improve the local search capability. The specific operation is as follows: an individual in the population is a row of binary code, which represents a set of coefficient values ​​to be optimized [k1, k2, ..., kn]. To perform the crossover operation, the binary code segments corresponding to each coefficient should be distinguished first (for example, the codes of columns 1-10 represent the value of k1, and the codes of columns 11-20 represent the value of k2). Then, each coefficient value k1, k2... is crossovered separately, that is, two parents to be crossovered are selected, and the probability is randomly generated. If the random probability is less than the crossover probability, a number less than the length of the k1 code is randomly generated. The codes of the two parents after this random number are exchanged to generate a new k1 offspring. If the generated random number is greater than the crossover probability, the two parents are directly retained in the offspring. The same operation is performed on k2, k3...kn, so independent crossover can be achieved between the coefficient individuals.

[0098] Among them, the crossover probability Pc during the crossover operation and the mutation probability Pm during the mutation operation are expressed as follows:

[0099]

[0100]

[0101] Where T is the total number of iterations, t is the current number of iterations, and a, b, and c are adaptive control parameters.

[0102] The reason for using the sine function is the same as the reason for using the cosine function mentioned above. In the early stage of the algorithm, the crossover probability is a+b and the mutation probability is c. In the later stage, the crossover probability is b and the mutation probability is close to 0. In the early stage of the algorithm, the crossover and mutation probability is large and the sine function changes smoothly in the early stage of iteration, which can ensure the local search ability of the early algorithm. As the iteration proceeds, the speed at which the sine function approaches 0 becomes faster and faster, and the crossover and mutation probabilities become smaller, which accelerates the convergence of the later algorithm.

[0103] Calculate the fitness values ​​of the offspring and the parent generation, and form a new offspring by removing duplicates and sorting;

[0104] The new offspring is mutated according to the mutation probability.

[0105] The new population after the crossover operation is mutated. The purpose of the mutation operation is to generate different solutions near the original solution and enhance the local search ability of the algorithm. The mutation operation is as follows: mutate the value of each coefficient mentioned above separately. For an individual to be mutated, randomly generate a probability. If the random probability is less than the mutation probability, randomly generate a number less than the individual code length. Then, at the position of this random number, 0 is mutated to 1 and 1 is mutated to 0. If the generated random number is greater than the mutation probability, the parent is directly retained to the offspring.

[0106] Calculate the fitness values ​​of the offspring and the parent generation, and form a new population by removing duplicates and sorting to participate in the next iteration.

[0107] Calculate the fitness values ​​of the parent generation before mutation and the offspring after mutation, remove the same individuals, sort them according to the fitness values, select individuals with good fitness to form a new population for the next iteration, and ensure that the dominant genes can be better inherited. And the population size does not change.

[0108] Preferably, it also includes:

[0109] During the crossover and mutation operations, the coding segment to which each coefficient belongs is distinguished, and the probability of crossover and mutation of the coefficients corresponding to each coding segment is operated independently, realizing the individual mutation of multi-dimensional individuals, enhancing the local search capability of each coefficient, and improving the optimization ability.

[0110] In spectrum matching, the optimization of multiple coefficients is involved. As shown in FIG4(a), the traditional crossover and mutation operations uniformly crossover and mutate each coefficient, which may result in some coefficients not having the ability to crossover and mutate, and thus the algorithm has poor local search capabilities. As shown in FIG4(b), the improved crossover and mutation method of this embodiment distinguishes the coding segments to which each coefficient belongs, and the probability and operation of the crossover and mutation of the coefficients corresponding to each coding segment are independent. The improved algorithm can realize the individual mutation of multiple dimensions, enhance the local search capability of each coefficient, and improve the optimization capability.

[0111] Preferably, it also includes:

[0112] The matching results are uniformly evaluated to judge the quality of the matching results; the evaluation parameters used in the evaluation refer to the correlation index between the matching spectrum vector and the target spectrum vector, and the formula is as follows:

[0113]

[0114] Where y is the target spectrum vector, L is the matching spectrum vector, is the expected value of y; the correlation index R 2 ≤1. The closer it is to 1, the better the matching effect.

[0115] It should be noted that due to the randomness of the genetic algorithm, in actual processing, it may be necessary to repeatedly run the genetic optimization algorithm N times to obtain N optimized matching results, and then evaluate the N matching results, and comprehensively select the one with the best evaluation result as the best matching result for spectral matching.

[0116] To facilitate understanding of the present invention, some practical examples are used below to illustrate the application of the present invention.

[0117] FIG5 shows an embodiment of spectral matching of any random spectrum using an ideal infrared LED spectrum curve. FIG5(a) shows 21 ideal infrared LED spectra for matching, whose spectrum amplitude can be adjusted by the driving current. The amplitude increases with the driving current. For the convenience of calculation, the spectrum amplitude is set to 1 in the embodiment, the half-width is 30 nanometers, and the center wavelength interval of each spectrum curve is 30 nanometers. Within the range of 1.3 microns to 1.9 microns, the spectrum amplitude is discretized into 61 spectrum data at equal wavelength intervals, and a spectrum vector is a 61-dimensional column vector. Therefore, according to the above mathematical model, the size of the matrix of the spectrum vector used for matching is 61*21, and the size of the matching coefficient matrix to be optimized is 21*1. The matching coefficient matrix obtained by optimizing the improved genetic algorithm is K = [0.9785, 0.8456, 0.8231, 0.7507, 0.6979, 0.4907, 0.6031, 0.4516, 0.4780, 0.4213, 0.4184, 0.4008, 0.3431, 0.3617, 0.3382, 0.2981, 0.3539, 0.3392, 0.3587, 0.3412, 0.3441] T ,Figure 5(b) is the matching result obtained by using the improved genetic algorithm.,The black square curve is an arbitrary random spectrum, and the black circle is the matched spectrum.,The matching results are evaluated and the matching correlation index is calculated to be: 0.9399.

[0118] Figure 6 This is an example of comparing the matching results of this embodiment with those of the traditional algorithm. The black square curve is an arbitrary random target spectrum, the black circle curve is the result of the traditional algorithm matching, and the triangle curve is the improved genetic algorithm matching result of this embodiment. The correlation coefficient index of the traditional genetic algorithm matching result evaluation is: 0.5400. The correlation coefficient index of the improved genetic algorithm matching result evaluation of this embodiment is 0.9399.

[0119] Table 1 is the optimization results of different fitness functions in one embodiment of the present invention. The optimization results of different fitness functions are different. The genetic algorithm selects the optimal solution according to the fitness function value. The fitness function is related to the stability and convergence of the algorithm. The three functions are all optimization functions for the distance D, but the optimization result of formula (3) is the best. Different function forms will affect the selected results, thereby having different optimization capabilities. By comparison, the fitness function proposed in this patent has a better optimization capability.

[0120] Table 1

[0121]

[0122] Table 2 is a comparison of the running time before and after the improved algorithm of an embodiment of the present invention. The algorithm is operated under the following computing resources: the system is Windows 10, the CPU is Core I5-5200U, the running memory is 8Gb, and MATLAB 2016a. The traditional genetic algorithm has poor local optimization ability, and the quality of the optimization result depends on the size of the initial population. Therefore, it is necessary to set a large-scale population for optimization, resulting in a large amount of calculation and a long calculation time. The improved genetic algorithm has a good local search ability, so only a smaller population needs to be set. During the operation, the algorithm can generate more possible local solutions, so it can reduce the amount of calculation and reduce the calculation time.

[0123] Table 2

[0124] Population size Running time / s Before optimization 10000 5042.523 After optimization 1000 1656.239

[0125] FIG7 is a second application example of the present invention, which shows the matching of spectra such as reflectance and emissivity. This type of spectrum matching is the average spectrum of each spectrum, that is, the coefficient sum of each spectrum involved in the matching should be 1 (k1+k2+...+k n =1). Figure 7(a) shows six random reflectance spectra involved in spectral matching, with a wavelength range of 1.3-2.5 microns, and Figure 7(b) shows two matching spectra (black circle curve and triangle curve) and the target spectrum (black square curve) obtained by running the improved genetic algorithm of this embodiment twice. According to the above mathematical model, the size of the spectral matrix used for matching is 121*6, and the size of the coefficient matrix to be optimized is 6*1. The coefficient matrix of the matching result 1 obtained by optimizing the improved genetic algorithm is K1=[0.2504, 0.3010, 0.0299, 0.2596, 0.0369, 0.1222] T , the evaluation correlation index is 0.7826, and the matching coefficient matrix of the matching result 2 obtained by optimizing the improved genetic algorithm is K2=[0.2475, 0.2024, 0.1411, 0.2570, 0.0290, 0.1229] T, , and its evaluation correlation index is 0.7875.

[0126] In summary, the embodiment of the present invention proposes a new fitness function; makes adaptive transformation and improvement on the selection probability of the genetic algorithm; improves the local search ability of the algorithm through improved crossover and mutation methods, and at the same time, the improved crossover and mutation probabilities can be adaptively changed with the number of population iterations, and finally the matching spectra are uniformly evaluated using correlation coefficients. Compared with the traditional genetic algorithm, this embodiment has better local search ability, can improve the algorithm's optimization ability, improve the accuracy of matching results, and reduce the running time of the algorithm.

[0127] See also Figure 8The second embodiment of the present invention further provides a spectrum matching device of an enhanced genetic algorithm, which comprises:

[0128] The model building unit 210 is used to build a matching mathematical model and a matching spectrum database and obtain a target spectrum vector; wherein the spectrum database consists of n m-dimensional discretized spectrum vectors l n (λ) is composed, and the matching mathematical model is expressed as k n is the matching coefficient, L(λ) is the matching spectrum vector;

[0129] A fitness function establishing unit 220, used to establish a fitness function based on the Euclidean distance and angle between the target spectrum vector and the matching spectrum vector;

[0130] The optimization solving unit 230 is used to input the matching spectrum database, the target spectrum vector and the fitness function into the genetic algorithm according to the matching mathematical model, and optimize the matching coefficient through the genetic algorithm;

[0131] The output unit 240 is used to output the optimal matching coefficient matrix and matching results.

[0132] The third embodiment of the present invention further provides a spectrum matching device of an enhanced genetic algorithm, which includes a memory and a processor. The memory stores a computer program, and the computer program can be executed by the processor to implement the spectrum matching method of the enhanced genetic algorithm as described above.

[0133] The fourth embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement the spectrum matching method of the enhanced genetic algorithm as described above.

[0134] In several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus and method embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0135] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0136] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or partly contributed to the prior art or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk. It should be noted that, in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.

[0137] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A spectrum matching method of an enhanced genetic algorithm, characterized in that: include: Construct a matching mathematical model and a matching spectral database, and obtain a target spectral vector; wherein the spectral database consists of n m-dimensional discretized spectral vectors l n (λ) is composed, and the matching mathematical model is expressed as k n is the matching coefficient, L(λ) is the matching spectrum vector; The fitness function is established based on the Euclidean distance and angle between the target spectral vector and the matching spectral vector; the relationship between the Euclidean distance D between the target spectral vector Y and the matching spectral vector L is: The relationship between the cosine value of the angle between the target spectrum vector and the matching spectrum vector is: The formula of fitness function Fitness is: According to the matching mathematical model, the matching spectral database, target spectral vector and fitness function are input into the genetic algorithm, and the matching coefficient is optimized and solved by the genetic algorithm; wherein the algorithm parameters of the genetic algorithm include coding length, population size, number of iterations, selection roulette, crossover probability and mutation probability; then the matching coefficient is optimized and solved by the genetic algorithm, specifically including: setting genetic algorithm parameters; initializing the population, and calculating the fitness value of the population according to the fitness function; judging whether the number of iterations is greater than a preset value; if so, outputting the optimal matching coefficient matrix and matching result; if not, selecting the population according to the selection roulette method; performing crossover according to the set crossover probability; calculating the fitness values ​​of the offspring and the parent generation, and forming a new offspring by deduplication and sorting; mutating the new offspring according to the mutation probability; calculating the fitness values ​​of the offspring and the parent generation, and forming a new population by deduplication and sorting to participate in the next iteration; Output the optimal matching coefficient matrix and matching results.

2. The spectrum matching method of the enhanced genetic algorithm according to claim 1, characterized in that: When the population is selected according to the selection roulette method, the cosine function is used to transform the individual fitness value of the selection operation as follows: After the transformation, the probability of an individual being selected changes, as shown below: Where T is the total number of iterations, t is the current number of iterations, Fit' represents the individual fitness value after transformation, Fit is the original fitness value, Fitavg is the average fitness value of the population, and Ps represents the probability of an individual with a fitness value of Fit' being selected.

3. The spectrum matching method of the enhanced genetic algorithm according to claim 2, characterized in that: The crossover probability Pc during the crossover operation and the mutation probability Pm during the mutation operation are expressed as follows: Where a, b, c are adaptive control parameters.

4. The spectrum matching method of the enhanced genetic algorithm according to claim 3 is characterized in that: During the crossover and mutation operations, the coding segment to which each coefficient belongs is distinguished, and the probability of crossover and mutation of the coefficients corresponding to each coding segment is operated independently, realizing the individual mutation of multi-dimensional individuals, enhancing the local search capability of each coefficient, and improving the optimization ability.

5. The spectrum matching method of the enhanced genetic algorithm according to claim 3 is characterized in that: Also includes: The matching results are uniformly evaluated to judge the quality of the matching results; the evaluation parameters used in the evaluation refer to the correlation index between the matching spectrum vector and the target spectrum vector, and the formula is as follows: In the formula, y is the target spectrum vector, L is the matching spectrum vector, y is the expected value of y; the correlation index R 2 ≤1. The closer it is to 1, the better the matching effect.

6. A spectrum matching device of an enhanced genetic algorithm, characterized in that: include: A model building unit is used to build a matching mathematical model and a matching spectral database and obtain a target spectral vector; wherein the spectral database consists of n m-dimensional discretized spectral vectors l n (λ) is composed, and the matching mathematical model is expressed as k n is the matching coefficient, L(λ) is the matching spectrum vector; The fitness function establishment unit is used to establish a fitness function based on the Euclidean distance and angle between the target spectrum vector and the matching spectrum vector; wherein the relationship between the Euclidean distance D between the target spectrum vector Y and the matching spectrum vector L is: The relationship between the cosine value of the angle between the target spectrum vector and the matching spectrum vector is: The formula of fitness function Fitness is: An optimization solution unit is used to input the matching spectral database, target spectral vector and fitness function into the genetic algorithm according to the matching mathematical model, and optimize the matching coefficient through the genetic algorithm; wherein the optimization solution unit is specifically used to: set the genetic algorithm parameters; initialize the population, and calculate the fitness value of the population according to the fitness function; determine whether the number of iterations is greater than a preset value; if so, output the optimal matching coefficient matrix and matching results; if not, select the population according to the roulette selection method; crossover according to the set crossover probability; calculate the fitness value of the offspring and the parent generation, and form a new offspring by deduplication and sorting; mutate the new offspring according to the mutation probability; calculate the fitness value of the offspring and the parent generation, and form a new population by deduplication and sorting to participate in the next iteration; The output unit is used to output the optimal matching coefficient matrix and matching results.

7. A spectrum matching device of an enhanced genetic algorithm, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the spectrum matching method of the enhanced genetic algorithm as claimed in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: A computer program is stored, and the computer program can be executed by a processor of the device where the computer-readable storage medium is located to implement the spectrum matching method of the enhanced genetic algorithm as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for matching time domain waveform of shock response spectrum based on genetic algorithm

    CN107133560A

  • Segment-Preserving Crossover in Genetic Algorithms

    US20080195565A1