CN112132259B - Neural network model input parameter dimension reduction method and computer readable storage medium - Google Patents

Neural network model input parameter dimension reduction method and computer readable storage medium Download PDF

Info

Publication number
CN112132259B
CN112132259B CN202010903848.0A CN202010903848A CN112132259B CN 112132259 B CN112132259 B CN 112132259B CN 202010903848 A CN202010903848 A CN 202010903848A CN 112132259 B CN112132259 B CN 112132259B
Authority
CN
China
Prior art keywords
data
value
result
neural network
sample data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010903848.0A
Other languages
Chinese (zh)
Other versions
CN112132259A (en
Inventor
张彩云
丁文祥
李雪丁
张友权
李星
郑祥靖
郭民权
丁萍
陈金瑞
朱本璐
任在常
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen University
Original Assignee
Xiamen University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen University filed Critical Xiamen University
Priority to CN202010903848.0A priority Critical patent/CN112132259B/en
Publication of CN112132259A publication Critical patent/CN112132259A/en
Application granted granted Critical
Publication of CN112132259B publication Critical patent/CN112132259B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/086Learning methods using evolutionary algorithms, e.g. genetic algorithms or genetic programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Physiology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a neural network model input parameter dimension reduction method and a computer readable storage medium, wherein the method comprises the following steps: acquiring sample data; dividing sample data into training data and test data according to a preset proportion; generating initial string structure data with preset quantity at random to obtain initial population, wherein each bit in the initial string structure data corresponds to each variable in the sample data one by one, and the value of each bit is a first character or a second character; respectively calculating Heidke skill scores corresponding to each string of structural data in the latest population, and taking the Heidke skill scores as fitness of each string of structural data; if string structure data with the fitness being greater than or equal to a preset target value exists, taking a variable corresponding to a bit with the value being a first character in the string structure data as a final modeling variable; if the population does not exist, generating new string structure data according to a genetic algorithm, obtaining a new population, and continuously calculating fitness. The invention can improve the accuracy and efficiency of the neural network model.

Description

Neural network model input parameter dimension reduction method and computer readable storage medium
Technical Field
The invention relates to the technical field of neural networks, in particular to a neural network model input parameter dimension reduction method and a computer readable storage medium.
Background
When a problem of a plurality of variables is studied by a statistical analysis method, the number of variables is too large, which increases the complexity of the problem. It is naturally desirable that the number of variables be small and that the information be large. In many cases, there is a certain correlation between variables, and when there is a certain correlation between two variables, it can be interpreted that there is a certain overlap of information that reflects this problem for the two variables. For example, meteorological data, hydrological data, water quality data, nutrient salt data, tidal data and the like may need to be collected when researching a red tide prediction model, and may contain tens of parameters, wherein a certain correlation exists between part of variables, and red tide information reflected by the variables has a certain repetition. The collected variables are analyzed to a certain extent, the parameters which influence the subject are searched, and on the basis of not influencing the model result, as few new variables as possible are established, so that the new variables are irrelevant to each other, and the new variables keep the original information as much as possible in the aspect of reflecting the information of the subject, thereby being convenient for finding out the key factors which influence the subject.
In addition, in real life, it is very difficult to describe with a linear model in practice. The occurrence of the neural network greatly reduces the difficulty and workload of model establishment. The neural network is only required to be regarded as a black box, and according to input and output data, the neural network can establish a corresponding mathematical model according to related learning rules. However, when the input parameters of the model are many and the input parameters are not independent of each other, the over-fitting phenomenon easily occurs by using the neural network, so that the problems of low precision, long modeling time and the like of the built model are caused. Therefore, before the model is established, it is necessary to perform optimization selection on the input independent variables, remove redundant independent variables, and select the independent variable which can reflect the relationship between the input and the output to participate in the modeling.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: provided are a neural network model input parameter dimension reduction method and a computer readable storage medium, which can improve the accuracy and efficiency of the neural network model.
In order to solve the technical problems, the invention adopts the following technical scheme: a neural network model input variable dimension reduction method, comprising:
obtaining sample data, wherein the sample data comprises positive sample data and negative sample data, and each sample data is composed of a plurality of variable data;
dividing the sample data into training data and test data according to a preset proportion;
generating initial string structure data with preset quantity at random to obtain an initial population, wherein each bit in the initial string structure data corresponds to each variable in the sample data one by one, and the value of each bit is a first character or a second character;
respectively calculating Heidke skill scores corresponding to each string of structural data in the latest population, and respectively taking the Heidke skill scores corresponding to each string of structural data as fitness of each string of structural data;
judging whether string structure data with the fitness being greater than or equal to a preset target value exists in the latest population;
if yes, taking a variable corresponding to a bit with the value of the first character in the string structure data with the fitness larger than or equal to the preset target value as a final modeling variable;
if not, generating new string structure data according to a genetic algorithm to obtain a new population;
and continuously executing the steps of respectively calculating the Heidke skill scores corresponding to the strings of structural data in the latest population, and respectively taking the Heidke skill scores corresponding to the strings of structural data as the fitness of the strings of structural data.
The invention also proposes a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements the steps of the method as described above.
The invention has the beneficial effects that: by taking the sea de k evaluation (HSS) comprehensively evaluated by the binary model as the fitness function of the genetic algorithm and carrying out dimension reduction on the input variable of the neural network by the genetic algorithm, the accuracy and efficiency of the neural network model can be improved, the probability of occurrence of the overfitting phenomenon of the neural network model can be reduced, and the model convergence time can be shortened.
Drawings
FIG. 1 is a flowchart of a neural network model input parameter dimension reduction method according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of the crossover operator principle of the crossover operation of the genetic algorithm in the second embodiment of the present invention;
fig. 3 is a schematic diagram of mutation operator principle of genetic algorithm mutation operation in the second embodiment of the present invention.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1, a method for dimension reduction of input variables of a neural network model includes:
obtaining sample data, wherein the sample data comprises positive sample data and negative sample data, and each sample data is composed of a plurality of variable data;
dividing the sample data into training data and test data according to a preset proportion;
generating initial string structure data with preset quantity at random to obtain an initial population, wherein each bit in the initial string structure data corresponds to each variable in the sample data one by one, and the value of each bit is a first character or a second character;
respectively calculating Heidke skill scores corresponding to each string of structural data in the latest population, and respectively taking the Heidke skill scores corresponding to each string of structural data as fitness of each string of structural data;
judging whether string structure data with the fitness being greater than or equal to a preset target value exists in the latest population;
if yes, taking a variable corresponding to a bit with the value of the first character in the string structure data with the fitness larger than or equal to the preset target value as a final modeling variable;
if not, generating new string structure data according to a genetic algorithm to obtain a new population;
and continuously executing the steps of respectively calculating the Heidke skill scores corresponding to the strings of structural data in the latest population, and respectively taking the Heidke skill scores corresponding to the strings of structural data as the fitness of the strings of structural data.
From the above description, the beneficial effects of the invention are as follows: the accuracy and efficiency of the neural network model can be improved.
Further, after the sample data is acquired, the method further includes:
and respectively carrying out normalization processing on each variable data in the sample data.
From the above description, it is possible to reduce the interference caused by the magnitude difference between different variables.
Further, the step of calculating the heicke skill scores corresponding to each string of structural data in the latest population respectively specifically comprises the following steps:
determining modeling variables according to variables corresponding to bits of which the values are the first characters in a string of structural data;
constructing an artificial neural network corresponding to the series of structural data, wherein the number of neurons of an input layer of the artificial neural network is consistent with the number of modeling variables, and the number of neurons of an output layer is 2;
training the artificial neural network according to modeling variables in the training data;
inputting modeling variables in the test data into a trained artificial neural network to obtain a forecast result, wherein the forecast result is a positive sample result or a negative sample result;
respectively counting the number of positive sample data and the number of negative sample data with the forecast result being a positive sample result in the test data, and the number of positive sample data and the number of negative sample data with the forecast result being a negative sample result, so as to obtain forecast result parameters corresponding to the series of structure data;
and calculating Heidke skill scores corresponding to the series of structural data according to the forecast result parameters and the total number of the test data.
From the above description, it can be seen that, by using the HSS specially adapted to the bigram evaluation as the fitness function, the dimension reduction effect of the bigram can be improved compared with the conventional method that the mean square error is used as the fitness function.
Further, the forecast result parameter includes a first value, a second value, a third value and a fourth value, the first value represents the number of positive sample data in which the forecast result is a positive sample result in the test data, the second value represents the number of positive sample data in which the forecast result is a negative sample result in the test data, the third value represents the number of negative sample data in which the forecast result is a positive sample result in the test data, and the fourth value represents the number of negative sample data in which the forecast result is a negative sample result in the test data;
the statistics of the number of positive sample data and the number of negative sample data with the forecast result being a positive sample result in the test data, and the number of positive sample data and the number of negative sample data with the forecast result being a negative sample result respectively, so as to obtain the forecast result parameters corresponding to the series of structural data specifically include:
if the forecast result corresponding to positive sample data in the test data is a positive sample result, adding one to a first value, wherein the initial value of the first value is 0;
if the forecast result corresponding to positive sample data in the test data is a negative sample result, adding one to a second value, wherein the initial value of the second value is 0;
if the forecast result corresponding to negative sample data in the test data is a positive sample result, adding one to a third value, wherein the initial value of the third value is 0;
if the forecast result corresponding to the negative sample data in the test data is the negative sample result, the fourth value is added with one, and the initial value of the fourth value is 0.
Further, the calculating the heicke skill score corresponding to the series of structural data according to the forecast result parameters and the total number of the test data specifically includes:
calculating Heidke skill scores corresponding to the series of structural data according to a first formula, wherein the first formula is HSS= [ (T) 1 +T 2 )-(expected correct) random ]/[N-(expected correct) random ]Wherein (expected correct) random Calculated according to a second formula (predicted correction) random =[(T 1 +F 1 )×(T 1 +F 2 )+(T 2 +F 1 )×(T 2 +F 2 )]/N,T 1 For the first value F corresponding to the series of structural data 1 For the second value corresponding to the series of structural data, F 2 For the third value, T, corresponding to the series of structural data 2 And N is the total data amount of the test data for the fourth value corresponding to the series of structural data.
From the above description, it is clear that the larger the heicke skill score, the better the forecasting effect.
Further, if the fitness of the plurality of string structure data is larger than the preset target value, taking the parameter corresponding to the bit with the value of the first character in the string structure data corresponding to the maximum value of the fitness as the final modeling variable.
Further, the generating new string structure data according to the genetic algorithm, and the obtaining new population specifically comprises:
and carrying out selection operation, crossover operation and mutation operation in a genetic algorithm on the string structure data in the current population to generate new string structure data, thereby obtaining a new population.
From the description, the individuals in the current population are screened by utilizing a genetic algorithm, so that the individuals with good adaptability are reserved, the individuals with poor adaptability are eliminated, and the new population inherits the information of the previous generation and is superior to the previous generation.
The invention also proposes a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements the steps of the method as described above.
Example 1
Referring to fig. 1, a first embodiment of the present invention is as follows: the neural network model input variable dimension reduction method can be applied to dimension reduction of input variables of a binary neural network prediction model, as shown in fig. 1, and comprises the following steps:
s1: sample data is acquired, the sample data including positive sample data and negative sample data, each sample data being composed of a plurality of variable data.
For example, if the sample data is red tide monitoring data, the monitoring data during the occurrence of red tide is marked as red tide data, that is, positive sample data, and the other monitoring data is marked as non-red tide data, that is, negative sample data. Red tide monitoring data contains 25 variables such as water temperature, salinity, chlorophyll and the like.
Further, in order to reduce interference caused by magnitude differences among different variables, sample data is normalized before the input model is trained. Specifically, according to the normalization formula, the variable values of the variables in the sample data are normalized respectively.
Normalization formula: x is X new =(X-X min )/(X max -X min )
Wherein X represents the variable value of a variable to be normalized, X new Represents the normalized variable value, X max And X min Representing the maximum and minimum values of the one variable, respectively.
S2: and dividing the sample data into training data and test data according to a preset proportion. For example, 80% of the sample data is used as training data and 20% is used as test data.
S3: and randomly generating a preset number of initial string structure data to obtain an initial population. Each bit in the initial string structure data corresponds to each variable in the sample data one by one, so that the length of the initial string structure data is the same as the number of the variables in the sample data, and the value of each bit is a first character or a second character. The variable corresponding to the bit of the first character takes part in modeling, namely takes part in training and forecasting of the artificial neural network, and the variable corresponding to the bit of the second character takes part in modeling.
In this embodiment, the preset number is 20, the first character is 1, and the second character is 0. Each initial string structure data is an individual, namely a chromosome, 20 individuals form a population, and the genetic algorithm starts iteration by taking the 20 string structure data as an initial point.
The step S2 and the step S3 may be performed in no sequence.
S4: and respectively calculating Heidke skill scores (HSS, the Heidke skill score) corresponding to the strings of structural data in the latest population, and respectively taking the Heidke skill scores corresponding to the strings of structural data as the fitness of the strings of structural data.
Specifically, the method comprises the following steps:
s401: traversing the population, and sequentially acquiring a string of structural data as current string of structural data.
S402: and determining modeling variables according to variables corresponding to the bits with the values of the first character in the current string structure data.
S403: constructing an artificial neural network corresponding to the current string structure data, wherein the number of neurons of an input layer of the artificial neural network is consistent with the number of modeling variables, and the number of neurons of an output layer is 2; and constructing a binary neural network forecasting model.
S404: and training the artificial neural network corresponding to the current string structure data according to the modeling variable in the training data.
S405: inputting modeling variables in the test data into the trained artificial neural network to obtain a forecast result, wherein the forecast result is a positive sample result or a negative sample result.
The number of neurons of the output layer of the artificial neural network is 2, so that the forecasting result is in a binary form. For example, assuming that the actual result corresponding to the positive sample data in the sample data is a and the actual result corresponding to the negative sample data is B, the prediction result is a or B.
S406: and respectively counting the number of positive sample data and the number of negative sample data with the forecast result being a positive sample result in the test data, and counting the number of positive sample data and the number of negative sample data with the forecast result being a negative sample result to obtain the forecast result parameters corresponding to the current string structure data.
In this embodiment, the forecast result parameter includes a first value, a second value, a third value and a fourth value, where the first value represents the number of positive sample data in which the forecast result is a positive sample result (i.e., the number of test data in which the actual result is a and the forecast result is a), the second value represents the number of positive sample data in which the forecast result is a negative sample result (i.e., the number of test data in which the actual result is a and the forecast result is B), the third value represents the number of negative sample data in which the forecast result is a positive sample result (i.e., the number of test data in which the actual result is B and the forecast result is a), and the fourth value represents the number of negative sample data in which the forecast result is a negative sample result (i.e., the number of test data in which the actual result is B and the forecast result is B).
Specifically, the first value T 1 Second value F 1 Third value F 2 And a fourth value T 2 The initial values are all 0, i.e. the first order T 1 =F 1 =F 2 =T 2 =0。
Then traversing the test data, if the current traversed test data is positive sample data, inputting the test data into the trained artificial neural networkThe forecasting result of the complex output is a positive sample result, and then the forecasting is considered to be correct, let T 1 =T 1 +1;
If the currently traversed test data is positive sample data and the forecast result output by the artificial neural network after the input training is negative sample result, the forecast error is considered, and F is caused 1 =F 1 =+1;
If the currently traversed test data is negative sample data and the forecast result output by the artificial neural network after the input training is positive sample result, the forecast error is considered, and F is caused 2 =F 2 =+1;
If the currently traversed test data is negative-sample data and the forecast result output by the artificial neural network after the input training is negative-sample result, the forecast is considered to be correct, and T is caused 2 =T 2 +1。
After traversing all the test data, obtaining the forecast result parameters corresponding to the current string structure data, and T 1 +F 1 +F 2 +T 2 N, N is the total data amount of the test data.
S407: and calculating Heidke skill scores corresponding to the current string structure data according to the forecast result parameters and the total number of the test data.
Specifically, the heicke skill score corresponding to the series of structural data is calculated according to the following formula.
A first formula: HSS= [ (T) 1 +T 2 )-(expected correct) random ]/[N-(expected correct) random ]
A second formula: (expected correct) random =[(T 1 +F 1 )×(T 1 +F 2 )+(T 2 +F 1 )×(T 2 +F 2 )]/N
Wherein T is 1 For the first value F corresponding to the series of structural data 1 For the second value corresponding to the series of structural data, F 2 For the third value, T, corresponding to the series of structural data 2 And N is the total data amount of the test data for the fourth value corresponding to the series of structural data.
S408: and taking the Heidke skill score corresponding to the current string structure data as the fitness of the current string structure data, namely the fitness of the individual in the genetic algorithm.
Wherein, the larger the Heidke skill score, the better the forecasting effect.
S5: judging whether string structure data with the fitness being greater than or equal to a preset target value exists in the latest population, if so, executing the step S6, and if not, executing the step S7.
S6: and taking the variable corresponding to the bit with the value of the first character in the string structure data with the fitness larger than or equal to the preset target value as a final modeling variable, namely taking the variable corresponding to the bit with the value of 1 in the string structure data meeting the condition as a model input variable after dimension reduction.
Further, if the fitness of the plurality of string structure data is larger than the preset target value, taking the parameter corresponding to the bit with the value of the first character in the string structure data corresponding to the maximum value of the fitness as the final modeling variable.
S7: generating new string structure data according to a genetic algorithm to obtain a new population; and then, continuing to calculate Heidke skill scores corresponding to each string of structural data in the new population, namely continuing to execute the step S4.
The genetic algorithm (Genetic Algorithms) was a parallel random search optimization method proposed by Holland, university of Michigan, U.S. in 1962 to simulate the genetic mechanism and biological evolutionary theory of nature. The method introduces the biological evolution principle of 'superior and inferior in nature and survival of the fittest' into coding series groups formed by optimizing parameters, screens individuals according to the selected fitness function and through selection, crossing and variation in inheritance, keeps the individuals with good fitness value, eliminates the individuals with poor fitness value, and inherits the information of the previous generation and is superior to the previous generation of the new groups.
The step is to obtain a new population through selection operation, crossover operation and mutation operation in a genetic algorithm according to the current population.
The selection operation refers to selecting an individual from an old population to a new population with a certain probability, wherein the probability of the individual being selected is related to the fitness value, and the better the fitness value of the individual is, the greater the probability of the individual being selected is.
In this embodiment, according to the fitness of each string of structural data in the current population, the relative fitness of each string of structural data is calculated and is used as the probability that each string of structural data is selected and inherited into the next generation population, where the relative fitness is the proportion of the fitness of one string of structural data to the sum of the fitness of all strings of structural data of the population.
Crossover refers to the selection of two individuals from a population, by the exchange combination of the two chromosomes, to create a new excellent individual. The crossover process is to randomly select one or more chromosome positions for exchange from two optional chromosomes in the population.
For example, assume that the chromosomes of two individuals before crossover are:
A:1100 0101 1111
B:1111 0101 0000
crossing the last four bits, and then respectively obtaining chromosomes of two crossed individuals:
A:1100 0101 0000
B:1111 0101 1111
mutation refers to the selection of one individual from a population, and the mutation is performed at a point in the chromosome to produce a more excellent individual.
For example, assume that the chromosome of an individual prior to mutation is: 1100 0101 1111; mutating the penultimate position, the chromosome of the individual after mutating is: 1100 0101 1101.
In the embodiment, the neural network is used for calculating the fitness of the genetic algorithm, the sea de k (HSS) of the binary model comprehensive evaluation is used as the fitness function of the genetic algorithm, and the genetic algorithm is used for reducing the dimension of the input variable of the neural network, so that the accuracy and the efficiency of the neural network model can be improved, the probability of occurrence of the overfitting phenomenon of the neural network model is reduced, and the model convergence time is shortened.
Example two
Referring to fig. 2-3, the present embodiment is a specific application scenario of the first embodiment. The embodiment takes the input parameter dimension reduction of a red tide short-term forecasting model of a binary BP network as an example for explanation.
1. Red tide monitoring data of a certain place is collected as sample data, totally 20752 groups, monitoring data during the occurrence of red tide are marked as red tide data (positive sample data), totally 3425 groups, and other monitoring data are marked as non-red tide data (negative sample data), totally 17327 groups. Contains 25 variables such as water temperature, salinity, chlorophyll and the like.
2. Setting the coding length of a genetic algorithm to 25, wherein 25 bits of a chromosome are respectively in one-to-one correspondence with 25 variables, the value of each gene can only be 1 or 0, and if the value of one bit of the chromosome is 1, the corresponding variable of the bit is involved in the training and forecasting of the red tide short-term forecasting model; otherwise, if the value is 0, the variable corresponding to the bit does not participate in training and forecasting of the red tide short-term forecasting model.
Randomly generating 20 initial string structure data, wherein each initial string structure data is an individual, namely a chromosome, 20 individuals form a population, and the genetic algorithm starts iteration by taking the 20 string structure data as an initial point, namely the length of each initial string structure data is 25, and the value of each bit is 1 or 0.
3. 80% of red tide monitoring data are randomly selected as training data, the remaining 20% are used as test data, and all data are normalized.
4. And taking 25 variables as input variables of a BP network (the number of neurons of an output layer is 25 and the number of neurons of the output layer is 2), training the BP network by using training data, and then inputting test data into the trained BP network to obtain a prediction result before dimension reduction for comparison with a prediction result after subsequent dimension reduction.
5. And taking a variable corresponding to a bit with a value of 1 in one string structure data as an input variable of the BP network (the number of neurons of an output layer is the same as the number of 1 in the string structure data, and the number of neurons of the output layer is 2), training the BP network by using variable data corresponding to training data, and then inputting variable data corresponding to test data into the trained BP network to obtain a forecast result.
6. When the forecasting result and the actual result are red tide, the forecasting is Correct, the red tide is marked as the Correct hit, when the forecasting result is that the red tide does not occur, the actual result is that the red tide occurs, the forecasting error is marked as False positive, when the forecasting result is that the red tide occurs, the actual result is that the red tide does not occur, the forecasting error is marked as False positive, and when the forecasting result and the actual result are that the red tide does not occur, the forecasting is Correct, the False positive is marked as the Correct positive; finally, the number of Correct hits, false positive and Correct negative is counted and is used as the first value T respectively 1 Second value F 1 Third value F 2 And a fourth value T 2
7. The heicke skill score for the string of structural data is calculated:
HSS=[(T 1 +T 2 )-(expected correct) random ]/[N-(expected correct) random ]
wherein (expected correction) random =[(T 1 +F 1 )×(T 1 +F 2 )+(T 2 +F 1 )×(T 2 +F 2 )]N, N is the total data amount of the test data.
8. Repeating the steps 5, 6 and 7 to finish the calculation of HSS values of all 20 string structure data in the population, and taking the HSS values as the fitness of a genetic algorithm, namely f (X) =HSS.
9. Setting a target HSS, which is marked as G, if f (X) of each string of structural data in the current population is smaller than G, executing the following 10 th, 11 th, 12 th and 13 th operations until a value larger than G is found in f (X), and executing the 14 th operation.
10. A genetic algorithm selection operation; specifically, the method comprises the following steps:
a) Calculating the relative fitness of each individual in the population, and taking the relative fitness as the probability that each individual is selected and inherited into the next generation population, wherein the relative fitness is the proportion of the fitness of one individual to the sum of the fitness of all individuals in the population, and the specific calculation formula is as follows:
wherein f (X) k ) For the fitness of the kth individual, M is the total number of individuals in the current population.
b) Using a simulated roulette operation, random numbers between (0, 1) are generated to determine the number of times each individual is selected. I.e. the individual in the current population is placed on the number axis between 0 and 1, the range of each individual in the number axis interval is determined according to the relative fitness of each individual, all the individuals occupy the number axis interval and do not overlap each other, that is, the larger the relative fitness of an individual is, the larger the range of the occupied number axis is, the larger the probability that the generated random number falls in the range is, that is, the larger the probability that the individual is selected is.
Obviously, the individuals with large fitness and large relative fitness have large selection probability and can be selected for many times, and the genetic genes of the individuals can be expanded in the population.
11. Crossing operation of genetic algorithm; for the dimension reduction of the input variable, the crossover operation adopts the simplest single-point crossover operator, and the crossover operator principle is shown in fig. 2. Specifically, the method comprises the following steps:
a) Pairing individuals in the current population pairwise, and sharing N/2 pairs of paired individual groups;
b) Randomly selecting a position behind a certain locus as an intersection point for each pair of paired individual groups;
c) For each pair of paired individual groups, two new individuals are generated by mutually interacting partial chromosomes of the two individuals according to the intersection positions determined in b.
12. Performing genetic algorithm mutation operation; for the dimension reduction of the input variable, the mutation operation adopts the simplest single-point mutation operator, and the mutation operator principle is shown in fig. 3. Specifically, the method comprises the following steps:
a) Randomly generating variation points;
b) According to the position of the variation point in the a, the gene value at the corresponding locus is changed, namely, the result of the variation operation is that 1 is changed to 0 or 0 is changed to 1.
Wherein the variation points for each individual are randomly generated, and thus the variation points for each individual are not necessarily the same.
13. And (3) performing the operations of steps 5, 6, 7 and 8 on the population newly generated by the genetic algorithm, calculating the fitness of each new individual (namely new string structure data), and then performing the operation of step 9.
14. And selecting string structure data with f (X) larger than G, and taking a variable corresponding to a bit with a value of 1 in the string structure data as a final modeling variable, namely a main parameter affecting the red tide model.
15. Assuming that the finally obtained variables after the dimension reduction are 10 variables such as water temperature, dissolved oxygen, chlorophyll and the like, which are far less than the original 25 parameters, taking the 10 variables as input variables of a BP network (the number of neurons of an output layer is 10 and the number of neurons of the output layer is 2), training the BP network by using the 10 variable data in training data, and then inputting the 10 variable data in test data into the trained BP network to obtain a prediction result after the dimension reduction.
Comparing the prediction results before and after the dimension reduction, as shown in table 1, the prediction accuracy of red tide after the dimension reduction is improved by 10.57%, the prediction accuracy of red tide without the occurrence is improved by 5.22%, the model convergence time is reduced by 85.5%, and the accuracy and the convergence time of the red tide short-term prediction model of the binary BP network are obviously improved by taking HSS as the fitness function dimension reduction.
The above procedure is repeated, the fitness function is changed into the root mean square error (square root of the ratio of the square of the deviation of the predicted value and the true value to the observed times N) of the predicted result and the actual result, the obtained results are shown in table 1, compared with the result using HSS as the fitness function, the red tide occurrence prediction accuracy is reduced by 0.85%, the red tide non-occurrence prediction accuracy is reduced by 2.09%, the model convergence time is increased by 2.33min, and obviously, the dimension reduction of the genetic algorithm on the binary model is better than the conventional mean square error is adopted as the fitness function by taking HSS as the fitness function.
Table 1: input parameter dimension-reducing front and rear prediction results of red tide short-term prediction model of binary BP network
Example III
The present embodiment is a computer-readable storage medium corresponding to the above embodiment, having stored thereon a computer program which, when executed by a processor, realizes the steps of:
obtaining sample data, wherein the sample data comprises positive sample data and negative sample data, and each sample data is composed of a plurality of variable data;
dividing the sample data into training data and test data according to a preset proportion;
generating initial string structure data with preset quantity at random to obtain an initial population, wherein each bit in the initial string structure data corresponds to each variable in the sample data one by one, and the value of each bit is a first character or a second character;
respectively calculating Heidke skill scores corresponding to each string of structural data in the latest population, and respectively taking the Heidke skill scores corresponding to each string of structural data as fitness of each string of structural data;
judging whether string structure data with the fitness being greater than or equal to a preset target value exists in the latest population;
if yes, taking a variable corresponding to a bit with the value of the first character in the string structure data with the fitness larger than or equal to the preset target value as a final modeling variable;
if not, generating new string structure data according to a genetic algorithm to obtain a new population;
and continuously executing the steps of respectively calculating the Heidke skill scores corresponding to the strings of structural data in the latest population, and respectively taking the Heidke skill scores corresponding to the strings of structural data as the fitness of the strings of structural data.
Further, after the sample data is acquired, the method further includes:
and respectively carrying out normalization processing on each variable data in the sample data.
Further, the step of calculating the heicke skill scores corresponding to each string of structural data in the latest population respectively specifically comprises the following steps:
determining modeling variables according to variables corresponding to bits of which the values are the first characters in a string of structural data;
constructing an artificial neural network corresponding to the series of structural data, wherein the number of neurons of an input layer of the artificial neural network is consistent with the number of modeling variables, and the number of neurons of an output layer is 2;
training the artificial neural network according to modeling variables in the training data;
inputting modeling variables in the test data into a trained artificial neural network to obtain a forecast result, wherein the forecast result is a positive sample result or a negative sample result;
respectively counting the number of positive sample data and the number of negative sample data with the forecast result being a positive sample result in the test data, and the number of positive sample data and the number of negative sample data with the forecast result being a negative sample result, so as to obtain forecast result parameters corresponding to the series of structure data;
and calculating Heidke skill scores corresponding to the series of structural data according to the forecast result parameters and the total number of the test data.
Further, the forecast result parameter includes a first value, a second value, a third value and a fourth value, the first value represents the number of positive sample data in which the forecast result is a positive sample result in the test data, the second value represents the number of positive sample data in which the forecast result is a negative sample result in the test data, the third value represents the number of negative sample data in which the forecast result is a positive sample result in the test data, and the fourth value represents the number of negative sample data in which the forecast result is a negative sample result in the test data;
the statistics of the number of positive sample data and the number of negative sample data with the forecast result being a positive sample result in the test data, and the number of positive sample data and the number of negative sample data with the forecast result being a negative sample result respectively, so as to obtain the forecast result parameters corresponding to the series of structural data specifically include:
if the forecast result corresponding to positive sample data in the test data is a positive sample result, adding one to a first value, wherein the initial value of the first value is 0;
if the forecast result corresponding to positive sample data in the test data is a negative sample result, adding one to a second value, wherein the initial value of the second value is 0;
if the forecast result corresponding to negative sample data in the test data is a positive sample result, adding one to a third value, wherein the initial value of the third value is 0;
if the forecast result corresponding to the negative sample data in the test data is the negative sample result, the fourth value is added with one, and the initial value of the fourth value is 0.
Further, the calculating the heicke skill score corresponding to the series of structural data according to the forecast result parameters and the total number of the test data specifically includes:
calculating Heidke skill scores corresponding to the series of structural data according to a first formula, wherein the first formula is HSS= [ (T) 1 +T 2 )-(expected correct) random ]/[N-(expected correct) random ]Wherein (expected correct) random Calculated according to a second formula (predicted correction) random =[(T 1 +F 1 )×(T 1 +F 2 )+(T 2 +F 1 )×(T 2 +F 2 )]/N,T 1 For the first value F corresponding to the series of structural data 1 For the second value corresponding to the series of structural data, F 2 For the third value, T, corresponding to the series of structural data 2 And N is the total data amount of the test data for the fourth value corresponding to the series of structural data.
Further, if the fitness of the plurality of string structure data is larger than the preset target value, taking the parameter corresponding to the bit with the value of the first character in the string structure data corresponding to the maximum value of the fitness as the final modeling variable.
Further, the generating new string structure data according to the genetic algorithm, and the obtaining new population specifically comprises:
and carrying out selection operation, crossover operation and mutation operation in a genetic algorithm on the string structure data in the current population to generate new string structure data, thereby obtaining a new population.
In summary, according to the neural network model input parameter dimension reduction method and the computer readable storage medium provided by the invention, the sea de k evaluation (HSS) comprehensively evaluated by the binary model is used as the fitness function of the genetic algorithm, and the dimension reduction is performed on the input variable of the neural network by the genetic algorithm, so that the accuracy and efficiency of the neural network model can be improved, the probability of occurrence of the over-fitting phenomenon of the neural network model is reduced, and the model convergence time is shortened.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (8)

1. The method for reducing the dimension of the input variable of the neural network model is characterized by comprising the following steps of:
obtaining sample data, wherein the sample data comprises positive sample data and negative sample data, and each sample data is composed of a plurality of variable data;
dividing the sample data into training data and test data according to a preset proportion;
generating initial string structure data with preset quantity at random to obtain an initial population, wherein each bit in the initial string structure data corresponds to each variable in the sample data one by one, and the value of each bit is a first character or a second character;
respectively calculating Heidke skill scores corresponding to each string of structural data in the latest population, and respectively taking the Heidke skill scores corresponding to each string of structural data as fitness of each string of structural data;
judging whether string structure data with the fitness being greater than or equal to a preset target value exists in the latest population;
if yes, taking a variable corresponding to a bit with the value of the first character in the string structure data with the fitness larger than or equal to the preset target value as a final modeling variable;
if not, generating new string structure data according to a genetic algorithm to obtain a new population;
and continuously executing the steps of respectively calculating the Heidke skill scores corresponding to the strings of structural data in the latest population, and respectively taking the Heidke skill scores corresponding to the strings of structural data as the fitness of the strings of structural data.
2. The method for dimension reduction of input variables of neural network model according to claim 1, further comprising, after the obtaining of the sample data:
and respectively carrying out normalization processing on each variable data in the sample data.
3. The method for dimension reduction of neural network model input variables according to claim 1, wherein the calculating of heicke skill scores corresponding to each string of structural data in the latest population respectively specifically comprises:
determining modeling variables according to variables corresponding to bits of which the values are the first characters in a string of structural data;
constructing an artificial neural network corresponding to the series of structural data, wherein the number of neurons of an input layer of the artificial neural network is consistent with the number of modeling variables, and the number of neurons of an output layer is 2;
training the artificial neural network according to modeling variables in the training data;
inputting modeling variables in the test data into a trained artificial neural network to obtain a forecast result, wherein the forecast result is a positive sample result or a negative sample result;
respectively counting the number of positive sample data and the number of negative sample data with the forecast result being a positive sample result in the test data, and the number of positive sample data and the number of negative sample data with the forecast result being a negative sample result, so as to obtain forecast result parameters corresponding to the series of structure data;
and calculating Heidke skill scores corresponding to the series of structural data according to the forecast result parameters and the total number of the test data.
4. A neural network model input variable dimension reduction method according to claim 3, wherein the forecast result parameter includes a first value, a second value, a third value and a fourth value, the first value representing the number of positive sample data in the test data for which the forecast result is a positive sample result, the second value representing the number of positive sample data in the test data for which the forecast result is a negative sample result, the third value representing the number of negative sample data in the test data for which the forecast result is a positive sample result, and the fourth value representing the number of negative sample data in the test data for which the forecast result is a negative sample result;
the statistics of the number of positive sample data and the number of negative sample data with the forecast result being a positive sample result in the test data, and the number of positive sample data and the number of negative sample data with the forecast result being a negative sample result respectively, so as to obtain the forecast result parameters corresponding to the series of structural data specifically include:
if the forecast result corresponding to positive sample data in the test data is a positive sample result, adding one to a first value, wherein the initial value of the first value is 0;
if the forecast result corresponding to positive sample data in the test data is a negative sample result, adding one to a second value, wherein the initial value of the second value is 0;
if the forecast result corresponding to negative sample data in the test data is a positive sample result, adding one to a third value, wherein the initial value of the third value is 0;
if the forecast result corresponding to the negative sample data in the test data is the negative sample result, the fourth value is added with one, and the initial value of the fourth value is 0.
5. The method for dimension reduction of neural network model input variables according to claim 4, wherein calculating the heicke skill score corresponding to the series of structural data according to the forecast result parameters and the total number of test data is specifically as follows:
calculating Heidke skill scores corresponding to the series of structural data according to a first formula, wherein the first formula is HSS= [ (T) 1 +T 2 )-(expected correct) random ]/[N-(expected correct) random ]Wherein (expected correct) random Calculated according to a second formula (predicted correction) random =[(T 1 +F 1 )×(T 1 +F 2 )+(T 2 +F 1 )×(T 2 +F 2 )]/N,T 1 For the first value F corresponding to the series of structural data 1 For the second value corresponding to the series of structural data, F 2 For the third value, T, corresponding to the series of structural data 2 And N is the total data amount of the test data for the fourth value corresponding to the series of structural data.
6. The method for dimension reduction of input variables of a neural network model according to claim 1, wherein if there are a plurality of string structure data having fitness greater than a preset target value, parameters corresponding to bits having a value of a first character in string structure data corresponding to a maximum value of the fitness are used as final modeling variables.
7. The method for dimension reduction of input variables of neural network model according to claim 1, wherein the generating new string structure data according to genetic algorithm, the obtaining new population specifically comprises:
and carrying out selection operation, crossover operation and mutation operation in a genetic algorithm on the string structure data in the current population to generate new string structure data, thereby obtaining a new population.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any of claims 1-7.
CN202010903848.0A 2020-09-01 2020-09-01 Neural network model input parameter dimension reduction method and computer readable storage medium Active CN112132259B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010903848.0A CN112132259B (en) 2020-09-01 2020-09-01 Neural network model input parameter dimension reduction method and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010903848.0A CN112132259B (en) 2020-09-01 2020-09-01 Neural network model input parameter dimension reduction method and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112132259A CN112132259A (en) 2020-12-25
CN112132259B true CN112132259B (en) 2024-03-05

Family

ID=73848416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010903848.0A Active CN112132259B (en) 2020-09-01 2020-09-01 Neural network model input parameter dimension reduction method and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112132259B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115269939B (en) * 2022-09-28 2023-02-17 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) Regular expression generation method and device, intelligent terminal and computer storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08129542A (en) * 1994-10-31 1996-05-21 Ricoh Co Ltd Parameter updating device for neural network
CN106777527A (en) * 2016-11-24 2017-05-31 上海市特种设备监督检验技术研究院 Monkey operation energy consumption analysis method based on neural network model
CN107247893A (en) * 2017-05-10 2017-10-13 广东工业大学 A kind of electric personal identification method of the brain based on genetic algorithm dimensionality reduction
CN109242558A (en) * 2018-08-29 2019-01-18 黑龙江工业学院 A kind of management data prediction technique, readable storage medium storing program for executing and forecasting system neural network based
CN110868312A (en) * 2018-08-28 2020-03-06 中国科学院沈阳自动化研究所 Industrial behavior anomaly detection method based on genetic algorithm optimization
WO2020092810A1 (en) * 2018-10-31 2020-05-07 Movidius Ltd. Automated generation of neural networks

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030018598A1 (en) * 2001-07-19 2003-01-23 Cawse James Norman Neural network method and system
US9775533B2 (en) * 2013-03-08 2017-10-03 Singapore Health Services Pte Ltd System and method of determining a risk score for triage

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08129542A (en) * 1994-10-31 1996-05-21 Ricoh Co Ltd Parameter updating device for neural network
CN106777527A (en) * 2016-11-24 2017-05-31 上海市特种设备监督检验技术研究院 Monkey operation energy consumption analysis method based on neural network model
CN107247893A (en) * 2017-05-10 2017-10-13 广东工业大学 A kind of electric personal identification method of the brain based on genetic algorithm dimensionality reduction
CN110868312A (en) * 2018-08-28 2020-03-06 中国科学院沈阳自动化研究所 Industrial behavior anomaly detection method based on genetic algorithm optimization
CN109242558A (en) * 2018-08-29 2019-01-18 黑龙江工业学院 A kind of management data prediction technique, readable storage medium storing program for executing and forecasting system neural network based
WO2020092810A1 (en) * 2018-10-31 2020-05-07 Movidius Ltd. Automated generation of neural networks

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
基于全卷积神经网络方法的日间黄海海雾卫星反演研究;刘树霄 等;海洋湖沼通报;第16-18页 *
孙文兵 ; .遗传算法降维优化的BP模型及葡萄酒质量预测.邵阳学院学报(自然科学版).2017,(01),全文. *
樊仲欣 ; 陈旭红 ; 谭桂容 ; .基于递归小波神经网络的江苏城镇夏季最高气温预报预警技术.自然灾害学报.2019,(06),全文. *
赵志彬 ; 赵芸莹 ; .基于主成分分析的GA-BP模型的供应链合作伙伴评价.商场现代化.2018,(12),全文. *
遗传算法降维优化的BP模型及葡萄酒质量预测遗传算法降维优化的BP模型及葡萄酒质量预测;孙文兵;邵阳学院学报( 自然科学版);第14卷(第1期);第24-28页 *
高文曦 ; 孙小琪 ; 镇丽华 ; .基于遗传算法数据降维的汉语数字语音识别.计算机系统应用.2016,(01),全文. *

Also Published As

Publication number Publication date
CN112132259A (en) 2020-12-25

Similar Documents

Publication Publication Date Title
CN106411896B (en) Network security situation prediction method based on APDE-RBF neural network
CN110336768B (en) Situation prediction method based on combined hidden Markov model and genetic algorithm
CN103105246A (en) Greenhouse environment forecasting feedback method of back propagation (BP) neural network based on improvement of genetic algorithm
CN112581262A (en) Whale algorithm-based fraud detection method for optimizing LVQ neural network
CN112215446A (en) Neural network-based unit dynamic fire risk assessment method
CN111709511A (en) Harris eagle optimization algorithm based on random unscented Sigma point variation
Ning et al. GA-BP air quality evaluation method based on fuzzy theory.
CN115906638A (en) Fault prediction model and method for establishing fire control system and related device
CN112132259B (en) Neural network model input parameter dimension reduction method and computer readable storage medium
CN111832817A (en) Small world echo state network time sequence prediction method based on MCP penalty function
CN115796358A (en) Carbon emission prediction method and terminal
CN111126560A (en) Method for optimizing BP neural network based on cloud genetic algorithm
CN115033878A (en) Rapid self-game reinforcement learning method and device, computer equipment and storage medium
Phan et al. Efficiency enhancement of evolutionary neural architecture search via training-free initialization
CN113673695B (en) Crowd behavior rule automatic extraction method based on novel feature automatic construction
CN114819151A (en) Biochemical path planning method based on improved agent-assisted shuffled frog leaping algorithm
CN115472291A (en) Esophageal squamous carcinoma survival prediction method based on improved goblet sea squirt optimized BP neural network
CN114971243A (en) FNN (false negative number) countermeasure generation-based dioxin emission risk early warning model construction method
CN114757433A (en) Method for quickly identifying relative risk of drinking water source antibiotic resistance
CN109858127B (en) Blue algae bloom prediction method based on recursive time sequence deep confidence network
CN112837739A (en) Hierarchical feature phylogenetic model based on self-encoder and Monte Carlo tree
CN115661508A (en) SAR (synthetic aperture radar) countermeasure image detection system and method based on multi-target neural network architecture optimization
CN118211185A (en) Runoff prediction method based on combination of optimization algorithm of mullet group and TCN model
Jie-zhen et al. BP neural network optimize based on improved genetic algorithm
Chen et al. A neural network optimization calculation method based on improved genetic algorithm

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant