CN112487726A - Training method and device for target test model - Google Patents
Training method and device for target test model Download PDFInfo
- Publication number
- CN112487726A CN112487726A CN202011515827.8A CN202011515827A CN112487726A CN 112487726 A CN112487726 A CN 112487726A CN 202011515827 A CN202011515827 A CN 202011515827A CN 112487726 A CN112487726 A CN 112487726A
- Authority
- CN
- China
- Prior art keywords
- value
- current
- test model
- target
- individuals
- 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.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 78
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000012549 training Methods 0.000 title claims abstract description 20
- 238000013101 initial test Methods 0.000 claims abstract description 79
- 230000002068 genetic effect Effects 0.000 claims abstract description 33
- 238000012546 transfer Methods 0.000 claims description 20
- 238000010606 normalization Methods 0.000 claims description 13
- 230000035772 mutation Effects 0.000 claims description 8
- 238000013528 artificial neural network Methods 0.000 abstract description 11
- 238000009530 blood pressure measurement Methods 0.000 abstract description 5
- 230000006870 function Effects 0.000 description 28
- 238000010586 diagram Methods 0.000 description 15
- 238000004891 communication Methods 0.000 description 10
- 238000004422 calculation algorithm Methods 0.000 description 8
- 238000012545 processing Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 6
- 230000009471 action Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000010353 genetic engineering Methods 0.000 description 3
- 238000005259 measurement Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000010076 replication Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000035939 shock Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/12—Computing arrangements based on biological models using genetic models
- G06N3/126—Evolutionary algorithms, e.g. genetic algorithms or genetic programming
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Biophysics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Molecular Biology (AREA)
- Mathematical Physics (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Computing Systems (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physiology (AREA)
- Genetics & Genomics (AREA)
- Medical Informatics (AREA)
- Computer Hardware Design (AREA)
- Geometry (AREA)
- Measuring Fluid Pressure (AREA)
Abstract
The application provides a training method and a training device for a target test model, and belongs to the technical field of neural networks. The method comprises the following steps: inputting the normalized values of the sample temperature value and the sample pressure value into an initial test model, and obtaining a test pressure value output by the initial test model; determining a current fitness value of an individual in a current group of the initial test model, wherein the individual is a current weight and a current threshold of the initial test model, and an error value between a test pressure value and a preset pressure value under the current weight and the current threshold is inversely proportional to the current fitness value; if the current fitness value does not meet the termination condition, performing iterative genetic operation on the individual of the initial test model until the current fitness value of the individual meets the termination condition to obtain a target weight and a target threshold; and taking the initial test model containing the target weight and the target threshold as a target test model. The application can reduce the influence of temperature on pressure and improve the accuracy of pressure measurement.
Description
Technical Field
The application relates to the technical field of neural networks, in particular to a training method and a training device for a target test model.
Background
The pneumatic pressure scanning test is a product combining a sensor technology and an electronic technology, and mainly faces to the scientific and technological fields of wind tunnel tests, aero-engine tests, automobile tests and the like. The method provides load for structural strength calculation by measuring the pressure distribution on the surface of the object to be measured, provides a design basis for researching the pneumatic characteristics of the object to be measured, and is an important means for verifying whether the numerical calculation method is accurate. The characteristics of the position of the minimum pressure point on the surface to be measured, the position of the shock wave, whether the air flow is separated and the like can be determined through multi-point pressure distribution measurement, and a basis is provided for pneumatic analysis; and important parameters such as the lift force, the differential pressure resistance, the pressure center position and the like of the object can be obtained through pressure distribution measurement. At present, a pressure sensor in pneumatic pressure scanning equipment is easily influenced by temperature, and the precision of the equipment can be influenced.
Disclosure of Invention
The embodiment of the application aims to provide a method and a device for training a target test model so as to solve the problem that equipment is affected by temperature. The specific technical scheme is as follows:
in a first aspect, a method for training a target test model is provided, the method including:
inputting the normalized values of the sample temperature value and the sample pressure value into an initial test model, and obtaining a test pressure value output by the initial test model;
determining a current fitness value of an individual in a current group of the initial test model, wherein the individual is a current weight and a current threshold of the initial test model, and an error value between the test pressure value and a preset pressure value under the current weight and the current threshold is inversely proportional to the current fitness value;
if the current fitness value does not meet the termination condition, performing iterative genetic operation on the individual of the initial test model until the current fitness value of the individual meets the termination condition to obtain a target weight and a target threshold;
and taking the initial test model containing the target weight and the target threshold as a target test model.
Optionally, if the current fitness value does not satisfy the termination condition, performing iterative genetic operation on the individual of the initial test model includes:
if the current fitness value does not meet the termination condition, selecting an individual to be selected in the current population through a fitness function, wherein the current population comprises a plurality of individuals, and the individual to be selected is an individual of which the current fitness value is higher than a preset fitness value;
carrying out crossover, mutation and duplication genetic operations on the individuals to be selected to obtain target individuals;
and forming a sub-population by a plurality of target individuals, and taking the sub-population as the current population.
Optionally, after selecting the candidate individuals in the current population through the fitness function, the method further includes: carrying out coding operation on the to-be-selected individual to obtain a coded to-be-selected individual;
before determining the current fitness value of the individuals in the current group of the initial test model, the method further comprises: and performing decoding operation on the current group.
Optionally, before inputting the normalized values of the sample temperature value and the sample pressure value into the initial test model, the method further comprises:
acquiring a plurality of sample temperature values and a plurality of sample pressure values sent by a target sensor;
determining a maximum output calibration value, a minimum output calibration value and an input/output calibration value of a current sample of the target sensor;
determining a first difference between the input-output calibration and the minimum output calibration, and a second difference between the maximum output calibration and the minimum output calibration;
and taking the ratio of the first difference value to the second difference value as a normalized numerical value of the input and the output of the current sample.
Optionally, after taking the ratio of the first difference to the second difference as the normalized value of the current sample input and output, the method further comprises:
determining the normalization value, a first weight, a first threshold and a first transfer function between an input layer and a hidden layer in an original test model, and determining a first output value of the hidden layer according to the normalization value, the first weight, the first threshold and the first transfer function;
determining a second weight, a second threshold and a second transfer function in the original test model before a hidden layer and an output layer, and determining a second output value of the output layer according to the first output value, the second weight, the second threshold and the second transfer function;
and constructing the initial test model according to the normalized numerical value and the second output value.
Optionally, after performing iterative genetic manipulation on the individuals of the initial test model, the method further comprises:
adding one to the original iteration times to obtain the current iteration times;
if the current iteration times meet the termination condition, stopping performing iterative genetic operation on the individuals of the initial test model;
and taking the weight and the threshold of the current iteration times as a target weight and a target threshold.
Optionally, the determining the current fitness value of the individuals in the current group of the initial test model comprises:
determining a sum of the fitted residuals of all the individuals, a number of individuals in the current group;
and taking the ratio of the sum value to the number of individuals as the current fitness value.
Optionally, after taking the initial test model containing the target weight and the target threshold as the target test model, the method further includes:
inputting the normalized values of the target temperature value and the target pressure value into the target test model, and obtaining a first pressure value output by the target test model;
and performing inverse normalization on the first pressure value to obtain a final pressure value after temperature compensation.
In a second aspect, there is provided an apparatus for training a target test model, the apparatus comprising:
the input and output module is used for inputting the normalized values of the sample temperature value and the sample pressure value into the initial test model and obtaining the test pressure value output by the initial test model;
a determining module, configured to determine a current fitness value of an individual in a current group of the initial test model, where the individual is a current weight and a current threshold of the initial test model, and an error value between the test pressure value and a preset pressure value under the current weight and the current threshold is inversely proportional to the current fitness value;
the iteration module is used for carrying out iterative genetic operation on the individuals of the initial test model if the current fitness value does not meet the termination condition until the current fitness value of the individuals meets the termination condition to obtain a target weight and a target threshold;
and the module is used for taking the initial test model containing the target weight and the target threshold as a target test model.
Optionally, the iteration module comprises:
a selecting unit, configured to select, if the current fitness value does not meet a termination condition, an individual to be selected in a current population through a fitness function, where the current population includes a plurality of individuals, and the individual to be selected is an individual whose current fitness value is higher than a preset fitness value;
the operation unit is used for carrying out crossover, mutation and duplication genetic operation on the individuals to be selected to obtain target individuals;
and the forming unit is used for forming a sub-population by the target individuals and taking the sub-population as the current population. The embodiment of the application has the following beneficial effects:
in the application, the optimal individual is selected by performing iterative genetic operation on the individual of the initial test model, so that the influence of temperature on pressure can be reduced, and the accuracy of pressure measurement is improved.
Of course, not all of the above advantages need be achieved in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a hardware environment diagram of a training method of a target test model according to an embodiment of the present disclosure;
FIG. 2 is a flowchart of a method for training a target test model according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of a method of iterative genetic manipulation provided by an embodiment of the present application;
FIG. 4 is a flow chart of iterative genetic operations provided by embodiments of the present application
FIG. 5 is a schematic diagram of a target test model provided by an embodiment of the present application;
fig. 6-1 is a schematic processing duration diagram of a BP neural network according to an embodiment of the present application;
FIG. 6-2 is a schematic diagram of a processing duration of a genetic algorithm optimized BP neural network provided in an embodiment of the present application;
FIG. 7-1 is a schematic diagram of a calibration pressure 40kPa output pressure value provided by an embodiment of the present application;
FIG. 7-2 is a schematic diagram of an output pressure value of 80kPa at the calibration pressure provided by the embodiment of the present application;
FIG. 8-1 is a schematic diagram of the mean absolute error of pressure values under each channel according to an embodiment of the present application;
FIG. 8-2 is a schematic diagram of a maximum absolute error of pressure values under each channel according to an embodiment of the present application
FIG. 9 is a schematic structural diagram of a training apparatus for a target test model according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for the convenience of description of the present application, and have no specific meaning in themselves. Thus, "module" and "component" may be used in a mixture.
To solve the problems mentioned in the background, according to an aspect of the embodiments of the present application, an embodiment of a training method of a target test model is provided.
Alternatively, in the embodiment of the present application, the training method of the target test model may be applied to a hardware environment formed by the terminal 101 and the server 103 as shown in fig. 1. As shown in fig. 1, a server 103 is connected to a terminal 101 through a network, which may be used to provide services for the terminal or a client installed on the terminal, and a database 105 may be provided on the server or separately from the server, and is used to provide data storage services for the server 103, and the network includes but is not limited to: wide area network, metropolitan area network, or local area network, and the terminal 101 includes but is not limited to a PC, a cell phone, a tablet computer, and the like.
The training method of the target test model in the embodiment of the present application may be executed by the server 103, or may be executed by both the server 103 and the terminal 101.
The embodiment of the application provides a training method of a target test model, which can be applied to a server and used for constructing the target test model.
The following describes in detail a training method of a target test model provided in an embodiment of the present application with reference to a specific embodiment, as shown in fig. 2, the specific steps are as follows:
step 201: and inputting the normalized values of the sample temperature value and the sample pressure value into the initial test model, and obtaining the test pressure value output by the initial test model.
And the server acquires the normalized value of the sample temperature value and the sample pressure value, and then inputs the normalized value into the initial test model to obtain the test pressure value output by the initial test model. The initial test model may be a BP (Back Propagation, a multi-layer feedforward network trained according to an error inverse Propagation algorithm) neural network.
Illustratively, the service uses high and low temperature boxes to control the temperature variation, sets temperature environments of 28 ℃, 35 ℃, 45 ℃, 52 ℃ and 61 ℃, and uses standard air pressure sources to provide standard air pressures of 0kPa, 20kPa, 40kPa, 60kPa and 80kPa for the measuring device under the 5 different temperature environments, so that 25 groups of output results at different temperatures and different standard air pressures can be obtained as sample temperature values and sample pressure values.
Step 202: a current fitness value of the individuals in the current cohort of the initial test model is determined.
The individual is the current weight and the current threshold of the initial test model, and the error value between the test pressure value and the preset pressure value under the current weight and the current threshold is inversely proportional to the current fitness value.
The initial test model includes an input layer, a hidden layer, and an output layer, wherein the number of hidden layers is at least one. The weight and the threshold value are arranged between the input layer and the hidden layer, the weight and the threshold value are arranged between the hidden layer and the output layer, the weight and the threshold value are different between different model layers, the weight and the threshold value can also be changed, and different weight values and different threshold values correspond to different test pressure values.
The server determines the current weight and the current threshold of each model layer in the initial test model, the current weight and the current threshold are used as individuals, then the current fitness value of the individual is determined, the initial test model outputs a test pressure value under the current weight and the current threshold, the server determines an error value between the test pressure value and a preset pressure value, the smaller the error value is, the output value of the initial test model is approximate to the preset pressure value, and the higher the current fitness value of the individual is.
Wherein, the calculation formula of the error value is as follows:
e=yn(j) -y (j), wherein e is an error value and y (j) is a test pressure value; y isn(j) Is a preset pressure value;
the formula for readjusting the current weight value according to the error value is as follows:
wherein eta is the learning efficiency, alpha is a situation factor,and the ith weight value is updated to the (i + 1) th weight value.
The formula for readjusting the current threshold value according to the error value is:
wherein eta isThe learning efficiency, alpha is a situation factor,and the ith +1 th threshold value is updated for the ith threshold value.
Step 203: and if the current fitness value does not meet the termination condition, performing iterative genetic operation on the individual of the initial test model until the current fitness value of the individual meets the termination condition to obtain a target weight and a target threshold.
The server judges whether the current fitness value meets a termination condition, if the server judges that the current fitness value does not meet the termination condition, the server indicates that the error value between the test pressure value and the preset pressure value is not smaller than the target error value under the current weight value and the current threshold value, iterative genetic operation needs to be carried out on the individual of the initial test model to improve the fitness value of the individual until the current fitness value of the individual meets the termination condition, and the target weight value and the target threshold value are obtained.
And if the server judges that the current fitness value meets the termination condition, indicating that the error value between the test pressure value and the preset pressure value is smaller than the target error value under the current weight value and the current threshold value, stopping performing iterative genetic operation on the individuals of the initial test model.
Step 204: and taking the initial test model containing the target weight and the target threshold as a target test model.
Under the target weight and the target threshold, the current fitness value of the individual meets the termination condition, so that the initial test model containing the target weight and the target threshold is used as the target test model.
In the application, the optimal individual is selected by performing iterative genetic operation on the individual of the initial test model, so that the influence of temperature on pressure can be reduced, the precision of pressure measurement is improved, and the problem of temperature drift generated in the air pressure measurement process of the high-density array type wind tunnel air pressure measurement device is solved.
As an alternative embodiment, as shown in fig. 3, if the current fitness value does not satisfy the termination condition, performing iterative genetic operations on the individuals of the initial test model includes:
step 301: and if the current fitness value does not meet the termination condition, selecting the to-be-selected individuals in the current population through a fitness function. The current population comprises a plurality of individuals, and the individuals to be selected are individuals with current fitness values higher than preset fitness values.
And if the server judges that the current fitness value does not meet the termination condition, calculating the current fitness values of all individuals in the current population through a fitness function, and taking the individuals with the current fitness values higher than the preset fitness values as the individuals to be selected.
Wherein determining the current fitness value of the individuals in the current group comprises: determining the sum of the fitting residuals of all individuals and the number of individuals in the current group; and taking the ratio of the sum value to the number of individuals as a current fitness value.
wherein f isminFor the purpose of the current fitness value,is the fitted residual of the ith individual, and N is the number of individuals.
Step 302: and carrying out crossover, mutation and replication genetic operations on the individuals to be selected to obtain target individuals.
The server selects two individuals from the individuals to be selected for cross operation to obtain the crossed individuals, then the individuals are subjected to variation, the algorithm is facilitated to find the globally optimal individual, and in order to keep the optimal individual, the optimal individual can be copied and inherited to the next generation to obtain the target individual. Illustratively, the replication may be performed using a roulette method.
Step 303: and forming a sub-population by the plurality of target individuals, and taking the sub-population as the current population.
And the server forms a sub-population according to the plurality of target individuals and takes the sub-population as the current population. And the server continues to calculate the current fitness value of the individuals in the current population until the current fitness value meets the termination condition.
In the application, the server calculates the current fitness values of all individuals through the fitness function, then determines the individuals to be selected of which the current fitness values are higher than the preset fitness values, and performs genetic operations of crossing, mutation and copying on the individuals to be selected, so that continuous iteration can be performed to obtain the individuals with the optimal fitness values. The BP neural network is optimized based on the genetic algorithm, the influence of temperature on device measurement can be effectively reduced, the precision of the measuring device is improved, and the algorithm is more robust.
As an optional implementation manner, after the candidate individuals in the current population are selected through the fitness function, the method further includes: coding the individual to be selected to obtain a coded individual to be selected; before determining the current fitness value of the individual in the current cohort of the initial test model, the method further comprises: and performing decoding operation on the current group.
And the server carries out coding operation on the to-be-selected individuals to obtain compiled sub-populations, and then decodes the sub-populations, so that the current fitness value of the current individuals in the sub-populations can be calculated conveniently.
As an alternative embodiment, after performing iterative genetic manipulation on individuals of the initial test model, the method further comprises: adding one to the original iteration times to obtain the current iteration times; if the current iteration times meet the termination condition, stopping performing iterative genetic operation on the individuals of the initial test model; and taking the weight and the threshold of the current iteration times as a target weight and a target threshold.
And after the server forms a sub-population, one iteration is completed, one is added on the basis of the original iteration times to obtain the current iteration times, if the server judges that the current iteration times meet the termination condition, the iteration times are enough, and the current weight and the current threshold can be used as the target weight and the target threshold.
FIG. 4 is a flow chart of an iterative genetic operation. As shown in fig. 4, an initial weight and an initial threshold of the BP neural network are determined, the initial weight and the initial threshold are encoded to obtain initial individuals, an initial population is constructed based on all the initial individuals, after the initial population is decoded, fitness value calculation is performed on all the initial individuals, whether the current fitness value meets a termination condition or not is judged, and if the server determines that the current fitness value meets the termination condition, a target test model is constructed based on the target weight and the target threshold. If the server determines that the current fitness value does not meet the termination condition, selecting the individuals to be selected with the fitness value higher than the preset fitness value from the initial individuals, performing crossover, mutation and copy genetic operations on the individuals to be selected, and forming a sub-population by the obtained target individuals, thereby completing one iteration. And the server continues to calculate the fitness value of the current individual in the sub-population until the current fitness value or the iteration number meets the termination condition. Wherein the termination condition comprises that the current adaptability value reaches the target adaptability value or the current iteration number reaches the target number.
As an optional embodiment, before inputting the normalized values of the sample temperature value and the sample pressure value into the initial test model, the method further comprises: acquiring a plurality of sample temperature values and a plurality of sample pressure values sent by a target sensor; determining a maximum output calibration value, a minimum output calibration value and an input/output calibration value of a current sample of a target sensor; determining a first difference value between the input and output calibration values and the minimum output calibration value and a second difference value between the maximum output calibration value and the minimum output calibration value; and taking the ratio of the first difference value to the second difference value as a normalized value of the input and the output of the current sample.
In the process of carrying out a pressure test experiment on the high-density array type wind tunnel air pressure measuring device, detecting temperature and pressure through a plurality of sensors, and acquiring a plurality of sample temperature values and a plurality of sample pressure values sent by a target sensor through a server, wherein the target sensor is one of the sensors, and the target sensor detects the sample temperature values and the sample pressure values. The server determines a maximum output calibration and a minimum output calibration sent by the target sensor, and an input-output calibration of one of the samples sent by the target sensor. The server determines a first difference value of the input/output calibration value and the minimum output calibration value and a second difference value of the maximum output calibration value and the minimum output calibration value; and taking the ratio of the first difference value to the second difference value as a normalized value of the input and the output of the current sample.
The calculation formula of the normalized value of the input and the output is as follows:
wherein,inputting and outputting a normalized value for the mth sample neural network; ximCalibrating the input and the output of the ith sensor for the mth sample; ximax、XiminThe maximum and minimum calibration values are output for the ith sensor.
As an optional implementation, after taking the ratio of the first difference to the second difference as the normalized value of the current sample input and output, the method further includes: determining a normalization value, a first weight value, a first threshold value and a first transfer function between an input layer and a hidden layer in an original test model, and determining a first output value of the hidden layer according to the normalization value, the first weight value, the first threshold value and the first transfer function; determining a second weight, a second threshold and a second transfer function in the original test model before the hidden layer and the output layer, and determining a second output value of the output layer according to the first output value, the second weight, the second threshold and the second transfer function; and constructing an initial test model according to the normalized value and the second output value.
Each model layer of the BP neural network model may include at least one node, illustratively 2 nodes for the input layer, 5 nodes for the hidden layer, and 1 node for the output layer. There are transfer functions between the input layer and the hidden layer, and between the hidden layer and the output layer, and exemplarily, the transfer function is tansig function. FIG. 5 is a schematic diagram of a target test model.
The first output value of the hidden layer is calculated as:
wherein Z isKIs a first output value, f1(. is a first transfer function between the input layer and the hidden layer, wki、θkWeight and threshold, x, between the input layer and the hidden layer, respectivelyiIs the normalized value of input and output, n and q are the number of nodes of the input layer and the hidden layer respectively, k is the kth node of the hidden layer,
the calculation formula of the second output value of the output layer is as follows:
wherein, yjIs the second output value, f2(. is a second transfer function between the hidden layer and the output layer, wjk、θjRespectively, the weight and the threshold between the hidden layer and the output layer, m is the number of nodes of the output layer, j is the jth node of the output layer,
as an optional implementation manner, after taking the initial test model containing the target weight and the target threshold as the target test model, the method further includes: inputting the normalized values of the target temperature value and the target pressure value into a target test model, and obtaining a first pressure value output by the target test model; and performing inverse normalization on the first pressure value to obtain a final pressure value after temperature compensation.
The server embeds the target test model into software of an upper computer of the high-density array type wind tunnel air pressure measuring device, then inputs a target temperature value and a normalization value of a target pressure value output by the high-density array type wind tunnel air pressure measuring device into the target test model, outputs a first pressure value after the target test model is operated, and performs inverse normalization on the first pressure value to obtain a final pressure value after temperature compensation.
According to the method, the software compensation method is used for carrying out temperature compensation on the high-density array type wind tunnel air pressure measuring device, and the complexity and the cost of device hardware can be reduced.
FIG. 6-1 is a schematic diagram of the processing duration of the BP neural network. FIG. 6-2 is a schematic diagram of the processing duration of the BP neural network optimized by the genetic algorithm. As can be seen from the figure, the convergence speed of the BP neural network optimized by the genetic algorithm is higher, and the data fusion precision is higher.
FIG. 7-1 is a schematic of the nominal 40kPa output pressure value. FIG. 7-2 is a schematic of the nominal pressure 80kPa output pressure value. As can be seen from the figure, under two kinds of pressure, this application can effectively restrain the influence of temperature to measuring device.
FIG. 8-1 is a schematic diagram of the mean absolute error of pressure values for each channel. Fig. 8-2 is a schematic diagram of the maximum absolute error of the pressure values under each channel. As can be seen from the figure, the output accuracy of the measuring device is improved after temperature compensation.
Based on the same technical concept, an embodiment of the present application further provides a training apparatus for a target test model, as shown in fig. 9, the apparatus includes:
an input/output module 901, configured to input the normalized values of the sample temperature value and the sample pressure value into the initial test model, and obtain a test pressure value output by the initial test model;
a first determining module 902, configured to determine a current fitness value of an individual in a current group of the initial test model, where the individual is a current weight and a current threshold of the initial test model, and an error value between a test pressure value and a preset pressure value under the current weight and the current threshold is inversely proportional to the current fitness value;
an iteration module 903, configured to perform iterative genetic operation on the individual of the initial test model if the current fitness value does not meet the termination condition, until the current fitness value of the individual meets the termination condition, to obtain a target weight and a target threshold;
a first acting module 904 is configured to act as the target test model with the initial test model having the target weight and the target threshold.
Optionally, the iteration module 903 comprises:
the selection unit is used for selecting the individuals to be selected in the current population through a fitness function if the current fitness value does not meet the termination condition, wherein the current population comprises a plurality of individuals, and the individuals to be selected are individuals of which the current fitness value is higher than a preset fitness value;
the operation unit is used for carrying out crossover, mutation and duplication genetic operation on the individuals to be selected to obtain target individuals;
and the forming unit is used for forming the sub-populations from the target individuals and taking the sub-populations as the current populations.
Optionally, the apparatus further comprises:
the encoding module is used for carrying out encoding operation on the to-be-selected individual to obtain an encoded to-be-selected individual;
and the decoding module is used for decoding the current group.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring a plurality of sample temperature values and a plurality of sample pressure values sent by the target sensor;
the second determination module is used for determining the maximum output calibration value, the minimum output calibration value and the input/output calibration value of the current sample of the target sensor;
a third determining module, configured to determine a first difference between the input/output calibration value and the minimum output calibration value, and a second difference between the maximum output calibration value and the minimum output calibration value;
and the second as a module, configured to use a ratio of the first difference to the second difference as a normalized value of the input and the output of the current sample.
Optionally, the apparatus further comprises:
the fourth determining module is used for determining the normalized value, the first weight, the first threshold and the first transfer function between the input layer and the hidden layer in the original test model, and determining the first output value of the hidden layer according to the normalized value, the first weight, the first threshold and the first transfer function;
a fifth determining module, configured to determine a second weight, a second threshold, and a second transfer function before the hidden layer and the output layer in the original test model, and determine a second output value of the output layer according to the first output value, the second weight, the second threshold, and the second transfer function;
and the construction module is used for constructing an initial test model according to the normalized value and the second output value.
Optionally, the apparatus further comprises:
the adding module is used for adding one to the original iteration times to obtain the current iteration times;
the stopping module is used for stopping iterative genetic operation on the individuals of the initial test model if the current iteration times meet the termination condition;
and the third is used as a module for taking the weight and the threshold of the current iteration times as the target weight and the target threshold.
Optionally, the first determining module 902 includes:
the determining unit is used for determining the sum of the fitting residuals of all the individuals and the number of the individuals in the current group;
as a unit for taking the ratio of the sum value to the number of individuals as the current fitness value.
Optionally, the apparatus further comprises:
the input module is used for inputting the normalized values of the target temperature value and the target pressure value into the target test model and obtaining a first pressure value output by the target test model;
and the inverse normalization module is used for performing inverse normalization on the first pressure value to obtain a final pressure value after temperature compensation.
According to another aspect of the embodiments of the present application, there is provided an electronic device, as shown in fig. 6, including a memory 1003, a processor 1001, a communication interface 1002, and a communication bus 1004, where the memory 1003 stores a computer program that is executable on the processor 1001, the memory 1003 and the processor 1001 communicate with each other through the communication interface 1002 and the communication bus 1004, and the processor 1001 implements the steps of the method when executing the computer program.
The memory and the processor in the electronic equipment are communicated with the communication interface through a communication bus. The communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
There is also provided, in accordance with yet another aspect of an embodiment of the present application, a computer-readable medium having non-volatile program code executable by a processor.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
When the embodiments of the present application are specifically implemented, reference may be made to the above embodiments, and corresponding technical effects are achieved.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units performing the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk. It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A method of training a target test model, the method comprising:
inputting the normalized values of the sample temperature value and the sample pressure value into an initial test model, and obtaining a test pressure value output by the initial test model;
determining a current fitness value of an individual in a current group of the initial test model, wherein the individual is a current weight and a current threshold of the initial test model, and an error value between the test pressure value and a preset pressure value under the current weight and the current threshold is inversely proportional to the current fitness value;
if the current fitness value does not meet the termination condition, performing iterative genetic operation on the individual of the initial test model until the current fitness value of the individual meets the termination condition to obtain a target weight and a target threshold;
and taking the initial test model containing the target weight and the target threshold as a target test model.
2. The method of claim 1, wherein performing iterative genetic operations on the individuals of the initial test model if the current fitness value does not satisfy a termination condition comprises:
if the current fitness value does not meet the termination condition, selecting an individual to be selected in the current population through a fitness function, wherein the current population comprises a plurality of individuals, and the individual to be selected is an individual of which the current fitness value is higher than a preset fitness value;
carrying out crossover, mutation and duplication genetic operations on the individuals to be selected to obtain target individuals;
and forming a sub-population by a plurality of target individuals, and taking the sub-population as the current population.
3. The method of claim 2,
after selecting the individuals to be selected in the current population through the fitness function, the method further comprises the following steps: carrying out coding operation on the to-be-selected individual to obtain a coded to-be-selected individual;
before determining the current fitness value of the individuals in the current group of the initial test model, the method further comprises: and performing decoding operation on the current group.
4. The method of claim 1, wherein prior to inputting the normalized values of the sample temperature value and the sample pressure value into the initial test model, the method further comprises:
acquiring a plurality of sample temperature values and a plurality of sample pressure values sent by a target sensor;
determining a maximum output calibration value, a minimum output calibration value and an input/output calibration value of a current sample of the target sensor;
determining a first difference between the input-output calibration and the minimum output calibration, and a second difference between the maximum output calibration and the minimum output calibration;
and taking the ratio of the first difference value to the second difference value as a normalized numerical value of the input and the output of the current sample.
5. The method of claim 4, wherein after taking the ratio of the first difference to the second difference as a normalized value for the current sample input and output, the method further comprises:
determining the normalization value, a first weight, a first threshold and a first transfer function between an input layer and a hidden layer in an original test model, and determining a first output value of the hidden layer according to the normalization value, the first weight, the first threshold and the first transfer function;
determining a second weight, a second threshold and a second transfer function in the original test model before a hidden layer and an output layer, and determining a second output value of the output layer according to the first output value, the second weight, the second threshold and the second transfer function;
and constructing the initial test model according to the normalized numerical value and the second output value.
6. The method of claim 1, wherein after performing iterative genetic operations on individuals of the initial test model, the method further comprises:
adding one to the original iteration times to obtain the current iteration times;
if the current iteration times meet the termination condition, stopping performing iterative genetic operation on the individuals of the initial test model;
and taking the weight and the threshold of the current iteration times as a target weight and a target threshold.
7. The method of claim 1, wherein determining the current fitness value of the individuals of the current cohort of the initial test model comprises:
determining a sum of the fitted residuals of all the individuals, a number of individuals in the current group;
and taking the ratio of the sum value to the number of individuals as the current fitness value.
8. The method of claim 1, wherein after taking an initial test model containing the target weights and the target threshold as a target test model, the method further comprises:
inputting the normalized values of the target temperature value and the target pressure value into the target test model, and obtaining a first pressure value output by the target test model;
and performing inverse normalization on the first pressure value to obtain a final pressure value after temperature compensation.
9. An apparatus for training a target test pattern, the apparatus comprising:
the input and output module is used for inputting the normalized values of the sample temperature value and the sample pressure value into the initial test model and obtaining the test pressure value output by the initial test model;
a determining module, configured to determine a current fitness value of an individual in a current group of the initial test model, where the individual is a current weight and a current threshold of the initial test model, and an error value between the test pressure value and a preset pressure value under the current weight and the current threshold is inversely proportional to the current fitness value;
the iteration module is used for carrying out iterative genetic operation on the individuals of the initial test model if the current fitness value does not meet the termination condition until the current fitness value of the individuals meets the termination condition to obtain a target weight and a target threshold;
and the module is used for taking the initial test model containing the target weight and the target threshold as a target test model.
10. The apparatus of claim 9, wherein the iteration module comprises:
a selecting unit, configured to select, if the current fitness value does not meet a termination condition, an individual to be selected in a current population through a fitness function, where the current population includes a plurality of individuals, and the individual to be selected is an individual whose current fitness value is higher than a preset fitness value;
the operation unit is used for carrying out crossover, mutation and duplication genetic operation on the individuals to be selected to obtain target individuals;
and the forming unit is used for forming a sub-population by the target individuals and taking the sub-population as the current population.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011515827.8A CN112487726A (en) | 2020-12-21 | 2020-12-21 | Training method and device for target test model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011515827.8A CN112487726A (en) | 2020-12-21 | 2020-12-21 | Training method and device for target test model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112487726A true CN112487726A (en) | 2021-03-12 |
Family
ID=74914926
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011515827.8A Pending CN112487726A (en) | 2020-12-21 | 2020-12-21 | Training method and device for target test model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112487726A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117805519A (en) * | 2023-12-21 | 2024-04-02 | 云动(太仓)测控技术有限公司 | Automobile electrical component simulation test system, method and device and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106503790A (en) * | 2015-08-28 | 2017-03-15 | 余学飞 | A kind of Pressure wire temperature compensation of Modified particle swarm optimization neutral net |
CN111160520A (en) * | 2019-12-06 | 2020-05-15 | 南京理工大学 | BP neural network wind speed prediction method based on genetic algorithm optimization |
-
2020
- 2020-12-21 CN CN202011515827.8A patent/CN112487726A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106503790A (en) * | 2015-08-28 | 2017-03-15 | 余学飞 | A kind of Pressure wire temperature compensation of Modified particle swarm optimization neutral net |
CN111160520A (en) * | 2019-12-06 | 2020-05-15 | 南京理工大学 | BP neural network wind speed prediction method based on genetic algorithm optimization |
Non-Patent Citations (5)
Title |
---|
刘贺等: "基于BP神经网络的压力传感器温度补偿方法研究", 《传感技术学报》, vol. 3, no. 5, pages 688 - 692 * |
张倩: "压阻式压力传感器测量系统的研究", 中国优秀硕士学位论文全文数据库》, no. 2019, pages 19 - 39 * |
徐顺;卢文科;左锋;: "基于PSO-BP神经网络的光纤压力传感器温度补偿研究", 仪表技术与传感器, no. 10 * |
王慧;赵国超;金鑫;宋宇宁;: "基于分段融合的压阻式传感器温度补偿方法", 传感技术学报, no. 04 * |
郭志君;卢文科;左锋;张珏;丁勇;: "基于NSGA-Ⅱ&BP的应变片式压力传感器温度补偿研究", 中国测试, no. 06 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117805519A (en) * | 2023-12-21 | 2024-04-02 | 云动(太仓)测控技术有限公司 | Automobile electrical component simulation test system, method and device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Blesa et al. | Robust sensor placement for leak location: analysis and design | |
CN113038386B (en) | Learning model-based device positioning | |
CN115269357B (en) | Micro-service abnormity detection method based on call chain | |
Li et al. | Structural damage identification based on integration of information fusion and shannon entropy | |
Wang et al. | Improved BP neural network algorithm to wind power forecast | |
CN111914470B (en) | Multi-element monitoring time series regression prediction method for energy chemical production system | |
CN108595892A (en) | Soft-measuring modeling method based on time difference model | |
CN112487726A (en) | Training method and device for target test model | |
CN111638034A (en) | Strain balance temperature gradient error compensation method and system based on deep learning | |
Guo et al. | Identification for Wiener‐Hammerstein systems under quantized inputs and quantized output observations | |
CN110717220B (en) | Method for verifying aviation hydraulic pipeline model | |
CN115049026A (en) | Regression analysis method of space non-stationarity relation based on GSNNR | |
Lv et al. | An improved test selection optimization model based on fault ambiguity group isolation and chaotic discrete PSO | |
CN117763436A (en) | Training method and device of fault diagnosis model based on small sample | |
CN110161114B (en) | Reinforced concrete detection method, device and system based on support vector machine | |
CN115932144B (en) | Chromatograph performance detection method, chromatograph performance detection device, chromatograph performance detection equipment and computer medium | |
CN112446168A (en) | Effluent BOD concentration soft measurement method based on MIC and RBFNN | |
JP6950647B2 (en) | Data determination device, method, and program | |
CN110825583A (en) | Energy efficiency qualitative assessment technology for multi-index fusion of cloud data center | |
CN114742108B (en) | Method and system for detecting fault of bearing of numerical control machine tool | |
Wang et al. | Stabilizing switching control for nonlinear system based on quasi‐ARX RBFN model | |
CN115206455A (en) | Deep neural network-based rare earth element component content prediction method and system | |
CN115865458A (en) | Network attack behavior detection method, system and terminal based on LSTM and GAT algorithms | |
CN115526253A (en) | Method for non-contact estimation of surface physical property value based on generation of countermeasure network | |
CN112345127B (en) | Data fusion method for double-core composite silicon piezoresistive pressure sensor |
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 |